Every program usually has some kind of data movement. This is the ability to transfer information from one area of the controller to another. The Omron CP1H series of programmable logic controllers provide several different ways to manipulate this information. We will be looking at several different ways in which data movement can happen with some programming examples. Data movement in the Omron CP1H does not care what is in the bits that make up the word. It will just send or receive this information. Remember that it is usually the instruction used, that determines how the information in the memory is determined.
We will be covering several different data movement instructions. A full explanation can be obtained by using the help menu in the CX-Programmer software or the Programming Manual for the CP1H. Links are provided at the end of this post.
Several of the instructions can have different variations.
Lets look at the MOV(021) instruction:
MOV(021) when used will be scanned and executed every cycle of the PLC that the input condition is on.
@MOV(021) when used will be executed when the input condition turns from off to on. This will trigger the instruction to happen only once.
!MOV(021) when used will do an immediate refreshing of the information before the move takes place on every scan.
!@MOV(021) when used will execute only once for a transition from off to on and do an immediate refresh of the information moved.
Please refer to the programming manual or help file in CX-Programmer for different variations of the instructions that you want to use. We will now quickly go over the data movement instructions in the Omron CP1H.
MOVE NOT: MVN(022)
This move not instruction will transfer 16 bits after to changes all of the 1 to 0 and 0 to 1 in the word. This will complement (inverse) the information before moving the source information to the designation.
DOUBLE MOVE NOT: MVNL(499)
This move not instruction will transfer 32 bits after to changes all of the 1 to 0 and 0 to 1 in the double word. This will complement (inverse) the information before moving the source information to the designation.
MOVE BIT: MOVB(082)
This instruction will move the specified bit from the source to the destination. The control word consists of 00 to 0F for the destination bit and 00 to 0F for the source bit. Example #0401 – Move bit 1 in the source to bit 4 in the destination.
MOVE DIGIT: MOVD(083)
This instruction will move the specified digit (4 bits) from the source to the destination. The control word consists of the following:
0 – always zero
0-3 – location of the first digit in the destination
0-3 – number of digits (0 = 1, … 3 = 4) to move
0-3 – first digit in the source
Example: #0201 – Move one digit from the second in source to the third in the destination.
MULTIPLE BIT TRANSFER: XFRB(062)
This instruction will move the specified number of consecutive bits from the source to the destination. The control word consists of the following:
00 – FF – number of bits to move
0-F – first bit in the destination
0-F – first bit in the source
Example: #0171 – Move one bit starting from bit 1 in source to bit 7 in the destination.
DATA EXCHANGE: XCHG(073)
This instruction will exchange the data between the words. So the information in the first word will be put into the second. The second word information will be put into the first.
You can see that we have many different instructions to move data in the Omron CP1H. This should give you a good idea of what is possible.
See the YouTube video below on data movement in the Omron CP1H PLC.
The following is a list of manuals associated with the CP1H programmable logic controller. See the descriptions for each of these manuals in the first post: Omron CP1H System Hardware
W450 – SYSMAC CP Series CP1H CPU Unit Operation Manual
W451 – SYSMAC CP Series CP1H CPU Unit Programming Manual
W342 – SYSMAC CS/CJ series Communications Commands Reference Manual
W446 – SYSMAC CX-Programmer Ver. 6.1 Operation Manual
W447 – SYSMAC CX-Programmer Ver. 6.1 Operation Manual Function Blocks
W444 – CX-One FA Integrated Tool Package Setup Manual
W445 – CX-Integrator Operation Manual
W344 – CX-Protocol Operation Manual
You can download the PLC program as discussed above here.
Next time we will look at compare instructions in the Omron CP1H PLC.
Watch on YouTube : Omron CP1H Data Movement
If you have any questions or need further information please contact me.
If you’re like most of my readers, you’re committed to learning about technology. Numbering systems used in PLC’s are not difficult to learn and understand. We will walk through the numbering systems used in PLCs. This includes Bits, Decimal, Hexadecimal, ASCII and Floating Point.
To get this free article, subscribe to my free email newsletter.
Use the information to inform other people how numbering systems work. Sign up now.
The ‘Robust Data Logging for Free’ eBook is also available as a free download. The link is included when you subscribe to ACC Automation.