01 Transfer and comparison

Version 34.1 by Mora Zhou on 2023/11/22 16:07

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

ParameterContentRangeData typeData type (label)
(S)Transmit source data or the device number stored data-32768 to 32767Signed BIN16ANY16_S
(D)Transmit destination device number-Signed BIN16ANY16_S

Device used

InstructionParameterDevicesOffset modificationPulse extension
KnXKnYKnMKnSTCDRSDKH[D]XXP
MOVParameter 1
Parameter 2   

Features

• Transfer the BIN 16-bit data specified in (S) to the device specified in (D).

07-1 Basic instructions_html_608d557cd7a9b085.png

Error code

Error codeContent
4085HThe output result of (S) in read application instruction exceeds the device range
4086HThe output result of (D) in write application instruction exceeds the device range

Example

07-1 Basic instructions_html_49a2ba67b393cca0.png

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

ParameterContentRangeData typeData type (label)
(S)Transmit source data or the device number stored data-2147483648 to 2147483647Signed BIN32ANY32_S
(D)Transmit destination device number-Signed BIN32ANY32_S

Device used

InstructionParameterDevicesOffset modificationPulse extension
KnXKnYKnMKnSTCDRSDLCHSCKH[D]XXP
DMOVParameter 1  
Parameter 2   

Features

Transfer the BIN 16-bit data specified in (S) to the device specified in (D).

07-1 Basic instructions_html_a7a87e4ee0331a3.png

Error code

Error codeContent
4085HThe output result of (S) in read application instruction exceeds the device range
4086HThe output result of (D) in write application instruction exceeds the device range

Example

07-1 Basic instructions_html_cbab7254f3dd95a9.png

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

ParameterContentRangeData typeData type (label)
(S)The start device that stores the transmission data-Signed BIN16ANY16_S
(D)The start device that transmit target-Signed BIN16ANY16_S
(N)Number of transmission1 ≤ N ≤ 512Signed BIN16ANY16_S

Device used

InstructionParameterDevicesOffset modification

Pulse extension

KnXKnYKnMKnSTCDRSDKH[D]XXP
BMOVParameter 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).

07-1 Basic instructions_html_be0796979ffd3c06.png

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 codeContent
4084HIn application instruction (N) input the data exceeds the specified range
4085HThe output results of (S) and (N) in read application instruction exceed the device range
4086HThe output result of (D) in write application instruction exceeds the device range

Example

07-1 Basic instructions_html_508e98856ee24b54.png

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

ParameterContentRangeData typeData type (label)
(S)The start device that stores the transmission data-32768 to 32767Signed BIN16ANY16_S
(D)The start device that transmit target-Signed BIN16ANY16_S
(N)Number of transmission[K1 ≤ N ≤ 512]Signed BIN16ANY16_S

Device used

InstructionParameterDevicesOffset modification

Pulse extension

KnXKnYKnMKnSTCDRSDKH[D]XXP
FMOVParameter 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.

07-1 Basic instructions_html_9ef78d87c9eeaa63.png

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 codeContent
4084H(S) and(N) input the data In application instruction exceed the specified range
4085HThe output results of (S) and (N) in read application instruction exceed the device range
4086HThe output result of (D) in write application instruction exceeds the device range

Example

07-1 Basic instructions_html_ff5ab9afced99509.png

 When M0 is set, the value of D0 to D4 is set to 0.

07-1 Basic instructions_html_95f9fe70e9adcf29.png

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

ParameterContentRangeData typeData type (label)
(S)Transfer data or start device storing transfer data-2147483648 to 2147483647Signed BIN32ANY32_S
(D)Start device of transfer destination-Signed BIN32ANY32_S
(N)Number of transfers[1≤ N ≤512]Signed BIN32ANY32_S

Device used

InstructionParameterDevicesOffset modification

Pulse extension

KnXKnYKnMKnSTCDRSDLCHSCKH[D]XXP
DFMOVParameter 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.

07-1 Basic instructions_html_f3f9cd2e9dfe1cfe.png

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 codeContent
4084H(S) and (N) input the data In application instruction exceed the specified range
4085HThe output results of (S) and (N) in read application instruction exceed the device range
4086HThe output result of (D) in write application instruction exceeds the device range

Example

07-1 Basic instructions_html_a390e21753dc736e.png

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

ParameterContentRangeData typeData type (label)
(S)The word device number that stores the data whose bit is to be moved Signed BIN16ANY16_S
(N1)Transfer destination device number1 to 4Signed BIN16ANY16_S
(N2)The number of digits to move1 to 4Signed BIN16ANY16_S
(D)The word device number that stores data for bit shifting Signed BIN16ANY16_S
(N3)The starting position of the moving target1 to 4Signed BIN16ANY16_S

Device used

InstructionParameterDevicesOffset modification

Pulse extension

KnXKnYKnMKnSTCDRSDKH[D]XXP
SMOVParameter 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).

07-1 Basic instructions_html_34ee545d4d67eedb.gif

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 codeContent
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.
4085HThe output result of (S), (N1) (N2), (D) and (N3) in the read application instruction exceeds the device range
4086HThe 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.

07-1 Basic instructions_html_813e30f89d5a26b3.png

Combine data of 3 digital switches connected to non-continuous input terminals.

07-1 Basic instructions_html_313402f5a5ed68ac.png

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

ParameterContentRangeData typeData type (label)
(S)Inverted data or the device number that stores data-32768 to 32767Signed BIN16ANY16_S
(D)The device number that stores the inversion result-Signed BIN16ANY16_S

Device used

InstructionParameterDevicesOffset modification

Pulse extension

KnXKnYKnMKnSTCDRSDKH[D]XXP
CMLParameter 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).

07-1 Basic instructions_html_ac6a8a5d1cd98a7.png

When the number of digits of the device with the specified digit is 4 points, other digits are not affected.

Error code

Error codeContent
4085HThe output result of (S) in read application instruction exceeds the device range
4086HThe output result of (D) in write application instruction exceeds the device range

Example

Example 1:

07-1 Basic instructions_html_1747c114427d7d5a.png

When M0 is set, the value of D0 is inverted and transferred to the value of D2.

Example 2:

invert input acquisition:

07-1 Basic instructions_html_11af96bca5fab94f.png

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

ParameterContentRangeData typeData type (label)
(s)Inverted data or the device number that stores data-2147483648 to 2147483647Signed BIN32ANY32_S
(d)The device number that stores the inversion result-Signed BIN32ANY32_S

Device used

InstructionParameterDevicesOffset modification

Pulse extension

KnXKnYKnMKnSTCDRSDLCHSCKHE[D]XXP
DCMLParameter 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).

07-1 Basic instructions_html_7f6b1b324c7b408b.png

When the number of digits of the device with the specified digit is 4 points, other digits are not affected.

Error code

Error codeContent
4085HThe output result of (s) in read application instruction exceeds the device range
4086HThe output result of (d) in write application instruction exceeds the device range

Example

07-1 Basic instructions_html_10734f3934cb4211.png

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

ParameterContentRangeData typeData type (label)
(S1)Comparison value data or the device storing the comparison value data-32768 to +32767Signed BIN16ANY16_S
(S2)Comparison source data or the device storing the comparison source data-32768 to 32767Signed BIN16ANY16_S
(D)Start bit device for output comparison result BitANYBIT_ARRAY

Device used

InstructionParameterDevicesOffset modification

Pulse extension

YMSSMD.bKnXKnYKnMKnSTCDRSDKH[D]XXP
CMPParameter 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.

07-1 Basic instructions_html_d5b466b2989a168c.png

(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 codeContent
4085HThe output results of (S1) and (S2) in read application instruction exceed the device range
4086HThe output result of (D) in write application instruction exceeds the device range

Example

07-1 Basic instructions_html_3f1803378f8b10a8.png

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

ParameterContentRangeData typeData type (label)
(S1)Comparison value data or the device storing the comparison value data-2147483648 to 2147483647Signed BIN32ANY32_S
(S2)Comparison source data or the device storing the comparison source data-2147483648 to 2147483647Signed BIN32ANY32_S
(D)Start bit device for output comparison result BitANYBIT_ARRAY

Device used

InstructionParameterDevicesOffset modification

Pulse extension

YMSSMD.bKnXKnYKnMKnSTCDRSDLCHSCKH[D]XXP
DCMPParameter 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.

07-1 Basic instructions_html_d5b466b2989a168c.png

(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 codeContent
4085HThe output results of (S1) and (S2) in read application instruction exceed the device range
4086HThe output result of (D) in write application instruction exceeds the device range

Example

07-1 Basic instructions_html_db9a9675057311a.png

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

ParameterContentRangeData typeData type (label)
(D1)The start device that stores the exchange data-32768 to 32767Signed BIN16ANY16_S
(D2)The start device that stores the exchange data-32768 to 32767Signed BIN16ANY16_S

Device used

InstructionParameterDevicesOffset modification

Pulse extension

KnYKnMKnSTCDRSD[D]XXP
XCHParameter 1
Parameter 2

Features

• Exchange the BIN 16-bit data of (D1) and (D2).

07-1 Basic instructions_html_da762df21d9f9e95.png

• 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.

07-1 Basic instructions_html_c0cea7cfb5b2e83c.png

Note: If continuous execution instructions are used, conversion will be performed every operation cycle.

Error code

Error codeContent
4084HIn exchange mode, the devices in (D1) and (D2) are different
4085HThe output results of (D1) and (D2) in the read application instruction exceed the device range
4086HThe 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.

07-1 Basic instructions_html_379b08fc9ff53251.png

When M0 is set, M1 is set: the upper 8 bits (bytes) and lower 8 bits (bytes) of D0 are exchanged with each other.

07-1 Basic instructions_html_3642e474e8c61a0f.png

DXCH/32-bit data exchange

DXCH(P)

Exchange (D1) and (D2) BIN 32-bit data.

-[DXCH (D1) (D2)]

Content, range and data type

ParameterContentRangeData typeData type (label)
(D1)The start device that stores the exchange data-2147483647 to 2147483647Signed BIN32ANY32_S
(D2)The start device that stores the exchange data-2147483647 to 2147483647Signed BIN32ANY32_S

Device used

InstructionParameterDevicesOffset modification

Pulse extension

KnYKnMKnSTCDRSDLCHSC[D]XXP
DXCHParameter 1
Parameter 2

Features

• Exchange the BIN 32-bit data of (D1), (D1)+1 and (D2), (D2)+1.

07-1 Basic instructions_html_3e35d534c210d03a.png

• 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).

07-1 Basic instructions_html_f115854aba0c26e.png

Note: If continuous execution instructions are used, conversion will be performed every operation cycle.

Error code

Error codeContent
4084HIn exchange mode, the devices in (D1) and (D2) are different
4085HThe output results of (D1) and (D2) in the read application instruction exceed the device range
4086HThe 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.

07-1 Basic instructions_html_4e345d7e7c986d10.png

When M0 is reset, set M1: the value of (D1, D0) and the value of (D3, D2) are exchanged.

07-1 Basic instructions_html_9fff2f30b51cfc7f.png

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

ParameterContentRangeData typeData type (label)
(S1)The comparison value data of low limit or the device that stores the comparison value data-32768 to 32767Signed BIN16ANY16_S
(S2)The comparison value data of high limit or the device that stores the comparison value data-32768 to 32767Signed BIN16ANY16_S
(S3)Comparison source data or the device that stores the comparison source data-32768 to 32767Signed BIN16ANY16_S
(D)The start bit device of output comparison result BitANYBIT_ARRAY

Device used

InstructionParameterDevicesOffset modification

Pulse extension

YMSSMD.bKnXKnYKnMKnSTCDRSDKHE[D]XXP
ZCPParameter 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.

07-1 Basic instructions_html_878004f8efa838b.gif

(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 codeContent
4085HThe output results of (S1), (S2) and (S3) in the read application instruction exceed the device range
4086HThe output result of (D) in write application instructions exceeds the device range

Example

07-1 Basic instructions_html_db2bc281a152807e.png

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

ParameterContentRangeData typeData type (label)
(S1)The comparison value data of low limit or the device that stores the comparison value data-2147483648 to 2147483647Signed BIN32ANY32_S
(S2)The comparison value data of high limit or the device that stores the comparison value data-2147483648 to 2147483647Signed BIN32ANY32_S
(S3)Comparison source data or the device that stores the comparison source data-2147483648 to 2147483647Signed BIN32ANY32_S
(D)The start bit device of output comparison result BitANYBIT_ARRAY

Device used

InstructionParameterDevicesOffset modification

Pulse extension

YMSSMD.bKnXKnYKnMKnSTCDRSDLCHSCKHE[D]XXP
DZCPParameter 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.

07-1 Basic instructions_html_878004f8efa838b.gif

(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 codeContent
4085HThe output results of (S1), (S2) and (S3) in the read application instruction exceed the device range
4086HThe output results of (D) in the write application instruction exceeds the device range

Example

07-1 Basic instructions_html_a215dc073ae34e2c.png

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.