CAUTION: This will be a long post.
I get a little confuse with MOVD (MOVE Digit) instruction of omron PLC.
According to an explanation I googled, a MOVD instruction has 3 elements: Source (S), Control word (C), Destination (D). The Source (S) is the value to be copied, control word (C) is the manipulator of the "movement", destination (D) is the destination of the copied value starting from the digit specified in C and filling in to the left.
Example:
MOVD DM0 #0132 DM10, DM0 = 5678 (D3=5, D2=6, D1=7, D0=8)
S = DM0
D = DM10
C = 0132 (D3=0, D2=1, D1=3, D0=2)
D0 = 2 (Specifies the 1st digit copied from source, the value must be
from 0 - 3)
Hence, the D2 of DM0, which 6, will be the first to be transferred
to the location specified by D2 of C.
D1 = 3 (Indicates the number of digits to be copied, 0=1 digit, 1=2
digits, 2=3 digits, 3=4 digits)
Since D1 of C = 3, hence we will move all 4 digits of Source to
Destination.
D2 = 1 (Indicates the starting digit that the data will be moved into
the Destination)
The D2 of DM0, which is 6, will be moved to D1 of the
Destination. The rest of the digit will be copied in the same pattern and
wrapping back around to D0.
D3 = 0 (The MSB must always be zero)
Hence result of the "movement" will be:
MOVD DM0 #0132 DM10 (DM0 = 5678, DM10 = 8567)
Continue to next post.........
I get a little confuse with MOVD (MOVE Digit) instruction of omron PLC.
According to an explanation I googled, a MOVD instruction has 3 elements: Source (S), Control word (C), Destination (D). The Source (S) is the value to be copied, control word (C) is the manipulator of the "movement", destination (D) is the destination of the copied value starting from the digit specified in C and filling in to the left.
Example:
MOVD DM0 #0132 DM10, DM0 = 5678 (D3=5, D2=6, D1=7, D0=8)
S = DM0
D = DM10
C = 0132 (D3=0, D2=1, D1=3, D0=2)
D0 = 2 (Specifies the 1st digit copied from source, the value must be
from 0 - 3)
Hence, the D2 of DM0, which 6, will be the first to be transferred
to the location specified by D2 of C.
D1 = 3 (Indicates the number of digits to be copied, 0=1 digit, 1=2
digits, 2=3 digits, 3=4 digits)
Since D1 of C = 3, hence we will move all 4 digits of Source to
Destination.
D2 = 1 (Indicates the starting digit that the data will be moved into
the Destination)
The D2 of DM0, which is 6, will be moved to D1 of the
Destination. The rest of the digit will be copied in the same pattern and
wrapping back around to D0.
D3 = 0 (The MSB must always be zero)
Hence result of the "movement" will be:
MOVD DM0 #0132 DM10 (DM0 = 5678, DM10 = 8567)
Continue to next post.........