Sign in to follow this  
Followers 0
IO_Rack

MC402-UK

1 post in this topic

I'm writing offline programs for some simple motion control using an MC402-UK module in a C200HG PLC. I have some questions concerning the fundamental operation between them. I'm attempting to minimize the MC402 programming by controlling as much as possible with the PLC. I'm using the IOWR and IORD instructions for exchanging data. 1) The manual states the READ_BIT or SET_BIT commands cannot be used for the UK models. Is there a more concise method of exchanging bit data other than picking them out from a Word? Example: bit_0 = VR(200) AND 1 bit_1 = VR(200) AND 2 bit_2 = VR(200) AND 4 bit_3 = VR(200) AND 8 bit_4 = VR(200) AND 16 bit_5 = VR(200) AND 32 bit_6 = VR(200) AND 64 bit_7 = VR(200) AND 128 IF bit_0 > 0 THEN OP(20, ON) ELSE OP(20, OFF) ENDIF IF bit_1 > 0 THEN OP(21, ON) ELSE OP(21, OFF) ENDIF IF bit_2 > 0 THEN OP(22, ON) ELSE OP(22, OFF) ENDIF IF bit_3 > 0 THEN OP(23, ON) ELSE OP(23, OFF) ENDIF IF bit_4 > 0 THEN OP(24, ON) ELSE OP(24, OFF) ENDIF IF bit_5 > 0 THEN OP(25, ON) ELSE OP(25, OFF) ENDIF ... 2) The manual also states "The servo period is not synchronised with the PC scan time." Does this mean it will require positive handshaking? For example, latch the bit in the PLC then unlatch it in the MC204. I did visit the site briefly and did some simple moves using the above code and this: BASE(1) IF IN(20) = ON THEN SPEED=100000 MOVEABS(3360000) WAIT IDLE WA(3000) ENDIF I used a push button to trigger the bit in the PLC. I did notice that sometimes it would not respond. Any other tips and/or tricks would be appreciated. I feel like I'm having to write a lot more code than I need to. Thanks

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0