Programming instructions
84
Applied instructions by default are 16 bit instructions. If 32 bit data manipulation
is desired, it is necessary to add a “D” to the front of the instruction.
Example: MOV transfers 16 bits of data
DMOV transfers 32 bits of data
Most of these instructions continue to execute as long as the input conditions are
TRUE. Sometimes this is not what is wanted. Where the programmer may want
to increment a data register (with INC) by 1 when an input is made, INC will
increment every scan as long as the input is on! This could be hundreds of times
every second!
To avoid this, it is possible to set up basic instructions so they execute only once,
on the FALSE to TRUE state change. To do this, add a “P” to the end of the
instruction.
Examples:
/ D0 D1 D20 divides D0 by D1 and places the result into D20 every scan
/P D0 D1 D20 does the division once when the input conditions are TRUE
13.2 Data Transfer Instructions
The data transfer instructions must be placed in the end of the rung. When the
input criterion is true, the data transfer instruction is performed.
Move Function 16-Bit Data 32-Bit Data Floating Point
1 to 1 MOV DMOV DEMOV
Many to Many BMOV - -
1 to Many FMOV DFMOV -
MOV – Data Move
DMOV – 32-Bit Move
DEMOV – Floating Point Move
The MOV move command moves data from the source (D1) to the destination
(D2). The command actually copies the data, so after the command is executed,
both registers contain the same data. Two variants of this command are DMOV
,
which moves a 32-bit value, and DEMOV, which moves a 32-bit floating point
value.