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.
Previously in this CP1H series, we have discussed:
System Hardware – Video
CX-Programmer – Video
Establish Communication – Video
Setting, Forcing and Online Editing – Video
Numbering System and Addressing – Video
CP1H Timers – Video
Counters – Video
Data Movement – Video
Compare Instructions – Video
Data Shift Instructions
– Video Part 1
– Video Part 2
Math Instructions – Video
Data Conversion – Video
Program Control Instructions – Video
Table Data Instructions – Video
Data Control Instructions – Video
AdvancedHMI Communication – Video
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.
Let’s 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: MOV(021) – Omron CP1H Data Movement
This move instruction will transfer 16bits at a time from the source to destination location.
MOVE NOT: MVN(022) – Omron CP1H Data Movement
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: MOVL(498) – Omron CP1H Data Movement
This double move instruction will transfer 32bits at a time from the source to the destination location.
DOUBLE MOVE NOT: MVNL(499) – Omron CP1H Data Movement
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) – Omron CP1H Data Movement
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) – Omron CP1H Data Movement
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) – Omron CP1H Data Movement
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.
BLOCK TRANSFER: XFER(070) – Omron CP1H Data Movement
This instruction will transfer the specified number of consecutive words from the source to the destination.
BLOCK SET: BSET(071) – Omron CP1H Data Movement
This instruction will copy the same word to a range of consecutive words from the starting word location to the ending word location.
DATA EXCHANGE: XCHG(073) – Omron CP1H Data Movement
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.
DOUBLE DATA EXCHANGE: XCGL(562) – Omron CP1H Data Movement
This instruction will exchange the data between the two double words. (32 bits)
SINGLE WORD DISTRIBUTE: DIST(080) – Omron CP1H Data Movement
This will transfer the source word to the destination word. The destination word is determined by adding an offset value to the base word.
DATA COLLECT: COLL(081) – Omron CP1H Data Movement
This will transfer the source word determined by adding an offset and putting it into the destination word.
MOVE TO REGISTER: MOVR(560) – Omron CP1H Data Movement
This will set the PLC memory address of the specified word or bit into the index register location.
MOVE TIMER/COUNTER PV TO REGISTER: MOVRW(561) – Omron CP1H Data Movement
This will set the PLC memory address of the specified timer or counter present value (PV) to the index register.
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.
Thank you,
Garry
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.