AngryRobot Posted September 22, 2017 Report Posted September 22, 2017 All, Is there an instruction that would let me take 8 inputs and map them to a word as a binary number? These inputs are on input cards with other non-related inputs, so I cannot simply look at the CIO channel value. For example, 1205.00 is a push button, and 1205.02 starts my binary inputs through 1205.09. I need to look at 1205.02 through 1205.09 in a series and to decode it into binary.
BobB Posted September 22, 2017 Report Posted September 22, 2017 MOVB if in the processor. You do not specify the PLC type you are using.
gclshortt Posted September 23, 2017 Report Posted September 23, 2017 We need to know the model number of the Omron PLC that you are using. Look at the instruction set under the data movement instructions heading. Example:http://www.edata.omron.com.au/eData/PLCs/CQM/W228-E1-08.pdf Here is the manual for the CQM1/CPM1/CPM1A/SRM1 In this PLC the Move Bit (MovB) instruction will only move one bit at a time. You need to use the Transfer Bits (XFRB) instruction. This will allow you to specify the number of bits to move from the source to the destination. Here is a post that will show the XFRB instruction as part of the data movement instructions in the CP1H.http://accautomation.ca/omron-cp1h-data-movement/ Regards,
AngryRobot Posted September 23, 2017 Author Report Posted September 23, 2017 I am using a CJ2H, sorry for leaving that out. With the MOVB instruction, is it possible to designate how many bits to move? Because some of these binary code inputs aren't full bytes so I might need to move six bits.
gclshortt Posted September 23, 2017 Report Posted September 23, 2017 https://assets.omron.eu/downloads/manual/en/w474_cs_cj_nsj_series_instruction_reference_manual_en.pdf Here is the above instruction manual for the CJ2H. The MOVB instruction will only move one bit at a time. Use the MULTIPLE BIT TRANSFER - XFRB instruction. You will be able to specify the number of bits to move along with the starting bit location in the source and destination words. See diagram above. Regards,
AngryRobot Posted September 24, 2017 Author Report Posted September 24, 2017 Thank you! The transfer bit instruction did the trick!
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now