07-01 Transfer comparison instruction
MOV/16-bit transmission
MOV(P)
Transfer the BIN 16-bit data of the device specified in (S) to the device specified in (D).
-[MOV (S) (D)]
Content, range and data type
Parameter | Content | Range | Data type | Data type (label) |
(S) | Transmit source data or the device number stored data | -32768 to 32767 | Signed BIN16 | ANY16_S |
(D) | Transmit destination device number | - | Signed BIN16 | ANY16_S |
Device used
Instruction | Parameter | Devices | Offset modification | Pulse extension | ||||||||||
KnX | KnY | KnM | KnS | T | C | D | R | SD | K | H | [D] | XXP | ||
MOV | Parameter 1 | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● |
Parameter 2 | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● |
Features
• Transfer the BIN 16-bit data specified in (S) to the device specified in (D).
Error code
Error code | Content |
4085H | The output result of (S) in read application instruction exceeds the device range |
4086H | The output result of (D) in write application instruction exceeds the device range |
Example
When M0 is set, the value of D0 is transferred to the value of D2: (D0)→(D2).
DMOV/32-bit transmission
DMOV(P)
Transfer the BIN 32-bit data of the device specified in (S) to the device specified in (D).
-[DMOV (S) (D)]
Content, range and data type
Parameter | Content | Range | Data type | Data type (label) |
(S) | Transmit source data or the device number stored data | -2147483648 to 2147483647 | Signed BIN32 | ANY32_S |
(D) | Transmit destination device number | - | Signed BIN32 | ANY32_S |
Device used
Instruction | Parameter | Devices | Offset modification | Pulse extension | ||||||||||||
KnX | KnY | KnM | KnS | T | C | D | R | SD | LC | HSC | K | H | [D] | XXP | ||
DMOV | Parameter 1 | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ||
Parameter 2 | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● |
Features
Transfer the BIN 16-bit data specified in (S) to the device specified in (D).
Error code
Error code | Content |
4085H | The output result of (S) in read application instruction exceeds the device range |
4086H | The output result of (D) in write application instruction exceeds the device range |
Example
When M0 is set, the value of (D1, D0) is transferred to the value of (D3, D2): (D1, D0) → (D3, D2).
BMOV/Batch transmission
BMOV(P)
The (N) point BIN 16-bit data starting from the device specified in (S) is sequentially transmitted to the device specified in (D).
-[BMOV (S) (D) (N)]
Content, range and data type
Parameter | Content | Range | Data type | Data type (label) |
(S) | The start device that stores the transmission data | - | Signed BIN16 | ANY16_S |
(D) | The start device that transmit target | - | Signed BIN16 | ANY16_S |
(N) | Number of transmission | 1 ≤ N ≤ 512 | Signed BIN16 | ANY16_S |
Device used
Instruction | Parameter | Devices | Offset modification | Pulse extension | ||||||||||
KnX | KnY | KnM | KnS | T | C | D | R | SD | K | H | [D] | XXP | ||
BMOV | Parameter 1 | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ||
Parameter 2 | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ||||
Parameter 3 | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● |
Features
Batch transfer the BIN 16-bit data of point (N) starting from the device specified in (S) to the device specified in (D).
When the device number exceeds the range, it will be transferred within the allowable range.
By controlling the direction reversal flag (SM224) of the BMOV instruction, the BIN 16-bit data at point (N) starting from the device specified in (D) can be batch transferred to the device specified in (S).
Error code
Error code | Content |
4084H | In application instruction (N) input the data exceeds the specified range |
4085H | The output results of (S) and (N) in read application instruction exceed the device range |
4086H | The output result of (D) in write application instruction exceeds the device range |
Example
When M0 is set, set M1, then (D5)→(D10); (D6)→(D11); (D7)→(D12);
When M0 is reset, set M1, then (D10)→(D5); (D11)→(D6); (D12)→(D7).
FMOV/16-bit multicast
FMOV(P)
Transfer the BIN 16-bit data of the device specified in (S1) to the device specified in (D) at (N) points (that is, transfer the same data to multiple addresses).
-[FMOV (S) (D) (N)]
Content, range and data type
Parameter | Content | Range | Data type | Data type (label) |
(S) | The start device that stores the transmission data | -32768 to 32767 | Signed BIN16 | ANY16_S |
(D) | The start device that transmit target | - | Signed BIN16 | ANY16_S |
(N) | Number of transmission | [K1 ≤ N ≤ 512] | Signed BIN16 | ANY16_S |
Device used
Instruction | Parameter | Devices | Offset modification | Pulse extension | ||||||||||
KnX | KnY | KnM | KnS | T | C | D | R | SD | K | H | [D] | XXP | ||
FMOV | Parameter 1 | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● |
Parameter 2 | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ||||
Parameter 3 | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● |
Features
The same data as the BIN 16-bit data of the device specified in (S) is transferred to the device specified in (D) at (N) points.
When the number specified in (N) exceeds the device number range, transfer is performed within the allowable range.
When a constant (K) is specified for the transmission source (S), it will be automatically converted to BIN.
Error code
Error code | Content |
4084H | (S) and(N) input the data In application instruction exceed the specified range |
4085H | The output results of (S) and (N) in read application instruction exceed the device range |
4086H | The output result of (D) in write application instruction exceeds the device range |
Example
When M0 is set, the value of D0 to D4 is set to 0.
DFMOV/ 32-bit multicast
DFMOV(P)
Transfer the BIN 32-bit data of the device specified in (S1) to the device specified in (D) at (N) points (that is, transfer the same data to multiple addresses).
-[FMOV (S) (D) (N)]
Content, range and data type
Parameter | Content | Range | Data type | Data type (label) |
(S) | Transfer data or start device storing transfer data | -2147483648 to 2147483647 | Signed BIN32 | ANY32_S |
(D) | Start device of transfer destination | - | Signed BIN32 | ANY32_S |
(N) | Number of transfers | [1≤ N ≤512] | Signed BIN32 | ANY32_S |
Device used
Instruction | Parameter | Devices | Offset modification | Pulse extension | ||||||||||||
KnX | KnY | KnM | KnS | T | C | D | R | SD | LC | HSC | K | H | [D] | XXP | ||
DFMOV | Parameter 1 | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● |
Parameter 2 | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ||||||
Parameter 3 | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● |
Features
The same data as the BIN 32-bit data of the device specified in (S) is transferred to the device specified in (D) at (N) points.
When the number specified in (N) exceeds the device number range, transfer is performed within the allowable range.
When a constant (K) is specified for the transmission source (S), it will be automatically converted to BIN.
Error code
Error code | Content |
4084H | (S) and (N) input the data In application instruction exceed the specified range |
4085H | The output results of (S) and (N) in read application instruction exceed the device range |
4086H | The output result of (D) in write application instruction exceeds the device range |
Example
When M0 is set, the value of (D1, D0), (D3, D2), (D5, D4), (D7, D6), (D9, D8) is set to 0.
SMOV/Bit shift
SMOV(P)
A instruction for distributing and synthesizing data in units of digits (4 bits).
-[SMOV (S) (N1) (N2) (D) (N3)]
Content, range and data type
Parameter | Content | Range | Data type | Data type (label) |
(S) | The word device number that stores the data whose bit is to be moved | Signed BIN16 | ANY16_S | |
(N1) | Transfer destination device number | 1 to 4 | Signed BIN16 | ANY16_S |
(N2) | The number of digits to move | 1 to 4 | Signed BIN16 | ANY16_S |
(D) | The word device number that stores data for bit shifting | Signed BIN16 | ANY16_S | |
(N3) | The starting position of the moving target | 1 to 4 | Signed BIN16 | ANY16_S |
Device used
Instruction | Parameter | Devices | Offset modification | Pulse extension | ||||||||||
KnX | KnY | KnM | KnS | T | C | D | R | SD | K | H | [D] | XXP | ||
SMOV | Parameter 1 | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ||
Parameter 2 | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | |
Parameter 3 | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | |
Parameter 4 | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ||||
Parameter 5 | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● |
Features
The data is distributed/combined in units of digits (4 bits). The contents of the transmission source (S) and the transmission destination (D) are converted into 4-digit BCD (0000 to 9999), and the (N1) bits are transferred to the lower (N2) bits and the (N3) bits of the transmission destination (D) (combined ) After reaching the starting position, it is converted to BIN and stored in the transfer destination (D).
When the instruction input is OFF, the transfer destination (D) does not change.
When the instruction input is ON, the data of the transmission source (S) and the number of digits other than the transmission specification of the transmission destination (D) do not change.
Perform BIN→BCD conversion on (S).
Transfer (synthesize) the (N1)th bit to the lower (N2), (D), (N3)th bit to the (N2)th bit counted from the previous. (D), the first and fourth digits start from (S), and the transmission will not be affected.
Convert the synthesized data (BCD) into BIN and store it in (D).
Extended function
If the SMOV instruction is executed after SM168 is turned ON, the BIN→BCD conversion will not be performed. The bit shift is performed in 4-bit units.
Error code
Error code | Content |
4084H | (N1), (N2) and (N3) input data that exceed the specified range in the application instruction or does not satisfy the relationship of N2≤N1 and N2≤N3. |
4085H | The output result of (S), (N1) (N2), (D) and (N3) in the read application instruction exceeds the device range |
4086H | The output result of (D) in write application instructions exceeds the device range |
Example
After synthesizing the data of the 3-digit digital switch, it is stored in D2 in binary.
Combine data of 3 digital switches connected to non-continuous input terminals.
When M0 is set,
(X020 to X027) BCD 2 digits → D 2 (binary);
(X000 to X003) BCD 1 digit → D 1 (binary);
Store the 1 digit of D1 into the 3 digit of D2, and synthesize a 3-digit value.
CML/16-bit invert transmission
CML(P)
After the BIN 16-bit data specified in (S) is inverted bit by bit, the result is transferred to the device specified in (D).
-[CML (S) (D)]
Content, range and data type
Parameter | Content | Range | Data type | Data type (label) |
(S) | Inverted data or the device number that stores data | -32768 to 32767 | Signed BIN16 | ANY16_S |
(D) | The device number that stores the inversion result | - | Signed BIN16 | ANY16_S |
Device used
Instruction | Parameter | Devices | Offset modification | Pulse extension | ||||||||||
KnX | KnY | KnM | KnS | T | C | D | R | SD | K | H | [D] | XXP | ||
CML | Parameter 1 | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● |
Parameter 2 | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● |
Features
After inverting the BIN 16-bit data specified in (S) bit by bit, the result is transferred to the device specified in (D).
When the number of digits of the device with the specified digit is 4 points, other digits are not affected.
Error code
Error code | Content |
4085H | The output result of (S) in read application instruction exceeds the device range |
4086H | The output result of (D) in write application instruction exceeds the device range |
Example
Example 1:
When M0 is set, the value of D0 is inverted and transferred to the value of D2.
Example 2:
invert input acquisition:
DCML/32-bit invert transmission
DCML(P)
After the BIN 32-bit data specified in (s) is inverted bit by bit, the result is transferred to the device specified in (d).
-[CML (s) (d)]
Content, range and data type
Parameter | Content | Range | Data type | Data type (label) |
(s) | Inverted data or the device number that stores data | -2147483648 to 2147483647 | Signed BIN32 | ANY32_S |
(d) | The device number that stores the inversion result | - | Signed BIN32 | ANY32_S |
Device used
Instruction | Parameter | Devices | Offset modification | Pulse extension | |||||||||||||
KnX | KnY | KnM | KnS | T | C | D | R | SD | LC | HSC | K | H | E | [D] | XXP | ||
DCML | Parameter 1 | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | |
Parameter 2 | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● |
Features
After inverting the BIN 32-bit data specified in (s) bit by bit, the result is transferred to the device specified in (d).
When the number of digits of the device with the specified digit is 4 points, other digits are not affected.
Error code
Error code | Content |
4085H | The output result of (s) in read application instruction exceeds the device range |
4086H | The output result of (d) in write application instruction exceeds the device range |
Example
When M0 is set, the value of (D1, D0) is reversed and transferred to the value of (D3, D2).
CMP/16-bit data comparison output
CMP(P)
Compare the BIN 16-bit data of the device specified in (s1) and (s2).
-[CML (S1) (S2) (D)]
Content, range and data type
Parameter | Content | Range | Data type | Data type (label) |
(S1) | Comparison value data or the device storing the comparison value data | -32768 to +32767 | Signed BIN16 | ANY16_S |
(S2) | Comparison source data or the device storing the comparison source data | -32768 to 32767 | Signed BIN16 | ANY16_S |
(D) | Start bit device for output comparison result | Bit | ANYBIT_ARRAY |
Device used
Instruction | Parameter | Devices | Offset modification | Pulse extension | |||||||||||||||
Y | M | S | SM | D.b | KnX | KnY | KnM | KnS | T | C | D | R | SD | K | H | [D] | XXP | ||
CMP | Parameter 1 | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | |||||
Parameter 2 | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | |||||||||
Parameter 3 | ● | ● | ● | ● | ● | ● |
Features
Compare the BIN 16-bit data of the device specified in (S1) with the BIN 16-bit data of the device specified in (S2). According to the result (less than, consistent, greater than), (D), (D)+1, (D) One of )+2 will turn ON.
(S1) and (S2) are handled as BIN values within the above setting data range.
Use algebraic methods for size comparison.
(1): Even if the instruction input is OFF and the CMP instruction is not executed, (D) to (D)+2 will keep the state before the instruction input changed from ON to OFF.
✎Note: Occupy the device specified in 3 points (D) at the beginning, please be careful not to overlap with the device used for other control.
Error code
Error code | Content |
4085H | The output results of (S1) and (S2) in read application instruction exceed the device range |
4086H | The output result of (D) in write application instruction exceeds the device range |
Example
When M0 is set, compare the values of D0 and D2:
If (D0)> (D2) then Y0 is ON.
If (D0) = (D2) then Y1 is ON. If (D0) <(D2) then Y2 is ON.
DCMP/32-bit data comparison output
DCMP(P)
Compare the BIN 32-bit data of the device specified in (S1) and (S2).
-[DCML (S1) (S2) (D)]
Content, range and data type
Parameter | Content | Range | Data type | Data type (label) |
(S1) | Comparison value data or the device storing the comparison value data | -2147483648 to 2147483647 | Signed BIN32 | ANY32_S |
(S2) | Comparison source data or the device storing the comparison source data | -2147483648 to 2147483647 | Signed BIN32 | ANY32_S |
(D) | Start bit device for output comparison result | Bit | ANYBIT_ARRAY |
Device used
Instruction | Parameter | Devices | Offset modification | Pulse extension | |||||||||||||||||
Y | M | S | SM | D.b | KnX | KnY | KnM | KnS | T | C | D | R | SD | LC | HSC | K | H | [D] | XXP | ||
DCMP | Parameter 1 | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | |||||
Parameter 2 | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | |||||||||
Parameter 3 | ● | ● | ● | ● | ● | ● |
Features
• Compare the BIN 16-bit data of the device specified in (S1) with the BIN 16-bit data of the device specified in (S2). According to the result (less than, consistent, greater than), (D), (D)+1, (D) One of )+2 will turn ON.
• (S1) and (S2) are handled as BIN values within the above setting data range.
• Use algebraic methods for size comparison.
(1): Even if the instruction input is OFF, the DCMP instruction is not executed, (D) to (D)+2 will keep the state before the instruction input changed from ON to OFF.
✎Note: Occupy the device specified in 3 points (D) at the beginning. Please be careful not to overlap with other control devices.
Error code
Error code | Content |
4085H | The output results of (S1) and (S2) in read application instruction exceed the device range |
4086H | The output result of (D) in write application instruction exceeds the device range |
Example
When M0 is set, compare the values of (D1, D0) and (D3, D2):
If (D1, D0)> (D3, D2) then Y0 is ON.
If (D1, D0) = (D3, D2) then Y1 is ON.
If (D1, D0) <(D3, D2) then Y2 is ON.
XCH/16-bit data exchange
XCH(P)
Exchange the BIN 16-bit data of (D1) and (D2).
-[XCH (D1) (D2)]
Content, range and data type
Parameter | Content | Range | Data type | Data type (label) |
(D1) | The start device that stores the exchange data | -32768 to 32767 | Signed BIN16 | ANY16_S |
(D2) | The start device that stores the exchange data | -32768 to 32767 | Signed BIN16 | ANY16_S |
Device used
Instruction | Parameter | Devices | Offset modification | Pulse extension | |||||||
KnY | KnM | KnS | T | C | D | R | SD | [D] | XXP | ||
XCH | Parameter 1 | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● |
Parameter 2 | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● |
Features
• Exchange the BIN 16-bit data of (D1) and (D2).
• When executing instructions with SM160 ON, if the device numbers of (D1) and (D2) are the same. Exchange the upper 8 bits (byte) and lower 8 bits (byte) of the word device.
✎Note: If continuous execution instructions are used, conversion will be performed every operation cycle.
Error code
Error code | Content |
4084H | In exchange mode, the devices in (D1) and (D2) are different |
4085H | The output results of (D1) and (D2) in the read application instruction exceed the device range |
4086H | The output results of (D1) and (D2) in the writing application instruction exceed the device range |
Example
When M0 is reset, set M1: the value of D0 and the value of D2 are exchanged.
When M0 is set, M1 is set: the upper 8 bits (bytes) and lower 8 bits (bytes) of D0 are exchanged with each other.
DXCH/32-bit data exchange
DXCH(P)
Exchange (D1) and (D2) BIN 32-bit data.
-[DXCH (D1) (D2)]
Content, range and data type
Parameter | Content | Range | Data type | Data type (label) |
(D1) | The start device that stores the exchange data | -2147483647 to 2147483647 | Signed BIN32 | ANY32_S |
(D2) | The start device that stores the exchange data | -2147483647 to 2147483647 | Signed BIN32 | ANY32_S |
Device used
Instruction | Parameter | Devices | Offset modification | Pulse extension | |||||||||
KnY | KnM | KnS | T | C | D | R | SD | LC | HSC | [D] | XXP | ||
DXCH | Parameter 1 | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● |
Parameter 2 | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● |
Features
• Exchange the BIN 32-bit data of (D1), (D1)+1 and (D2), (D2)+1.
• When executing instructions with SM160 ON, if the device numbers of (D1) and (D2) are the same. Exchange the upper 8 bits (byte) and lower 8 bits (byte) of the word device (D1) and (D1+1).
✎Note: If continuous execution instructions are used, conversion will be performed every operation cycle.
Error code
Error code | Content |
4084H | In exchange mode, the devices in (D1) and (D2) are different |
4085H | The output results of (D1) and (D2) in the read application instruction exceed the device range |
4086H | The output results of (D1) and (D2) in the writing application instruction exceed the device range |
Example :
When M0 is set, M1 is set: the high 8 bits (byte) and low 8 bits (byte) of the D0 Devices are exchanged, and the high 8 bits (byte) and low 8 bits (byte) of the D1 Devices ) Exchange each other.
When M0 is reset, set M1: the value of (D1, D0) and the value of (D3, D2) are exchanged.
ZCP/16-bit data interval comparison
ZCP(P)
Compare the BIN 16-bit data of the device specified in (S1) and the value (bandwidth) of the BIN 16-bit data of the device specified in (S2) with the BIN 16-bit data of the device specified in the comparison source (S3), Output the result (bottom, area, top) to the device specified in (D) and later.
-[ZCP (S1) (S2) (S3) (D)]
Content, range and data type
Parameter | Content | Range | Data type | Data type (label) |
(S1) | The comparison value data of low limit or the device that stores the comparison value data | -32768 to 32767 | Signed BIN16 | ANY16_S |
(S2) | The comparison value data of high limit or the device that stores the comparison value data | -32768 to 32767 | Signed BIN16 | ANY16_S |
(S3) | Comparison source data or the device that stores the comparison source data | -32768 to 32767 | Signed BIN16 | ANY16_S |
(D) | The start bit device of output comparison result | Bit | ANYBIT_ARRAY |
Device used
Instruction | Parameter | Devices | Offset modification | Pulse extension | ||||||||||||||||
Y | M | S | SM | D.b | KnX | KnY | KnM | KnS | T | C | D | R | SD | K | H | E | [D] | XXP | ||
ZCP | Parameter 1 | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | |||||
Parameter 2 | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ||||||
Parameter 3 | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ||||||
Parameter 4 | ● | ● | ● | ● | ● | ● |
Features
• Compare the BIN 16-bit data of the device specified in (S1) and the value (bandwidth) of the BIN 16-bit data of the device specified in (S2) with the BIN 16-bit data of the device specified in the comparison source (S3) , According to the result (bottom, area, top), one of (D), (D)+1, (D)+2 will be turned ON. (S1), (S2), (S3) are treated as BIN values within the above-mentioned setting data range. Use algebraic methods for size comparison.
• Use algebraic methods for size comparison.
(1): Even if the instruction input is OFF and the ZCP instruction is not executed, (D) to (D)+2 will keep the state before the instruction input turns from ON to OFF.
✎Note:
• Please set the lower comparison value (S1) to a value smaller than the upper comparison value (S2).
• When (s1) is greater than (S2), it will be processed as (S2)=(S1).
• The device specified in 3 points (d) is occupied at the beginning. Please be careful not to overlap with other control devices.
Error code
Error code | Content |
4085H | The output results of (S1), (S2) and (S3) in the read application instruction exceed the device range |
4086H | The output result of (D) in write application instructions exceeds the device range |
Example
When M0 is set, compare whether D0 is between 0 and 1000:
If (D0)> (1000), then Y0 is ON.
If (0) ≤ (D0) ≤ (1000), then Y1 is ON.
If (D0) <(0), then Y2 is ON.
DZCP/32-bit data interval comparison
DZCP(P)
Compare the BIN 32-bit data of the device specified in (S1) and the value (bandwidth) of the BIN 32-bit data of the device specified in (S2) with the BIN 32-bit data of the device specified in the comparison source (S3), Output the result (bottom, area, top) to the device specified in (D) and later.
-[DZCP (S1) (S2) (S3) (D)]
Content, range and data type
Parameter | Content | Range | Data type | Data type (label) |
(S1) | The comparison value data of low limit or the device that stores the comparison value data | -2147483648 to 2147483647 | Signed BIN32 | ANY32_S |
(S2) | The comparison value data of high limit or the device that stores the comparison value data | -2147483648 to 2147483647 | Signed BIN32 | ANY32_S |
(S3) | Comparison source data or the device that stores the comparison source data | -2147483648 to 2147483647 | Signed BIN32 | ANY32_S |
(D) | The start bit device of output comparison result | Bit | ANYBIT_ARRAY |
Device used
Instruction | Parameter | Devices | Offset modification | Pulse extension | ||||||||||||||||||
Y | M | S | SM | D.b | KnX | KnY | KnM | KnS | T | C | D | R | SD | LC | HSC | K | H | E | [D] | XXP | ||
DZCP | Parameter 1 | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | |||||
Parameter 2 | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ||||||
Parameter 3 | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ||||||
Parameter 4 | ● | ● | ● | ● | ● | ● |
Features
• Compare the BIN 32-bit data of the device specified in (S1) and the value (bandwidth) of the BIN 32-bit data of the device specified in (S2) with the BIN 32-bit data of the device specified in the comparison source (S3) , According to the result (bottom, area, top), one of (D), (D)+1, (D)+2 will be turned ON. (S1), (S2), (S3) are treated as BIN values within the above-mentioned setting data range. Use algebraic methods for size comparison.
• Use algebraic methods for size comparison.
(1): Even if the instruction input is OFF and the ZCP instruction is not executed, (D) to (D)+2 will keep the state before the instruction input turns from ON to OFF.
✎Note:
• Please set the lower comparison value (S1) to a value smaller than the upper comparison value (S2).
• When (S1) is greater than (S2), it will be processed as (S2)=(S1).
• The device specified in 3 points (D) is occupied at the beginning. Please be careful not to overlap with other control devices.
Error code
Error code | Content |
4085H | The output results of (S1), (S2) and (S3) in the read application instruction exceed the device range |
4086H | The output results of (D) in the write application instruction exceeds the device range |
Example
When M0 is set, compare D0 with whether it is between 0 and 100000:
If (D0)> (100000), then Y0 is ON.
If (0) ≤ (D0) ≤ (100000), then Y1 is ON.
If (D0) <(0), then Y2 is ON.
Cycle shift instruction
ROR/16-bit cycle shift right
ROR(P)
Shift the 16-bit data of the device specified in (D) to the right by (N) bits without including the carry flag.
-[ROR (D) (N)]
Content, range and data type
Parameter | Content | Range | Data type | Data type (label) |
(D) | The device start number for cycle shift right | - | Signed BIN 16 bit | ANY16 |
(N) | The number of times to cycle shift right | 0 to 15 | Signed BIN 16 bit | ANY16 |
Device used
Instruction | Parameter | Devices | Offset modification | Pulse extension | ||||||||||
KnX | KnY | KnM | KnS | T | C | D | R | SD | K | H | [D] | XXP | ||
ROR | Parameter 1 | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | |||
Parameter 2 | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● |
Features
・The 16-bit data of the device specified in (D) is shifted right by (N) bits without including the carry flag. The carry flag is in the ON or OFF state according to the state before the ROR(P) is executed.
(N) Specifies 0 to 15. When a value of 16 or more is specified in (N), the remainder value of (N)÷16 is shifted to the right. For example, when (N)=18, 18÷16=1 and the remainder is 2, so a 2-bit right shift is performed.
Related device
Device | Name | Content |
SM151 | Carry | It turns ON when the last bit shifted from the lowest is 1. |
✎Note:
Do not set the number of digits (N) shifted right to a negative value.
In the case of continuous execution type instructions (ROR, RCR), the right shift will be executed every scan time (operation cycle), so be careful.
When specifying the number of digits to specify the device in (D), only K4 (16-bit instruction) or K8 (32-bit instruction) is valid. (For example, K4Y10, K8M0).
Error code
Error code | Content |
4084H | A negative value is specified in (N). |
4085H | The output results of (D) and (N) in the read application instruction exceed the device range |
4086H | The output result of (D) in the write application instruction exceeds the device range |
Example
Shift the 1 in the D0 device by 3 bits to the right to get 8192.
DROR/32-bit cycle shift right
DROR(P)
Shift the 32-bit data of the device specified in (D) to the right by (N) bits without including the carry flag.
-[DROR (D) (N)]
Content, range and data type
Parameter | Content | Range | Data type | Data type (label) |
(D) | The device start number for cycle shift right | - | Signed BIN 32 bit | ANY32 |
(N) | The number of times to cycle shift right | 0 to 31 | Signed BIN 32 bit | ANY32 |
Device used
Instruction | Parameter | Devices | Offset modification | Pulse extension | ||||||||||||
KnX | KnY | KnM | KnS | T | C | D | R | SD | LC | HSC | K | H | [D] | XXP | ||
DROR | Parameter 1 | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | |||
Parameter 2 | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● |
Features
・The 32-bit data of the device specified in (D) is shifted right by (N) bits without including the carry flag. The carry flag is on or off according to the state before DROR(P) is executed.
(N) Specifies 0 to 31. When a value of 32 or more is specified in (N), the remainder of (N)÷32 is shifted to the right. For example, when (N)=34, 34÷32=1 and the remainder is 2, so a 2-bit right shift is performed.
Related device
Device | Name | Content |
SM151 | Carry | It turns ON when the last bit shifted from the lowest is 1. |
✎Note:
Do not set the number of digits (N) shifted right to a negative value.
In the case of continuous execution type instructions (ROR, RCR), the right shift will be executed every scan time (operation cycle), so be careful. When specifying the number of digits to specify the device in (D), only K4 (16-bit instruction) or K8 (32-bit instruction) is valid. (For example, K4Y10, K8M0).
Error code
Error code | Content |
4084H | A negative value is specified in (N). |
4085H | The output results of (D) and (N) in the read application instruction exceed the device range |
4086H | The output result of (D) in the write application instruction exceeds the device range |
After the rising edge of M1 is triggered, the value 32 of the D0 device is shifted right by 3 bits to get 4.
Example
RCR/16-bit cycle shift right with carry
RCR(P)
Shift the 16-bit data of the device specified in (D) to the right by (N) bits with the carry flag included.
-[RCR (D) (N)]
Content, range and data type
Parameter | Content | Range | Data type | Data type (label) |
(D) | The device start number for cycle shift right | - | Signed BIN 16 bit | ANY16 |
(N) | The number of times to cycle shift right | 0 to 15 | Signed BIN 16 bit | ANY16 |
Device used
Instruction | Parameter | Devices | Offset modification | Pulse extension | ||||||||||
KnX | KnY | KnM | KnS | T | C | D | R | SD | K | H | [D] | XXP | ||
RCR | Parameter 1 | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | |||
Parameter 2 | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● |
Features
Shift the BIN 16-bit data of the device specified in (D) to the right by (N) bits with the carry flag included. The carry flag is on or off according to the state before the RCR(P) is executed.
(N) Specifies 0 to 15. When a value of 16 or more is specified in (N), the remainder value of (N)÷16 is shifted to the right. For example, when (N)=18, 18÷16=1 and the remainder is 2, so a 2-bit right shift is performed.
Related device
Device | Name | Content |
SM151 | Carry | It turns ON when the last bit shifted from the lowest is 1. |
✎Note:
Do not set the number of digits (N) shifted right to a negative value.
In the case of continuous execution type instructions (ROR, RCR), the right shift will be executed every scan time (operation cycle), so be careful.
When specifying the number of digits to specify the device in (D), only K4 (16-bit instruction) or K8 (32-bit instruction) is valid. (For example, K4Y10, K8M0).
Error code
Error code | Content |
4084H | A negative value is specified in (N) |
4085H | The output results of (D) and (N) in the read application instruction exceed the device range |
4086H | The output result of (D) in the write application instruction exceeds the device range |
Example
After the rising edge of M0 is triggered, the carry flag SM151 turns ON, and D0 is assigned the value 1. When M1=ON, the value in the D0 device is shifted right by 4 bits to get 12288.
DRCR/32-bit cycle shift right with carry
DRCR(P)
Shift the 32-bit data of the device specified in (D) to the right by (N) bits with the carry flag included.
-[DRCR (D) (N)]
Content, range and data type
Parameter | Content | Range | Data type | Data type (label) |
(D) | The device start number for cycle shift right | - | Signed BIN 32 bit | ANY32 |
(N) | The number of times to cycle shift right | 0 to 31 | Signed BIN 32 bit | ANY32 |
Device used
Instruction | Parameter | Devices | Offset modification | Pulse extension | ||||||||||||
KnX | KnY | KnM | KnS | T | C | D | R | SD | LC | HSC | K | H | [D] | XXP | ||
DRCR | Parameter 1 | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | |||
Parameter 2 | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● |
Features
・The BIN 32-bit data of the device specified in (D) is shifted right by (N) bits with the carry flag included. The carry flag is in the ON or OFF state according to the state before DRCR(P) is executed.
(N) Specifies 0 to 31. When a value of 32 or more is specified in (N), the remainder value of (N)÷32 is shifted to the right. For example, when (N)=34, 34÷32=1 and the remainder is 2, so a 2-bit right shift is performed.
Related device
Devices | Name | Content |
SM151 | Carry | It turns ON when the last bit shifted from the lowest is 1. |
✎Note:
Do not set the number of bits (N) to turn right to a negative value.
In the case of continuous execution type instructions (DROR, DRCR), the right shift will be executed every scan time (operation cycle), so be careful. When specifying the number of digits to specify the device in (D), only K4 (16-bit instruction) or K8 (32-bit instruction) is valid. (For example, K4Y10, K8M0).
Error code
Error code | Content |
4084H | A negative value is specified in (N). |
4085H | The output results of (D) and (N) in the read application instruction exceed the device range |
4086H | The output result of (D) in the write application instruction exceeds the device range |
Example
After the rising edge of M0 is triggered, the carry flag SM151 turns ON, and D0 is assigned the value 1. When M1=ON, the value in the D0 device is shifted right by 20 bits to get 12288.
ROL/16-bit cycle shift left
ROL(P)
Shift the 16-bit data of the device specified in (D) to the left by (N) bits without including the carry flag.
-[ROL (D) (N)]
Content, range and data type
Parameter | Content | Range | Data type | Data type (label) |
(D) | The device start number for cycle shift left | - | Signed BIN 16 bit | ANY16 |
(N) | The number of times to cycle shift left | 0 to 15 | Signed BIN 16 bit | ANY16 |
Device used
Instruction | Parameter | Devices | Offset modification | Pulse extension | ||||||||||
KnX | KnY | KnM | KnS | T | C | D | R | SD | K | H | [D] | XXP | ||
ROL | Parameter 1 | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | |||
Parameter 2 | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● |
Features
・The 16-bit data of the device specified in (D) is shifted to the left by (N) bits without including the carry flag. The carry flag is in the ON or OFF state according to the state before ROL(P) is executed.
(N) Specify 0 to 15. When a value of 16 or more is specified in (N), the remainder value of (N)÷16 is shifted to the left. For example, when (N)=18, 18÷16=1 and the remainder is 2, so a 2-bit left shift is performed.
Related device
Device | Name | Content |
SM151 | Carry | It turns ON when the last bit shifted from the highest is 1. |
✎Note:
Do not set the number of digits (N) shifted to the left to a negative value. In the case of continuous execution type instructions (ROL, RCL), the shift to the left will be executed every scan time (operation cycle), so be careful. When specifying the number of digits to specify the device in (D), only K4 (16-bit instruction) or K8 (32-bit instruction) is valid. (For example, K4Y10, K8M0).
Error code
Error code | Content |
4084H | A negative value is specified in (N). |
4085H | The output results of (D) and (N) in the read application instruction exceed the device range |
4086H | The output result of (D) in the write application instruction exceeds the device range |
Example
Shift 1 in the D0 device to the left by 3 bits to get 8.
DROL/32-bit cycle shift left
DROL(P)
Shift the 32-bit data of the device specified in (D) to the left by (N) bits without including the carry flag.
-[DROL (D) (N)]
Content, range and data type
Parameter | Content | Range | Data type | Data type (label) |
(D) | The device start number for cycle shift left | - | Signed BIN 32 bit | ANY32 |
(N) | The number of times to cycle shift left | 0 to 31 | Signed BIN 32 bit | ANY32 |
Device used
Instruction | Parameter | Devices | Offset modification | Pulse extension | ||||||||||||
KnX | KnY | KnM | KnS | T | C | D | R | SD | LC | HSC | K | H | [D] | XXP | ||
DROL | Parameter 1 | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | |||
Parameter 2 | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● |
Features
・The 32-bit data of the device specified in (D) is shifted left by (N) bits without including the carry flag. The carry flag is on or off according to the state before DROL(P) is executed.
(N) Specifies 0 to 31. When a value of 32 or more is specified in (N), the remainder of (N)÷32 is shifted to the left. For example, when (N)=34, 34÷32=1 and the remainder is 2, so a 2-bit left shift is performed.
Related device
Device | Name | Content |
SM151 | Carry | It turns ON when the last bit shifted from the highest is 1. |
✎Note:
Do not set the number of digits (N) shifted to the left to a negative value.
In the case of continuous execution type instructions (ROL, RCL), the shift to the left will be executed every scan time (operation cycle), so be careful. When specifying the number of digits to specify the device in (D), only K4 (16-bit instruction) or K8 (32-bit instruction) is valid. (For example, K4Y10, K8M0).
Error code
Error code | Content |
4084H | A negative value is specified in (N). |
4085H | The output results of (D) and (N) in the read application instruction exceed the device range |
4086H | The output result of (D) in the write application instruction exceeds the device range |
Example
Shift 1 in the D0 device to the left by 3 bits to get 8.
RCL/16-bit cycle shift left with carry
RCL(P)
Shift the 16-bit data of the device specified in (D) to the left by (N) bits with the carry flag included.
-[RCL (D) (N)]
Content, range and data type
Parameter | Content | Range | Data type | Data type (label) |
(D) | The device start number for cycle shift left | - | Signed BIN 16 bit | ANY16 |
(N) | The number of times to cycle shift left | 0 to 15 | Signed BIN 16 bit | ANY16 |
Device used
Instruction | Parameter | Devices | Offset modification | Pulse extension | ||||||||||
KnX | KnY | KnM | KnS | T | C | D | R | SD | K | H | [D] | XXP | ||
RCL | Parameter 1 | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | |||
Parameter 2 | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● |
Features
・The 16-bit data of the device specified in (D) is shifted (N) to the left with the carry flag included. The carry flag is on or off according to the state before RCL(P) is executed.
(N) Specifies 0 to 15. When a value of 16 or more is specified in (N), the remainder value of (N)÷16 is shifted to the left. For example, when (N)=18, 18÷16=1 and the remainder is 2, so a 2-bit left shift is performed.
Related device
Device | Name | Content |
SM151 | Carry | It turns ON when the last bit shifted from the highest is 1. |
✎Note:
Do not set the number of digits (N) shifted to the left to a negative value. In the case of continuous execution type instructions (ROL, RCL), the shift to the left will be executed every scan time (operation cycle), so be careful. When specifying the number of digits to specify the device in (D), only K4 (16-bit instruction) or K8 (32-bit instruction) is valid. (For example, K4Y10, K8M0).
Error code
Error code | Content |
4084H | A negative value is specified in (N). |
4085H | The output results of (D) and (N) in the read application instruction exceed the device range |
4086H | The output result of (D) in the write application instruction exceeds the device range |
Example
After the rising edge of M0 is triggered, the carry flag SM151 turns ON, and D0 is assigned the value 1.
When M1=ON, move the value in the D0 device with carry to the left by 4 bits to get 24.
DRCL/32-bit cycle shift left with carry
DRCL(P)
Move the 32-bit data of the device specified in (D) to the left by (N) bits with the carry flag included.
-[DRCL (D) (N)]
Content, range and data type
Parameter | Content | Range | Data type | Data type (label) |
(D) | The device start number for cycle shift left | - | Signed BIN 32 bit | ANY32 |
(N) | The number of times to cycle shift left | 0 to 31 | Signed BIN 32 bit | ANY32 |
Device used
Instruction | Parameter | Devices | Offset modification | Pulse extension | ||||||||||||
KnX | KnY | KnM | KnS | T | C | D | R | SD | LC | HSC | K | H | [D] | XXP | ||
DRCL | Parameter 1 | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | |||
Parameter 2 | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● |
Features
The 32-bit data of the device specified in (D) is shifted (N) to the left with the carry flag included. The carry flag is on or off according to the state before RCL(P) is executed.
(N) Specifies 0 to 31. When a value of 32 or more is specified in (N), the remainder of (N)÷32 is shifted to the left. For example, when (N)=34, 34÷32=1 and the remainder is 2, so a 2-bit left shift is performed.
Related device
Devices | Name | Content |
SM151 | Carry | Turns ON when the last bit shifted from the highest is 1. |
✎Note:
Do not set the number of digits (N) shifted to the left to a negative value. In the case of continuous execution type instructions (ROL, RCL), the shift to the left will be executed every scan time (operation cycle), so be careful. When specifying the number of digits to specify the device in (D), only K4 (16-bit instruction) or K8 (32-bit instruction) is valid. (For example, K4Y10, K8M0).
Error code
Error code | Content |
4084H | A negative value is specified in (N). |
4085H | The output results of (D) and (N) in the read application instruction exceed the device range |
4086H | The output result of (D) in the write application instruction exceeds the device range |
Example
After the rising edge of M0 is triggered, the carry flag SM151 turns ON, and D0 is assigned the value 1. When M1=ON, carry the value in the D0 device to the left by 4 bits to get 24.
SFTR/n-bit shift right of n-bit data
SFTR(P)
Shift (N2) the data of the start (N1) bits of the device specified in (D) to the right.
-[SFTR (S) (D) (N1) (N2)]
Content, range and data type
Parameter | Content | Range | Data type | Data type (label) |
(S) | The start number of the device storing the shifted data after shifting | - | Bit | ANY_BOOL |
(D) | The shifted device start number | - | Bit | ANY_BOOL |
(N1) | The length of shifted data | 0 to 32767 | Signed BIN 16 bit | ANY16 |
(N2) | Number of shifts | 0 to 32767 | Signed BIN 16 bit | ANY16 |
Device used
Instruction | Parameter | Devices | Offset modification | Pulse extension | ||||||||||||||||
X | Y | M | S | SM | D.b | KnX | KnY | KnM | KnS | T | C | D | R | SD | K | H | [D] | XXP | ||
SFTR | Parameter 1 | ● | ● | ● | ● | ● | ● | ● | ● | |||||||||||
Parameter 2 | ● | ● | ● | ● | ● | ● | ● | |||||||||||||
Parameter 3 | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | |||||||
Parameter 4 | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● |
Features
Shift (N2) the data of the start (N1) bits of the device specified in (D) to the right. After shifting, the point (N2) starting from (S) is transferred to the point (N2) starting from (D) + (N1 to N2).
When K0 is specified in (S), the bit of the (D) + (N1 to N2) starting point (N2) after the shift is set to 0.
When K1 is specified in (S), the bit of the (D) + (N1 to N2) starting point (N2) after the shift is set to 1.
(1): When (S)=K0, it becomes 0.
Error code
Error code | Content |
4084H | When the value specified in (N1) and (N2) exceeds the range of 0 to 32767 |
When the value specified in (N1) and (N2) is (N1)<(N2) | |
4085H | When the device specified in read application instructions (S), (D), (N1) and (N2) exceeds the corresponding device range |
4086H | When the device specified in the write application instruction (D) exceeds the corresponding device range |
Example
For N1=9 bits (the length of the shift register) data starting with M0, right shift N2=3 bits. After shifting, transfer N2=3 bits from Y0 to N2=3 bits from M6.
SFTL/n-bit shift left of n-bit data
SFTL(P)
Shift the start (N1) bit data of the device specified in (D) to the left by (N2) bits.
-[SFTL (S) (D) (N1) (N2)]
Content, range and data type
Parameter | Content | Range | Data type | Data type (label) |
(S) | The start number of the device storing shifted data after shifting | - | Bit | ANY_BOOL |
(D) | The shifted device start number | - | Bit | ANY_BOOL |
(N1) | The length of shifted data | 0 to 32767 | Signed BIN 16 bit | ANY16 |
(N2) | Number of shifts | 0 to 32767 | Signed BIN 16 bit | ANY16 |
Device used
Instruction | Parameter | Devices | Offset modification | Pulse extension | ||||||||||||||||
X | Y | M | S | SM | D.b | KnX | KnY | KnM | KnS | T | C | D | R | SD | K | H | [D] | XXP | ||
SFTL | Parameter 1 | ● | ● | ● | ● | ● | ● | ● | ● | |||||||||||
Parameter 2 | ● | ● | ● | ● | ● | ● | ● | |||||||||||||
Parameter 3 | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | |||||||
Parameter 4 | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● |
Features
Shift (N2) bits of the data at the beginning (N1) bits of the device specified in (D). After shifting, the point (N2) starting from (S) is transferred to the point (N2) starting from (D) + (N1 to N2).
When K0 is specified in (S), the bit of the (D) + (N1 to N2) starting point (N2) after the shift is set to 0.
When K1 is specified in (S), the bit of the (D) + (N1 to N2) starting point (N2) after the shift is set to 1.
(1): When (S)=K0, it becomes 0.
Error code
Error code | Content |
4084H | When the value specified in (N1) and (N2) exceeds the range of 0 to 32767 |
When the value specified in (N1) and (N2) is (N1)<(N2) | |
4085H | When the device specified in read application instructions (S), (D), (N1) and (N2) exceeds the corresponding device range |
4086H | When the device specified in the write application instruction (D) exceeds the corresponding device range |
Example
Example 1:
Example 2:
WSFR/n-word shift right of n-word data
WSFR(P)
Shift (N2) the data of the start (N1) bits of the device specified in (D) to the right.
-[WSFR (S) (D) (N1) (N2)]
Content, range and data type
Parameter | Content | Range | Data type | Data type (label) |
(S) | The start number of the device storing shifted data after shifting | - | word | ANY_BOOL |
(D) | The shifted device start number | - | word | ANY_BOOL |
(N1) | The length of shifted data | 0 to 32767 | Signed BIN 16 bit | ANY16 |
(N2) | Number of shifts | 0 to 32767 | Signed BIN 16 bit | ANY16 |
Device used
Instruction | Parameter | Devices | Offset modification | Pulse extension | ||||||||||
KnX | KnY | KnM | KnS | T | C | D | R | SD | K | H | [D] | XXP | ||
SFTR | Parameter 1 | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● |
Parameter 2 | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ||||
Parameter 3 | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | |
Parameter 4 | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● |
Features
Shift (N2) the data of the beginning (N1) word of the device specified in (D) to the right. After shifting, the point (N2) starting from (S) is transferred to the point (N2) starting from (D) + (N1 to N2).
When K is specified in (S), the device at (D) + (N1 to N2) starting (N2) point after shifting is set to the specified value.
If the value specified in (N1) or (N2) is 0, it will be no processing.
Error code
Error code | Content |
4084H | When the value specified in (N1) and (N2) exceeds the range of 0 to 32767 |
When the value specified in (N1) and (N2) is (N1)<(N2) | |
When (S) and (D) both specify KnM, KnX, and KnS, the value of n varies. | |
4085H | When the device specified in read application instructions (S), (D), (N1) and (N2) exceeds the corresponding device range |
4086H | When the device specified in the write application instruction (D) exceeds the corresponding device range |
Example
(S) and (D) specify the same multiple in the digit specified device. This program realizes to shift Y0 to Y7 bits right, shift Y10 to Y17 right to Y0 to Y7, and then store X0 to X7 to Y10 to Y17.
WSFL/n-word shift left of n-word data
WSFL(P)
Shift the start (N1) bit data of the device specified in (D) to the left by (N2) bits.
-[WSFL (S) (D) (N1) (N2)]
Content, range and data type
Parameter | Content | Range | Data type | Data type (label) |
(S) | The start number of the device storing shifted data after shifting | - | Word | ANY_BOOL |
(D) | The shifted device start number | - | Word | ANY_BOOL |
(N1) | The length of shifted data | 0 to 32767 | Signed BIN 16 bit | ANY16 |
(N2) | Number of shifts | 0 to 32767 | Signed BIN 16 bit | ANY16 |
Device used
Instruction | Parameter | Devices | Offset modification | Pulse extension | ||||||||||
KnX | KnY | KnM | KnS | T | C | D | R | SD | K | H | [D] | XXP | ||
SFTR | Parameter 1 | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● |
Parameter 2 | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ||||
Parameter 3 | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | |
Parameter 4 | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● |
Features
Shift (N2) the data of the beginning (N1) word of the device specified in (D) to the left. After shifting, transfer the point (N2) starting from (S) to the point (N2) starting from (D).
When K is specified in (S), the device at (D) + (N1 to N2) starting (N2) point after shifting is set to the specified value.
If the value specified in (N1) or (N2) is 0, it will be no processing.
Error Code
Error code | Content |
4084H | When the value specified in (N1) and (N2) exceeds the range of 0 to 32767 |
When the value specified in (N1) and (N2) is (N1)<(N2) | |
When (S) and (D) both specify KnM, KnX, and KnS, the value of n varies. | |
4085H | When the device specified in read application instructions (S), (D), (N1) and (N2) exceeds the corresponding device range |
4086H | When the device specified in the write application instruction (D) exceeds the corresponding device range |
Example
(S), (D) Do the same multiple specification in the digit specification device. This program realizes to remove the high bits of Y10 to Y17 left, move Y0 to Y7 left to Y10 to Y17, and then store X0 to X7 to Y0 to Y7.
SFR/n-bit shift right of 16-bit data
SFR(P)
Shift the 16-bit data of the device specified in (D) right by (N) bits.
-[SFR (D) (N)]
Content, range and data type
Parameter | Content | Range | Data type | Data type (label) |
(D) | The start number of the device storing the shifted data | - | Signed BIN 16 bit | ANY16 |
(N) | Number of shifts | 0-15 | Signed BIN 16 bit | ANY16 |
Device used
Instruction | Parameter | Devices | Offset modification | Pulse extension | ||||||||||
KnX | KnY | KnM | KnS | T | C | D | R | SD | K | H | [D] | XXP | ||
SFR | Parameter 1 | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | |||
Parameter 2 | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● |
Features
When (N)=6
Shift the 16-bit data of the device specified in (D) to the right (N) bits from the highest bit. The (N) bit from the most significant bit will become 0.
When (N)=6
When a bit device is specified in (d), the device range specified in the digit specification is shifted to the right.
(N) Specifies 0 to 15. When a value of 16 or more is specified in (N), the remainder of (N)÷16 is shifted to the left. For example, when (N)=18, 18÷16=1 and the remainder 2, so it is shifted by 2 bits to the right.
Related device
Device | Name | Content |
SM151 | Carry | Set to ON/OFF according to the state of N-1 bit (1/0) |
Error code
Error code | Content |
4084H | A negative value is specified in (N). |
4085H | The output results of (D) and (N) in the read application instruction exceed the device range |
4086H | The output result of (D) in the write application instruction exceeds the device range |
Example
When M1 is ON, the contents of Y10 to Y23 are shifted to the right by the number of digits specified in D0.
DSFR/n word data shift right by 1 word
DSFR(P)
Shift the data at the start (N) point of the device specified in (D) to the right by 1 word.
-[DSFR (D) (N)]
Content, range and data type
Parameter | Content | Range | Data type | Data type (label) |
(D) | The start number of the device storing the shifted data | - | Signed BIN 16 bit | ANY16 |
(N) | Number of shifts | 0 to 32767 | Signed BIN 16 bit | ANY16 |
Device used
Instruction | Parameter | Devices | Offset modification | Pulse extension | ||||||||||
KnX | KnY | KnM | KnS | T | C | D | R | SD | K | H | [D] | XXP | ||
DSFR | Parameter 1 | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | |||
Parameter 2 | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● |
Features
• Shift the data at the start (N) point of the device specified in (D) by 1 word to the right.
• The device specified in (D)+(N-1) will become 0.
✎Note: In (D), when specifying the device number by specifying the number of bits of the bit device, the device number should be a multiple of 16 (0, 16, 32, 64...), and only K4 should be specified for the number of bits. When the number of bits is not K4, K4 is used for processing.
Error code
Error code | Content |
4084H | When the value specified in (N) exceeds the range of 0 to 32767 |
4085H | The output results of (D) and (N) in the read application instruction exceed the device range |
4086H | The output result of (D) in the write application instruction exceeds the device range |
Example
When M1 is ON, shift the contents of D0 to D4 to the right by 1 word (D1→D0, D2→D1, D3→D2, D4→D3, D4 is set to 0).
Before execution:
After execution:
SFL/n-bit shift left of 16-bit data
SFL(P)
Shift the 16-bit data of the device specified in (D) to the left by (N) bits.
-[SFL (D) (N)]
Content, range and data type
Parameter | Content | Range | Data type | Data type (label) |
(D) | The start number of the device storing the shifted data | - | Signed BIN 16 bit | ANY16 |
(N) | Number of shifts | 0 to 15 | Signed BIN 16 bit | ANY16 |
Device used
Instruction | Parameter | Devices | Offset modification | Pulse extension | ||||||||||
KnX | KnY | KnM | KnS | T | C | D | R | SD | K | H | [D] | XXP | ||
SFL | Parameter 1 | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | |||
Parameter 2 | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● |
Features
Shift the 16-bit data of the device specified in (D) to the left (N) bits from the lowest bit. The (N) bit from the lowest bit will become 0.
When (N)=8, it is as follows.
When a bit device is specified in (D), the left shift is performed in the device range specified in the digit specification.
When (N)=3, it is as follows.
(N) Specify 0 to 15. When a value of 16 or more is specified in (N), the remainder of (N)÷16 is shifted to the left. For example, when (N)=18, 18÷16=1 remainder 2, so it is shifted by 2 bits to the left.
Related device
Device | Name | Content |
SM151 | Carry | Turn ON/OFF according to the state of N+1 bit (1/0) |
Error code
Error code | Content |
4084H | A negative value is specified in (N). |
4085H | The output results of (D) and (N) in the read application instruction exceed the device range |
4086H | The output result of (D) in the write application instruction exceeds the device range |
Example
When M1 is ON, the contents of Y10 to Y17 are shifted to the left by the number of digits specified in D0.
DSFL/one word shift left of n word data
DSFL(P)
Move the data at the beginning (N) point of the device specified in (D) by 1 word to the left.
-[DSFL (D) (N)]
Content, range and data type
Parameter | Content | Range | Data type | Data type (label) |
(D) | The start number of the device storing the shifted data | - | Signed BIN 16 bit | ANY16 |
(N) | Number of shifts | 0 to 32,767 | Signed BIN 16 bit | ANY16 |
Device used
Instruction | Parameter | Devices | Offset modification | Pulse extension | ||||||||||
KnX | KnY | KnM | KnS | T | C | D | R | SD | K | H | [D] | XXP | ||
DSFL | Parameter 1 | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | |||
Parameter 2 | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● |
Features
Shift the data at the start (N) point of the device specified in (D) to the left by 1 word.
The device specified in (D) will become 0.
✎Note: In (D), when specifying the device number by specifying the number of bits of the bit device, the device number should be a multiple of 16 (0, 16, 32, 64...), and only K4 should be specified for the number of bits. When the number of bits is not K4, K4 is used for processing.
Error code
Error code | Content |
4084H | When the value specified in (N) exceeds the range of 0 to 32,767 |
4085H | The output results of (D) and (N) in the read application instruction exceed the device range |
4086H | The output result of (D) in the write application instruction exceeds the device range |
Example
When M1 is ON, shift the contents of D0 to D4 to the left by 1 word (D3→D4, D2→D3, D1→D2, D0→D1, D0 is set to 0).
Before execution:
After execution:
Arithmetic operation instructions
ADD/16-bit addition operation
ADD(P)
Add the BIN 16-bit data specified in (S1) and the BIN 16-bit data specified in (S2), and store the result in the device specified in (D).
-[ADD (S1) (S2) (D)]
Content, range and data type
Parameter | Content | Range | Data type | Data type (label) |
(S1) | Addition operation data or the device storing the addition data | -32768 to 32767 | Signed BIN16 | ANY16_S |
(S2) | Addition operation data or the device storing the addition data | -32768 to 32767 | Signed BIN16 | ANY16_S |
(D) | Device for storing operation results | Signed BIN16 | ANY16_S |
Device used
Instruction | Parameter | Devices | Offset modification | Pulse extension | ||||||||||
KnX | KnY | KnM | KnS | T | C | D | R | SD | K | H | [D] | XXP | ||
ADD | Parameter 1 | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● |
Parameter 2 | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | |
Parameter 3 | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● |
Features
Add the BIN 16-bit data specified in (S1) and the BIN 16-bit data specified in (S2), and store the result of the addition in the device specified in (D).
Related device
Devices | Name | Content |
SM151 | Carry | When the operation result exceeds 32,767, the carry flag will be (ON). |
SM152 | Borrow | When the operation result is less than -32,768, the borrow flag will be (ON). |
SM153 | Zero point | When the operation result is 0, the zero flag will be (ON). |
✎Note:
1.When the source operand and destination operand are specified as the same device:
The source operand and destination operand can also be specified as the same device number.
In this case, if you use continuous execution instructions (ADD, DADD), the result of the addition operation will change every operation cycle.
2.The difference between the ADD instruction and the INC instruction using the +1 addition operation program:
ADD[P] means that every time X001 changes from OFF to ON, the content of D0 is added by one operation.
Although this instruction is very similar to the INCP instruction described later, there are some differences in the following content.
ADD/ADDP/DADD/DADDP instructions | INC/INCP/DINC/DINCP instructions | |||
Flag bit (zero, borrow, carry) | Action | No action | ||
Calculation result | 16-bit operation result | (S) + (+1) = (D) | 32767 → 0 → +1 → +2 → | 32767→-32768→-32767 |
(S) + (-1) = (D) | ← -2 ← -1 ← 0 ← -32768 | —— | ||
32-bit operation result | (S) + (+1) = (D) | 2147483647 → 0 → +1 → +2 → | 2147483647 → -2147483648→ -2147483647 | |
(S) + (-1) = (D) | ← -2 ← -1 ← 0 ← -2147483648 | —— |
Error code
Error code | Content |
4085H | The output results of (S1) and (S2) in the read application instruction exceed the device range |
4086H | The output result of (D) in the write application instruction exceeds the device range |
Example
Add 10 to the data in (D0), and store the operation result in (D2), that is, (D0) + 10 → (D2).
DADD/32-bit addition operation
DADD(P)
Add the BIN32-bit data specified in (S1) and the BIN32-bit data specified in (S2), and store the result in the device specified in (D).
-[DADD (S1) (S2) (D)]
Content, range and data type
Parameter | Content | Range | Data type | Data type (label) |
(S1) | Addition data or the device storing the addition data | -2147483648 to 2147483647 | Signed BIN32 | ANY32_S |
(S2) | Addition data or the device storing the addition data | -2147483648 to 2147483647 | Signed BIN32 | ANY32_S |
(D) | Device for storing operation results | Signed BIN32 | ANY32_S |
Device used
Instruction | Parameter | Devices | Offset modification | Pulse extension | ||||||||||||
KnX | KnY | KnM | KnS | T | C | D | R | SD | LC | HSC | K | H | [D] | XXP | ||
DADD | Parameter 1 | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● |
Parameter 2 | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | |
Parameter 3 | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● |
Features
Add the BIN32-bit data specified in (s1) and the BIN32-bit data specified in (s2), and store the result of the addition in the device specified in (d).
Related device
Devices | Name | Content |
SM151 | Carry | When the operation result exceeds 32,767, the carry flag will be (ON). |
SM152 | Borrow | When the operation result is less than -32,768, the borrow flag will be (ON). |
SM153 | Zero point | When the operation result is 0, the zero flag will be (ON). |
✎Note:
1. When the source operand and destination operand are specified as the same device:
The source operand and destination operand can also be specified as the same device number.
In this case, if you use continuous execution instructions (ADD, DADD), the result of the addition operation will change every operation cycle. Please note.
2. The difference between the ADD instruction and the INC instruction using the +1 addition operation program:
ADD[P] means that every time X001 changes from OFF to ON, the content of D0 is added by one operation.
Although this instruction is very similar to the INCP instruction described later, there are some differences in the following content.
ADD/ADDP/DADD/DADDP instructions | INC/INCP/DINC/DINCP instructions | |||
Flag bit (zero, borrow, carry) | Action | No action | ||
Calculation result | 16-bit Operation result | (S) + (+1) = (d) | 32767→0→+1→+2→ | 32767→-32768→-32767 |
(S) + (-1) = (d) | ←-2←-1←0←-32768 | —— | ||
33-Bit operation result | (S) + (+1) = (d) | 2147483647→0→+1→+2→ | 2147483647→-2147483648→-2147483647 | |
(S) + (-1) = (d) | ←-2←-1←0←-2147483648 | —— |
Error code
Error code | Content |
4085H | The output results of (S1) and (S2) in the read application instruction exceed the device range |
4086H | The output result of (D) in the write application instruction exceeds the device range |
Example
Add 100000 to the data in (D1, D0), and store the result of the operation in (D3, D2), that is, (D1, D0) + 100000 → (D3, D2).
SUB/16-bit subtraction operation
SUB(P)
Subtract the BIN 16-bit data specified in (S1) and the BIN 16-bit data specified in (S2), and store the result in the device specified in (D).
-[SUB (S1) (S2) (D)]
Content, range and data type
Parameter | Content | Range | Data type | Data type (label) |
(S1) | The subtraction data or the device storing the subtraction data | -32768 to 32767 | Signed BIN16 | ANY16_S |
(S2) | The subtraction data or the device storing the subtraction data | -32768 to 32767 | Signed BIN16 | ANY16_S |
(D) | Device for storing calculation results | Signed BIN16 | ANY16_S |
Device used
Instruction | Parameter | Devices | Offset modification | Pulse extension | ||||||||||
KnX | KnY | KnM | KnS | T | C | D | R | SD | K | H | [D] | XXP | ||
SUB | Parameter 1 | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● |
Parameter 2 | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | |
Parameter 3 | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● |
Features
Subtract the BIN 16-bit data specified in (S1) and the BIN 16-bit data specified in (S2), and store the result of the operation in the device specified in (D).
Related device
Devices | Name | Content |
SM151 | Carry | When the operation result exceeds 32,767, the carry flag will be (ON). |
SM152 | Borrow | When the operation result is less than -32,768, the borrow flag will be (ON). |
SM153 | Zero point | When the operation result is 0, the zero flag will be (ON). |
✎Note:
1. When the source operand and destination operand are specified as the same device:
The source operand and destination operand can also be specified as the same device number.
In this case, if continuous execution type instructions (SUB, DSUB) are used, the result of the subtraction operation will change every operation cycle. Please be careful.
2. The difference between the SUB(P) instruction and the -(P) instruction and DEC(P) instruction executed by the -1 subtraction program
SUB(P) instruction every time X1 changes from OFF to ON, the program of D0 content -1 is similar to -(P) instruction and DEC(P) instruction described later, but the following contents are different.
SUB/SUBP/DSUB/DSUBP instructions | DEC/DECP/DDEC/DDECP instructions | |||
Flag bit (zero, borrow, carry) | Action | No action | ||
Calculation result | 16-bit operation result | (S)-(+1)=(D) | ←-2←-1←0←-32768 | -32768→+32767→32766 |
(S)-(-1)=(D) | +32767→0→+1→+2→ | —— | ||
32-bit operation result | (S)-(+1)=(D) | ←-2←-1←0←-2147483648 | -2147483648→2147483647→2147483646 | |
(S)-(-1)=(D) | 2147483647→0→+1→+2→ | —— |
Error code
Error code | Content |
4085H | The output results of (S1) and (S2) in the read application instruction exceed the device range |
4086H | The output result of (D) in the write application instruction exceeds the device range |
Example
Subtract 10 from the data in D0, and store the calculation result in D2, that is, (D0)-10 → (D2).
DSUB/32-bit subtraction operation
DSUB(P)
Subtract the BIN32-bit data specified in (S1) and the BIN32-bit data specified in (S2), and store the result in the device specified in (D).
-[DSUB (S1) (S2) (D)]
Content, range and data type
Parameter | Content | Range | Data type | Data type (label) |
(S1) | The subtraction data or the device storing the subtraction data | -2147483648 to 2147483647 | Signed BIN32 | ANY32_S |
(S2) | The subtraction data or the device storing the subtraction data | -2147483648 to 2147483647 | Signed BIN32 | ANY32_S |
(D) | Device for storing calculation results | Signed BIN32 | ANY32_S |
Device used
Instruction | Parameter | Devices | Offset modification | Pulse extension | ||||||||||||
KnX | KnY | KnM | KnS | T | C | D | R | SD | LC | HSC | K | H | [D] | XXP | ||
DSUB | Parameter 1 | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● |
Parameter 2 | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | |
Parameter 3 | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● |
Features
Subtract the BIN32-bit data specified in (S1) and the BIN32-bit data specified in (S2), and store the result of the operation in the device specified in (D).
Related device
Devices | Name | Content |
SM151 | Carry | When the operation result exceeds 2,147,483,647, the carry flag will be ON. |
SM152 | Borrow | When the operation result is less than -2,147,483,648, the borrow flag will be ON. |
SM153 | Zero point | When the operation result is 0, the zero flag will be ON. |
✎Note:
1. When the source operand and destination operand are specified as the same device:
The source operand and destination operand can also be specified as the same device number.
In this case, if continuous execution type instructions (SUB, DSUB) are used, the result of the subtraction operation will change every operation cycle. Please be careful.
2. The difference between the SUB(P) instruction and the -(P) instruction and DEC(P) instruction executed by the -1 subtraction program
SUB(P) instruction every time X1 changes from OFF to ON, the program of D0 content -1 is similar to -(P) instruction and DEC(P) instruction described later, but the following contents are different.
SUB/SUBP/DSUB/DSUBP instructions | DEC/DECP/DDEC/DDECP instructions | |||
Flag bit (zero, borrow, carry) | Action | No action | ||
Calculation result | 16-bit operation result | (S)-(+1)=(D) | ←-2←-1←0←-32768 | -32768→32767→32766 |
(S)-(-1)=(D) | +32767→0→+1→+2→ | —— | ||
32-bit operation result | (S)-(+1)=(D) | ←-2←-1←0←-2147483648 | -2147483648→2147483647→2147483646 | |
(S)-(-1)=(D) | +2147483647→0→+1→+2→ | —— |
Error code
Error code | Content |
4085H | The output results of (S1) and (S2) in the read application instruction exceed the device range |
4086H | The output result of (D) in the write application instruction exceeds the device range |
Example
Subtract 100000 from the data in (D1,D0), and store the result of the operation in (D3,D2), that is, (D1,D0)-10000 → (D3,D2).
MUL/16-bit multiplication
MUL(P)
Multiply the BIN16 bits specified in (S1) with the BIN16 bits specified in (S2), and store the result in the device specified in (D).
-[MUL (S1) (S2) (D)]
Content, range and data type
Parameter | Content | Range | Data type | Data type (label) |
(S1) | Multiplication operation data or the device storing multiplication operation data | -32768 to 32767 | Signed BIN 16 bit | ANY16_S |
(S2) | Multiplication operation data or the device storing multiplication operation data | -32768 to 32767 | Signed BIN 16 bit | ANY16_S |
(D) | Device for storing calculation results | Signed BIN 32 bit | ANY32_S |
Device used
Instruction | Parameter | Devices | Offset modification | Pulse extension | ||||||||||||
KnX | KnY | KnM | KnS | T | C | D | R | SD | LC | HSC | K | H | [D] | XXP | ||
MUL | Parameter 1 | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ||
Parameter 2 | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | |||
Parameter 3 | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● |
Features
Multiply the BIN 16-bit data specified in (S1) with the BIN 16-bit data specified in (S2), and store the result of the operation in the device specified in (D).
(D) is the multiplication result in the case of bit device
• K1: lower 4 bits (B0 to B3)
• K4: Lower 16 bits (B0 to B15)
• K8: Lower 32 bits (B0 to B31)
Error code
Error code | Content |
4085H | The output results of (S1) and (S2) in the read application instruction exceed the device range |
4086H | The output result of (D) in the write application instruction exceeds the device range |
Example
Multiply the data in (D0) by (D2), and store the operation result in (D5, D4), that is, (D0) × (D2) → (D5, D4).
DMUL/32-bit multiplication
DMUL(P)
Multiply the 32-bit BIN specified in (S1) and the 32-bit BIN specified in (S2), and store the result in the device specified in (D).
-[DMUL (S1) (S2) (D)]
Content, range and data type
Parameter | Content | Range | Data type | Data type (label) |
(S1) | Multiplication operation data or device storing multiplication operation data | -2147483648 to 2147483647 | Signed BIN 32 bit | ANY32_S |
(S2) | Multiplication operation data or device storing multiplication operation data | -2147483648 to 2147483647 | Signed BIN 32 bit | ANY32_S |
(D) | Device for storing calculation results | Signed BIN64 bit | ANY64_S |
Device used
Instruction | Parameter | Devices | Offset modification | Pulse extension | ||||||||||||
KnX | KnY | KnM | KnS | T | C | D | R | SD | LC | HSC | K | H | [D] | XXP | ||
DMUL | Parameter 1 | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● |
Parameter 2 | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | |
Parameter 3 | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● |
Features
Multiply the BIN32-bit data specified in (S1) and the BIN32-bit data specified in (S2), and store the result of the operation in the device specified in (D).
(D) is the multiplication result in the case of bit device
• K1: lower 4 bits (B0 to B3)
• K4: Lower 16 bits (B0 to B15)
• K8: Lower 32 bits (B0 to B31)
Error code
Error code | Content |
4085H | The output results of (S1) and (S2) in the read application instruction exceed the device range |
4086H | The output result of (D) in the write application instruction exceeds the device range |
Example
Multiply the data in (D1, D0) by (D3, D2), and store the result of the operation in ((D7, D6), (D5, D4)), ie (D1, D0) × (D3, D2) → ((D7, D6), (D5, D4)).
DIV/16-bit division operation
DIV(P)
Divide the BIN 16-bit data specified in (S1) with the BIN 16-bit data specified in (S2), and store the result in the device specified in (D).
-[DIV (S1) (S2) (D)]
Content, range and data type
Parameter | Content | Range | Data type | Data type (label) |
(S1) | Division operation data or device storing division operation data | -32768 to 32767 | Signed BIN 16 bit | ANY16_S |
(S2) | Division operation data or device storing division operation data | -32768 to 32767 | Signed BIN 16 bit | ANY16_S |
(D) | Device for storing calculation results | Signed BIN 32 bit | ANY32_S |
Device used
Instruction | Parameter | Devices | Offset modification | Pulse extension | ||||||||||||
KnX | KnY | KnM | KnS | T | C | D | R | SD | LC | HSC | K | H | [D] | XXP | ||
DIV | Parameter 1 | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ||
Parameter 2 | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | |||
Parameter 3 | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● |
Features
Divide the BIN 16-bit data specified in (S1) with the BIN 16-bit data specified in (S2), and store the result of the operation in the device specified in (D).
In the case of a word device, the division result uses a 32-bit storage quotient and remainder, and in the case of a bit device, only a 16-bit storage quotient is used.
• Quotient is stored in the lower 16 bits.
• The remainder is stored in the upper 16 bits. (Can only be stored in the case of word devices.)
✎Note
1. About the opearation result
• The highest bit of the quotient and remainder represents the sign of positive (0) and negative (1).
• When one of (S1) or (S2) is negative, the quotient becomes negative. When (S1) is negative, the remainder becomes negative.
2. The device specified by (D)
• With the digit specification function, when specifying a bit device, the remainder cannot be obtained.
Error code
Error code | Content |
4080H | The input of divisor (S2) is 0 |
4085H | The output results of (S1) and (S2) in the read application instruction exceed the device range |
4086H | The output result of (D) in the write application instruction exceeds the device range |
Example
Divide the data in (D0) by (D2), and store the result of the calculation: the quotient is stored in (D4), and the remainder is stored in (D5), ie (D0)/ (D2) → (D5(quotient)) (D4( remainder)).
DDIV/32-bit division operation
DDIV(P)
Divide the BIN32-bit data specified in (S1) with the BIN32-bit data specified in (S2), and store the result in the device specified in (D).
-[DDIV (S1) (S2) (D)]
Content, range and data type
Parameter | Content | Range | Data type | Data type (label) |
(S1) | Division operation data or device storing division operation data | -2147483648 to 2147483647 | Signed BIN 32 bit | ANY32_S |
(S2) | Division operation data or device storing division operation data | -2147483648 to 2147483647 | Signed BIN 32 bit | ANY32_S |
(D) | Device for storing calculation results | Signed BIN64 bit | ANY64_S |
Device used
Instruction | Parameter | Devices | Offset modification | Pulse extension | ||||||||||||
KnX | KnY | KnM | KnS | T | C | D | R | SD | LC | HSC | K | H | [D] | XXP | ||
DDIV | Parameter 1 | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● |
Parameter 2 | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | |
Parameter 3 | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● |
Features
Divide the BIN32-bit data specified in (S1) with the BIN32-bit data specified in (S2), and store the result of the operation in the device specified in (D).
In the case of word devices, the division result uses BIN64 bits to store the quotient and remainder. In the case of bit devices, only the BIN 32-bit storage quotient is used.
✎Note:
1. About the operation result
• The highest bit of the quotient and remainder represents the sign of positive (0) and negative (1).
• When one of (S1) or (S2) is negative, the quotient becomes negative. When (S1) is negative, the remainder becomes negative.
2. The specified device of (D)
• With the digit specification function, when a bit device is specified, the remainder cannot be obtained.
Error code
Error code | Content |
4080H | The input of divisor (S2) is 0 |
4085H | The output results of (S1) and (S2) in the read application instruction exceed the device range |
4086H | The output result of (D) in the write application instruction exceeds the device range |
Example
Divide the data in (D1, D0) by (D3, D2), and store the result of the calculation: the quotient is stored in (D5, D4), and the remainder is stored in (D7, D6), that is (D1, D0)/ (D3, D2) → (D5, D4) (quotient) (D7, D6) (remainder).
INC/16-bit data increment
INC(P)
Add one to the device (BIN 16-bit data) specified in (D).
-[INC (D)]
Content, range and data type
Parameter | Content | Range | Data type | Data type (label) |
(D) | The word device number that stores the data added by one | -32768 to 32767 | Signed BIN 16 bit | ANY16_S |
Device used
Instruction | Parameter | Devices | Offset modification | Pulse extension | |||||||
KnY | KnM | KnS | T | C | D | R | SD | [D] | XXP | ||
INC | Parameter 1 | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● |
Features
Add one to the device (BIN 16-bit data) specified in (D).
• If the INC(P) instruction is executed when the content of the device specified in (D) is 32767, -32768 will be stored in the device specified in (D).
• Flags (zero, borrow, carry) do not perform actions.
✎Note: If the continuous execution (INC) instruction is used, the addition operation will be performed every operation cycle, so care should be taken.
Error code
Error code | Content |
4085H | The output results of (D) in the read application instruction exceed the device range |
4086H | The output result of (D) in the write application instruction exceeds the device range |
Example
Add one to the device value specified in D0, that is, (D0) + 1 → (D0).
DINC/32-bit data increment
DINC(P)
Add one to the device (BIN 32-bit data) specified in (D).
-[DINC (D)]
Content, range and data type
Parameter | Content | Range | Data type | Data type (label) |
(D) | The word device number that stores the data added by one | -2147483648 to 2147493647 | Signed BIN 32 bit | ANY32_S |
Device used
Instruction | Parameter | Devices | Offset modification | Pulse extension | |||||||||
KnY | KnM | KnS | T | C | D | R | SD | LC | HSC | [D] | XXP | ||
DINC | Parameter 1 | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● |
Features
Add one to the device (BIN 32-bit data) specified in (D).
• When the DINC(P) instruction is executed when the content of the device specified in (D) is 2147483647, -2147483648 will be stored in the device specified in (D).
• Flags (zero, borrow, carry) do not perform actions.
✎Note: If the continuous execution (INC) instruction is used, the addition operation will be performed every operation cycle, so care should be taken.
Error code
Error code | Content |
4085H | The output results of (D) in the read application instruction exceed the device range |
4086H | The output result of (D) in the write application instruction exceeds the device range |
Example
Add one to the device value specified in (D1, D0), that is, (D1, D0) + 1 → (D1, D0).
DEC/16 bit data decrement
DEC(P)
Minus one for the device (BIN 16-bit data) specified in (D).
-[DEC (D)]
Content, range and data type
Parameter | Content | Range | Data type | Data type (label) |
(D) | The word device number that stores the data minus by one | -32768 to 32767 | Signed BIN 16 bit | ANY16_S |
Device used
Instruction | Parameter | Devices | Offset modification | Pulse extension | |||||||
KnY | KnM | KnS | T | C | D | R | SD | [D] | XXP | ||
DEC | Parameter 1 | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● |
Features
Minus one for the device (BIN 16-bit data) specified in (D).
• If the DEC(P) instruction is executed when the content of the device specified in (D) is -32768, 32767 will be stored in the device specified in (D).
• Flags (zero, borrow, carry) do not perform actions.
✎Note: If using continuous execution (DEC) instructions, subtraction will be performed every operation cycle, so care should be taken.
Error code
Error code | Content |
4085H | The output results of (D) in the read application instruction exceed the device range |
4086H | The output result of (D) in the write application instruction exceeds the device range |
Example
Each time M0 is set, the value of the device specified in D0 will be -1, (D0)-1 → (D0).
DDEC/32-bit data decrement
DDEC(P)
Minus one for the device (BIN 32-bit data) specified in (D).
-[DDEC (D)]
Content, range and data type
Parameter | Content | Range | Data type | Data type (label) |
(D) | The word device number that stores the data minus by one | -2147483648 to 2147483647 | Signed BIN 32 bit | ANY32_S |
Device used
Instruction | Parameter | Devices | Offset modification | Pulse extension | |||||||||
KnY | KnM | KnS | T | C | D | R | SD | LC | HSC | [D] | XXP | ||
DDEC | Parameter 1 | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● | ● |
Features
Minus one for the device (BIN 32-bit data) specified in (D).
If the DDEC(P) instruction is executed when the content of the device specified in (D) is 0, minus one will be stored in the device specified in (D).
• Flags (zero, borrow, carry) do not perform actions.
✎Note: If using continuous execution (DEC) instructions, subtraction will be performed every operation cycle.
Error code
Error code | Content |
4085H | The output results of (D) in the read application instruction exceed the device range |
4086H | The output result of (D) in the write application instruction exceeds the device range |
Example
Minus one on the device value specified in (D1, D0), that is, (D1, D0)-1 → (D0).