Wiki source code of 06 Basic instructions
Show last authors
| author | version | line-number | content |
|---|---|---|---|
| 1 | = **Transfer Comparison instruction** = | ||
| 2 | |||
| 3 | == ** MOV/16-bit Transmission** == | ||
| 4 | |||
| 5 | **MOV(P)** | ||
| 6 | |||
| 7 | Transfer the BIN 16-bit data of the device specified in (s) to the device specified in (d). | ||
| 8 | |||
| 9 | -[MOV (s) (d)] | ||
| 10 | |||
| 11 | **Content, range and data type** | ||
| 12 | |||
| 13 | |=**Parameter**|=**Content**|=(% style="width: 120px;" %)**Range**|=(% style="width: 100px;" %)**Data type**|=**Data type (label)** | ||
| 14 | |(s)|Transmit source data or the device number stored data|(% style="width:120px" %)-32768 to 32767|(% style="width:100px" %)Signed BIN16|ANY16_S | ||
| 15 | |(d)|Transmit destination device number|(% style="width:120px" %)((( | ||
| 16 | - | ||
| 17 | |||
| 18 | |||
| 19 | )))|(% style="width:100px" %)Signed BIN16|ANY16_S | ||
| 20 | |||
| 21 | **Device used** | ||
| 22 | |||
| 23 | |=**instruction**|=**Parameter**|=(% colspan="24" %)**Devices**|=**Index modification**|=((( | ||
| 24 | **Pulse** | ||
| 25 | |||
| 26 | **extension** | ||
| 27 | ))) | ||
| 28 | | | |**X**|**Y**|**M**|**S**|**SM**|**T(bit)**|**C(bit)**|**LC(bit)**|**HSC(bit)**|**D.b**|**KnX**|**KnY**|**KnM**|**KnS**|**T**|**C**|**D**|**R**|**SD**|**LC**|**HSC**|**K**|**H**|**E**|**[D]**|**XXP** | ||
| 29 | |MOV|Parameter 1| | | | | | | | | | |●|●|●|●|●|●|●|●|●| | |●|●| |●|● | ||
| 30 | | |Parameter 2| | | | | | | | | | | |●|●|●|●|●|●|●|●| | | | | |●|● | ||
| 31 | |||
| 32 | **Features** | ||
| 33 | |||
| 34 | • Transfer the BIN 16-bit data specified in (s) to the device specified in (d). | ||
| 35 | |||
| 36 | (% style="text-align:center" %) | ||
| 37 | [[image:图片2.png]] | ||
| 38 | |||
| 39 | **Error code** | ||
| 40 | |||
| 41 | |=**Error code**|=**Content** | ||
| 42 | |4085H|The output result of (s) in read application instruction exceeds the device range | ||
| 43 | |4086H|The output result of (d) in write application instruction exceeds the device range | ||
| 44 | |||
| 45 | **Example** | ||
| 46 | |||
| 47 | (% style="text-align:center" %) | ||
| 48 | [[image:图片1.png]] | ||
| 49 | |||
| 50 | When M0 is set, the value of D0 is transferred to the value of D2: (D0)→(D2). | ||
| 51 | |||
| 52 | == DMOV/32-bit Transmission == | ||
| 53 | |||
| 54 | **DMOV(P)** | ||
| 55 | |||
| 56 | Transfer the BIN 32-bit data of the device specified in (s) to the device specified in (d). | ||
| 57 | |||
| 58 | -[DMOV (s) (d)] | ||
| 59 | |||
| 60 | **Content, range and data type** | ||
| 61 | |||
| 62 | |=**Parameter**|=**Content**|=**Range**|=**Data type**|=**Data type (label)** | ||
| 63 | |=(s)|Transmit source data or the device number stored data|-2147483648 to 2147483647|Signed BIN32|ANY32_S | ||
| 64 | |=(d)|Transmit destination device number|-|Signed BIN32|ANY32_S | ||
| 65 | |||
| 66 | **Device used** | ||
| 67 | |||
| 68 | |=(% rowspan="2" %)**instruction**|=(% rowspan="2" %)**Parameter**|=(% colspan="24" %)**Devices**|=**Index modification**|=((( | ||
| 69 | **Pulse** | ||
| 70 | |||
| 71 | **extension** | ||
| 72 | ))) | ||
| 73 | |**X**|**Y**|**M**|**S**|**SM**|**T(bit)**|**C(bit)**|**LC(bit)**|**HSC(bit)**|**D.b**|**KnX**|**KnY**|**KnM**|**KnS**|**T**|**C**|**D**|**R**|**SD**|**LC**|**HSC**|**K**|**H**|**E**|**[D]**|**XXP** | ||
| 74 | |(% rowspan="2" %)DMOV|Parameter 1| | | | | | | | | | |●|●|●|●|●|●|●|●|●| | |●|●| |●|● | ||
| 75 | |Parameter 2| | | | | | | | | | | |●|●|●|●|●|●|●|●|●|●| | | |●|● | ||
| 76 | |||
| 77 | **Features** | ||
| 78 | |||
| 79 | Transfer the BIN 16-bit data specified in (s) to the device specified in (d). | ||
| 80 | |||
| 81 | (% style="text-align:center" %) | ||
| 82 | [[image:1708590517501-798.png]] | ||
| 83 | |||
| 84 | **Error code** | ||
| 85 | |||
| 86 | |=**Error code**|=**Content** | ||
| 87 | |4085H|The output result of (s) in read application instruction exceeds the device range | ||
| 88 | |4086H|The output result of (d) in write application instruction exceeds the device range | ||
| 89 | |||
| 90 | **Example** | ||
| 91 | |||
| 92 | (% style="text-align:center" %) | ||
| 93 | [[image:1708590813837-824.png]] | ||
| 94 | |||
| 95 | When M0 is set, the value of (D1, D0) is transferred to the value of (D3, D2): (D1, D0) → (D3, D2). | ||
| 96 | |||
| 97 | == BMOV/Batch Transmission == | ||
| 98 | |||
| 99 | **BMOV(P)** | ||
| 100 | |||
| 101 | The (n) point BIN 16-bit data starting from the device specified in (s) is sequentially transmitted to the device specified in (d). | ||
| 102 | |||
| 103 | -[BMOV (s) (d) (n)] | ||
| 104 | |||
| 105 | **Content, range and data type** | ||
| 106 | |||
| 107 | |=**Parameter**|=**Content**|=**Range**|=**Data type**|=**Data type (label)** | ||
| 108 | |(s)|The start device that stores the transmission data|-|Signed BIN16|ANY16_S | ||
| 109 | |(d)|The start device that transmit target|-|Signed BIN16|ANY16_S | ||
| 110 | |(n)|Number of transmission|1 ≤ n ≤ 512|Signed BIN16|ANY16_S | ||
| 111 | |||
| 112 | **Device used** | ||
| 113 | |||
| 114 | |=(% rowspan="2" %)**instruction**|=(% rowspan="2" %)**Parameter**|=(% colspan="24" %)**Devices**|=**Index modification**|=((( | ||
| 115 | **Pulse** | ||
| 116 | |||
| 117 | **extension** | ||
| 118 | ))) | ||
| 119 | |**X**|**Y**|**M**|**S**|**SM**|**T(bit)**|**C(bit)**|**LC(bit)**|**HSC(bit)**|**D.b**|**KnX**|**KnY**|**KnM**|**KnS**|**T**|**C**|**D**|**R**|**SD**|**LC**|**HSC**|**K**|**H**|**E**|**[D]**|**XXP** | ||
| 120 | |(% rowspan="3" %)BMOV|Parameter 1| | | | | | | | | | |●|●|●|●|●|●|●|●|●| | | | | |●|● | ||
| 121 | |Parameter 2| | | | | | | | | | | |●|●|●|●|●|●|●|●| | | | | |●|● | ||
| 122 | |Parameter 3| | | | | | | | | | |●|●|●|●|●|●|●|●|●| | |●|●| |●|● | ||
| 123 | |||
| 124 | **Features** | ||
| 125 | |||
| 126 | Batch transfer the BIN 16-bit data of point (n) starting from the device specified in (s) to the device specified in (d). | ||
| 127 | |||
| 128 | (% style="text-align:center" %) | ||
| 129 | [[image:1708590952127-122.png]] | ||
| 130 | |||
| 131 | When the device number exceeds the range, it will be transferred within the allowable range. | ||
| 132 | |||
| 133 | 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). | ||
| 134 | |||
| 135 | **Error code** | ||
| 136 | |||
| 137 | |=**Error code**|=**Content** | ||
| 138 | |4084H|In application instruction (n) input the data exceeds the specified range | ||
| 139 | |4085H|The output results of (s) and (n) in read application instruction exceed the device range | ||
| 140 | |4086H|The output result of (d) in write application instruction exceeds the device range | ||
| 141 | |||
| 142 | **Example** | ||
| 143 | |||
| 144 | (% style="text-align:center" %) | ||
| 145 | [[image:1708590989629-793.png]] | ||
| 146 | |||
| 147 | When M0 is set, set M1, then (D5)→(D10); (D6)→(D11); (D7)→(D12); | ||
| 148 | |||
| 149 | When M0 is reset, set M1, then (D10)→(D5); (D11)→(D6); (D12)→(D7). | ||
| 150 | |||
| 151 | == FMOV/16-bit Multicast == | ||
| 152 | |||
| 153 | **FMOV(P)** | ||
| 154 | |||
| 155 | 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). | ||
| 156 | |||
| 157 | -[FMOV (s) (d) (n)] | ||
| 158 | |||
| 159 | **Content, range and data type** | ||
| 160 | |||
| 161 | |=**Parameter**|=**Content**|=**Range**|=**Data type**|=**Data type (label)** | ||
| 162 | |(s)|The start device that stores the transmission data|-32768 to 32767|Signed BIN16|ANY16_S | ||
| 163 | |(d)|The start device that transmit target|-|Signed BIN16|ANY16_S | ||
| 164 | |(n)|Number of transmission|[K1 ≤ n ≤ 512]|Signed BIN16|ANY16_S | ||
| 165 | |||
| 166 | **Device used** | ||
| 167 | |||
| 168 | |=(% rowspan="2" %)**instruction**|=(% rowspan="2" %)**Parameter**|=(% colspan="24" %)**Devices**|=**Index modification**|=((( | ||
| 169 | **Pulse** | ||
| 170 | |||
| 171 | **extension** | ||
| 172 | ))) | ||
| 173 | |**X**|**Y**|**M**|**S**|**SM**|**T(bit)**|**C(bit)**|**LC(bit)**|**HSC(bit)**|**D.b**|**KnX**|**KnY**|**KnM**|**KnS**|**T**|**C**|**D**|**R**|**SD**|**LC**|**HSC**|**K**|**H**|**E**|**[D]**|**XXP** | ||
| 174 | |(% rowspan="3" %)FMOV|Parameter 1| | | | | | | | | | |●|●|●|●|●|●|●|●|●| | |●|●| |●|● | ||
| 175 | |Parameter 2| | | | | | | | | | | |●|●|●|●|●|●|●|●| | | | | |●|● | ||
| 176 | |Parameter 3| | | | | | | | | | |●|●|●|●|●|●|●|●|●| | |●|●| |●|● | ||
| 177 | |||
| 178 | **Features** | ||
| 179 | |||
| 180 | 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. | ||
| 181 | |||
| 182 | (% style="text-align:center" %) | ||
| 183 | [[image:1708591128027-832.png]] | ||
| 184 | |||
| 185 | When the number specified in (n) exceeds the device number range, transfer is performed within the allowable range. | ||
| 186 | |||
| 187 | When a constant (K) is specified for the transmission source (s), it will be automatically converted to BIN. | ||
| 188 | |||
| 189 | **Error code** | ||
| 190 | |||
| 191 | |||
| 192 | |=**Error code**|=**Content** | ||
| 193 | |4084H|(s) and(n) input the data In application instruction exceed the specified range | ||
| 194 | |4085H|The output results of (s) and (n) in read application instruction exceed the device range | ||
| 195 | |4086H|The output result of (d) in write application instruction exceeds the device range | ||
| 196 | |||
| 197 | **Example** | ||
| 198 | |||
| 199 | (% style="text-align:center" %) | ||
| 200 | [[image:1708591172502-492.png]] | ||
| 201 | |||
| 202 | When M0 is set, the value of D0 to D4 is set to 0. | ||
| 203 | |||
| 204 | (% style="text-align:center" %) | ||
| 205 | [[image:1708591336176-892.png]] | ||
| 206 | |||
| 207 | == **DFMOV/ 32-bit Multicast** == | ||
| 208 | |||
| 209 | **DFMOV(P)** | ||
| 210 | |||
| 211 | 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). | ||
| 212 | |||
| 213 | -[FMOV (s) (d) (n)] | ||
| 214 | |||
| 215 | **Content, range and data type** | ||
| 216 | |||
| 217 | |=**Parameter**|=**Content**|=**Range**|=**Data type**|=**Data type (label)** | ||
| 218 | |(s)|Transfer data or start device storing transfer data|-2147483648 to 2147483647|Signed BIN32|ANY32_S | ||
| 219 | |(d)|Start device of transfer destination|-|Signed BIN32|ANY32_S | ||
| 220 | |(n)|Number of transfers|[1≤n≤512]|Signed BIN32|ANY32_S | ||
| 221 | |||
| 222 | **Device used** | ||
| 223 | |||
| 224 | |=(% rowspan="2" %)**instruction**|=(% rowspan="2" %)**Parameter**|=(% colspan="24" %)**Devices**|=**Index modification**|=((( | ||
| 225 | **Pulse** | ||
| 226 | |||
| 227 | **extension** | ||
| 228 | ))) | ||
| 229 | |**X**|**Y**|**M**|**S**|**SM**|**T(bit)**|**C(bit)**|**LC(bit)**|**HSC(bit)**|**D.b**|**KnX**|**KnY**|**KnM**|**KnS**|**T**|**C**|**D**|**R**|**SD**|**LC**|**HSC**|**K**|**H**|**E**|**[D]**|**XXP** | ||
| 230 | |(% rowspan="3" %)DFMOV|Parameter 1| | | | | | | | | | |●|●|●|●|●|●|●|●|●|●|●|●|●| |●|● | ||
| 231 | |Parameter 2| | | | | | | | | | | |●|●|●|●|●|●|●|●| | | | | |●|● | ||
| 232 | |Parameter 3| | | | | | | | | | |●|●|●|●|●|●|●|●|●| | |●|●| |●|● | ||
| 233 | |||
| 234 | **Features** | ||
| 235 | |||
| 236 | 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. | ||
| 237 | |||
| 238 | (% style="text-align:center" %) | ||
| 239 | [[image:1708591575858-882.png]] | ||
| 240 | |||
| 241 | When the number specified in (n) exceeds the device number range, transfer is performed within the allowable range. | ||
| 242 | |||
| 243 | When a constant (K) is specified for the transmission source (s), it will be automatically converted to BIN. | ||
| 244 | |||
| 245 | **Error code** | ||
| 246 | |||
| 247 | |=**Error code**|=**Content** | ||
| 248 | |4084H|(s) and (n) input the data In application instruction exceed the specified range | ||
| 249 | |4085H|The output results of (s) and (n) in read application instruction exceed the device range | ||
| 250 | |4086H|The output result of (d) in write application instruction exceeds the device range | ||
| 251 | |||
| 252 | **Example** | ||
| 253 | |||
| 254 | (% style="text-align:center" %) | ||
| 255 | [[image:1708591633133-701.png]] | ||
| 256 | |||
| 257 | When M0 is set, the value of (D1, D0), (D3, D2), (D5, D4), (D7, D6), (D9, D8) is set to 0. | ||
| 258 | |||
| 259 | == SMOV/Bit Shift == | ||
| 260 | |||
| 261 | **SMOV(P)** | ||
| 262 | |||
| 263 | A instruction for distributing and synthesizing data in units of digits (4 bits). | ||
| 264 | |||
| 265 | -[SMOV (s) (n1) (n2) (d) (n3)] | ||
| 266 | |||
| 267 | **Content, range and data type** | ||
| 268 | |||
| 269 | |=**Parameter**|=**Content**|=**Range**|=**Data type**|=**Data type (label)** | ||
| 270 | |(s)|The word device number that stores the data whose bit is to be moved| |Signed BIN16|ANY16_S | ||
| 271 | |(n1)|Transfer destination device number|1 to 4|Signed BIN16|ANY16_S | ||
| 272 | |(n2)|The number of digits to move|1 to 4|Signed BIN16|ANY16_S | ||
| 273 | |(d)|The word device number that stores data for bit shifting| |Signed BIN16|ANY16_S | ||
| 274 | |(n3)|The starting position of the moving target|1 to 4|Signed BIN16|ANY16_S | ||
| 275 | |||
| 276 | **Device used** | ||
| 277 | |||
| 278 | |=(% rowspan="2" %)**instruction**|=(% rowspan="2" %)**Parameter**|=(% colspan="24" %)**Devices**|=**Index modification**|=((( | ||
| 279 | **Pulse** | ||
| 280 | |||
| 281 | **extension** | ||
| 282 | ))) | ||
| 283 | |**X**|**Y**|**M**|**S**|**SM**|**T(bit)**|**C(bit)**|**LC(bit)**|**HSC(bit)**|**D.b**|**KnX**|**KnY**|**KnM**|**KnS**|**T**|**C**|**D**|**R**|**SD**|**LC**|**HSC**|**K**|**H**|**E**|**[D]**|**XXP** | ||
| 284 | |(% rowspan="5" %)SMOV|Parameter 1| | | | | | | | | | |●|●|●|●|●|●|●|●|●| | | | | |●|● | ||
| 285 | |Parameter 2| | | | | | | | | | |●|●|●|●|●|●|●|●|●| | |●|●| |●|● | ||
| 286 | |Parameter 3| | | | | | | | | | |●|●|●|●|●|●|●|●|●| | |●|●| |●|● | ||
| 287 | |Parameter 4| | | | | | | | | | | |●|●|●|●|●|●|●|●| | | | | |●|● | ||
| 288 | |Parameter 5| | | | | | | | | | |●|●|●|●|●|●|●|●|●| | |●|●| |●|● | ||
| 289 | |||
| 290 | **Features** | ||
| 291 | |||
| 292 | destination (d) are conver.The data is distributed/combined in units of digits (4 bits). The contents of the transmission source (s) and the transmission ted 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). | ||
| 293 | |||
| 294 | When the instruction input is OFF, the transfer destination (d) does not change. | ||
| 295 | |||
| 296 | 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. | ||
| 297 | |||
| 298 | (% style="text-align:center" %) | ||
| 299 | [[image:图片1.png]] | ||
| 300 | |||
| 301 | |||
| 302 | 1. Perform BIN→BCD conversion on (s). | ||
| 303 | 1. 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. | ||
| 304 | 1. Convert the synthesized data (BCD) into BIN and store it in (d). | ||
| 305 | |||
| 306 | **Extended function** | ||
| 307 | |||
| 308 | 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. | ||
| 309 | |||
| 310 | **Error code** | ||
| 311 | |||
| 312 | |=**Error code**|=**Content** | ||
| 313 | |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. | ||
| 314 | |4085H|The output result of (s), (n1) (n2), (d) and (n3) in the read application instruction exceeds the device range | ||
| 315 | |4086H|The output result of (d) in write application instructions exceeds the device range | ||
| 316 | |||
| 317 | **Example** | ||
| 318 | |||
| 319 | After synthesizing the data of the 3-digit digital switch, it is stored in D2 in binary. | ||
| 320 | |||
| 321 | (% style="text-align:center" %) | ||
| 322 | [[image:1708592329704-420.png]] | ||
| 323 | |||
| 324 | Combine data of 3 digital switches connected to non-continuous input terminals. | ||
| 325 | |||
| 326 | (% style="text-align:center" %) | ||
| 327 | [[image:1708592355415-149.png]] | ||
| 328 | |||
| 329 | When M0 is set, | ||
| 330 | |||
| 331 | (X020 to X027) BCD 2 digits → D 2 (binary); | ||
| 332 | |||
| 333 | (X000 to X003) BCD 1 digit → D 1 (binary); | ||
| 334 | |||
| 335 | Store the 1 digit of D1 into the 3 digit of D2, and synthesize a 3-digit value. | ||
| 336 | |||
| 337 | == CML/16-bit Invert Transmission == | ||
| 338 | |||
| 339 | **CML(P)** | ||
| 340 | |||
| 341 | After the BIN 16-bit data specified in (s) is inverted bit by bit, the result is transferred to the device specified in (d). | ||
| 342 | |||
| 343 | -[CML (s) (d)] | ||
| 344 | |||
| 345 | **Content, range and data type** | ||
| 346 | |||
| 347 | |=**Parameter**|=**Content**|=**Range**|=**Data type**|=**Data type (label)** | ||
| 348 | |(s)|Inverted data or the device number that stores data|-32768 to 32767|Signed BIN16|ANY16_S | ||
| 349 | |(d)|The device number that stores the inversion result|-|Signed BIN16|ANY16_S | ||
| 350 | |||
| 351 | **Device used** | ||
| 352 | |||
| 353 | |=(% rowspan="2" %)**instruction**|=(% rowspan="2" %)**Parameter**|=(% colspan="24" %)**Devices**|=**Index modification**|=((( | ||
| 354 | **Pulse** | ||
| 355 | |||
| 356 | **extension** | ||
| 357 | ))) | ||
| 358 | |**X**|**Y**|**M**|**S**|**SM**|**T(bit)**|**C(bit)**|**LC(bit)**|**HSC(bit)**|**D.b**|**KnX**|**KnY**|**KnM**|**KnS**|**T**|**C**|**D**|**R**|**SD**|**LC**|**HSC**|**K**|**H**|**E**|**[D]**|**XXP** | ||
| 359 | |(% rowspan="2" %)CML|Parameter 1| | | | | | | | | | |●|●|●|●|●|●|●|●|●| | |●|●| |●|● | ||
| 360 | |Parameter 2| | | | | | | | | | | |●|●|●|●|●|●|●|●| | | | | |●|● | ||
| 361 | |||
| 362 | **Features** | ||
| 363 | |||
| 364 | After inverting the BIN 16-bit data specified in (s) bit by bit, the result is transferred to the device specified in (d). | ||
| 365 | |||
| 366 | (% style="text-align:center" %) | ||
| 367 | [[image:1708592437397-834.png]] | ||
| 368 | |||
| 369 | When the number of digits of the device with the specified digit is 4 points, other digits are not affected. | ||
| 370 | |||
| 371 | **Error code** | ||
| 372 | |||
| 373 | |=**Error code**|=**Content** | ||
| 374 | |4085H|The output result of (s) in read application instruction exceeds the device range | ||
| 375 | |4086H|The output result of (d) in write application instruction exceeds the device range | ||
| 376 | |||
| 377 | **Example** | ||
| 378 | |||
| 379 | Example 1: | ||
| 380 | |||
| 381 | (% style="text-align:center" %) | ||
| 382 | [[image:1708592498105-403.png]] | ||
| 383 | |||
| 384 | When M0 is set, the value of D0 is inverted and transferred to the value of D2. | ||
| 385 | |||
| 386 | Example 2: | ||
| 387 | |||
| 388 | invert input acquisition: | ||
| 389 | |||
| 390 | (% style="text-align:center" %) | ||
| 391 | [[image:1708592530381-166.png]] | ||
| 392 | |||
| 393 | == DCML/32-bit Invert Transmission == | ||
| 394 | |||
| 395 | **DCML(P)** | ||
| 396 | |||
| 397 | After the BIN 32-bit data specified in (s) is inverted bit by bit, the result is transferred to the device specified in (d). | ||
| 398 | |||
| 399 | -[CML (s) (d)] | ||
| 400 | |||
| 401 | **Content, range and data type** | ||
| 402 | |||
| 403 | |=**Parameter**|=**Content**|=**Range**|=**Data type**|=**Data type (label)** | ||
| 404 | |(s)|Inverted data or the device number that stores data|-2147483648 to 2147483647|Signed BIN32|ANY32_S | ||
| 405 | |(d)|The device number that stores the inversion result|-|Signed BIN32|ANY32_S | ||
| 406 | |||
| 407 | **Device used** | ||
| 408 | |||
| 409 | |=(% rowspan="2" %)**instruction**|=(% rowspan="2" %)**Parameter**|=(% colspan="24" %)**Devices**|=**Index modification**|=((( | ||
| 410 | **Pulse** | ||
| 411 | |||
| 412 | **extension** | ||
| 413 | ))) | ||
| 414 | |**X**|**Y**|**M**|**S**|**SM**|**T(bit)**|**C(bit)**|**LC(bit)**|**HSC(bit)**|**D.b**|**KnX**|**KnY**|**KnM**|**KnS**|**T**|**C**|**D**|**R**|**SD**|**LC**|**HSC**|**K**|**H**|**E**|**[D]**|**XXP** | ||
| 415 | |(% rowspan="2" %)DCML|Parameter 1| | | | | | | | | | |●|●|●|●|●|●|●|●|●|●|●|●|●| |●|● | ||
| 416 | |Parameter 2| | | | | | | | | | | |●|●|●|●|●|●|●|●|●|●| | | |●|● | ||
| 417 | |||
| 418 | **Features** | ||
| 419 | |||
| 420 | After inverting the BIN 32-bit data specified in (s) bit by bit, the result is transferred to the device specified in (d). | ||
| 421 | |||
| 422 | (% style="text-align:center" %) | ||
| 423 | [[image:1708592601925-932.png]] | ||
| 424 | |||
| 425 | When the number of digits of the device with the specified digit is 4 points, other digits are not affected. | ||
| 426 | |||
| 427 | **Error code** | ||
| 428 | |||
| 429 | |=**Error code**|=**Content** | ||
| 430 | |4085H|The output result of (s) in read application instruction exceeds the device range | ||
| 431 | |4086H|The output result of (d) in write application instruction exceeds the device range | ||
| 432 | |||
| 433 | **Example** | ||
| 434 | |||
| 435 | (% style="text-align:center" %) | ||
| 436 | [[image:1708592648329-938.png]] | ||
| 437 | |||
| 438 | When M0 is set, the value of (D1, D0) is reversed and transferred to the value of (D3, D2). | ||
| 439 | |||
| 440 | == CMP/16-bit Data Comparison Output == | ||
| 441 | |||
| 442 | **CMP(P)** | ||
| 443 | |||
| 444 | Compare the BIN 16-bit data of the device specified in (s1) and (s2). | ||
| 445 | |||
| 446 | -[CML (s1) (s2) (d)] | ||
| 447 | |||
| 448 | **Content, range and data type** | ||
| 449 | |||
| 450 | |||
| 451 | |**Parameter**|**Content**|**Range**|**Data type**|**Data type (label)** | ||
| 452 | |(s1)|Comparison value data or the device storing the comparison value data|-32768 to +32767|Signed BIN16|ANY16_S | ||
| 453 | |(s2)|Comparison source data or the device storing the comparison source data|-32768 to 32767|Signed BIN16|ANY16_S | ||
| 454 | |(d)|Start bit device for output comparison result| |Bit|ANYBIT_ARRAY | ||
| 455 | |||
| 456 | **Device used** | ||
| 457 | |||
| 458 | |(% rowspan="2" %)**instruction**|(% rowspan="2" %)**Parameter**|(% colspan="24" %)**Devices**|**Index modification**|((( | ||
| 459 | **Pulse** | ||
| 460 | |||
| 461 | **extension** | ||
| 462 | ))) | ||
| 463 | |**X**|**Y**|**M**|**S**|**SM**|**T(bit)**|**C(bit)**|**LC(bit)**|**HSC(bit)**|**D.b**|**KnX**|**KnY**|**KnM**|**KnS**|**T**|**C**|**D**|**R**|**SD**|**LC**|**HSC**|**K**|**H**|**E**|**[D]**|**XXP** | ||
| 464 | |(% rowspan="3" %)CMP|Parameter 1| | | | | | | | | | |●|●|●|●|●|●|●|●|●| | |●|●| |●|● | ||
| 465 | |Parameter 2| | | | | | | | | | | |●|●|●|●|●|●|●|●| | | | | |●|● | ||
| 466 | |Parameter 3| |●|●|●|●| | | | |●| | | | | | | | | | | | | | |●| | ||
| 467 | |||
| 468 | **Features** | ||
| 469 | |||
| 470 | 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. | ||
| 471 | |||
| 472 | (s1) and (s2) are handled as BIN values within the above setting data range. | ||
| 473 | |||
| 474 | Use algebraic methods for size comparison. | ||
| 475 | |||
| 476 | (% style="text-align:center" %) | ||
| 477 | [[image:1708592716888-578.png]] | ||
| 478 | |||
| 479 | (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. | ||
| 480 | |||
| 481 | **✎Note: ** | ||
| 482 | |||
| 483 | Occupy the device specified in 3 points (d) at the beginning, please be careful not to overlap with the device used for other control. | ||
| 484 | |||
| 485 | **Error code** | ||
| 486 | |||
| 487 | |||
| 488 | |**Error code**|**Content** | ||
| 489 | |4085H|The output results of (s1) and (s2) in read application instruction exceed the device range | ||
| 490 | |4086H|The output result of (d) in write application instruction exceeds the device range | ||
| 491 | |||
| 492 | **Example** | ||
| 493 | |||
| 494 | (% style="text-align:center" %) | ||
| 495 | [[image:1708592758771-657.png]] | ||
| 496 | |||
| 497 | When M0 is set, compare the values of D0 and D2: | ||
| 498 | |||
| 499 | If (D0)> (D2) then Y0 is ON. | ||
| 500 | |||
| 501 | If (D0) = (D2) then Y1 is ON. If (D0) <(D2) then Y2 is ON. | ||
| 502 | |||
| 503 | == DCMP/32-bit Data Comparison Output == | ||
| 504 | |||
| 505 | **DCMP(P)** | ||
| 506 | |||
| 507 | Compare the BIN 32-bit data of the device specified in (s1) and (s2). | ||
| 508 | |||
| 509 | -[DCML (s1) (s2) (d)] | ||
| 510 | |||
| 511 | **Content, range and data type** | ||
| 512 | |||
| 513 | |||
| 514 | |=**Parameter**|=**Content**|=**Range**|=**Data type**|=**Data type (label)** | ||
| 515 | |(s1)|Comparison value data or the device storing the comparison value data|-2147483648 to 2147483647|Signed BIN32|ANY32_S | ||
| 516 | |(s2)|Comparison source data or the device storing the comparison source data|-2147483648 to 2147483647|Signed BIN32|ANY32_S | ||
| 517 | |(d)|Start bit device for output comparison result| |Bit|ANYBIT_ARRAY | ||
| 518 | |||
| 519 | **Device used** | ||
| 520 | |||
| 521 | |=(% rowspan="2" %)**instruction**|=(% rowspan="2" %)**Parameter**|=(% colspan="24" %)**Devices**|=**Index modification**|=((( | ||
| 522 | **Pulse** | ||
| 523 | |||
| 524 | **extension** | ||
| 525 | ))) | ||
| 526 | |**X**|**Y**|**M**|**S**|**SM**|**T(bit)**|**C(bit)**|**LC(bit)**|**HSC(bit)**|**D.b**|**KnX**|**KnY**|**KnM**|**KnS**|**T**|**C**|**D**|**R**|**SD**|**LC**|**HSC**|**K**|**H**|**E**|**[D]**|**XXP** | ||
| 527 | |(% rowspan="3" %)DCMP|Parameter 1| | | | | | | | | | |●|●|●|●|●|●|●|●|●|●|●|●|●| |●|● | ||
| 528 | |Parameter 2| | | | | | | | | | | |●|●|●|●|●|●|●|●|●|●| | | |●|● | ||
| 529 | |Parameter 3| |●|●|●|●| | | | |●| | | | | | | | | | | | | | |●| | ||
| 530 | |||
| 531 | **Features** | ||
| 532 | |||
| 533 | • 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. | ||
| 534 | |||
| 535 | • (s1) and (s2) are handled as BIN values within the above setting data range. | ||
| 536 | |||
| 537 | • Use algebraic methods for size comparison. | ||
| 538 | |||
| 539 | (% style="text-align:center" %) | ||
| 540 | [[image:1708592852238-153.png]] | ||
| 541 | |||
| 542 | (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. | ||
| 543 | |||
| 544 | (% class="box infomessage" %) | ||
| 545 | ((( | ||
| 546 | **✎Note: ** | ||
| 547 | |||
| 548 | Occupy the device specified in 3 points (d) at the beginning. Please be careful not to overlap with other control devices. | ||
| 549 | ))) | ||
| 550 | |||
| 551 | **Error code** | ||
| 552 | |||
| 553 | |=**Error code**|=**Content** | ||
| 554 | |4085H|The output results of (s1) and (s2) in read application instruction exceed the device range | ||
| 555 | |4086H|The output result of (d) in write application instruction exceeds the device range | ||
| 556 | |||
| 557 | **Example** | ||
| 558 | |||
| 559 | (% style="text-align:center" %) | ||
| 560 | [[image:1708593020814-669.png]] | ||
| 561 | |||
| 562 | (% style="text-align:center" %) | ||
| 563 | [[image:1708593024791-647.png]] | ||
| 564 | |||
| 565 | == XCH/16-bit Data Exchange == | ||
| 566 | |||
| 567 | **XCH(P)** | ||
| 568 | |||
| 569 | Exchange the BIN 16-bit data of (d1) and (d2). | ||
| 570 | |||
| 571 | -[XCH (d1) (d2)] | ||
| 572 | |||
| 573 | **Content, range and data type** | ||
| 574 | |||
| 575 | |=**Parameter**|=**Content**|=**Range**|=**Data type**|=**Data type (label)** | ||
| 576 | |(d1)|The start device that stores the exchange data|-32768 to 32767|Signed BIN16|ANY16_S | ||
| 577 | |(d2)|The start device that stores the exchange data|-32768 to 32767|Signed BIN16|ANY16_S | ||
| 578 | |||
| 579 | **Device used** | ||
| 580 | |||
| 581 | |=(% rowspan="2" %)**instruction**|=(% rowspan="2" %)**Parameter**|=(% colspan="24" %)**Devices**|=**Index modification**|=((( | ||
| 582 | **Pulse** | ||
| 583 | |||
| 584 | **extension** | ||
| 585 | ))) | ||
| 586 | |**X**|**Y**|**M**|**S**|**SM**|**T(bit)**|**C(bit)**|**LC(bit)**|**HSC(bit)**|**D.b**|**KnX**|**KnY**|**KnM**|**KnS**|**T**|**C**|**D**|**R**|**SD**|**LC**|**HSC**|**K**|**H**|**E**|**[D]**|**XXP** | ||
| 587 | |(% rowspan="2" %)XCH|Parameter 1| | | | | | | | | | | |●|●|●|●|●|●|●|●| | | | | |●|● | ||
| 588 | |Parameter 2| | | | | | | | | | | |●|●|●|●|●|●|●|●| | | | | |●|● | ||
| 589 | |||
| 590 | **Features** | ||
| 591 | |||
| 592 | • Exchange the BIN 16-bit data of (d1) and (d2). | ||
| 593 | |||
| 594 | (% style="text-align:center" %) | ||
| 595 | [[image:1708593141082-993.png]] | ||
| 596 | |||
| 597 | • 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. | ||
| 598 | |||
| 599 | (% style="text-align:center" %) | ||
| 600 | [[image:1708593162883-397.png]] | ||
| 601 | |||
| 602 | (% class="box infomessage" %) | ||
| 603 | ((( | ||
| 604 | **✎Note: ** | ||
| 605 | |||
| 606 | If continuous execution instructions are used, conversion will be performed every operation cycle. | ||
| 607 | ))) | ||
| 608 | |||
| 609 | **Error code** | ||
| 610 | |||
| 611 | |=**Error code**|=**Content** | ||
| 612 | |4084H|In exchange mode, the devices in (d1) and (d2) are different | ||
| 613 | |4085H|The output results of (d1) and (d2) in the read application instruction exceed the device range | ||
| 614 | |4086H|The output results of (d1) and (d2) in the writing application instruction exceed the device range | ||
| 615 | |||
| 616 | **Example** | ||
| 617 | |||
| 618 | When M0 is reset, set M1: the value of D0 and the value of D2 are exchanged. | ||
| 619 | |||
| 620 | (% style="text-align:center" %) | ||
| 621 | [[image:1708593244047-197.png]] | ||
| 622 | |||
| 623 | When M0 is set, M1 is set: the upper 8 bits (bytes) and lower 8 bits (bytes) of D0 are exchanged with each other. | ||
| 624 | |||
| 625 | (% style="text-align:center" %) | ||
| 626 | [[image:1708593262736-480.png]] | ||
| 627 | |||
| 628 | == DXCH/32-bit Data Exchange == | ||
| 629 | |||
| 630 | **DXCH(P)** | ||
| 631 | |||
| 632 | Exchange (d1) and (d2) BIN 32-bit data. | ||
| 633 | |||
| 634 | -[DXCH (d1) (d2)] | ||
| 635 | |||
| 636 | **Content, range and data type** | ||
| 637 | |||
| 638 | |||
| 639 | |=**Parameter**|=**Content**|=**Range**|=**Data type**|=**Data type (label)** | ||
| 640 | |(d1)|The start device that stores the exchange data|-2147483647 to 2147483647|Signed BIN32|ANY32_S | ||
| 641 | |(d2)|The start device that stores the exchange data|-2147483647 to 2147483647|Signed BIN32|ANY32_S | ||
| 642 | |||
| 643 | **Device used** | ||
| 644 | |||
| 645 | |=(% rowspan="2" %)**instruction**|=(% rowspan="2" %)**Parameter**|=(% colspan="24" %)**Devices**|=**Index modification**|=((( | ||
| 646 | **Pulse** | ||
| 647 | |||
| 648 | **extension** | ||
| 649 | ))) | ||
| 650 | |**X**|**Y**|**M**|**S**|**SM**|**T(bit)**|**C(bit)**|**LC(bit)**|**HSC(bit)**|**D.b**|**KnX**|**KnY**|**KnM**|**KnS**|**T**|**C**|**D**|**R**|**SD**|**LC**|**HSC**|**K**|**H**|**E**|**[D]**|**XXP** | ||
| 651 | |(% rowspan="2" %)DXCH|Parameter 1| | | | | | | | | | | |●|●|●|●|●|●|●|●|●|●| | | |●|● | ||
| 652 | |Parameter 2| | | | | | | | | | | |●|●|●|●|●|●|●|●|●|●| | | |●|● | ||
| 653 | |||
| 654 | **Features** | ||
| 655 | |||
| 656 | • Exchange the BIN 32-bit data of (d1), (d1)+1 and (d2), (d2)+1. | ||
| 657 | |||
| 658 | (% style="text-align:center" %) | ||
| 659 | [[image:1708593394355-443.png]] | ||
| 660 | |||
| 661 | • When executing instruction | ||
| 662 | |||
| 663 | s 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). | ||
| 664 | |||
| 665 | (% style="text-align:center" %) | ||
| 666 | [[image:1708593437017-148.png]] | ||
| 667 | |||
| 668 | (% class="box infomessage" %) | ||
| 669 | ((( | ||
| 670 | **✎Note:** | ||
| 671 | |||
| 672 | **~ **If continuous execution instructions are used, conversion will be performed every operation cycle. | ||
| 673 | ))) | ||
| 674 | |||
| 675 | **Error code** | ||
| 676 | |||
| 677 | |=**Error code**|=**Content** | ||
| 678 | |4084H|In exchange mode, the devices in (d1) and (d2) are different | ||
| 679 | |4085H|The output results of (d1) and (d2) in the read application instruction exceed the device range | ||
| 680 | |4086H|The output results of (d1) and (d2) in the writing application instruction exceed the device range | ||
| 681 | |||
| 682 | **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. | ||
| 683 | |||
| 684 | (% style="text-align:center" %) | ||
| 685 | [[image:1708593494709-216.png]] | ||
| 686 | |||
| 687 | When M0 is reset, set M1: the value of (D1, D0) and the value of (D3, D2) are exchanged. | ||
| 688 | |||
| 689 | (% style="text-align:center" %) | ||
| 690 | [[image:1708593508187-176.png]] | ||
| 691 | |||
| 692 | == ZCP/16-bit Data Interval Comparison == | ||
| 693 | |||
| 694 | **ZCP(P)** | ||
| 695 | |||
| 696 | 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. | ||
| 697 | |||
| 698 | -[ZCP (s1) (s2) (s3) (d)] | ||
| 699 | |||
| 700 | **Content, range and data type** | ||
| 701 | |||
| 702 | |||
| 703 | |=**Parameter**|=**Content**|=**Range**|=**Data type**|=**Data type (label)** | ||
| 704 | |(s1)|The comparison value data of low limit or the device that stores the comparison value data|-32768 to 32767|Signed BIN16|ANY16_S | ||
| 705 | |(s2)|The comparison value data of high limit or the device that stores the comparison value data|-32768 to 32767|Signed BIN16|ANY16_S | ||
| 706 | |(s3)|Comparison source data or the device that stores the comparison source data|-32768 to 32767|Signed BIN16|ANY16_S | ||
| 707 | |(d)|The start bit device of output comparison result| |Bit|ANYBIT_ARRAY | ||
| 708 | |||
| 709 | **Device used** | ||
| 710 | |||
| 711 | |=(% rowspan="2" %)**instruction**|=(% rowspan="2" %)**Parameter**|=(% colspan="24" %)**Devices**|=**Index modification**|=((( | ||
| 712 | **Pulse** | ||
| 713 | |||
| 714 | **extension** | ||
| 715 | ))) | ||
| 716 | |**X**|**Y**|**M**|**S**|**SM**|**T(bit)**|**C(bit)**|**LC(bit)**|**HSC(bit)**|**D.b**|**KnX**|**KnY**|**KnM**|**KnS**|**T**|**C**|**D**|**R**|**SD**|**LC**|**HSC**|**K**|**H**|**E**|**[D]**|**XXP** | ||
| 717 | |(% rowspan="4" %)ZCP|Parameter 1| | | | | | | | | | |●|●|●|●|●|●|●|●|●| | |●|●|●|●|● | ||
| 718 | |Parameter 2| | | | | | | | | | |●|●|●|●|●|●|●|●|●| | |●|●|●|●|● | ||
| 719 | |Parameter 3| | | | | | | | | | |●|●|●|●|●|●|●|●|●| | |●|●|●|●|● | ||
| 720 | |Parameter 4| |●|●|●|●| | | | |●| | | | | | | | | | | | | | |●| | ||
| 721 | |||
| 722 | **Features** | ||
| 723 | |||
| 724 | • 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. | ||
| 725 | |||
| 726 | • Use algebraic methods for size comparison. | ||
| 727 | |||
| 728 | (% style="text-align:center" %) | ||
| 729 | [[image:1708593605019-728.png]] | ||
| 730 | |||
| 731 | (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. | ||
| 732 | |||
| 733 | (% class="box infomessage" %) | ||
| 734 | ((( | ||
| 735 | **✎Note: ** | ||
| 736 | |||
| 737 | • Please set the lower comparison value (s1) to a value smaller than the upper comparison value (s2). | ||
| 738 | |||
| 739 | • When (s1) is greater than (s2), it will be processed as (s2)=(s1). | ||
| 740 | |||
| 741 | • The device specified in 3 points (d) is occupied at the beginning. Please be careful not to overlap with other control devices. | ||
| 742 | ))) | ||
| 743 | |||
| 744 | **Error code** | ||
| 745 | |||
| 746 | |=**Error code**|=**Content** | ||
| 747 | |4085H|The output results of (s1), (s2) and (s3) in the read application instruction exceed the device range | ||
| 748 | |4086H|The output result of (d) in write application instructions exceeds the device range | ||
| 749 | |||
| 750 | **Example** | ||
| 751 | |||
| 752 | (% style="text-align:center" %) | ||
| 753 | [[image:1708593715182-386.png]] | ||
| 754 | |||
| 755 | When M0 is set, compare whether D0 is between 0 and 1000: | ||
| 756 | |||
| 757 | If (D0)> (1000), then Y0 is ON. | ||
| 758 | |||
| 759 | If (0) ≤ (D0) ≤ (1000), then Y1 is ON. | ||
| 760 | |||
| 761 | If (D0) <(0), then Y2 is ON. | ||
| 762 | |||
| 763 | == DZCP/32-bit Data Interval Comparison == | ||
| 764 | |||
| 765 | **DZCP(P)** | ||
| 766 | |||
| 767 | 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. | ||
| 768 | |||
| 769 | -[DZCP (s1) (s2) (s3) (d)] | ||
| 770 | |||
| 771 | **Content, range and data type** | ||
| 772 | |||
| 773 | |=**Parameter**|=**Content**|=**Range**|=**Data type**|=**Data type (label)** | ||
| 774 | |(s1)|The comparison value data of low limit or the device that stores the comparison value data|-2147483648 to 2147483647|Signed BIN32|ANY32_S | ||
| 775 | |(s2)|The comparison value data of high limit or the device that stores the comparison value data|-2147483648 to 2147483647|Signed BIN32|ANY32_S | ||
| 776 | |(s3)|Comparison source data or the device that stores the comparison source data|-2147483648 to 2147483647|Signed BIN32|ANY32_S | ||
| 777 | |(d)|The start bit device of output comparison result| |Bit|ANYBIT_ARRAY | ||
| 778 | |||
| 779 | **Device used** | ||
| 780 | |||
| 781 | |=(% rowspan="2" %)**instruction**|=(% rowspan="2" %)**Parameter**|=(% colspan="24" %)**Devices**|=**Index modification**|=((( | ||
| 782 | **Pulse** | ||
| 783 | |||
| 784 | **extension** | ||
| 785 | ))) | ||
| 786 | |**X**|**Y**|**M**|**S**|**SM**|**T(bit)**|**C(bit)**|**LC(bit)**|**HSC(bit)**|**D.b**|**KnX**|**KnY**|**KnM**|**KnS**|**T**|**C**|**D**|**R**|**SD**|**LC**|**HSC**|**K**|**H**|**E**|**[D]**|**XXP** | ||
| 787 | |(% rowspan="4" %)DZCP|Parameter 1| | | | | | | | | | |●|●|●|●|●|●|●|●|●|●|●|●|●|●|●|● | ||
| 788 | |Parameter 2| | | | | | | | | | |●|●|●|●|●|●|●|●|●|●|●|●|●|●|●|● | ||
| 789 | |Parameter 3| | | | | | | | | | |●|●|●|●|●|●|●|●|●|●|●|●|●|●|●|● | ||
| 790 | |Parameter 4| |●|●|●|●| | | | |●| | | | | | | | | | | | | | |●| | ||
| 791 | |||
| 792 | **Features** | ||
| 793 | |||
| 794 | • 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. | ||
| 795 | |||
| 796 | • Use algebraic methods for size comparison. | ||
| 797 | |||
| 798 | (% style="text-align:center" %) | ||
| 799 | [[image:图片2.png]] | ||
| 800 | |||
| 801 | |||
| 802 | (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. | ||
| 803 | |||
| 804 | (% class="box infomessage" %) | ||
| 805 | ((( | ||
| 806 | **✎Note: ** | ||
| 807 | |||
| 808 | • Please set the lower comparison value (s1) to a value smaller than the upper comparison value (s2). | ||
| 809 | |||
| 810 | • When (s1) is greater than (s2), it will be processed as (s2)=(s1). | ||
| 811 | |||
| 812 | • The device specified in 3 points (d) is occupied at the beginning. Please be careful not to overlap with other control devices. | ||
| 813 | ))) | ||
| 814 | |||
| 815 | **Error code** | ||
| 816 | |||
| 817 | |=**Error code**|=**Content** | ||
| 818 | |4085H|The output results of (s1), (s2) and (s3) in the read application instruction exceed the device range | ||
| 819 | |4086H|The output results of (d) in the write application instruction exceeds the device range | ||
| 820 | |||
| 821 | **Example** | ||
| 822 | |||
| 823 | (% style="text-align:center" %) | ||
| 824 | [[image:1708593992672-738.png]] | ||
| 825 | |||
| 826 | When M0 is set, compare D0 with whether it is between 0 and 100000: | ||
| 827 | |||
| 828 | If (D0)> (100000), then Y0 is ON. | ||
| 829 | |||
| 830 | If (0) ≤ (D0) ≤ (100000), then Y1 is ON. | ||
| 831 | |||
| 832 | If (D0) <(0), then Y2 is ON. | ||
| 833 | |||
| 834 | = Cycle Shift instruction = | ||
| 835 | |||
| 836 | == ROR/16-bit Cycle Shift Right == | ||
| 837 | |||
| 838 | **ROR(P)** | ||
| 839 | |||
| 840 | Shift the 16-bit data of the device specified in (d) to the right by (n) bits without including the carry flag. | ||
| 841 | |||
| 842 | -[ROR (d) (n)] | ||
| 843 | |||
| 844 | **Content, range and data type** | ||
| 845 | |||
| 846 | |=**Parameter**|=**Content**|=**Range**|=**Data type**|=**Data type (label)** | ||
| 847 | |(d)|The device start number for cycle shift right|-|Signed BIN 16 bit|ANY16 | ||
| 848 | |(n)|The number of times to cycle shift right|0 to 15|Signed BIN 16 bit|ANY16 | ||
| 849 | |||
| 850 | **Device used** | ||
| 851 | |||
| 852 | |=(% rowspan="2" %)**instruction**|=(% rowspan="2" %)**Parameter**|=(% colspan="24" %)**Devices**|=**Index modification**|=((( | ||
| 853 | **Pulse** | ||
| 854 | |||
| 855 | **extension** | ||
| 856 | ))) | ||
| 857 | |**X**|**Y**|**M**|**S**|**SM**|**T(bit)**|**C(bit)**|**LC(bit)**|**HSC(bit)**|**D.b**|**KnX**|**KnY**|**KnM**|**KnS**|**T**|**C**|**D**|**R**|**SD**|**LC**|**HSC**|**K**|**H**|**E**|**[D]**|**XXP** | ||
| 858 | |(% rowspan="2" %)ROR|Parameter 1| | | | | | | | | | | |●|●|●|●|●|●|●|●| | | | | |●|● | ||
| 859 | |Parameter 2| | | | | | | | | | |●|●|●|●|●|●|●|●|●| | |●|●| |●|● | ||
| 860 | |||
| 861 | **Features** | ||
| 862 | |||
| 863 | ・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. | ||
| 864 | |||
| 865 | (% style="text-align:center" %) | ||
| 866 | [[image:图片3.png]] | ||
| 867 | |||
| 868 | |||
| 869 | (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. | ||
| 870 | |||
| 871 | **Related device** | ||
| 872 | |||
| 873 | |=**Device**|=**Name**|=**Content** | ||
| 874 | |SM151|Carry|It turns ON when the last bit shifted from the lowest is 1. | ||
| 875 | |||
| 876 | (% class="box infomessage" %) | ||
| 877 | ((( | ||
| 878 | **✎Note:** | ||
| 879 | |||
| 880 | * Do not set the number of digits (n) shifted right to a negative value. | ||
| 881 | * In the case of continuous execution type instructions (ROR, RCR), the right shift will be executed every scan time (operation cycle), so be careful. | ||
| 882 | * 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). | ||
| 883 | ))) | ||
| 884 | |||
| 885 | **Error code** | ||
| 886 | |||
| 887 | |=**Error code**|=**Content** | ||
| 888 | |4084H|A negative value is specified in (n). | ||
| 889 | |4085H|The output results of (d) and (n) in the read application instruction exceed the device range | ||
| 890 | |4086H|The output result of (d) in the write application instruction exceeds the device range | ||
| 891 | |||
| 892 | **Example** | ||
| 893 | |||
| 894 | (% style="text-align:center" %) | ||
| 895 | [[image:1708594252328-359.png]] | ||
| 896 | |||
| 897 | Shift the 1 in the D0 device by 3 bits to the right to get 8192. | ||
| 898 | |||
| 899 | == DROR/32-bit Cycle Shift Right == | ||
| 900 | |||
| 901 | **DROR(P)** | ||
| 902 | |||
| 903 | Shift the 32-bit data of the device specified in (d) to the right by (n) bits without including the carry flag. | ||
| 904 | |||
| 905 | -[DROR (d) (n)] | ||
| 906 | |||
| 907 | **Content, range and data type** | ||
| 908 | |||
| 909 | |=**Parameter**|=**Content**|=**Range**|=**Data type**|=**Data type (label)** | ||
| 910 | |(d)|The device start number for cycle shift right|-|Signed BIN 32 bit|ANY32 | ||
| 911 | |(n)|The number of times to cycle shift right|0 to 31|Signed BIN 32 bit|ANY32 | ||
| 912 | |||
| 913 | **Device used** | ||
| 914 | |||
| 915 | |=(% rowspan="2" %)**instruction**|=(% rowspan="2" %)**Parameter**|=(% colspan="24" %)**Devices**|=**Index modification**|=((( | ||
| 916 | **Pulse** | ||
| 917 | |||
| 918 | **extension** | ||
| 919 | ))) | ||
| 920 | |**X**|**Y**|**M**|**S**|**SM**|**T(bit)**|**C(bit)**|**LC(bit)**|**HSC(bit)**|**D.b**|**KnX**|**KnY**|**KnM**|**KnS**|**T**|**C**|**D**|**R**|**SD**|**LC**|**HSC**|**K**|**H**|**E**|**[D]**|**XXP** | ||
| 921 | |(% rowspan="2" %)DROR|Parameter 1| | | | | | | | | | | |●|●|●|●|●|●|●|●|●|●| | | |●|● | ||
| 922 | |Parameter 2| | | | | | | | | | |●|●|●|●|●|●|●|●|●|●|●|●|●| |●|● | ||
| 923 | |||
| 924 | **Features** | ||
| 925 | |||
| 926 | ・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. | ||
| 927 | |||
| 928 | (% style="text-align:center" %) | ||
| 929 | [[image:图片4.png]] | ||
| 930 | |||
| 931 | (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. | ||
| 932 | |||
| 933 | **Related device** | ||
| 934 | |||
| 935 | |**Device**|**Name**|**Content** | ||
| 936 | |SM151|Carry|It turns ON when the last bit shifted from the lowest is 1. | ||
| 937 | |||
| 938 | (% class="box infomessage" %) | ||
| 939 | ((( | ||
| 940 | **✎Note:** | ||
| 941 | |||
| 942 | * Do not set the number of digits (n) shifted to the left to a negative value. | ||
| 943 | * 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). | ||
| 944 | ))) | ||
| 945 | |||
| 946 | **Error code** | ||
| 947 | |||
| 948 | |=**Error code**|=**Content** | ||
| 949 | |4084H|A negative value is specified in (n). | ||
| 950 | |4085H|The output results of (d) and (n) in the read application instruction exceed the device range | ||
| 951 | |4086H|The output result of (d) in the write application instruction exceeds the device range | ||
| 952 | |||
| 953 | **~ Example** | ||
| 954 | |||
| 955 | (% style="text-align:center" %) | ||
| 956 | [[image:图片12.png]] | ||
| 957 | |||
| 958 | After the rising edge of M1 is triggered, the value 32 of the D0 device is shifted right by 3 bits to get 4. | ||
| 959 | |||
| 960 | == RCL/16-bit Cycle Shift Left with Carry == | ||
| 961 | |||
| 962 | **RCL(P)** | ||
| 963 | |||
| 964 | Shift the 16-bit data of the device specified in (d) to the left by (n) bits with the carry flag included. | ||
| 965 | |||
| 966 | -[RCL (d) (n)] | ||
| 967 | |||
| 968 | **Content, range and data type** | ||
| 969 | |||
| 970 | |=**Parameter**|=**Content**|=**Range**|=**Data type**|=**Data type (label)** | ||
| 971 | |(d)|The device start number for cycle shift left|-|Signed BIN 16 bit|ANY16 | ||
| 972 | |(n)|The number of times to cycle shift left|0 to 15|Signed BIN 16 bit|ANY16 | ||
| 973 | |||
| 974 | **Device used** | ||
| 975 | |||
| 976 | |=(% rowspan="2" %)**instruction**|=(% rowspan="2" %)**Parameter**|=(% colspan="24" %)**Devices**|=((( | ||
| 977 | **Index** | ||
| 978 | |||
| 979 | **modification** | ||
| 980 | )))|=((( | ||
| 981 | **Pulse** | ||
| 982 | |||
| 983 | **extension** | ||
| 984 | ))) | ||
| 985 | |**X**|**Y**|**M**|**S**|**SM**|**T(bit)**|**C(bit)**|**LC(bit)**|**HSC(bit)**|**D.b**|**KnX**|**KnY**|**KnM**|**KnS**|**T**|**C**|**D**|**R**|**SD**|**LC**|**HSC**|**K**|**H**|**E**|**[D]**|**XXP** | ||
| 986 | |(% rowspan="2" %)RCL|Parameter 1| | | | | | | | | | | |●|●|●|●|●|●|●|●| | | | | |●|● | ||
| 987 | |Parameter 2| | | | | | | | | | |●|●|●|●|●|●|●|●|●| | |●|●| |●|● | ||
| 988 | |||
| 989 | **Features** | ||
| 990 | |||
| 991 | 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. | ||
| 992 | |||
| 993 | (% style="text-align:center" %) | ||
| 994 | [[image:图片11.png]] | ||
| 995 | |||
| 996 | |||
| 997 | (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. | ||
| 998 | |||
| 999 | **Related device** | ||
| 1000 | |||
| 1001 | |=**Device**|=**Name**|=**Content** | ||
| 1002 | |SM151|Carry|It turns ON when the last bit shifted from the highest is 1. | ||
| 1003 | |||
| 1004 | (% class="box infomessage" %) | ||
| 1005 | ((( | ||
| 1006 | **✎Note: ** | ||
| 1007 | |||
| 1008 | * Do not set the number of digits (n) shifted to the left to a negative value. | ||
| 1009 | * 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. | ||
| 1010 | * 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). | ||
| 1011 | ))) | ||
| 1012 | |||
| 1013 | **Error code** | ||
| 1014 | |||
| 1015 | |=**Error code**|=**Content** | ||
| 1016 | |4084H|A negative value is specified in (n). | ||
| 1017 | |4085H|The output results of (d) and (n) in the read application instruction exceed the device range | ||
| 1018 | |4086H|The output result of (d) in thewrite application instruction exceeds the device range | ||
| 1019 | |||
| 1020 | **Example** | ||
| 1021 | |||
| 1022 | (% style="text-align:center" %) | ||
| 1023 | [[image:图片13.png]] | ||
| 1024 | |||
| 1025 | 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. | ||
| 1026 | |||
| 1027 | == DRCR/32-bit Cycle Shift Right with Carry == | ||
| 1028 | |||
| 1029 | **DRCR(P)** | ||
| 1030 | |||
| 1031 | Shift the 32-bit data of the device specified in (d) to the right by (n) bits with the carry flag included. | ||
| 1032 | |||
| 1033 | -[DRCR (d) (n)] | ||
| 1034 | |||
| 1035 | **Content, range and data type** | ||
| 1036 | |||
| 1037 | |=**Parameter**|=**Content**|=**Range**|=**Data type**|=**Data type (label)** | ||
| 1038 | |(d)|The device start number for cycle shift right|-|Signed BIN 32 bit|ANY32 | ||
| 1039 | |(n)|The number of times to cycle shift right|0 to 31|Signed BIN 32 bit|ANY32 | ||
| 1040 | |||
| 1041 | **Device used** | ||
| 1042 | |||
| 1043 | |=(% rowspan="2" %)**instruction**|=(% rowspan="2" %)**Parameter**|=(% colspan="24" %)**Devices**|=**Index modification**|=((( | ||
| 1044 | **Pulse** | ||
| 1045 | |||
| 1046 | **extension** | ||
| 1047 | ))) | ||
| 1048 | |**X**|**Y**|**M**|**S**|**SM**|**T(bit)**|**C(bit)**|**LC(bit)**|**HSC(bit)**|**D.b**|**KnX**|**KnY**|**KnM**|**KnS**|**T**|**C**|**D**|**R**|**SD**|**LC**|**HSC**|**K**|**H**|**E**|**[D]**|**XXP** | ||
| 1049 | |(% rowspan="2" %)DRCR|Parameter 1| | | | | | | | | | | |●|●|●|●|●|●|●|●|●|●| | | |●|● | ||
| 1050 | |Parameter 2| | | | | | | | | | |●|●|●|●|●|●|●|●|●|●|●|●|●| |●|● | ||
| 1051 | |||
| 1052 | **Features** | ||
| 1053 | |||
| 1054 | ・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. | ||
| 1055 | |||
| 1056 | (% style="text-align:center" %) | ||
| 1057 | [[image:图片1.png]] | ||
| 1058 | |||
| 1059 | (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. | ||
| 1060 | |||
| 1061 | **Related device** | ||
| 1062 | |||
| 1063 | |=**Devices**|=**Name**|=**Content** | ||
| 1064 | |SM151|Carry|It turns ON when the last bit shifted from the lowest is 1. | ||
| 1065 | |||
| 1066 | (% class="box infomessage" %) | ||
| 1067 | ((( | ||
| 1068 | **✎Note: ** | ||
| 1069 | |||
| 1070 | * Do not set the number of bits (n) to turn right to a negative value. | ||
| 1071 | * In the case of continuous execution type instructions (DROR, DRCR), the right shift will be executed every scan time (operation cycle), so be careful. | ||
| 1072 | * 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). | ||
| 1073 | ))) | ||
| 1074 | |||
| 1075 | **Error code** | ||
| 1076 | |||
| 1077 | |=**Error code**|=**Content** | ||
| 1078 | |4084H|A negative value is specified in (n). | ||
| 1079 | |4085H|The output results of (d) and (n) in the read application instruction exceed the device range | ||
| 1080 | |4086H|The output result of (d) in the write application instruction exceeds the device range | ||
| 1081 | |||
| 1082 | **Example** | ||
| 1083 | |||
| 1084 | (% style="text-align:center" %) | ||
| 1085 | [[image:图片2.png]] | ||
| 1086 | |||
| 1087 | 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. | ||
| 1088 | |||
| 1089 | == ROL/16-bit Cycle Shift Left == | ||
| 1090 | |||
| 1091 | **ROL(P)** | ||
| 1092 | |||
| 1093 | Shift the 16-bit data of the device specified in (d) to the left by (n) bits without including the carry flag. | ||
| 1094 | |||
| 1095 | -[ROL (d) (n)] | ||
| 1096 | |||
| 1097 | **Content, range and data type** | ||
| 1098 | |||
| 1099 | |=**Parameter**|=**Content**|=**Range**|=**Data type**|=**Data type (label)** | ||
| 1100 | |(d)|The device start number for cycle shift left|-|Signed BIN 16 bit|ANY16 | ||
| 1101 | |(n)|The number of times to cycle shift left|0 to 15|Signed BIN 16 bit|ANY16 | ||
| 1102 | |||
| 1103 | **Device used** | ||
| 1104 | |||
| 1105 | |=(% rowspan="2" %)**instruction**|=(% rowspan="2" %)**Parameter**|=(% colspan="24" %)**Devices**|=**Index modification**|=((( | ||
| 1106 | **Pulse** | ||
| 1107 | |||
| 1108 | **extension** | ||
| 1109 | ))) | ||
| 1110 | |**X**|**Y**|**M**|**S**|**SM**|**T(bit)**|**C(bit)**|**LC(bit)**|**HSC(bit)**|**D.b**|**KnX**|**KnY**|**KnM**|**KnS**|**T**|**C**|**D**|**R**|**SD**|**LC**|**HSC**|**K**|**H**|**E**|**[D]**|**XXP** | ||
| 1111 | |(% rowspan="2" %)ROL|Parameter 1| | | | | | | | | | | |●|●|●|●|●|●|●|●| | | | | |●|● | ||
| 1112 | |Parameter 2| | | | | | | | | | |●|●|●|●|●|●|●|●|●| | |●|●| |●|● | ||
| 1113 | |||
| 1114 | **Features** | ||
| 1115 | |||
| 1116 | ・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. | ||
| 1117 | |||
| 1118 | (% style="text-align:center" %) | ||
| 1119 | [[image:图片3.png]] | ||
| 1120 | |||
| 1121 | (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. | ||
| 1122 | |||
| 1123 | **Related device** | ||
| 1124 | |||
| 1125 | |=**Device**|=**Name**|=**Content** | ||
| 1126 | |SM151|Carry|It turns ON when the last bit shifted from the highest is 1. | ||
| 1127 | |||
| 1128 | (% class="box infomessage" %) | ||
| 1129 | ((( | ||
| 1130 | **✎Note: ** | ||
| 1131 | |||
| 1132 | 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). | ||
| 1133 | ))) | ||
| 1134 | |||
| 1135 | **Error code** | ||
| 1136 | |||
| 1137 | |=**Error code**|=**Content** | ||
| 1138 | |4084H|A negative value is specified in (n). | ||
| 1139 | |4085H|The output results of (d) and (n) in the read application instruction exceed the device range | ||
| 1140 | |4086H|The output result of (d) in the write application instruction exceeds the device range | ||
| 1141 | |||
| 1142 | **Example** | ||
| 1143 | |||
| 1144 | (% style="text-align:center" %) | ||
| 1145 | [[image:图片4.png]] | ||
| 1146 | |||
| 1147 | Shift 1 in the D0 device to the left by 3 bits to get 8. | ||
| 1148 | |||
| 1149 | == DROL/32-bit Cycle Shift Left == | ||
| 1150 | |||
| 1151 | [[image:file:///C:\Users\ANNAXU~~1\AppData\Local\Temp\ksohtml1960\wps1.png]][[image:file:///C:\Users\ANNAXU~~1\AppData\Local\Temp\ksohtml1960\wps2.png]]**DROL(P)** | ||
| 1152 | |||
| 1153 | Shift the 32-bit data of the device specified in (d) to the left by (n) bits without including the carry flag. | ||
| 1154 | |||
| 1155 | -[DROL (d) (n)] | ||
| 1156 | |||
| 1157 | **Content, range and data type** | ||
| 1158 | |||
| 1159 | |=**Parameter**|=**Content**|=**Range**|=**Data type**|=**Data type (label)** | ||
| 1160 | |(d)|The device start number for cycle shift left|-|Signed BIN 32 bit|ANY32 | ||
| 1161 | |(n)|The number of times to cycle shift left|0 to 31|Signed BIN 32 bit|ANY32 | ||
| 1162 | |||
| 1163 | **Device used** | ||
| 1164 | |||
| 1165 | |=(% rowspan="2" %)**instruction**|=(% rowspan="2" %)**Parameter**|=(% colspan="24" %)**Devices**|=((( | ||
| 1166 | **Index** | ||
| 1167 | |||
| 1168 | **modification** | ||
| 1169 | )))|=((( | ||
| 1170 | **Pulse** | ||
| 1171 | |||
| 1172 | **extension** | ||
| 1173 | ))) | ||
| 1174 | |**X**|**Y**|**M**|**S**|**SM**|**T(bit)**|**C(bit)**|**LC(bit)**|**HSC(bit)**|**D.b**|**KnX**|**KnY**|**KnM**|**KnS**|**T**|**C**|**D**|**R**|**SD**|**LC**|**HSC**|**K**|**H**|**E**|**[D]**|**XXP** | ||
| 1175 | |(% rowspan="2" %)DROL|Parameter 1| | | | | | | | | | | |●|●|●|●|●|●|●|●|●|●| | | |●|● | ||
| 1176 | |Parameter 2| | | | | | | | | | |●|●|●|●|●|●|●|●|●|●|●|●|●| |●|● | ||
| 1177 | |||
| 1178 | **Features** | ||
| 1179 | |||
| 1180 | ・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. | ||
| 1181 | |||
| 1182 | (% style="text-align:center" %) | ||
| 1183 | [[image:图片5.png]] | ||
| 1184 | |||
| 1185 | (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. | ||
| 1186 | |||
| 1187 | **Related device** | ||
| 1188 | |||
| 1189 | |=**Device**|=**Name**|=**Content** | ||
| 1190 | |SM151|Carry|It turns ON when the last bit shifted from the highest is 1. | ||
| 1191 | |||
| 1192 | (% class="box infomessage" %) | ||
| 1193 | ((( | ||
| 1194 | **✎Note: ** | ||
| 1195 | |||
| 1196 | * Do not set the number of digits (n) shifted to the left to a negative value. | ||
| 1197 | * 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). | ||
| 1198 | ))) | ||
| 1199 | |||
| 1200 | **Error code** | ||
| 1201 | |||
| 1202 | |=**Error code**|=**Content** | ||
| 1203 | |4084H|A negative value is specified in (n). | ||
| 1204 | |4085H|The output results of (d) and (n) in the read application instruction exceed the device range | ||
| 1205 | |4086H|The output result of (d) in the write application instruction exceeds the device range | ||
| 1206 | |||
| 1207 | **~ Example** | ||
| 1208 | |||
| 1209 | (% style="text-align:center" %) | ||
| 1210 | [[image:图片6.png]] | ||
| 1211 | |||
| 1212 | Shift 1 in the D0 device to the left by 3 bits to get 8. | ||
| 1213 | |||
| 1214 | == RCL/16-bit Cycle Shift Left with Carry == | ||
| 1215 | |||
| 1216 | **RCL(P)** | ||
| 1217 | |||
| 1218 | Shift the 16-bit data of the device specified in (d) to the left by (n) bits with the carry flag included. | ||
| 1219 | |||
| 1220 | -[RCL (d) (n)] | ||
| 1221 | |||
| 1222 | **Content, range and data type** | ||
| 1223 | |||
| 1224 | |=**Parameter**|=**Content**|=**Range**|=**Data type**|=**Data type (label)** | ||
| 1225 | |(d)|The device start number for cycle shift left|-|Signed BIN 16 bit|ANY16 | ||
| 1226 | |(n)|The number of times to cycle shift left|0 to 15|Signed BIN 16 bit|ANY16 | ||
| 1227 | |||
| 1228 | **Device used** | ||
| 1229 | |||
| 1230 | |=(% rowspan="2" %)**instruction**|=(% rowspan="2" %)**Parameter**|=(% colspan="24" %)**Devices**|=((( | ||
| 1231 | **Index** | ||
| 1232 | |||
| 1233 | **modification** | ||
| 1234 | )))|=((( | ||
| 1235 | **Pulse** | ||
| 1236 | |||
| 1237 | **extension** | ||
| 1238 | ))) | ||
| 1239 | |**X**|**Y**|**M**|**S**|**SM**|**T(bit)**|**C(bit)**|**LC(bit)**|**HSC(bit)**|**D.b**|**KnX**|**KnY**|**KnM**|**KnS**|**T**|**C**|**D**|**R**|**SD**|**LC**|**HSC**|**K**|**H**|**E**|**[D]**|**XXP** | ||
| 1240 | |(% rowspan="2" %)RCL|Parameter 1| | | | | | | | | | | |●|●|●|●|●|●|●|●| | | | | |●|● | ||
| 1241 | |Parameter 2| | | | | | | | | | |●|●|●|●|●|●|●|●|●| | |●|●| |●|● | ||
| 1242 | |||
| 1243 | **Features** | ||
| 1244 | |||
| 1245 | ・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. | ||
| 1246 | |||
| 1247 | (% style="text-align:center" %) | ||
| 1248 | [[image:图片7.png]] | ||
| 1249 | |||
| 1250 | (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. | ||
| 1251 | |||
| 1252 | **Related device** | ||
| 1253 | |||
| 1254 | |=**Device**|=**Name**|=**Content** | ||
| 1255 | |SM151|Carry|It turns ON when the last bit shifted from the highest is 1. | ||
| 1256 | |||
| 1257 | 1. ((( | ||
| 1258 | **✎Note: ** | ||
| 1259 | |||
| 1260 | 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). | ||
| 1261 | ))) | ||
| 1262 | |||
| 1263 | **Error code** | ||
| 1264 | |||
| 1265 | |=**Error code**|=**Content** | ||
| 1266 | |4084H|A negative value is specified in (n). | ||
| 1267 | |4085H|The output results of (d) and (n) in the read application instruction exceed the device range | ||
| 1268 | |4086H|The output result of (d) in the write application instruction exceeds the device range | ||
| 1269 | |||
| 1270 | **Example** | ||
| 1271 | |||
| 1272 | (% style="text-align:center" %) | ||
| 1273 | [[image:图片8.png]] | ||
| 1274 | |||
| 1275 | After the rising edge of M0 is triggered, the carry flag SM151 turns ON, and D0 is assigned the value 1. | ||
| 1276 | |||
| 1277 | == DRCL/32-bit Cycle Shift Left with Carry == | ||
| 1278 | |||
| 1279 | **DRCL(P)** | ||
| 1280 | |||
| 1281 | Move the 32-bit data of the device specified in (d) to the left by (n) bits with the carry flag included. | ||
| 1282 | |||
| 1283 | -[DRCL (d) (n)] | ||
| 1284 | |||
| 1285 | **Content, range and data type** | ||
| 1286 | |||
| 1287 | |=**Parameter**|=**Content**|=**Range**|=**Data type**|=**Data type (label)** | ||
| 1288 | |(d)|The device start number for cycle shift left|-|Signed BIN 32 bit|ANY32 | ||
| 1289 | |(n)|The number of times to cycle shift left|0 to 31|Signed BIN 32 bit|ANY32 | ||
| 1290 | |||
| 1291 | **Device used** | ||
| 1292 | |||
| 1293 | |=(% rowspan="2" %)**instruction**|=(% rowspan="2" %)**Parameter**|=(% colspan="24" %)**Devices**|=((( | ||
| 1294 | **Index** | ||
| 1295 | |||
| 1296 | **modification** | ||
| 1297 | )))|=((( | ||
| 1298 | **Pulse** | ||
| 1299 | |||
| 1300 | **extension** | ||
| 1301 | ))) | ||
| 1302 | |**X**|**Y**|**M**|**S**|**SM**|**T(bit)**|**C(bit)**|**LC(bit)**|**HSC(bit)**|**D.b**|**KnX**|**KnY**|**KnM**|**KnS**|**T**|**C**|**D**|**R**|**SD**|**LC**|**HSC**|**K**|**H**|**E**|**[D]**|**XXP** | ||
| 1303 | |(% rowspan="2" %)DRCL|Parameter 1| | | | | | | | | | | |●|●|●|●|●|●|●|●|●|●| | | |●|● | ||
| 1304 | |Parameter 2| | | | | | | | | | |●|●|●|●|●|●|●|●|●|●|●|●|●| |●|● | ||
| 1305 | |||
| 1306 | **Features** | ||
| 1307 | |||
| 1308 | 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. | ||
| 1309 | |||
| 1310 | (% style="text-align:center" %) | ||
| 1311 | [[image:图片9.png]] | ||
| 1312 | |||
| 1313 | (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. | ||
| 1314 | |||
| 1315 | **Related device** | ||
| 1316 | |||
| 1317 | |=**Devices**|=**Name**|=**Content** | ||
| 1318 | |SM151|Carry|Turns ON when the last bit shifted from the highest is 1. | ||
| 1319 | |||
| 1320 | (% class="box infomessage" %) | ||
| 1321 | ((( | ||
| 1322 | **✎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). | ||
| 1323 | ))) | ||
| 1324 | |||
| 1325 | **Error code** | ||
| 1326 | |||
| 1327 | |=**Error code**|=**Content** | ||
| 1328 | |4084H|A negative value is specified in (n). | ||
| 1329 | |4085H|The output results of (d) and (n) in the read application instruction exceed the device range | ||
| 1330 | |4086H|The output result of (d) in the write application instruction exceeds the device range | ||
| 1331 | |||
| 1332 | (% style="text-align:center" %) | ||
| 1333 | [[image:图片11.png]] | ||
| 1334 | |||
| 1335 | 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. | ||
| 1336 | |||
| 1337 | == SFTR/n-bit Shift Right of n-bit Data == | ||
| 1338 | |||
| 1339 | [[image:file:///C:\Users\ANNAXU~~1\AppData\Local\Temp\ksohtml1960\wps3.png]]**SFTR(P)** | ||
| 1340 | |||
| 1341 | Shift (n2) the data of the start (n1) bits of the device specified in (d) to the right. | ||
| 1342 | |||
| 1343 | -[SFTR (s) (d) (n1) (n2)] | ||
| 1344 | |||
| 1345 | **Content, range and data type** | ||
| 1346 | |||
| 1347 | |=**Parameter**|=**Content**|=**Range**|=**Data type**|=**Data type (label)** | ||
| 1348 | |(s)|The start number of the device storing the shifted data after shifting|-|Bit|ANY_BOOL | ||
| 1349 | |(d)|The shifted device start number |-|Bit|ANY_BOOL | ||
| 1350 | |(n1)|The length of shifted data|0 to 32767|Signed BIN 16 bit|ANY16 | ||
| 1351 | |(n2)|Number of shifts|0 to 32767|Signed BIN 16 bit|ANY16 | ||
| 1352 | |||
| 1353 | **Device used** | ||
| 1354 | |||
| 1355 | |=(% rowspan="2" %)**instruction**|=(% rowspan="2" %)**Parameter**|=(% colspan="24" %)**Devices**|=((( | ||
| 1356 | **Index** | ||
| 1357 | |||
| 1358 | **modification** | ||
| 1359 | )))|=((( | ||
| 1360 | **Pulse** | ||
| 1361 | |||
| 1362 | **extension** | ||
| 1363 | ))) | ||
| 1364 | |**X**|**Y**|**M**|**S**|**SM**|**T(bit)**|**C(bit)**|**LC(bit)**|**HSC(bit)**|**D.b**|**KnX**|**KnY**|**KnM**|**KnS**|**T**|**C**|**D**|**R**|**SD**|**LC**|**HSC**|**K**|**H**|**E**|**[D]**|**XXP** | ||
| 1365 | |(% rowspan="3" %)SFTR|Parameter 1|●|●|●|●|●| | | | |●| | | | | | | | | | | | | | |●|● | ||
| 1366 | |Parameter 2| |●|●|●|●| | | | |●| | | | | | | | | | | | | | |●|● | ||
| 1367 | |Parameter 3| | | | | | | | | | |●|●|●|●|●|●|●|●|●| | |●|●| |●|● | ||
| 1368 | | |Parameter 4| | | | | | | | | | |●|●|●|●|●|●|●|●|●| | |●|●| |●|● | ||
| 1369 | |||
| 1370 | **Features** | ||
| 1371 | |||
| 1372 | 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). | ||
| 1373 | |||
| 1374 | When K0 is specified in (s), the bit of the (d) + (n1 to n2) starting point (n2) after the shift is set to 0. | ||
| 1375 | |||
| 1376 | When K1 is specified in (s), the bit of the (d) + (n1 to n2) starting point (n2) after the shift is set to 1. | ||
| 1377 | |||
| 1378 | (% style="text-align:center" %) | ||
| 1379 | [[image:图片13.png]] | ||
| 1380 | |||
| 1381 | (1): When (s)=K0, it becomes 0. | ||
| 1382 | |||
| 1383 | **Error code** | ||
| 1384 | |||
| 1385 | |=**Error code**|=**Content** | ||
| 1386 | |(% rowspan="2" %)4084H|When the value specified in (n1) and (n2) exceeds the range of 0 to 32767 | ||
| 1387 | |When the value specified in (n1) and (n2) is (n1)<(n2) | ||
| 1388 | |4085H|When the device specified in read application instructions (s), (d), (n1) and (n2) exceeds the corresponding device range | ||
| 1389 | |4086H|When the device specified in the write application instruction (d) exceeds the corresponding device range | ||
| 1390 | |||
| 1391 | **Example** | ||
| 1392 | |||
| 1393 | 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. | ||
| 1394 | |||
| 1395 | (% style="text-align:center" %) | ||
| 1396 | [[image:图片14.png]] | ||
| 1397 | |||
| 1398 | (% style="text-align:center" %) | ||
| 1399 | [[image:图片15.png]] | ||
| 1400 | |||
| 1401 | == SFTL/n-bit Shift Left of n-bit Data == | ||
| 1402 | |||
| 1403 | **SFTL(P)** | ||
| 1404 | |||
| 1405 | Shift the start (n1) bit data of the device specified in (d) to the left by (n2) bits. | ||
| 1406 | |||
| 1407 | -[SFTL (s) (d) (n1) (n2)] | ||
| 1408 | |||
| 1409 | **Content, range and data type** | ||
| 1410 | |||
| 1411 | |=**Parameter**|=**Content**|=**Range**|=**Data type**|=**Data type (label)** | ||
| 1412 | |(s)|The start number of the device storing shifted data after shifting|-|Bit|ANY_BOOL | ||
| 1413 | |(d)|The shifted device start number|-|Bit|ANY_BOOL | ||
| 1414 | |(n1)|The length of shifted data|0 to 32767|Signed BIN 16 bit|ANY16 | ||
| 1415 | |(n2)|Number of shifts|0 to 32767|Signed BIN 16 bit|ANY16 | ||
| 1416 | |||
| 1417 | **Device used** | ||
| 1418 | |||
| 1419 | |=(% rowspan="2" %)**instruction**|=(% rowspan="2" %)**Parameter**|=(% colspan="24" %)**Devices**|=((( | ||
| 1420 | **Index** | ||
| 1421 | |||
| 1422 | **modification** | ||
| 1423 | )))|=((( | ||
| 1424 | **Pulse** | ||
| 1425 | |||
| 1426 | **extension** | ||
| 1427 | ))) | ||
| 1428 | |**X**|**Y**|**M**|**S**|**SM**|**T(bit)**|**C(bit)**|**LC(bit)**|**HSC(bit)**|**D.b**|**KnX**|**KnY**|**KnM**|**KnS**|**T**|**C**|**D**|**R**|**SD**|**LC**|**HSC**|**K**|**H**|**E**|**[D]**|**XXP** | ||
| 1429 | |(% rowspan="3" %)SFTL|Parameter 1|●|●|●|●|●| | | | |●| | | | | | | | | | | | | | |●|● | ||
| 1430 | |Parameter 2| |●|●|●|●| | | | |●| | | | | | | | | | | | | | |●|● | ||
| 1431 | |Parameter 3| | | | | | | | | | |●|●|●|●|●|●|●|●|●| | |●|●| |●|● | ||
| 1432 | | |Parameter 4| | | | | | | | | | |●|●|●|●|●|●|●|●|●| | |●|●| |●|● | ||
| 1433 | |||
| 1434 | **Features** | ||
| 1435 | |||
| 1436 | 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). | ||
| 1437 | |||
| 1438 | When K0 is specified in (s), the bit of the (d) + (n1 to n2) starting point (n2) after the shift is set to 0. | ||
| 1439 | |||
| 1440 | When K1 is specified in (s), the bit of the (d) + (n1 to n2) starting point (n2) after the shift is set to 1. | ||
| 1441 | |||
| 1442 | (% style="text-align:center" %) | ||
| 1443 | [[image:图片16.png]] | ||
| 1444 | |||
| 1445 | (1): When (s)=K0, it becomes 0. | ||
| 1446 | |||
| 1447 | **Error code** | ||
| 1448 | |||
| 1449 | |**Error code**|**Content** | ||
| 1450 | |(% rowspan="2" %)4084H|When the value specified in (n1) and (n2) exceeds the range of 0 to 32767 | ||
| 1451 | |When the value specified in (n1) and (n2) is (n1)<(n2) | ||
| 1452 | |4085H|When the device specified in read application instructions (s), (d), (n1) and (n2) exceeds the corresponding device range | ||
| 1453 | |4086H|When the device specified in the write application instruction (d) exceeds the corresponding device range | ||
| 1454 | |||
| 1455 | **Example** | ||
| 1456 | |||
| 1457 | (% style="text-align:center" %) | ||
| 1458 | [[image:图片17.png]] | ||
| 1459 | |||
| 1460 | |||
| 1461 | (% style="text-align:center" %) | ||
| 1462 | [[image:图片18.png]] | ||
| 1463 | |||
| 1464 | = WSFR/n-word Shift Right of n-word Data = | ||
| 1465 | |||
| 1466 | **WSFR(P)** | ||
| 1467 | |||
| 1468 | Shift (n2) the data of the start (n1) bits of the device specified in (d) to the right. | ||
| 1469 | |||
| 1470 | -[WSFR (s) (d) (n1) (n2)] | ||
| 1471 | |||
| 1472 | **Content, range and data type** | ||
| 1473 | |||
| 1474 | |=**Parameter**|=**Content**|=**Range**|=**Data type**|=**Data type (label)** | ||
| 1475 | |(s)|The start number of the device storing shifted data after shifting|-|word|ANY_BOOL | ||
| 1476 | |(d)|The shifted device start number|-|word|ANY_BOOL | ||
| 1477 | |(n1)|The length of shifted data|0 to 32767|Signed BIN 16 bit|ANY16 | ||
| 1478 | |(n2)|Number of shifts|0 to 32767|Signed BIN 16 bit|ANY16 | ||
| 1479 | |||
| 1480 | **Device used** | ||
| 1481 | |||
| 1482 | |=(% rowspan="2" %)**instruction**|=(% rowspan="2" %)**Parameter**|=(% colspan="24" %)**Devices**|=((( | ||
| 1483 | **Index** | ||
| 1484 | |||
| 1485 | **modification** | ||
| 1486 | )))|=((( | ||
| 1487 | **Pulse** | ||
| 1488 | |||
| 1489 | **extension** | ||
| 1490 | ))) | ||
| 1491 | |**X**|**Y**|**M**|**S**|**SM**|**T(bit)**|**C(bit)**|**LC(bit)**|**HSC(bit)**|**D.b**|**KnX**|**KnY**|**KnM**|**KnS**|**T**|**C**|**D**|**R**|**SD**|**LC**|**HSC**|**K**|**H**|**E**|**[D]**|**XXP** | ||
| 1492 | |(% rowspan="3" %)SFTR|Parameter 1| | | | | | | | | | |●|●|●|●|●|●|●|●|●| | |●|●| |●|● | ||
| 1493 | |Parameter 2| | | | | | | | | | | |●|●|●|●|●|●|●|●| | | | | |●|● | ||
| 1494 | |Parameter 3| | | | | | | | | | |●|●|●|●|●|●|●|●|●| | |●|●| |●|● | ||
| 1495 | | |Parameter 4| | | | | | | | | | |●|●|●|●|●|●|●|●|●| | |●|●| |●|● | ||
| 1496 | |||
| 1497 | **Features** | ||
| 1498 | |||
| 1499 | 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). | ||
| 1500 | |||
| 1501 | When K is specified in (s), the device at (d) + (n1 to n2) starting (n2) point after shifting is set to the specified value. | ||
| 1502 | |||
| 1503 | If the value specified in (n1) or (n2) is 0, it will be no processing. | ||
| 1504 | |||
| 1505 | (% style="text-align:center" %) | ||
| 1506 | [[image:图片19.png]] | ||
| 1507 | |||
| 1508 | **Error code** | ||
| 1509 | |||
| 1510 | |=**Error code**|=**Content** | ||
| 1511 | |(% rowspan="3" %)4084H|When the value specified in (n1) and (n2) exceeds the range of 0 to 32767 | ||
| 1512 | |When the value specified in (n1) and (n2) is (n1)<(n2) | ||
| 1513 | |When (s) and (d) both specify KnM, KnX, and KnS, the value of n varies. | ||
| 1514 | |4085H|When the device specified in read application instructions (s), (d), (n1) and (n2) exceeds the corresponding device range | ||
| 1515 | |4086H|When the device specified in the write application instruction (d) exceeds the corresponding device range | ||
| 1516 | |||
| 1517 | **Example** | ||
| 1518 | |||
| 1519 | (% style="text-align:center" %) | ||
| 1520 | [[image:图片20.png]] | ||
| 1521 | |||
| 1522 | (% style="text-align:center" %) | ||
| 1523 | [[image:图片21.png]] | ||
| 1524 | |||
| 1525 | (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. | ||
| 1526 | |||
| 1527 | == WSFL/n-word Shift Left of n-word Data == | ||
| 1528 | |||
| 1529 | **WSFL(P)** | ||
| 1530 | |||
| 1531 | Shift the start (n1) bit data of the device specified in (d) to the left by (n2) bits. | ||
| 1532 | |||
| 1533 | -[WSFL (s) (d) (n1) (n2)] | ||
| 1534 | |||
| 1535 | **Content, range and data type** | ||
| 1536 | |||
| 1537 | |=**Parameter**|=**Content**|=**Range**|=**Data type**|=**Data type (label)** | ||
| 1538 | |(s)|The start number of the device storing shifted data after shifting|-|Word|ANY_BOOL | ||
| 1539 | |(d)|The shifted device start number|-|Word|ANY_BOOL | ||
| 1540 | |(n1)|The length of shifted data|0 to 32767|Signed BIN 16 bit|ANY16 | ||
| 1541 | |(n2)|Number of shifts|0 to 32767|Signed BIN 16 bit|ANY16 | ||
| 1542 | |||
| 1543 | **Device used** | ||
| 1544 | |||
| 1545 | |=(% rowspan="2" %)**instruction**|=(% rowspan="2" %)**Parameter**|=(% colspan="24" %)**Devices**|=((( | ||
| 1546 | **Index** | ||
| 1547 | |||
| 1548 | **modification** | ||
| 1549 | )))|=((( | ||
| 1550 | **Pulse** | ||
| 1551 | |||
| 1552 | **extension** | ||
| 1553 | ))) | ||
| 1554 | |**X**|**Y**|**M**|**S**|**SM**|**T(bit)**|**C(bit)**|**LC(bit)**|**HSC(bit)**|**D.b**|**KnX**|**KnY**|**KnM**|**KnS**|**T**|**C**|**D**|**R**|**SD**|**LC**|**HSC**|**K**|**H**|**E**|**[D]**|**XXP** | ||
| 1555 | |(% rowspan="3" %)SFTR|Parameter 1| | | | | | | | | | |●|●|●|●|●|●|●|●|●| | |●|●| |●|● | ||
| 1556 | |Parameter 2| | | | | | | | | | | |●|●|●|●|●|●|●|●| | | | | |●|● | ||
| 1557 | |Parameter 3| | | | | | | | | | |●|●|●|●|●|●|●|●|●| | |●|●| |●|● | ||
| 1558 | | |Parameter 4| | | | | | | | | | |●|●|●|●|●|●|●|●|●| | |●|●| |●|● | ||
| 1559 | |||
| 1560 | **Features** | ||
| 1561 | |||
| 1562 | 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). | ||
| 1563 | |||
| 1564 | When K is specified in (s), the device at (d) + (n1 to n2) starting (n2) point after shifting is set to the specified value. | ||
| 1565 | |||
| 1566 | If the value specified in (n1) or (n2) is 0, it will be no processing. | ||
| 1567 | |||
| 1568 | (% style="text-align:center" %) | ||
| 1569 | [[image:图片22.png]] | ||
| 1570 | |||
| 1571 | **Error Code** | ||
| 1572 | |||
| 1573 | |=**Error code**|=**Content** | ||
| 1574 | |(% rowspan="3" %)4084H|When the value specified in (n1) and (n2) exceeds the range of 0 to 32767 | ||
| 1575 | |When the value specified in (n1) and (n2) is (n1)<(n2) | ||
| 1576 | |When (s) and (d) both specify KnM, KnX, and KnS, the value of n varies. | ||
| 1577 | |4085H|When the device specified in read application instructions (s), (d), (n1) and (n2) exceeds the corresponding device range | ||
| 1578 | |4086H|When the device specified in the write application instruction (d) exceeds the corresponding device range | ||
| 1579 | |||
| 1580 | **Example** | ||
| 1581 | |||
| 1582 | (% style="text-align:center" %) | ||
| 1583 | [[image:图片23.png]] | ||
| 1584 | |||
| 1585 | (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. | ||
| 1586 | |||
| 1587 | == SFR/n-bit Shift Right of 16-bit Data == | ||
| 1588 | |||
| 1589 | **SFR(P)** | ||
| 1590 | |||
| 1591 | Shift the 16-bit data of the device specified in (d) right by (n) bits. | ||
| 1592 | |||
| 1593 | -[SFR (d) (n)] | ||
| 1594 | |||
| 1595 | **Content, range and data type** | ||
| 1596 | |||
| 1597 | |=**Parameter**|=**Content**|=**Range**|=**Data type**|=**Data type (label)** | ||
| 1598 | |=(d)|The start number of the device storing the shifted data|-|Signed BIN 16 bit|ANY16 | ||
| 1599 | |=(n)|Number of shifts|0-15|Signed BIN 16 bit|ANY16 | ||
| 1600 | |||
| 1601 | **Device used** | ||
| 1602 | |||
| 1603 | |=(% rowspan="2" %)**instruction**|=(% rowspan="2" %)**Parameter**|=(% colspan="24" %)**Devices**|=((( | ||
| 1604 | **Index** | ||
| 1605 | |||
| 1606 | **modification** | ||
| 1607 | )))|=((( | ||
| 1608 | **Pulse** | ||
| 1609 | |||
| 1610 | **extension** | ||
| 1611 | ))) | ||
| 1612 | |**X**|**Y**|**M**|**S**|**SM**|**T(bit)**|**C(bit)**|**LC(bit)**|**HSC(bit)**|**D.b**|**KnX**|**KnY**|**KnM**|**KnS**|**T**|**C**|**D**|**R**|**SD**|**LC**|**HSC**|**K**|**H**|**E**|**[D]**|**XXP** | ||
| 1613 | |(% rowspan="2" %)SFR|Parameter 1| | | | | | | | | | | |●|●|●|●|●|●|●|●| | | | | |●|● | ||
| 1614 | |Parameter 2| | | | | | | | | | |●|●|●|●|●|●|●|●|●| | |●|●| |●|● | ||
| 1615 | |||
| 1616 | **Features** | ||
| 1617 | |||
| 1618 | (% style="text-align:center" %) | ||
| 1619 | [[image:图片24.png]] | ||
| 1620 | |||
| 1621 | |||
| 1622 | |||
| 1623 | (% style="text-align:center" %) | ||
| 1624 | [[image:图片25.png]] | ||
| 1625 | |||
| 1626 | When (N)=6 | ||
| 1627 | |||
| 1628 | 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. | ||
| 1629 | |||
| 1630 | When (N)=6 | ||
| 1631 | |||
| 1632 | When a bit device is specified in (d), the device range specified in the digit specification is shifted to the right. | ||
| 1633 | |||
| 1634 | (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. | ||
| 1635 | |||
| 1636 | **Related device ** | ||
| 1637 | |||
| 1638 | |=**Device**|=**Name**|=**Content** | ||
| 1639 | |=SM151|Carry|Set to ON/OFF according to the state of n-1 bit (1/0) | ||
| 1640 | |||
| 1641 | **Error code** | ||
| 1642 | |||
| 1643 | |=**Error code**|=**Content** | ||
| 1644 | |=4084H|A negative value is specified in (n). | ||
| 1645 | |=4085H|The output results of (d) and (n) in the read application instruction exceed the device range | ||
| 1646 | |=4086H|The output result of (d) in the write application instruction exceeds the device range | ||
| 1647 | |||
| 1648 | **Example** | ||
| 1649 | |||
| 1650 | (% style="text-align:center" %) | ||
| 1651 | [[image:图片26.png]] | ||
| 1652 | |||
| 1653 | (% style="text-align:center" %) | ||
| 1654 | [[image:图片27.png]] | ||
| 1655 | |||
| 1656 | When M1 is ON, the contents of Y10 to Y23 are shifted to the right by the number of digits specified in D0. | ||
| 1657 | |||
| 1658 | == DSFR/n word Data Shift Right by 1 Word == | ||
| 1659 | |||
| 1660 | **DSFR(P)** | ||
| 1661 | |||
| 1662 | Shift the data at the start (n) point of the device specified in (d) to the right by 1 word. | ||
| 1663 | |||
| 1664 | -[DSFR (d) (n)] | ||
| 1665 | |||
| 1666 | **Content, range and data type** | ||
| 1667 | |||
| 1668 | |=**Parameter**|=**Content**|=**Range**|=**Data type**|=**Data type (label)** | ||
| 1669 | |=(d)|The start number of the device storing the shifted data|-|Signed BIN 16 bit|- | ||
| 1670 | |=(n)|Number of shifts|0 to 32767|Signed BIN 16 bit|INT | ||
| 1671 | |||
| 1672 | **Device used** | ||
| 1673 | |||
| 1674 | |=(% rowspan="2" %)**instruction**|=(% rowspan="2" %)**Parameter**|=(% colspan="24" %)**Devices**|=((( | ||
| 1675 | **Index** | ||
| 1676 | |||
| 1677 | **modification** | ||
| 1678 | )))|=((( | ||
| 1679 | **Pulse** | ||
| 1680 | |||
| 1681 | **extension** | ||
| 1682 | ))) | ||
| 1683 | |**X**|**Y**|**M**|**S**|**SM**|**T(bit)**|**C(bit)**|**LC(bit)**|**HSC(bit)**|**D.b**|**KnX**|**KnY**|**KnM**|**KnS**|**T**|**C**|**D**|**R**|**SD**|**LC**|**HSC**|**K**|**H**|**E**|**[D]**|**XXP** | ||
| 1684 | |(% rowspan="2" %)DSFR|Parameter 1| | | | | | | | | | | |●|●|●|●|●|●|●|●| | | | | |●|● | ||
| 1685 | |Parameter 2| | | | | | | | | | |●|●|●|●|●|●|●|●|●| | |●|●| |●|● | ||
| 1686 | |||
| 1687 | **Features** | ||
| 1688 | |||
| 1689 | • Shift the data at the start (n) point of the device specified in (d) by 1 word to the right. | ||
| 1690 | |||
| 1691 | (% style="text-align:center" %) | ||
| 1692 | [[image:图片28.png]] | ||
| 1693 | |||
| 1694 | • The device specified in (d)+(n-1) will become 0. | ||
| 1695 | |||
| 1696 | (% class="box infomessage" %) | ||
| 1697 | ((( | ||
| 1698 | **✎Note: ** | ||
| 1699 | 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. | ||
| 1700 | ))) | ||
| 1701 | |||
| 1702 | **Error code** | ||
| 1703 | |||
| 1704 | |=**Error code**|=**Content** | ||
| 1705 | |=4084H|When the value specified in (n) exceeds the range of 0 to 32767 | ||
| 1706 | |=4085H|The output results of (d) and (n) in the read application instruction exceed the device range | ||
| 1707 | |=4086H|The output result of (d) in the write application instruction exceeds the device range | ||
| 1708 | |||
| 1709 | **Example** | ||
| 1710 | |||
| 1711 | 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). | ||
| 1712 | |||
| 1713 | (% style="text-align:center" %) | ||
| 1714 | [[image:图片29.png]] | ||
| 1715 | |||
| 1716 | Before execution: | ||
| 1717 | |||
| 1718 | (% style="text-align:center" %) | ||
| 1719 | [[image:图片30.png]] | ||
| 1720 | |||
| 1721 | After execution: | ||
| 1722 | |||
| 1723 | (% style="text-align:center" %) | ||
| 1724 | [[image:图片31.png]] | ||
| 1725 | |||
| 1726 | == SFL/n-bit Shift Left of 16-bit Data == | ||
| 1727 | |||
| 1728 | **SFL(P)** | ||
| 1729 | |||
| 1730 | Shift the 16-bit data of the device specified in (d) to the left by (n) bits. | ||
| 1731 | |||
| 1732 | -[SFL (d) (n)] | ||
| 1733 | |||
| 1734 | **Content, range and data type** | ||
| 1735 | |||
| 1736 | |=**Parameter**|=**Content**|=**Range**|=**Data type**|=**Data type (label)** | ||
| 1737 | |=(d)|The start number of the device storing the shifted data|-|Signed BIN 16 bit|ANY16 | ||
| 1738 | |=(n)|Number of shifts|0 to 15|Signed BIN 16 bit|ANY16 | ||
| 1739 | |||
| 1740 | **Device used** | ||
| 1741 | |||
| 1742 | |=(% rowspan="2" %)**instruction**|=(% rowspan="2" %)**Parameter**|=(% colspan="24" %)**Devices**|=((( | ||
| 1743 | **Index** | ||
| 1744 | |||
| 1745 | **modification** | ||
| 1746 | )))|=((( | ||
| 1747 | **Pulse** | ||
| 1748 | |||
| 1749 | **extension** | ||
| 1750 | ))) | ||
| 1751 | |**X**|**Y**|**M**|**S**|**SM**|**T(bit)**|**C(bit)**|**LC(bit)**|**HSC(bit)**|**D.b**|**KnX**|**KnY**|**KnM**|**KnS**|**T**|**C**|**D**|**R**|**SD**|**LC**|**HSC**|**K**|**H**|**E**|**[D]**|**XXP** | ||
| 1752 | |(% rowspan="2" %)SFL|Parameter 1| | | | | | | | | | | |●|●|●|●|●|●|●|●| | | | | |●|● | ||
| 1753 | |Parameter 2| | | | | | | | | | |●|●|●|●|●|●|●|●|●| | |●|●| |●|● | ||
| 1754 | |||
| 1755 | **Features** | ||
| 1756 | |||
| 1757 | 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. | ||
| 1758 | |||
| 1759 | (% style="text-align:center" %) | ||
| 1760 | [[image:图片32.png]] | ||
| 1761 | |||
| 1762 | When (n)=8, it is as follows. | ||
| 1763 | |||
| 1764 | When a bit device is specified in (d), the left shift is performed in the device range specified in the digit specification. | ||
| 1765 | |||
| 1766 | (% style="text-align:center" %) | ||
| 1767 | [[image:图片33.png]] | ||
| 1768 | |||
| 1769 | When (n)=3, it is as follows. | ||
| 1770 | |||
| 1771 | (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. | ||
| 1772 | |||
| 1773 | **Related device ** | ||
| 1774 | |||
| 1775 | |=**Device**|=**Name**|=**Content** | ||
| 1776 | |SM151|Carry|Turn ON/OFF according to the state of n+1 bit (1/0) | ||
| 1777 | |||
| 1778 | **Error code** | ||
| 1779 | |||
| 1780 | |=**Error code**|=**Content** | ||
| 1781 | |=4084H|A negative value is specified in (n). | ||
| 1782 | |=4085H|The output results of (d) and (n) in the read application instruction exceed the device range | ||
| 1783 | |=4086H|The output result of (d) in the write application instruction exceeds the device range | ||
| 1784 | |||
| 1785 | **Example: **When M1 is ON, the contents of Y10 to Y17 are shifted to the left by the number of digits specified in D0. | ||
| 1786 | |||
| 1787 | (% style="text-align:center" %) | ||
| 1788 | [[image:图片34.png]] | ||
| 1789 | |||
| 1790 | (% style="text-align:center" %) | ||
| 1791 | [[image:图片35.png]] | ||
| 1792 | |||
| 1793 | == DSFL/one Word Shift Left of n Word Data == | ||
| 1794 | |||
| 1795 | **DSFL(P)** | ||
| 1796 | |||
| 1797 | Move the data at the beginning (n) point of the device specified in (d) by 1 word to the left. | ||
| 1798 | |||
| 1799 | -[DSFL (d) (n)] | ||
| 1800 | |||
| 1801 | **Content, range and data type** | ||
| 1802 | |||
| 1803 | |=**Parameter**|=**Content**|=**Range**|=**Data type**|=**Data type (label)** | ||
| 1804 | |=(d)|The start number of the device storing the shifted data|-|Signed BIN 16 bit|- | ||
| 1805 | |=(n)|Number of shifts|0 to 32,767|Signed BIN 16 bit|INT | ||
| 1806 | |||
| 1807 | **Device used** | ||
| 1808 | |||
| 1809 | |=(% rowspan="2" %)**instruction**|=(% rowspan="2" %)**Parameter**|=(% colspan="24" %)**Devices**|=((( | ||
| 1810 | **Index** | ||
| 1811 | |||
| 1812 | **modification** | ||
| 1813 | )))|=((( | ||
| 1814 | **Pulse** | ||
| 1815 | |||
| 1816 | **extension** | ||
| 1817 | ))) | ||
| 1818 | |**X**|**Y**|**M**|**S**|**SM**|**T(bit)**|**C(bit)**|**LC(bit)**|**HSC(bit)**|**D.b**|**KnX**|**KnY**|**KnM**|**KnS**|**T**|**C**|**D**|**R**|**SD**|**LC**|**HSC**|**K**|**H**|**E**|**[D]**|**XXP** | ||
| 1819 | |(% rowspan="2" %)DSFL|Parameter 1| | | | | | | | | | | |●|●|●|●|●|●|●|●| | | | | |●|● | ||
| 1820 | |Parameter 2| | | | | | | | | | |●|●|●|●|●|●|●|●|●| | |●|●| |●|● | ||
| 1821 | |||
| 1822 | **Features** | ||
| 1823 | |||
| 1824 | Shift the data at the start (n) point of the device specified in (d) to the left by 1 word. | ||
| 1825 | |||
| 1826 | The device specified in (d) will become 0. | ||
| 1827 | |||
| 1828 | (% class="box infomessage" %) | ||
| 1829 | ((( | ||
| 1830 | **✎Note: ** | ||
| 1831 | 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. | ||
| 1832 | ))) | ||
| 1833 | |||
| 1834 | **Error code** | ||
| 1835 | |||
| 1836 | |**Error code**|**Content** | ||
| 1837 | |4084H|When the value specified in (n) exceeds the range of 0 to 32,767 | ||
| 1838 | |4085H|The output results of (d) and (n) in the read application instruction exceed the device range | ||
| 1839 | |4086H|The output result of (d) in the write application instruction exceeds the device range | ||
| 1840 | |||
| 1841 | **Example** | ||
| 1842 | |||
| 1843 | 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). | ||
| 1844 | |||
| 1845 | (% style="text-align:center" %) | ||
| 1846 | [[image:图片37.png]] | ||
| 1847 | |||
| 1848 | Before execution: | ||
| 1849 | |||
| 1850 | (% style="text-align:center" %) | ||
| 1851 | [[image:图片38.png]] | ||
| 1852 | |||
| 1853 | After execution: | ||
| 1854 | |||
| 1855 | (% style="text-align:center" %) | ||
| 1856 | [[image:图片39.png]] | ||
| 1857 | |||
| 1858 | = Arithmetic Operation instructions = | ||
| 1859 | |||
| 1860 | == **ADD/16-bit Addition Operation** == | ||
| 1861 | |||
| 1862 | |||
| 1863 | [[image:file:///C:\Users\ANNAXU~~1\AppData\Local\Temp\ksohtml1960\wps4.png]]**ADD(P)** | ||
| 1864 | |||
| 1865 | 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). | ||
| 1866 | |||
| 1867 | -[ADD (s1) (s2) (d)] | ||
| 1868 | |||
| 1869 | **Content, range and data type** | ||
| 1870 | |||
| 1871 | |=**Parameter**|=**Content**|=**Range**|=**Data type**|=**Data type (label)** | ||
| 1872 | |=(s1)|Addition operation data or the device storing the addition data|-32768 to 32767|Signed BIN16|ANY16_S | ||
| 1873 | |=(s2)|Addition operation data or the device storing the addition data|-32768 to 32767|Signed BIN16|ANY16_S | ||
| 1874 | |=(d)|Device for storing operation results| |Signed BIN16|ANY16_S | ||
| 1875 | |||
| 1876 | **Device used** | ||
| 1877 | |||
| 1878 | |=(% rowspan="2" %)**instruction**|=(% rowspan="2" %)**Parameter**|=(% colspan="24" %)**Devices**|=((( | ||
| 1879 | **Index** | ||
| 1880 | |||
| 1881 | **modification** | ||
| 1882 | )))|=((( | ||
| 1883 | **Pulse** | ||
| 1884 | |||
| 1885 | **extension** | ||
| 1886 | ))) | ||
| 1887 | |=**X**|**Y**|**M**|**S**|**SM**|**T(bit)**|**C(bit)**|**LC(bit)**|**HSC(bit)**|**D.b**|**KnX**|**KnY**|**KnM**|**KnS**|**T**|**C**|**D**|**R**|**SD**|**LC**|**HSC**|**K**|**H**|**E**|**[D]**|**XXP** | ||
| 1888 | |=(% rowspan="3" %)ADD|Parameter 1| | | | | | | | | | |●|●|●|●|●|●|●|●|●| | |●|●| |●|● | ||
| 1889 | |=Parameter 2| | | | | | | | | | |●|●|●|●|●|●|●|●|●| | |●|●| |●|● | ||
| 1890 | |=Parameter 3| | | | | | | | | | | |●|●|●|●|●|●|●|●| | | | | |●|● | ||
| 1891 | |||
| 1892 | **Features** | ||
| 1893 | |||
| 1894 | 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). | ||
| 1895 | |||
| 1896 | (% style="text-align:center" %) | ||
| 1897 | [[image:图片40.png]] | ||
| 1898 | |||
| 1899 | **Related device ** | ||
| 1900 | |||
| 1901 | |=**Devices**|=**Name**|=**Content** | ||
| 1902 | |SM151|Carry|When the operation result exceeds 32,767, the carry flag will be (ON). | ||
| 1903 | |SM152|Borrow|When the operation result is less than -32,768, the borrow flag will be (ON). | ||
| 1904 | |SM153|Zero point|When the operation result is 0, the zero flag will be (ON). | ||
| 1905 | |||
| 1906 | (% style="text-align:center" %) | ||
| 1907 | [[image:图片41.png]] | ||
| 1908 | |||
| 1909 | (% class="box infomessage" %) | ||
| 1910 | ((( | ||
| 1911 | **✎Note: ** | ||
| 1912 | |||
| 1913 | * When the source operand and destination operand are specified as the same device: | ||
| 1914 | |||
| 1915 | 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. | ||
| 1916 | |||
| 1917 | * The difference between the ADD instruction and the INC instruction using the +1 addition operation program: | ||
| 1918 | |||
| 1919 | 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. | ||
| 1920 | ))) | ||
| 1921 | |||
| 1922 | |||
| 1923 | |(% colspan="3" %) |**ADD/ADDP/DADD/DADDP instructions**|**INC/INCP/DINC/DINCP instructions** | ||
| 1924 | |(% colspan="3" %)**sign bit (zero, borrow, carry)**|**Action**|**No action** | ||
| 1925 | |(% rowspan="4" %)Calculation result|(% rowspan="2" %)((( | ||
| 1926 | 16-bit | ||
| 1927 | |||
| 1928 | operation result | ||
| 1929 | )))|(S) + (+1) = (d)|32767 → 0 → +1 → +2 →|32767→-32768→-32767 | ||
| 1930 | |(S) + (-1) = (d)|← -2 ← -1 ← 0 ← -32768|—— | ||
| 1931 | |(% rowspan="2" %)((( | ||
| 1932 | 1. bit | ||
| 1933 | |||
| 1934 | operation result | ||
| 1935 | )))|(S) + (+1) = (d)|2147483647 → 0 → +1 → +2 →|2147483647 → -2147483648→ -2147483647 | ||
| 1936 | |(S) + (-1) = (d)|← -2 ← -1 ← 0 ← -2147483648|—— | ||
| 1937 | |||
| 1938 | **Error code** | ||
| 1939 | |||
| 1940 | |=**Error code**|=**Content** | ||
| 1941 | |=4085H|The output results of (s1) and (s2) in the read application instruction exceed the device range | ||
| 1942 | |=4086H|The output result of (d) in the write application instruction exceeds the device range | ||
| 1943 | |||
| 1944 | **Example** | ||
| 1945 | |||
| 1946 | (% style="text-align:center" %) | ||
| 1947 | [[image:图片42.png]] | ||
| 1948 | |||
| 1949 | Add 10 to the data in (D0), and store the operation result in (D2), that is, (D0) + 10 → (D2). | ||
| 1950 | |||
| 1951 | == **DADD/32-bit Addition Operation** == | ||
| 1952 | |||
| 1953 | |||
| 1954 | [[image:file:///C:\Users\ANNAXU~~1\AppData\Local\Temp\ksohtml1960\wps5.png]]**DADD(P)** | ||
| 1955 | |||
| 1956 | 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). | ||
| 1957 | |||
| 1958 | -[DADD (s1) (s2) (d)] | ||
| 1959 | |||
| 1960 | **Content, range and data type** | ||
| 1961 | |||
| 1962 | |=**Parameter**|=**Content**|=**Range**|=**Data type**|=**Data type (label)** | ||
| 1963 | |=(s1)|Addition data or the device storing the addition data|-2147483648 to 2147483647|Signed BIN32|ANY32_S | ||
| 1964 | |=(s2)|Addition data or the device storing the addition data|-2147483648 to 2147483647|Signed BIN32|ANY32_S | ||
| 1965 | |=(d)|Device for storing operation results| |Signed BIN32|ANY32_S | ||
| 1966 | |||
| 1967 | **Device used** | ||
| 1968 | |||
| 1969 | |=(% rowspan="2" %)**instruction**|=(% rowspan="2" %)**Parameter**|=(% colspan="24" %)**Devices**|=((( | ||
| 1970 | **Index** | ||
| 1971 | |||
| 1972 | **modification** | ||
| 1973 | )))|=((( | ||
| 1974 | **Pulse** | ||
| 1975 | |||
| 1976 | **extension** | ||
| 1977 | ))) | ||
| 1978 | |**X**|**Y**|**M**|**S**|**SM**|**T(bit)**|**C(bit)**|**LC(bit)**|**HSC(bit)**|**D.b**|**KnX**|**KnY**|**KnM**|**KnS**|**T**|**C**|**D**|**R**|**SD**|**LC**|**HSC**|**K**|**H**|**E**|**[D]**|**XXP** | ||
| 1979 | |(% rowspan="3" %)DADD|Parameter 1| | | | | | | | | | |●|●|●|●|●|●|●|●|●|●|●|●|●| |●|● | ||
| 1980 | |Parameter 2| | | | | | | | | | |●|●|●|●|●|●|●|●|●|●|●|●|●| |●|● | ||
| 1981 | |Parameter 3| | | | | | | | | | | |●|●|●|●|●|●|●|●| | | | | |●|● | ||
| 1982 | |||
| 1983 | **Features** | ||
| 1984 | |||
| 1985 | 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). | ||
| 1986 | |||
| 1987 | (% style="text-align:center" %) | ||
| 1988 | [[image:图片43.png]] | ||
| 1989 | |||
| 1990 | **Related device ** | ||
| 1991 | |||
| 1992 | |=**Devices**|=**Name**|=**Content** | ||
| 1993 | |=SM151|Carry|When the operation result exceeds 32,767, the carry flag will be (ON). | ||
| 1994 | |=SM152|Borrow|When the operation result is less than -32,768, the borrow flag will be (ON). | ||
| 1995 | |=SM153|Zero point|When the operation result is 0, the zero flag will be (ON). | ||
| 1996 | |||
| 1997 | (% style="text-align:center" %) | ||
| 1998 | [[image:1708666795958-183.png]] | ||
| 1999 | |||
| 2000 | (% class="box infomessage" %) | ||
| 2001 | ((( | ||
| 2002 | **✎Note: ** | ||
| 2003 | |||
| 2004 | * When the source operand and destination operand are specified as the same device: | ||
| 2005 | |||
| 2006 | The source operand and destination operand can also be specified as the same device number. | ||
| 2007 | |||
| 2008 | In this case, if you use continuous execution instructions (ADD, DADD), the result of the addition operation will change every operation cycle. Please note. | ||
| 2009 | |||
| 2010 | * The difference between the ADD instruction and the INC instruction using the +1 addition operation program: | ||
| 2011 | |||
| 2012 | ADD[P] means that every time X001 changes from OFF to ON, the content of D0 is added by one operation. | ||
| 2013 | |||
| 2014 | Although this instruction is very similar to the INCP instruction described later, there are some differences in the following content. | ||
| 2015 | ))) | ||
| 2016 | |||
| 2017 | |||
| 2018 | |=(% colspan="3" %) |=**ADD/ADDP/DADD/DADDP instructions**|=**INC/INCP/DINC/DINCP instructions** | ||
| 2019 | |(% colspan="3" %)**sign bit (zero, borrow, carry)**|**Action**|**No action** | ||
| 2020 | |(% rowspan="4" %)Calculation result|(% rowspan="2" %)((( | ||
| 2021 | 1. bit | ||
| 2022 | |||
| 2023 | Operation result | ||
| 2024 | )))|(S) + (+1) = (d)|32767→0→+1→+2→|32767→-32768→-32767 | ||
| 2025 | |(S) + (-1) = (d)|←-2←-1←0←-32768|—— | ||
| 2026 | |(% rowspan="2" %)((( | ||
| 2027 | 1. Bit | ||
| 2028 | |||
| 2029 | operation result | ||
| 2030 | )))|(S) + (+1) = (d)|2147483647→0→+1→+2→|2147483647→-2147483648→-2147483647 | ||
| 2031 | |(S) + (-1) = (d)|←-2←-1←0←-2147483648|—— | ||
| 2032 | |||
| 2033 | **Error code** | ||
| 2034 | |||
| 2035 | |=**Error code**|=**Content** | ||
| 2036 | |=4085H|The output results of (s1) and (s2) in the read application instruction exceed the device range | ||
| 2037 | |=4086H|The output result of (d) in the write application instruction exceeds the device range | ||
| 2038 | |||
| 2039 | **Example** | ||
| 2040 | |||
| 2041 | (% style="text-align:center" %) | ||
| 2042 | [[image:1708666919232-341.png]] | ||
| 2043 | |||
| 2044 | 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). | ||
| 2045 | |||
| 2046 | == SUB/16-bit Subtraction Operation == | ||
| 2047 | |||
| 2048 | **SUB(P)** | ||
| 2049 | |||
| 2050 | 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). | ||
| 2051 | |||
| 2052 | -[SUB (s1) (s2) (d)] | ||
| 2053 | |||
| 2054 | **Content, range and data type** | ||
| 2055 | |||
| 2056 | |**Parameter**|**Content**|**Range**|**Data type**|**Data type (label)** | ||
| 2057 | |(s1)|The subtraction data or the device storing the subtraction data|-32768 to 32767|Signed BIN16|ANY16_S | ||
| 2058 | |(s2)|The subtraction data or the device storing the subtraction data|-32768 to 32767|Signed BIN16|ANY16_S | ||
| 2059 | |(d)|Device for storing calculation results| |Signed BIN16|ANY16_S | ||
| 2060 | |||
| 2061 | **Device used** | ||
| 2062 | |||
| 2063 | |=(% rowspan="2" %)**instruction**|=(% rowspan="2" %)**Parameter**|=(% colspan="24" %)**Devices**|=((( | ||
| 2064 | **Index** | ||
| 2065 | |||
| 2066 | **modification** | ||
| 2067 | )))|=((( | ||
| 2068 | **Pulse** | ||
| 2069 | |||
| 2070 | **extension** | ||
| 2071 | ))) | ||
| 2072 | |**X**|**Y**|**M**|**S**|**SM**|**T(bit)**|**C(bit)**|**LC(bit)**|**HSC(bit)**|**D.b**|**KnX**|**KnY**|**KnM**|**KnS**|**T**|**C**|**D**|**R**|**SD**|**LC**|**HSC**|**K**|**H**|**E**|**[D]**|**XXP** | ||
| 2073 | |(% rowspan="3" %)SUB|Parameter 1| | | | | | | | | | |●|●|●|●|●|●|●|●|●| | |●|●| |●|● | ||
| 2074 | |Parameter 2| | | | | | | | | | |●|●|●|●|●|●|●|●|●| | |●|●| |●|● | ||
| 2075 | |Parameter 3| | | | | | | | | | | |●|●|●|●|●|●|●|●| | | | | |●|● | ||
| 2076 | |||
| 2077 | **Features** | ||
| 2078 | |||
| 2079 | 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). | ||
| 2080 | |||
| 2081 | (% style="text-align:center" %) | ||
| 2082 | [[image:图片1.png]] | ||
| 2083 | |||
| 2084 | **Related device ** | ||
| 2085 | |||
| 2086 | |**Devices**|**Name**|**Content** | ||
| 2087 | |SM151|Carry|When the operation result exceeds 32,767, the carry flag will be (ON). | ||
| 2088 | |SM152|Borrow|When the operation result is less than -32,768, the borrow flag will be (ON). | ||
| 2089 | |SM153|Zero point|When the operation result is 0, the zero flag will be (ON). | ||
| 2090 | |||
| 2091 | [[image:图片2.png]] | ||
| 2092 | |||
| 2093 | (% class="box infomessage" %) | ||
| 2094 | ((( | ||
| 2095 | **✎Note: ** | ||
| 2096 | |||
| 2097 | * When the source operand and destination operand are specified as the same device: | ||
| 2098 | |||
| 2099 | The source operand and destination operand can also be specified as the same device number. | ||
| 2100 | |||
| 2101 | 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. | ||
| 2102 | |||
| 2103 | * The difference between the SUB(P) instruction and the -(P) instruction and DEC(P) instruction executed by the -1 subtraction program | ||
| 2104 | |||
| 2105 | 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. | ||
| 2106 | ))) | ||
| 2107 | |||
| 2108 | |=(% colspan="3" %) |=**SUB/SUBP/DSUB/DSUBP instructions**|=**DEC/DECP/DDEC/DDECP instructions** | ||
| 2109 | |(% colspan="3" %)**Sign bit (zero, borrow, carry)**|**Action**|**No action** | ||
| 2110 | |(% rowspan="4" %)Calculation result|(% rowspan="2" %)16-bit operation result|(S)-(+1)=(d)|←-2←-1←0←-32768|-32768→+32767→32766 | ||
| 2111 | |(S)-(-1)=(d)|+32767→0→+1→+2→|—— | ||
| 2112 | |(% rowspan="2" %)32-bit operation result|(S)-(+1)=(d)|←-2←-1←0←-2147483648|-2147483648→2147483647→2147483646 | ||
| 2113 | |(S)-(-1)=(d)|2147483647→0→+1→+2→|—— | ||
| 2114 | |||
| 2115 | **Error code** | ||
| 2116 | |||
| 2117 | |=**Error code**|=**Content** | ||
| 2118 | |4085H|The output results of (s1) and (s2) in the read application instruction exceed the device range | ||
| 2119 | |4086H|The output result of (d) in the write application instruction exceeds the device range | ||
| 2120 | |||
| 2121 | **Example** | ||
| 2122 | |||
| 2123 | |||
| 2124 | (% style="text-align:center" %) | ||
| 2125 | [[image:图片3.png]] | ||
| 2126 | |||
| 2127 | Subtract 10 from the data in D0, and store the calculation result in D2, that is, (D0)-10 → (D2). | ||
| 2128 | |||
| 2129 | == DSUB/32-bit Subtraction Operation == | ||
| 2130 | |||
| 2131 | **DSUB(P)** | ||
| 2132 | |||
| 2133 | 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). | ||
| 2134 | |||
| 2135 | -[DSUB (s1) (s2) (d)] | ||
| 2136 | |||
| 2137 | **Content, range and data type** | ||
| 2138 | |||
| 2139 | |=**Parameter**|=**Content**|=**Range**|=**Data type**|=**Data type (label)** | ||
| 2140 | |(s1)|The subtraction data or the device storing the subtraction data|-2147483648 to 2147483647|Signed BIN32|ANY32_S | ||
| 2141 | |(s2)|The subtraction data or the device storing the subtraction data|-2147483648 to 2147483647|Signed BIN32|ANY32_S | ||
| 2142 | |(d)|Device for storing calculation results| |Signed BIN32|ANY32_S | ||
| 2143 | |||
| 2144 | **Device used** | ||
| 2145 | |||
| 2146 | |=(% rowspan="2" %)**instruction**|=(% rowspan="2" %)**Parameter**|=(% colspan="24" %)**Devices**|=((( | ||
| 2147 | **Index** | ||
| 2148 | |||
| 2149 | **modification** | ||
| 2150 | )))|=((( | ||
| 2151 | **Pulse** | ||
| 2152 | |||
| 2153 | **extension** | ||
| 2154 | ))) | ||
| 2155 | |**X**|**Y**|**M**|**S**|**SM**|**T(bit)**|**C(bit)**|**LC(bit)**|**HSC(bit)**|**D.b**|**KnX**|**KnY**|**KnM**|**KnS**|**T**|**C**|**D**|**R**|**SD**|**LC**|**HSC**|**K**|**H**|**E**|**[D]**|**XXP** | ||
| 2156 | |(% rowspan="3" %)DSUB|Parameter 1| | | | | | | | | | |●|●|●|●|●|●|●|●|●|●|●|●|●| |●|● | ||
| 2157 | |Parameter 2| | | | | | | | | | |●|●|●|●|●|●|●|●|●|●|●|●|●| |●|● | ||
| 2158 | |Parameter 3| | | | | | | | | | | |●|●|●|●|●|●|●|●|●|●| | | |●|● | ||
| 2159 | |||
| 2160 | **Features** | ||
| 2161 | |||
| 2162 | 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). | ||
| 2163 | |||
| 2164 | (% style="text-align:center" %) | ||
| 2165 | [[image:图片4.png]] | ||
| 2166 | |||
| 2167 | Related device | ||
| 2168 | |||
| 2169 | |=**Devices**|=**Name**|=**Content** | ||
| 2170 | |SM151|Carry|When the operation result exceeds 2,147,483,647, the carry flag will be ON. | ||
| 2171 | |SM152|Borrow|When the operation result is less than -2,147,483,648, the borrow flag will be ON. | ||
| 2172 | |SM153|Zero point|When the operation result is 0, the zero flag will be ON. | ||
| 2173 | |||
| 2174 | (% style="text-align:center" %) | ||
| 2175 | [[image:图片5.png]] | ||
| 2176 | |||
| 2177 | (% class="box infomessage" %) | ||
| 2178 | ((( | ||
| 2179 | **✎Note: ** | ||
| 2180 | |||
| 2181 | * When the source operand and destination operand are specified as the same device: | ||
| 2182 | |||
| 2183 | The source operand and destination operand can also be specified as the same device number. | ||
| 2184 | |||
| 2185 | 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. | ||
| 2186 | |||
| 2187 | * The difference between the SUB(P) instruction and the -(P) instruction and DEC(P) instruction executed by the -1 subtraction program | ||
| 2188 | |||
| 2189 | 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. | ||
| 2190 | ))) | ||
| 2191 | |||
| 2192 | |=(% colspan="3" %) |=**SUB/SUBP/DSUB/DSUBP instructions**|=**DEC/DECP/DDEC/DDECP instructions** | ||
| 2193 | |(% colspan="3" %)**Sign bit (zero, borrow, carry)**|**Action**|**No action** | ||
| 2194 | |(% rowspan="4" %)Calculation result|(% rowspan="2" %)16-bit operation result|(S)-(+1)=(d)|←-2←-1←0←-32768|-32768→32767→32766 | ||
| 2195 | |(S)-(-1)=(d)|+32767→0→+1→+2→|—— | ||
| 2196 | |(% rowspan="2" %)32-bit operation result|(S)-(+1)=(d)|←-2←-1←0←-2147483648|-2147483648→2147483647→2147483646 | ||
| 2197 | |(S)-(-1)=(d)|+2147483647→0→+1→+2→|—— | ||
| 2198 | |||
| 2199 | **Error code** | ||
| 2200 | |||
| 2201 | |=**Error code**|=**Content** | ||
| 2202 | |4085H|The output results of (s1) and (s2) in the read application instruction exceed the device range | ||
| 2203 | |4086H|The output result of (d) in the write application instruction exceeds the device range | ||
| 2204 | |||
| 2205 | **Example** | ||
| 2206 | |||
| 2207 | (% style="text-align:center" %) | ||
| 2208 | [[image:图片6.png]] | ||
| 2209 | |||
| 2210 | 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). | ||
| 2211 | |||
| 2212 | == MUL/16-bit Multiplication == | ||
| 2213 | |||
| 2214 | **MUL(P)** | ||
| 2215 | |||
| 2216 | Multiply the BIN16 bits specified in (s1) with the BIN16 bits specified in (s2), and store the result in the device specified in (d). | ||
| 2217 | |||
| 2218 | -[MUL (s1) (s2) (d)] | ||
| 2219 | |||
| 2220 | **Content, range and data type** | ||
| 2221 | |||
| 2222 | |=**Parameter**|=**Content**|=**Range**|=**Data type**|=**Data type (label)** | ||
| 2223 | |(s1)|Multiplication operation data or the device storing multiplication operation data|-32768 to 32767|Signed BIN 16 bit|ANY16_S | ||
| 2224 | |(s2)|Multiplication operation data or the device storing multiplication operation data|-32768 to 32767|Signed BIN 16 bit|ANY16_S | ||
| 2225 | |(d)|Device for storing calculation results| |Signed BIN 32 bit|ANY32_S | ||
| 2226 | |||
| 2227 | **Device used** | ||
| 2228 | |||
| 2229 | |=(% rowspan="2" %)**instruction**|=(% rowspan="2" %)**Parameter**|=(% colspan="24" %)**Devices**|=((( | ||
| 2230 | **Index** | ||
| 2231 | |||
| 2232 | **modification** | ||
| 2233 | )))|=((( | ||
| 2234 | **Pulse** | ||
| 2235 | |||
| 2236 | **extension** | ||
| 2237 | ))) | ||
| 2238 | |**X**|**Y**|**M**|**S**|**SM**|**T(bit)**|**C(bit)**|**LC(bit)**|**HSC(bit)**|**D.b**|**KnX**|**KnY**|**KnM**|**KnS**|**T**|**C**|**D**|**R**|**SD**|**LC**|**HSC**|**K**|**H**|**E**|**[D]**|**XXP** | ||
| 2239 | |(% rowspan="3" %)MUL|Parameter 1| | | | | | | | | | |●|●|●|●|●|●|●|●|●| | |●|●| |●|● | ||
| 2240 | |Parameter 2| | | | | | | | | | |●|●|●|●|●|●|●|●|●| | |●|●| |●|● | ||
| 2241 | |Parameter 3| | | | | | | | | | | |●|●|●|●|●|●|●|●|●|●| | | |●|● | ||
| 2242 | |||
| 2243 | **Features** | ||
| 2244 | |||
| 2245 | 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). | ||
| 2246 | |||
| 2247 | (% style="text-align:center" %) | ||
| 2248 | [[image:图片7.png]] | ||
| 2249 | |||
| 2250 | (d) is the multiplication result in the case of bit device | ||
| 2251 | |||
| 2252 | • K1: lower 4 bits (b0 to b3) | ||
| 2253 | |||
| 2254 | • K4: Lower 16 bits (b0 to b15) | ||
| 2255 | |||
| 2256 | • K8: Lower 32 bits (b0 to b31) | ||
| 2257 | |||
| 2258 | **Error code** | ||
| 2259 | |||
| 2260 | |**Error code**|**Content** | ||
| 2261 | |4085H|The output results of (s1) and (s2) in the read application instruction exceed the device range | ||
| 2262 | |4086H|The output result of (d) in the write application instruction exceeds the device range | ||
| 2263 | |||
| 2264 | **Example** | ||
| 2265 | |||
| 2266 | (% style="text-align:center" %) | ||
| 2267 | [[image:图片8.png]] | ||
| 2268 | |||
| 2269 | Multiply the data in (D0) by (D2), and store the operation result in (D5, D4), that is, (D0) × (D2) → (D5, D4). | ||
| 2270 | |||
| 2271 | == **DMUL/32-bit Multiplication** == | ||
| 2272 | |||
| 2273 | |||
| 2274 | **DMUL(P)** | ||
| 2275 | |||
| 2276 | 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). | ||
| 2277 | |||
| 2278 | -[DMUL (s1) (s2) (d)] | ||
| 2279 | |||
| 2280 | **Content, range and data type** | ||
| 2281 | |||
| 2282 | |=**Parameter**|=**Content**|=**Range**|=**Data type**|=**Data type (label)** | ||
| 2283 | |(s1)|Multiplication operation data or device storing multiplication operation data|-2147483648 to 2147483647|Signed BIN 32 bit|ANY32_S | ||
| 2284 | |(s2)|Multiplication operation data or device storing multiplication operation data|-2147483648 to 2147483647|Signed BIN 32 bit|ANY32_S | ||
| 2285 | |(d)|Device for storing calculation results| |Signed BIN64 bit|ANY64_S | ||
| 2286 | |||
| 2287 | **Device used** | ||
| 2288 | |||
| 2289 | |=(% rowspan="2" %)**instruction**|=(% rowspan="2" %)**Parameter**|=(% colspan="24" %)**Devices**|=((( | ||
| 2290 | **Index** | ||
| 2291 | |||
| 2292 | **modification** | ||
| 2293 | )))|=((( | ||
| 2294 | **Pulse** | ||
| 2295 | |||
| 2296 | **extension** | ||
| 2297 | ))) | ||
| 2298 | |**X**|**Y**|**M**|**S**|**SM**|**T(bit)**|**C(bit)**|**LC(bit)**|**HSC(bit)**|**D.b**|**KnX**|**KnY**|**KnM**|**KnS**|**T**|**C**|**D**|**R**|**SD**|**LC**|**HSC**|**K**|**H**|**E**|**[D]**|**XXP** | ||
| 2299 | |(% rowspan="3" %)DMUL|Parameter 1| | | | | | | | | | |●|●|●|●|●|●|●|●|●|●|●|●|●| |●|● | ||
| 2300 | |Parameter 2| | | | | | | | | | |●|●|●|●|●|●|●|●|●|●|●|●|●| |●|● | ||
| 2301 | |Parameter 3| | | | | | | | | | | |●|●|●|●|●|●|●|●|●|●| | | |●|● | ||
| 2302 | |||
| 2303 | **Features** | ||
| 2304 | |||
| 2305 | 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). | ||
| 2306 | |||
| 2307 | (% style="text-align:center" %) | ||
| 2308 | [[image:图片9.png]] | ||
| 2309 | |||
| 2310 | (d) is the multiplication result in the case of bit device | ||
| 2311 | |||
| 2312 | • K1: lower 4 bits (b0 to b3) | ||
| 2313 | |||
| 2314 | • K4: Lower 16 bits (b0 to b15) | ||
| 2315 | |||
| 2316 | • K8: Lower 32 bits (b0 to b31) | ||
| 2317 | |||
| 2318 | **Error code** | ||
| 2319 | |||
| 2320 | |**Error code**|**Content** | ||
| 2321 | |4085H|The output results of (s1) and (s2) in the read application instruction exceed the device range | ||
| 2322 | |4086H|The output result of (d) in the write application instruction exceeds the device range | ||
| 2323 | |||
| 2324 | **Example** | ||
| 2325 | |||
| 2326 | (% style="text-align:center" %) | ||
| 2327 | [[image:图片10.png]] | ||
| 2328 | |||
| 2329 | 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)). | ||
| 2330 | |||
| 2331 | == DIV/16-bit Division Operation == | ||
| 2332 | |||
| 2333 | **DIV(P)** | ||
| 2334 | |||
| 2335 | 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). | ||
| 2336 | |||
| 2337 | -[DIV (s1) (s2) (d)] | ||
| 2338 | |||
| 2339 | **Content, range and data type** | ||
| 2340 | |||
| 2341 | |=**Parameter**|=**Content**|=**Range**|=**Data type**|=**Data type (label)** | ||
| 2342 | |(s1)|Division operation data or device storing division operation data|-32768 to 32767|Signed BIN 16 bit|ANY16_S | ||
| 2343 | |(s2)|Division operation data or device storing division operation data|-32768 to 32767|Signed BIN 16 bit|ANY16_S | ||
| 2344 | |(d)|Device for storing calculation results| |Signed BIN 32 bit|ANY32_S | ||
| 2345 | |||
| 2346 | **Device used** | ||
| 2347 | |||
| 2348 | |=(% rowspan="2" %)**instruction**|=(% rowspan="2" %)**Parameter**|=(% colspan="24" %)**Devices**|=((( | ||
| 2349 | **Index** | ||
| 2350 | |||
| 2351 | **modification** | ||
| 2352 | )))|=((( | ||
| 2353 | **Pulse** | ||
| 2354 | |||
| 2355 | **extension** | ||
| 2356 | ))) | ||
| 2357 | |**X**|**Y**|**M**|**S**|**SM**|**T(bit)**|**C(bit)**|**LC(bit)**|**HSC(bit)**|**D.b**|**KnX**|**KnY**|**KnM**|**KnS**|**T**|**C**|**D**|**R**|**SD**|**LC**|**HSC**|**K**|**H**|**E**|**[D]**|**XXP** | ||
| 2358 | |(% rowspan="3" %)DIV|Parameter 1| | | | | | | | | | |●|●|●|●|●|●|●|●|●| | |●|●| |●|● | ||
| 2359 | |Parameter 2| | | | | | | | | | |●|●|●|●|●|●|●|●|●| | |●|●| |●|● | ||
| 2360 | |Parameter 3| | | | | | | | | | | |●|●|●|●|●|●|●|●|●|●| | | |●|● | ||
| 2361 | |||
| 2362 | **Features** | ||
| 2363 | |||
| 2364 | 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). | ||
| 2365 | |||
| 2366 | (% style="text-align:center" %) | ||
| 2367 | [[image:图片11.png]] | ||
| 2368 | |||
| 2369 | 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. | ||
| 2370 | |||
| 2371 | • Quotient is stored in the lower 16 bits. | ||
| 2372 | |||
| 2373 | • The remainder is stored in the upper 16 bits. (Can only be stored in the case of word devices.) | ||
| 2374 | |||
| 2375 | (% class="box infomessage" %) | ||
| 2376 | ((( | ||
| 2377 | **✎Note:** | ||
| 2378 | |||
| 2379 | * About the opearation result | ||
| 2380 | |||
| 2381 | • The highest bit of the quotient and remainder represents the sign of positive (0) and negative (1). | ||
| 2382 | |||
| 2383 | • When one of (s1) or (s2) is negative, the quotient becomes negative. When (s1) is negative, the remainder becomes negative. | ||
| 2384 | |||
| 2385 | * The device specified by (d) | ||
| 2386 | |||
| 2387 | • With the digit specification function, when specifying a bit device, the remainder cannot be obtained. | ||
| 2388 | ))) | ||
| 2389 | |||
| 2390 | **Error code** | ||
| 2391 | |||
| 2392 | |=**Error code**|=**Content** | ||
| 2393 | |4080H|The input of divisor (s2) is 0 | ||
| 2394 | |4085H|The output results of (s1) and (s2) in the read application instruction exceed the device range | ||
| 2395 | |4086H|The output result of (d) in the write application instruction exceeds the device range | ||
| 2396 | |||
| 2397 | **Example** | ||
| 2398 | |||
| 2399 | (% style="text-align:center" %) | ||
| 2400 | [[image:图片12.png]] | ||
| 2401 | |||
| 2402 | 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) → (D4(quotient)) (D5( remainder)). | ||
| 2403 | |||
| 2404 | == DDIV/32-bit Division Operation == | ||
| 2405 | |||
| 2406 | [[image:file:///C:\Users\ANNAXU~~1\AppData\Local\Temp\ksohtml3172\wps1.png]]**DDIV(P)** | ||
| 2407 | |||
| 2408 | 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). | ||
| 2409 | |||
| 2410 | -[DDIV (s1) (s2) (d)] | ||
| 2411 | |||
| 2412 | **Content, range and data type** | ||
| 2413 | |||
| 2414 | |=**Parameter**|=**Content**|=**Range**|=**Data type**|=**Data type (label)** | ||
| 2415 | |(s1)|Division operation data or device storing division operation data|-2147483648 to 2147483647|Signed BIN 32 bit|ANY32_S | ||
| 2416 | |(s2)|Division operation data or device storing division operation data|-2147483648 to 2147483647|Signed BIN 32 bit|ANY32_S | ||
| 2417 | |(d)|Device for storing calculation results| |Signed BIN64 bit|ANY64_S | ||
| 2418 | |||
| 2419 | **Device used** | ||
| 2420 | |||
| 2421 | |=(% rowspan="2" %)**instruction**|=(% rowspan="2" %)**Parameter**|=(% colspan="24" %)**Devices**|=((( | ||
| 2422 | **Index** | ||
| 2423 | |||
| 2424 | **modification** | ||
| 2425 | )))|=((( | ||
| 2426 | **Pulse** | ||
| 2427 | |||
| 2428 | **extension** | ||
| 2429 | ))) | ||
| 2430 | |**X**|**Y**|**M**|**S**|**SM**|**T(bit)**|**C(bit)**|**LC(bit)**|**HSC(bit)**|**D.b**|**KnX**|**KnY**|**KnM**|**KnS**|**T**|**C**|**D**|**R**|**SD**|**LC**|**HSC**|**K**|**H**|**E**|**[D]**|**XXP** | ||
| 2431 | |(% rowspan="3" %)DDIV|Parameter 1| | | | | | | | | | |●|●|●|●|●|●|●|●|●|●|●|●|●| |●|● | ||
| 2432 | |Parameter 2| | | | | | | | | | |●|●|●|●|●|●|●|●|●|●|●|●|●| |●|● | ||
| 2433 | |Parameter 3| | | | | | | | | | | |●|●|●|●|●|●|●|●|●|●| | | |●|● | ||
| 2434 | |||
| 2435 | **Features** | ||
| 2436 | |||
| 2437 | 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). | ||
| 2438 | |||
| 2439 | (% style="text-align:center" %) | ||
| 2440 | [[image:图片13.png]] | ||
| 2441 | |||
| 2442 | 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. | ||
| 2443 | |||
| 2444 | (% class="box infomessage" %) | ||
| 2445 | ((( | ||
| 2446 | **✎Note: ** | ||
| 2447 | |||
| 2448 | * About the operation result | ||
| 2449 | |||
| 2450 | • The highest bit of the quotient and remainder represents the sign of positive (0) and negative (1). | ||
| 2451 | |||
| 2452 | • When one of (s1) or (s2) is negative, the quotient becomes negative. When (s1) is negative, the remainder becomes negative. | ||
| 2453 | |||
| 2454 | * The specified device of (d) | ||
| 2455 | |||
| 2456 | • With the digit specification function, when a bit device is specified, the remainder cannot be obtained. | ||
| 2457 | ))) | ||
| 2458 | |||
| 2459 | **Error code** | ||
| 2460 | |||
| 2461 | |=**Error code**|=**Content** | ||
| 2462 | |4080H|The input of divisor (s2) is 0 | ||
| 2463 | |4085H|The output results of (s1) and (s2) in the read application instruction exceed the device range | ||
| 2464 | |4086H|The output result of (d) in the write application instruction exceeds the device range | ||
| 2465 | |||
| 2466 | **Example** | ||
| 2467 | |||
| 2468 | (% style="text-align:center" %) | ||
| 2469 | [[image:图片14.png]] | ||
| 2470 | |||
| 2471 | 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). | ||
| 2472 | |||
| 2473 | == **INC/16-bit Data Increment** == | ||
| 2474 | |||
| 2475 | |||
| 2476 | **INC(P)** | ||
| 2477 | |||
| 2478 | Add one to the device (BIN 16-bit data) specified in (d). | ||
| 2479 | |||
| 2480 | -[INC (d)] | ||
| 2481 | |||
| 2482 | Content, range and data type | ||
| 2483 | |||
| 2484 | |=**Parameter**|=**Content**|=**Range**|=**Data type**|=**Data type (label)** | ||
| 2485 | |(d)|The word device number that stores the data added by one|-32768 to 32767|Signed BIN 16 bit|ANY16_S | ||
| 2486 | |||
| 2487 | **Device used** | ||
| 2488 | |||
| 2489 | |=(% rowspan="2" %)**instruction**|=(% rowspan="2" %)**Parameter**|=(% colspan="24" %)**Devices**|=((( | ||
| 2490 | **Index** | ||
| 2491 | |||
| 2492 | **modification** | ||
| 2493 | )))|=((( | ||
| 2494 | **Pulse** | ||
| 2495 | |||
| 2496 | **extension** | ||
| 2497 | ))) | ||
| 2498 | |**X**|**Y**|**M**|**S**|**SM**|**T(bit)**|**C(bit)**|**LC(bit)**|**HSC(bit)**|**D.b**|**KnX**|**KnY**|**KnM**|**KnS**|**T**|**C**|**D**|**R**|**SD**|**LC**|**HSC**|**K**|**H**|**E**|**[D]**|**XXP** | ||
| 2499 | |INC|Parameter 1| | | | | | | | | | | |●|●|●|●|●|●|●|●| | | | | |●|● | ||
| 2500 | |||
| 2501 | **Features** | ||
| 2502 | |||
| 2503 | Add one to the device (BIN 16-bit data) specified in (d). | ||
| 2504 | |||
| 2505 | (% style="text-align:center" %) | ||
| 2506 | [[image:图片15.png]] | ||
| 2507 | |||
| 2508 | • 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). | ||
| 2509 | |||
| 2510 | • Flags (zero, borrow, carry) do not perform actions. | ||
| 2511 | |||
| 2512 | (% class="box infomessage" %) | ||
| 2513 | ((( | ||
| 2514 | **✎Note: ** | ||
| 2515 | If the continuous execution (INC) instruction is used, the addition operation will be performed every operation cycle, so care should be taken. | ||
| 2516 | ))) | ||
| 2517 | |||
| 2518 | **Error code** | ||
| 2519 | |||
| 2520 | |=**Error code**|=**Content** | ||
| 2521 | |=4085H|The output results of (d) in the read application instruction exceed the device range | ||
| 2522 | |=4086H|The output result of (d) in the write application instruction exceeds the device range | ||
| 2523 | |||
| 2524 | **Example** | ||
| 2525 | |||
| 2526 | (% style="text-align:center" %) | ||
| 2527 | [[image:图片16.png]] | ||
| 2528 | |||
| 2529 | Add one to the device value specified in D0, that is, (D0) + 1 → (D0). | ||
| 2530 | |||
| 2531 | == DINC/32-bit Data Increment == | ||
| 2532 | |||
| 2533 | [[image:file:///C:\Users\ANNAXU~~1\AppData\Local\Temp\ksohtml3172\wps2.png]]**DINC(P)** | ||
| 2534 | |||
| 2535 | Add one to the device (BIN 32-bit data) specified in (d). | ||
| 2536 | |||
| 2537 | -[DINC (d)] | ||
| 2538 | |||
| 2539 | **Content, range and data type** | ||
| 2540 | |||
| 2541 | |=**Parameter**|=**Content**|=**Range**|=**Data type**|=**Data type (label)** | ||
| 2542 | |=(d)|The word device number that stores the data added by one|-2147483648 to 2147493647|Signed BIN 32 bit|ANY32_S | ||
| 2543 | |||
| 2544 | **Device used** | ||
| 2545 | |||
| 2546 | |=(% rowspan="2" %)**instruction**|=(% rowspan="2" %)**Parameter**|=(% colspan="24" %)**Devices**|=((( | ||
| 2547 | **Index** | ||
| 2548 | |||
| 2549 | **modification** | ||
| 2550 | )))|=((( | ||
| 2551 | **Pulse** | ||
| 2552 | |||
| 2553 | **extension** | ||
| 2554 | ))) | ||
| 2555 | |**X**|**Y**|**M**|**S**|**SM**|**T(bit)**|**C(bit)**|**LC(bit)**|**HSC(bit)**|**D.b**|**KnX**|**KnY**|**KnM**|**KnS**|**T**|**C**|**D**|**R**|**SD**|**LC**|**HSC**|**K**|**H**|**E**|**[D]**|**XXP** | ||
| 2556 | |DINC|Parameter 1| | | | | | | | | | | |●|●|●|●|●|●|●|●|●|●| | | |●|● | ||
| 2557 | |||
| 2558 | **Features** | ||
| 2559 | |||
| 2560 | Add one to the device (BIN 32-bit data) specified in (d). | ||
| 2561 | |||
| 2562 | (% style="text-align:center" %) | ||
| 2563 | [[image:图片17.png]] | ||
| 2564 | |||
| 2565 | • 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). | ||
| 2566 | |||
| 2567 | • Flags (zero, borrow, carry) do not perform actions. | ||
| 2568 | |||
| 2569 | (% class="box infomessage" %) | ||
| 2570 | ((( | ||
| 2571 | **✎Note:** | ||
| 2572 | If the continuous execution (INC) instruction is used, the addition operation will be performed every operation cycle, so care should be taken. | ||
| 2573 | ))) | ||
| 2574 | |||
| 2575 | **Error code** | ||
| 2576 | |||
| 2577 | |=**Error code**|=**Content** | ||
| 2578 | |=4085H|The output results of (d) in the read application instruction exceed the device range | ||
| 2579 | |=4086H|The output result of (d) in the write application instruction exceeds the device range | ||
| 2580 | |||
| 2581 | **Example** | ||
| 2582 | |||
| 2583 | (% style="text-align:center" %) | ||
| 2584 | [[image:图片18.png]] | ||
| 2585 | |||
| 2586 | Add one to the device value specified in (D1, D0), that is, (D1, D0) + 1 → (D1, D0). | ||
| 2587 | |||
| 2588 | == DEC/16 bit Data Decrement == | ||
| 2589 | |||
| 2590 | **DEC(P)** | ||
| 2591 | |||
| 2592 | Minus one for the device (BIN 16-bit data) specified in (d). | ||
| 2593 | |||
| 2594 | -[DEC (d)] | ||
| 2595 | |||
| 2596 | **Content, range and data type** | ||
| 2597 | |||
| 2598 | |=**Parameter**|=**Content**|=**Range**|=**Data type**|=**Data type (label)** | ||
| 2599 | |=(d)|The word device number that stores the data minus by one|-32768 to 32767|Signed BIN 16 bit|ANY16_S | ||
| 2600 | |||
| 2601 | **Device used** | ||
| 2602 | |||
| 2603 | |=(% rowspan="2" %)**instruction**|=(% rowspan="2" %)**Parameter**|=(% colspan="24" %)**Devices**|=((( | ||
| 2604 | **Index** | ||
| 2605 | |||
| 2606 | **modification** | ||
| 2607 | )))|=((( | ||
| 2608 | **Pulse** | ||
| 2609 | |||
| 2610 | **extension** | ||
| 2611 | ))) | ||
| 2612 | |**X**|**Y**|**M**|**S**|**SM**|**T(bit)**|**C(bit)**|**LC(bit)**|**HSC(bit)**|**D.b**|**KnX**|**KnY**|**KnM**|**KnS**|**T**|**C**|**D**|**R**|**SD**|**LC**|**HSC**|**K**|**H**|**E**|**[D]**|**XXP** | ||
| 2613 | |DEC|Parameter 1| | | | | | | | | | | |●|●|●|●|●|●|●|●| | | | | |●|● | ||
| 2614 | |||
| 2615 | **Features** | ||
| 2616 | |||
| 2617 | Minus one for the device (BIN 16-bit data) specified in (d). | ||
| 2618 | |||
| 2619 | (% style="text-align:center" %) | ||
| 2620 | [[image:图片19.png]] | ||
| 2621 | |||
| 2622 | • 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). | ||
| 2623 | |||
| 2624 | • Flags (zero, borrow, carry) do not perform actions. | ||
| 2625 | |||
| 2626 | (% class="box infomessage" %) | ||
| 2627 | ((( | ||
| 2628 | **✎Note: ** | ||
| 2629 | If using continuous execution (DEC) instructions, subtraction will be performed every operation cycle, so care should be taken. | ||
| 2630 | ))) | ||
| 2631 | |||
| 2632 | **Error code** | ||
| 2633 | |||
| 2634 | |=**Error code**|=**Content** | ||
| 2635 | |=4085H|The output results of (d) in the read application instruction exceed the device range | ||
| 2636 | |=4086H|The output result of (d) in the write application instruction exceeds the device range | ||
| 2637 | |||
| 2638 | **Example** | ||
| 2639 | |||
| 2640 | (% style="text-align:center" %) | ||
| 2641 | [[image:图片20.png]] | ||
| 2642 | |||
| 2643 | Each time M0 is set, the value of the device specified in D0 will be -1, (D0)-1 → (D0). | ||
| 2644 | |||
| 2645 | == DDEC/32-bit Data Decrement == | ||
| 2646 | |||
| 2647 | [[image:file:///C:\Users\ANNAXU~~1\AppData\Local\Temp\ksohtml3172\wps3.png]]**DDEC(P)** | ||
| 2648 | |||
| 2649 | Minus one for the device (BIN 32-bit data) specified in (d). | ||
| 2650 | |||
| 2651 | -[DDEC (d)] | ||
| 2652 | |||
| 2653 | **Content, range and data type** | ||
| 2654 | |||
| 2655 | |=**Parameter**|=**Content**|=**Range**|=**Data type**|=**Data type (label)** | ||
| 2656 | |=(d)|The word device number that stores the data minus by one|-2147483648 to 2147483647|Signed BIN 32 bit|ANY32_S | ||
| 2657 | |||
| 2658 | **Device used** | ||
| 2659 | |||
| 2660 | |=(% rowspan="2" %)**instruction**|=(% rowspan="2" %)**Parameter**|=(% colspan="24" %)**Devices**|=((( | ||
| 2661 | **Index** | ||
| 2662 | |||
| 2663 | **modification** | ||
| 2664 | )))|=((( | ||
| 2665 | **Pulse** | ||
| 2666 | |||
| 2667 | **extension** | ||
| 2668 | ))) | ||
| 2669 | |**X**|**Y**|**M**|**S**|**SM**|**T(bit)**|**C(bit)**|**LC(bit)**|**HSC(bit)**|**D.b**|**KnX**|**KnY**|**KnM**|**KnS**|**T**|**C**|**D**|**R**|**SD**|**LC**|**HSC**|**K**|**H**|**E**|**[D]**|**XXP** | ||
| 2670 | |DDEC|Parameter 1| | | | | | | | | | | |●|●|●|●|●|●|●|●|●|●| | | |●|● | ||
| 2671 | |||
| 2672 | **Features** | ||
| 2673 | |||
| 2674 | Minus one for the device (BIN 32-bit data) specified in (d). | ||
| 2675 | |||
| 2676 | (% style="text-align:center" %) | ||
| 2677 | [[image:图片21.png]] | ||
| 2678 | |||
| 2679 | 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). | ||
| 2680 | |||
| 2681 | • Flags (zero, borrow, carry) do not perform actions. | ||
| 2682 | |||
| 2683 | (% class="box infomessage" %) | ||
| 2684 | ((( | ||
| 2685 | **✎Note: ** | ||
| 2686 | If using continuous execution (DEC) instructions, subtraction will be performed every operation cycle. | ||
| 2687 | ))) | ||
| 2688 | |||
| 2689 | **Error code** | ||
| 2690 | |||
| 2691 | |=**Error code**|=**Content** | ||
| 2692 | |=4085H|The output results of (d) in the read application instruction exceed the device range | ||
| 2693 | |=4086H|The output result of (d) in the write application instruction exceeds the device range | ||
| 2694 | |||
| 2695 | **Example** | ||
| 2696 | |||
| 2697 | (% style="text-align:center" %) | ||
| 2698 | [[image:图片22.png]] | ||
| 2699 | |||
| 2700 | Minus one on the device value specified in (D1, D0), that is, (D1, D0)-1 → (D0). | ||
| 2701 | |||
| 2702 | = **Logic Operation instructions** = | ||
| 2703 | |||
| 2704 | == NEG/16-bit Complement == | ||
| 2705 | |||
| 2706 | [[image:file:///C:\Users\ANNAXU~~1\AppData\Local\Temp\ksohtml3172\wps5.png]]**NEG(P)** | ||
| 2707 | |||
| 2708 | After inverting the sign of the BIN 16-bit device specified in (d), store it in the device specified in (d). | ||
| 2709 | |||
| 2710 | -[NEG (d)] | ||
| 2711 | |||
| 2712 | **Content, range and data type** | ||
| 2713 | |||
| 2714 | |=**Parameter**|=**Content**|=**Range**|=**Data type**|=**Data type (label)** | ||
| 2715 | |=(d)|The start device that stores the data complement of 2|-32768 to 32767|Signed BIN16|ANY16_S | ||
| 2716 | |||
| 2717 | **Device used** | ||
| 2718 | |||
| 2719 | |=(% rowspan="2" %)**instruction**|=(% rowspan="2" %)**Parameter**|=(% colspan="24" %)**Devices**|=((( | ||
| 2720 | **Index** | ||
| 2721 | |||
| 2722 | **modification** | ||
| 2723 | )))|=((( | ||
| 2724 | **Pulse** | ||
| 2725 | |||
| 2726 | **extension** | ||
| 2727 | ))) | ||
| 2728 | |**X**|**Y**|**M**|**S**|**SM**|**T(bit)**|**C(bit)**|**LC(bit)**|**HSC(bit)**|**D.b**|**KnX**|**KnY**|**KnM**|**KnS**|**T**|**C**|**D**|**R**|**SD**|**LC**|**HSC**|**K**|**H**|**E**|**[D]**|**XXP** | ||
| 2729 | |NEG|Parameter 1| | | | | | | | | | |●|●|●|●|●|●|●|●|●| | | | | |●|● | ||
| 2730 | |||
| 2731 | **Features** | ||
| 2732 | |||
| 2733 | • Invert the sign of the BIN 16-bit device specified in (d), and store it in the device specified in (d). | ||
| 2734 | |||
| 2735 | • Used when inverting positive and negative signs. | ||
| 2736 | |||
| 2737 | (% style="text-align:center" %) | ||
| 2738 | [[image:图片23.png]] | ||
| 2739 | |||
| 2740 | (% class="box infomessage" %) | ||
| 2741 | ((( | ||
| 2742 | **✎Note: | ||
| 2743 | **If the continuous execution (NEG) instruction is used, every operation cycle will be inverted, so care should be taken. | ||
| 2744 | ))) | ||
| 2745 | |||
| 2746 | **Error code** | ||
| 2747 | |||
| 2748 | |=**Error code**|=**Content** | ||
| 2749 | |=4085H|The output results of (d) in the read application instruction exceed the device range | ||
| 2750 | |=4086H|The output result of (d) in the write application instruction exceeds the device range | ||
| 2751 | |||
| 2752 | **Example** | ||
| 2753 | |||
| 2754 | In the two examples below, if D2=K4 and D4=K8, or D2=K8 and D10 is always K4. | ||
| 2755 | |||
| 2756 | Each time M0 is set, the device value specified in D0 is reversed. | ||
| 2757 | |||
| 2758 | (% style="text-align:center" %) | ||
| 2759 | [[image:图片24.png]] | ||
| 2760 | |||
| 2761 | Take the absolute value of the difference of the subtraction operation. | ||
| 2762 | |||
| 2763 | If D2>D4, M10=On. If D2=D4, M11=On. If D2 <D4, M12=On. This ensures that D10 is positive. | ||
| 2764 | |||
| 2765 | It can also be represented by the following program: | ||
| 2766 | |||
| 2767 | (% style="text-align:center" %) | ||
| 2768 | [[image:图片26.png]] | ||
| 2769 | |||
| 2770 | When bit15 of D10 is "1" (indicating that D10 is a negative number), M10 = On, use NEG instruction to complement D10 to obtain the absolute value of D10. | ||
| 2771 | |||
| 2772 | In the above two examples, if D2=K4, D4=K8; or D2=K8, D4=K4, the result of D10 is K4. | ||
| 2773 | |||
| 2774 | |||
| 2775 | (% style="text-align:center" %) | ||
| 2776 | [[image:图片27.png]] | ||
| 2777 | |||
| 2778 | == DNEG/32-bit Complement == | ||
| 2779 | |||
| 2780 | **DNEG(P)** | ||
| 2781 | |||
| 2782 | After inverting the sign of the BIN 32-bit device specified in (d), store it in the device specified in (d). | ||
| 2783 | |||
| 2784 | -[DNEG (d)] | ||
| 2785 | |||
| 2786 | **Content, range and data type** | ||
| 2787 | |||
| 2788 | |=**Parameter**|=**Content**|=**Range**|=**Data type**|=**Data type (label)** | ||
| 2789 | |=(d)|The start device that stores the data complement of 2|-2147483648 to 2147483647|Signed BIN16|ANY16_S | ||
| 2790 | |||
| 2791 | **Device used** | ||
| 2792 | |||
| 2793 | |=(% rowspan="2" %)**instruction**|=(% rowspan="2" %)**Parameter**|=(% colspan="24" %)**Devices**|=((( | ||
| 2794 | **Index** | ||
| 2795 | |||
| 2796 | **modification** | ||
| 2797 | )))|=((( | ||
| 2798 | **Pulse** | ||
| 2799 | |||
| 2800 | **extension** | ||
| 2801 | ))) | ||
| 2802 | |**X**|**Y**|**M**|**S**|**SM**|**T(bit)**|**C(bit)**|**LC(bit)**|**HSC(bit)**|**D.b**|**KnX**|**KnY**|**KnM**|**KnS**|**T**|**C**|**D**|**R**|**SD**|**LC**|**HSC**|**K**|**H**|**E**|**[D]**|**XXP** | ||
| 2803 | |DNEG|Parameter 1| | | | | | | | | | |●|●|●|●|●|●|●|●|●|●|●| | | |●|● | ||
| 2804 | |||
| 2805 | **Features** | ||
| 2806 | |||
| 2807 | • Invert the sign of the BIN 32-bit device specified in (d) and store it in the device specified in (d). | ||
| 2808 | |||
| 2809 | • Used when inverting positive and negative signs. | ||
| 2810 | |||
| 2811 | (% style="text-align:center" %) | ||
| 2812 | [[image:图片28.png]] | ||
| 2813 | |||
| 2814 | (% class="box infomessage" %) | ||
| 2815 | ((( | ||
| 2816 | **✎Note: ** | ||
| 2817 | If you use continuous execution (DNEG) instructions, every operation cycle will be inverted, so care should be taken. | ||
| 2818 | ))) | ||
| 2819 | |||
| 2820 | **Error code** | ||
| 2821 | |||
| 2822 | |**Error code**|**Content** | ||
| 2823 | |4085H|The output results of (d) in the read application instruction exceed the device range | ||
| 2824 | |4086H|The output result of (d) in the write application instruction exceeds the device range | ||
| 2825 | |||
| 2826 | **Example** | ||
| 2827 | |||
| 2828 | (% style="text-align:center" %) | ||
| 2829 | [[image:图片29.png]] | ||
| 2830 | |||
| 2831 | Each time M0 is set, the device value specified in (D1, D0) is reversed. | ||
| 2832 | |||
| 2833 | == WOR/16-bit Data Logical OR == | ||
| 2834 | |||
| 2835 | **WOR(P)** | ||
| 2836 | |||
| 2837 | Perform a logical OR operation on the BIN 16-bit data of the device specified in (s1) and the BIN 16-bit data of the device specified in (s2), and store the result in the device specified in (d). | ||
| 2838 | |||
| 2839 | -[WOR (s1) (s2) (d)] | ||
| 2840 | |||
| 2841 | **Content, range and data type** | ||
| 2842 | |||
| 2843 | |=**Parameter**|=**Content**|=**Range**|=**Data type**|=**Data type (label)** | ||
| 2844 | |=(s1)|Stores data for logical OR operation or a device that stores data|-32768 to 32767|Signed BIN16|ANY16_S | ||
| 2845 | |=(s2)|Stores data for logical OR operation or a device that stores data|-32768to 32767|Signed BIN16|ANY16_S | ||
| 2846 | |=(d)|Device for storing logic or result| |Signed BIN16|ANY16_S | ||
| 2847 | |||
| 2848 | **Device used** | ||
| 2849 | |||
| 2850 | |=(% rowspan="2" %)**instruction**|=(% rowspan="2" %)**Parameter**|=(% colspan="24" %)**Devices**|=((( | ||
| 2851 | **Index** | ||
| 2852 | |||
| 2853 | **modification** | ||
| 2854 | )))|=((( | ||
| 2855 | **Pulse** | ||
| 2856 | |||
| 2857 | **extension** | ||
| 2858 | ))) | ||
| 2859 | |**X**|**Y**|**M**|**S**|**SM**|**T(bit)**|**C(bit)**|**LC(bit)**|**HSC(bit)**|**D.b**|**KnX**|**KnY**|**KnM**|**KnS**|**T**|**C**|**D**|**R**|**SD**|**LC**|**HSC**|**K**|**H**|**E**|**[D]**|**XXP** | ||
| 2860 | |(% rowspan="3" %)WOR|Parameter 1| | | | | | | | | | |●|●|●|●|●|●|●|●|●| | |●|●| |●|● | ||
| 2861 | |Parameter 2| | | | | | | | | | |●|●|●|●|●|●|●|●|●| | |●|●| |●|● | ||
| 2862 | |Parameter 3| | | | | | | | | | | |●|●|●|●|●|●|●|●| | | | | |●|● | ||
| 2863 | |||
| 2864 | **Features** | ||
| 2865 | |||
| 2866 | • Perform a logical OR operation on the BIN 16-bit data of the device specified in (s1) and the BIN 16-bit data of the device specified in (s2), and store the result in the device specified in (d). | ||
| 2867 | |||
| 2868 | (% style="text-align:center" %) | ||
| 2869 | [[image:图片30.png]] | ||
| 2870 | |||
| 2871 | In the case of bit devices, bit devices after the number of points specified by the number of digits will be calculated as 0. | ||
| 2872 | |||
| 2873 | **Error code** | ||
| 2874 | |||
| 2875 | |=**Error code**|=**Content** | ||
| 2876 | |=4085H|The output results of (s1) and (s2) in the read application instruction exceed the device range | ||
| 2877 | |=4086H|The output result of (d) in the write application instruction exceeds the device range | ||
| 2878 | |||
| 2879 | **Example** | ||
| 2880 | |||
| 2881 | (% style="text-align:center" %) | ||
| 2882 | [[image:图片31.png]] | ||
| 2883 | |||
| 2884 | When M0 is set, (D0) and (D2) are logically performed, and the value is stored in (D4), that is (D0)∨(D2) → (D4) | ||
| 2885 | |||
| 2886 | == DOR/32-bit Data Logical OR == | ||
| 2887 | |||
| 2888 | [[image:file:///C:\Users\ANNAXU~~1\AppData\Local\Temp\ksohtml3172\wps6.png]]**DOR(P)** | ||
| 2889 | |||
| 2890 | After inverting the sign of the BIN 32-bit device specified in (d), store it in the device specified in (d). | ||
| 2891 | |||
| 2892 | -[DOR (s1) (s2) (d)] | ||
| 2893 | |||
| 2894 | **Content, range and data type** | ||
| 2895 | |||
| 2896 | |=**Parameter**|=**Content**|=**Range**|=**Data type**|=**Data type (label)** | ||
| 2897 | |=(s1)|Stores data for logical OR operation or a device that stores data|-2147483648 to 2147483647|Signed BIN32|ANY32_S | ||
| 2898 | |=(s2)|Stores data for logical OR operation or a device that stores data|-2147483648 to 2147483647|Signed BIN32|ANY32_S | ||
| 2899 | |=(d)|Device for storing logic or result| |Signed BIN32|ANY32_S | ||
| 2900 | |||
| 2901 | **Device used** | ||
| 2902 | |||
| 2903 | |=(% rowspan="2" %)**instruction**|=(% rowspan="2" %)**Parameter**|=(% colspan="24" %)**Devices**|=((( | ||
| 2904 | **Index** | ||
| 2905 | |||
| 2906 | **modification** | ||
| 2907 | )))|=((( | ||
| 2908 | **Pulse** | ||
| 2909 | |||
| 2910 | **extension** | ||
| 2911 | ))) | ||
| 2912 | |**X**|**Y**|**M**|**S**|**SM**|**T(bit)**|**C(bit)**|**LC(bit)**|**HSC(bit)**|**D.b**|**KnX**|**KnY**|**KnM**|**KnS**|**T**|**C**|**D**|**R**|**SD**|**LC**|**HSC**|**K**|**H**|**E**|**[D]**|**XXP** | ||
| 2913 | |(% rowspan="3" %)DOR|Parameter 1| | | | | | | | | | |●|●|●|●|●|●|●|●|●|●|●|●|●| |●|● | ||
| 2914 | |Parameter 2| | | | | | | | | | |●|●|●|●|●|●|●|●|●|●|●|●|●| |●|● | ||
| 2915 | |Parameter 3| | | | | | | | | | | |●|●|●|●|●|●|●|●|●|●| | | |●|● | ||
| 2916 | |||
| 2917 | **Features** | ||
| 2918 | |||
| 2919 | Perform a logical OR operation on the BIN 32-bit data of the device specified in (s1) and the BIN 32-bit data of the device specified in (s2), and store the result in the device specified in (d). | ||
| 2920 | |||
| 2921 | (% style="text-align:center" %) | ||
| 2922 | [[image:图片32.png]] | ||
| 2923 | |||
| 2924 | In the case of bit devices, bit devices after the number of points specified by the number of digits will be calculated as 0. | ||
| 2925 | |||
| 2926 | **Error code** | ||
| 2927 | |||
| 2928 | |=**Error code**|=**Content** | ||
| 2929 | |=4085H|The output results of (s1) and (s2) in the read application instruction exceed the device range | ||
| 2930 | |=4086H|The output result of (d) in the write application instruction exceeds the device range | ||
| 2931 | |||
| 2932 | **Example** | ||
| 2933 | |||
| 2934 | (% style="text-align:center" %) | ||
| 2935 | [[image:图片33.png]] | ||
| 2936 | |||
| 2937 | |||
| 2938 | When M0 is set, (D1, D0) and (D3, D2) are logically performed, and the value is stored in (D5, D4), that is, (D1, D0)∨(D3, D2) → (D5, D4) ). | ||
| 2939 | |||
| 2940 | == WAND/16-bit Data Logic AND == | ||
| 2941 | |||
| 2942 | **WAND(P)** | ||
| 2943 | |||
| 2944 | Perform a logical AND operation on each bit of the BIN 16-bit data of the device specified in (s1) and the BIN 16-bit data of the device specified in (s2), and store the result in the device specified in (d). | ||
| 2945 | |||
| 2946 | -[WAND (s1) (s2) (d)] | ||
| 2947 | |||
| 2948 | **Content, range and data type** | ||
| 2949 | |||
| 2950 | |=**Parameter**|=**Content**|=**Range**|=**Data type**|=**Data type (label)** | ||
| 2951 | |(s1)|Store the data for logical AND operation or the device storing the data|-32768to 32767|Signed BIN16|ANY16_S | ||
| 2952 | |(s2)|Store the data for logical AND operation or the device storing the data|-32768 to 32767|Signed BIN16|ANY16_S | ||
| 2953 | |(d)|Device for storing logic and result| |Signed BIN16|ANY16_S | ||
| 2954 | |||
| 2955 | **Device used** | ||
| 2956 | |||
| 2957 | |=(% rowspan="2" %)**instruction**|=(% rowspan="2" %)**Parameter**|=(% colspan="24" %)**Devices**|=((( | ||
| 2958 | **Index** | ||
| 2959 | |||
| 2960 | **modification** | ||
| 2961 | )))|=((( | ||
| 2962 | **Pulse** | ||
| 2963 | |||
| 2964 | **extension** | ||
| 2965 | ))) | ||
| 2966 | |**X**|**Y**|**M**|**S**|**SM**|**T(bit)**|**C(bit)**|**LC(bit)**|**HSC(bit)**|**D.b**|**KnX**|**KnY**|**KnM**|**KnS**|**T**|**C**|**D**|**R**|**SD**|**LC**|**HSC**|**K**|**H**|**E**|**[D]**|**XXP** | ||
| 2967 | |(% rowspan="3" %)WAND|Parameter 1| | | | | | | | | | |●|●|●|●|●|●|●|●|●| | |●|●| |●|● | ||
| 2968 | |Parameter 2| | | | | | | | | | |●|●|●|●|●|●|●|●|●| | |●|●| |●|● | ||
| 2969 | |Parameter 3| | | | | | | | | | | |●|●|●|●|●|●|●|●| | | | | |●|● | ||
| 2970 | |||
| 2971 | **Features** | ||
| 2972 | |||
| 2973 | Perform a logical AND operation on each bit of the BIN 16-bit data of the device specified in (s1) and the BIN 16-bit data of the device specified in (s2), and store the result in the device specified in (d). | ||
| 2974 | |||
| 2975 | (% style="text-align:center" %) | ||
| 2976 | [[image:图片34.png]] | ||
| 2977 | |||
| 2978 | In the case of bit devices, bit devices after the number of points specified by the number of digits will be calculated as 0. | ||
| 2979 | |||
| 2980 | **Error code** | ||
| 2981 | |||
| 2982 | |=**Error code**|=**Content** | ||
| 2983 | |=4085H|The output results of (s1) and (s2) in the read application instruction exceed the device range | ||
| 2984 | |=4086H|The output result of (d) in the write application instruction exceeds the device range | ||
| 2985 | |||
| 2986 | **Example** | ||
| 2987 | |||
| 2988 | (% style="text-align:center" %) | ||
| 2989 | [[image:图片35.png]] | ||
| 2990 | |||
| 2991 | |||
| 2992 | When M0 is set, the logical AND operation of (D0) and (D2) is performed, and the value is stored in (D4), that is, (D0) ∧ (D2) → (D4). | ||
| 2993 | |||
| 2994 | == DAND/32-bit Data Logic AND == | ||
| 2995 | |||
| 2996 | **DAND(P)** | ||
| 2997 | |||
| 2998 | Perform a logical AND operation on each bit of the BIN 32-bit data of the device specified in (s1) and the BIN 32-bit data of the device specified in (s2), and store the result in the device specified in (d). | ||
| 2999 | |||
| 3000 | -[DAND (s1) (s2) (d)] | ||
| 3001 | |||
| 3002 | **Content, range and data type** | ||
| 3003 | |||
| 3004 | |=**Parameter**|=**Content**|=**Range**|=**Data type**|=**Data type (label)** | ||
| 3005 | |=(s1)|Store the data for logical AND operation or the device storing the data|-2147483648 to +2147483647|Signed BIN32|ANY32_S | ||
| 3006 | |=(s2)|Store the data for logical AND operation or the device storing the data|-2147483648 to +2147483647|Signed BIN32|ANY32_S | ||
| 3007 | |=(d)|Device for storing logic and result| |Signed BIN32|ANY32_S | ||
| 3008 | |||
| 3009 | **Device used** | ||
| 3010 | |||
| 3011 | |=(% rowspan="2" %)**instruction**|=(% rowspan="2" %)**Parameter**|=(% colspan="24" %)**Devices**|=((( | ||
| 3012 | **Index** | ||
| 3013 | |||
| 3014 | **modification** | ||
| 3015 | )))|=((( | ||
| 3016 | **Pulse** | ||
| 3017 | |||
| 3018 | **extension** | ||
| 3019 | ))) | ||
| 3020 | |**X**|**Y**|**M**|**S**|**SM**|**T(bit)**|**C(bit)**|**LC(bit)**|**HSC(bit)**|**D.b**|**KnX**|**KnY**|**KnM**|**KnS**|**T**|**C**|**D**|**R**|**SD**|**LC**|**HSC**|**K**|**H**|**E**|**[D]**|**XXP** | ||
| 3021 | |(% rowspan="3" %)DAND|Parameter 1| | | | | | | | | | |●|●|●|●|●|●|●|●|●|●|●|●|●| |●|● | ||
| 3022 | |Parameter 2| | | | | | | | | | |●|●|●|●|●|●|●|●|●|●|●|●|●| |●|● | ||
| 3023 | |Parameter 3| | | | | | | | | | | |●|●|●|●|●|●|●|●|●|●| | | |●|● | ||
| 3024 | |||
| 3025 | **Features** | ||
| 3026 | |||
| 3027 | Perform a logical AND operation on each bit of the BIN 32-bit data of the device specified in (s1) and the BIN 32-bit data of the device specified in (s2), and store the result in the device specified in (d). | ||
| 3028 | |||
| 3029 | (% style="text-align:center" %) | ||
| 3030 | [[image:图片36.png]] | ||
| 3031 | |||
| 3032 | In the case of bit devices, bit devices after the number of points specified by the number of digits will be calculated as 0. | ||
| 3033 | |||
| 3034 | **Error code** | ||
| 3035 | |||
| 3036 | |=**Error code**|=**Content** | ||
| 3037 | |=4085H|The output results of (s1) and (s2) in the read application instruction exceed the device range | ||
| 3038 | |=4086H|The output result of (d) in the write application instruction exceeds the device range | ||
| 3039 | |||
| 3040 | **Example** | ||
| 3041 | |||
| 3042 | (% style="text-align:center" %) | ||
| 3043 | [[image:图片37.png]] | ||
| 3044 | |||
| 3045 | When M0 is set, perform logical AND operation of (D1, D0) and (D3, D2), and store the value in (D5, D4), (D1, D0) ∧ (D3, D2) → (D5, D4) . | ||
| 3046 | |||
| 3047 | == WXOR/16-bit Data Logic Exclusive OR == | ||
| 3048 | |||
| 3049 | **WXOR(P)** | ||
| 3050 | |||
| 3051 | Perform an exclusive OR operation on the BIN 16-bit data of the device specified in (s1) and the BIN 16-bit data of the device specified in (s2), and store the result in the device specified in (d). | ||
| 3052 | |||
| 3053 | -[WXOR (s1) (s2) (d)] | ||
| 3054 | |||
| 3055 | **Content, range and data type** | ||
| 3056 | |||
| 3057 | |=**Parameter**|=**Content**|=**Range**|=**Data type**|=**Data type (label)** | ||
| 3058 | |=(s1)|Store the data for exclusive OR operation or the device storing the data|-32768 to 32767|Signed BIN16|ANY16_S | ||
| 3059 | |=(s2)|Store the data for exclusive OR operation or the device storing the data|-32768 to +32767|Signed BIN16|ANY16_S | ||
| 3060 | |=(d)|Device for storing XOR result| |Signed BIN16|ANY16_S | ||
| 3061 | |||
| 3062 | **Device used** | ||
| 3063 | |||
| 3064 | |=(% rowspan="2" %)**instruction**|=(% rowspan="2" %)**Parameter**|=(% colspan="24" %)**Devices**|=((( | ||
| 3065 | **Index** | ||
| 3066 | |||
| 3067 | **modification** | ||
| 3068 | )))|=((( | ||
| 3069 | **Pulse** | ||
| 3070 | |||
| 3071 | **extension** | ||
| 3072 | ))) | ||
| 3073 | |**X**|**Y**|**M**|**S**|**SM**|**T(bit)**|**C(bit)**|**LC(bit)**|**HSC(bit)**|**D.b**|**KnX**|**KnY**|**KnM**|**KnS**|**T**|**C**|**D**|**R**|**SD**|**LC**|**HSC**|**K**|**H**|**E**|**[D]**|**XXP** | ||
| 3074 | |(% rowspan="3" %)WXOR|Parameter 1| | | | | | | | | | |●|●|●|●|●|●|●|●|●| | |●|●| |●|● | ||
| 3075 | |Parameter 2| | | | | | | | | | |●|●|●|●|●|●|●|●|●| | |●|●| |●|● | ||
| 3076 | |Parameter 3| | | | | | | | | | | |●|●|●|●|●|●|●|●| | | | | |●|● | ||
| 3077 | |||
| 3078 | **Features** | ||
| 3079 | |||
| 3080 | • Perform logical exclusive OR operation on the BIN 16-bit data of the device specified in (s1) and the BIN 16-bit data of the device specified in (s2), and store the result in the device specified in (d). | ||
| 3081 | |||
| 3082 | (% style="text-align:center" %) | ||
| 3083 | [[image:图片38.png]] | ||
| 3084 | |||
| 3085 | In the case of bit devices, bit devices after the number of points specified by the number of digits will be calculated as 0. | ||
| 3086 | |||
| 3087 | **Error code** | ||
| 3088 | |||
| 3089 | |=**Error code**|=**Content** | ||
| 3090 | |=4085H|The output results of (s1) and (s2) in the read application instruction exceed the device range | ||
| 3091 | |=4086H|The output result of (d) in the write application instruction exceeds the device range | ||
| 3092 | |||
| 3093 | **Example** | ||
| 3094 | |||
| 3095 | Example 1: When M0 is set, (D0) and (D2) are XOR operation, and the value is stored in (D4), (D0)∀(D2)→(D4). | ||
| 3096 | |||
| 3097 | (% style="text-align:center" %) | ||
| 3098 | [[image:图片39.png]] | ||
| 3099 | |||
| 3100 | Example 2: When used with the CML instruction, it can realize the logic exclusive OR (XORNOT) operation: | ||
| 3101 | |||
| 3102 | (% style="text-align:center" %) | ||
| 3103 | [[image:图片40.png]] | ||
| 3104 | |||
| 3105 | == **DXOR/32-bit data logic exclusive OR** == | ||
| 3106 | |||
| 3107 | **DXOR(P)** | ||
| 3108 | |||
| 3109 | Perform an exclusive OR operation on the BIN 32-bit data of the device specified in (s1) and the BIN 32-bit data of the device specified in (s2), and store the result in the device specified in (d). | ||
| 3110 | |||
| 3111 | -[DXOR (s1) (s2) (d)] | ||
| 3112 | |||
| 3113 | **Content, range and data type** | ||
| 3114 | |||
| 3115 | |=**Parameter**|=**Content**|=**Range**|=**Data type**|=**Data type (label)** | ||
| 3116 | |=(s1)|Store the data for exclusive OR operation or the device storing the data|-2147483648 to 2147483647|Signed BIN32|ANY32_S | ||
| 3117 | |=(s2)|Store the data for exclusive OR operation or the device storing the data|-2147483648 to 2147483647|Signed BIN32|ANY32_S | ||
| 3118 | |=(d)|Device for storing XOR result| |Signed BIN32|ANY32_S | ||
| 3119 | |||
| 3120 | **Device used** | ||
| 3121 | |||
| 3122 | |=(% rowspan="2" %)**instruction**|=(% rowspan="2" %)**Parameter**|=(% colspan="24" %)**Devices**|=((( | ||
| 3123 | **Index** | ||
| 3124 | |||
| 3125 | **modification** | ||
| 3126 | )))|=((( | ||
| 3127 | **Pulse** | ||
| 3128 | |||
| 3129 | **extension** | ||
| 3130 | ))) | ||
| 3131 | |**X**|**Y**|**M**|**S**|**SM**|**T(bit)**|**C(bit)**|**LC(bit)**|**HSC(bit)**|**D.b**|**KnX**|**KnY**|**KnM**|**KnS**|**T**|**C**|**D**|**R**|**SD**|**LC**|**HSC**|**K**|**H**|**E**|**[D]**|**XXP** | ||
| 3132 | |(% rowspan="3" %)DXOR|Parameter 1| | | | | | | | | | |●|●|●|●|●|●|●|●|●|●|●|●|●| |●|● | ||
| 3133 | |Parameter 2| | | | | | | | | | |●|●|●|●|●|●|●|●|●|●|●|●|●| |●|● | ||
| 3134 | |Parameter 3| | | | | | | | | | | |●|●|●|●|●|●|●|●|●|●| | | |●|● | ||
| 3135 | |||
| 3136 | **Features** | ||
| 3137 | |||
| 3138 | Perform an exclusive OR operation on the BIN 32-bit data of the device specified in (s1) and the BIN 32-bit data of the device specified in (s2), and store the result in the device specified in (d). | ||
| 3139 | |||
| 3140 | (% style="text-align:center" %) | ||
| 3141 | [[image:图片41.png]] | ||
| 3142 | |||
| 3143 | In the case of bit devices, bit devices after the number of points specified by the number of digits will be calculated as 0. | ||
| 3144 | |||
| 3145 | **Error code** | ||
| 3146 | |||
| 3147 | |=**Error code**|=**Content** | ||
| 3148 | |=4085H|The output results of (s1) and (s2)in the read application instruction exceed the device range | ||
| 3149 | |=4086H|The output result of (d) in the write application instruction exceeds the device range | ||
| 3150 | |||
| 3151 | **Example** | ||
| 3152 | |||
| 3153 | (% style="text-align:center" %) | ||
| 3154 | [[image:图片42.png]] | ||
| 3155 | |||
| 3156 | |||
| 3157 | When M0 is set, (D1, D0) and (D3, D2) are XOR operation, and the value is stored in (D5, D4), that is, (D1, D0) ∀ (D3, D2) → (D5, D4) ) | ||
| 3158 | |||
| 3159 | == ANS/Alarm Settings == | ||
| 3160 | |||
| 3161 | **ANS(P)** | ||
| 3162 | |||
| 3163 | Used to set alarm instructions. | ||
| 3164 | |||
| 3165 | -[ANS (s) (n) (d)] | ||
| 3166 | |||
| 3167 | **Content, range and data type** | ||
| 3168 | |||
| 3169 | |=**Parameter**|=**Content**|=**Range**|=**Data type**|=**Data type (label)** | ||
| 3170 | |=(s)|Timer number for judging time|-|Signed BIN 16 bit|ANY16 | ||
| 3171 | |=(n)|Data that judges time|1 to 32767|Signed BIN 16 bit|ANY16 | ||
| 3172 | |=(d)|The set alarm device|-|Bit|ANY16_BOOL | ||
| 3173 | |||
| 3174 | **Device used** | ||
| 3175 | |||
| 3176 | |=(% rowspan="2" %)**instruction**|=(% rowspan="2" %)**Parameter**|=(% colspan="24" %)**Devices**|=((( | ||
| 3177 | **Index** | ||
| 3178 | |||
| 3179 | **modification** | ||
| 3180 | )))|=((( | ||
| 3181 | **Pulse** | ||
| 3182 | |||
| 3183 | **extension** | ||
| 3184 | ))) | ||
| 3185 | |**X**|**Y**|**M**|**S**|**SM**|**T(bit)**|**C(bit)**|**LC(bit)**|**HSC(bit)**|**D.b**|**KnX**|**KnY**|**KnM**|**KnS**|**T**|**C**|**D**|**R**|**SD**|**LC**|**HSC**|**K**|**H**|**E**|**[D]**|**XXP** | ||
| 3186 | |(% rowspan="3" %)ANS|Parameter 1| | | | | | | | | | | | | | |●| | | | | | | | | |●|● | ||
| 3187 | |Parameter 2| | | | | | | | | | |●|●|●|●|●|●|●|●|●| | |●|●| |●|● | ||
| 3188 | |Parameter 3| | | |●| | | | | | | | | | | | | | | | | | | | |●|● | ||
| 3189 | |||
| 3190 | **Features** | ||
| 3191 | |||
| 3192 | When the instruction input continues to be ON for the judgment time [(n)×100ms, timer (s)], set (d). If the instruction time turns off below the judgment time [(n)×100ms], the current value of the judgment timer (s) is reset, and (d) is not set. In addition, if the instruction input turns off, the judgment timer will be reset. | ||
| 3193 | |||
| 3194 | (% style="text-align:center" %) | ||
| 3195 | [[image:图片43.png]] | ||
| 3196 | |||
| 3197 | (% style="text-align:center" %) | ||
| 3198 | [[image:图片44.png]] | ||
| 3199 | |||
| 3200 | * Judge the time ((n)X 100ms or less) | ||
| 3201 | * Judgment time or more (inclusive) ((n) X 100ms or more (inclusive)) | ||
| 3202 | |||
| 3203 | **Related device** | ||
| 3204 | |||
| 3205 | |=**Devices**|=**Name**|=**Content** | ||
| 3206 | |=SM249|Signal alarm is valid|After SM249 is ON, the following SM248 and SD249 act. | ||
| 3207 | |=SM248|Signal alarm action|SM249 is ON, when any one of the states S900 to S999 is active, SM248 is ON | ||
| 3208 | |=SD249|Signal alarm ON state minimum number|Save the smallest number of actions in S900 to S999. | ||
| 3209 | |||
| 3210 | **Error code** | ||
| 3211 | |||
| 3212 | |=**Error code**|=**Content** | ||
| 3213 | |(% rowspan="3" %)4084H|The value specified in (n1) and (n2) exceeds the range of 0 to 32767 | ||
| 3214 | |The timer number is not in the range of T0 to T199. | ||
| 3215 | |The signal alarm is not in the range of S900 to S999. | ||
| 3216 | |4085H|When the device specified in the read application instructions (s) and (n) exceeds the corresponding device range | ||
| 3217 | |4086H|When the device specified in the write application instruction (d) exceeds the corresponding device range | ||
| 3218 | |||
| 3219 | **Example** | ||
| 3220 | |||
| 3221 | The fault number is displayed by the signal alarm. | ||
| 3222 | |||
| 3223 | As shown below, when you write a program for diagnosing external faults, such as monitoring the content of SM249 (the smallest number in the ON state), the smallest number in the ON state among S900 to S999 will be displayed. When multiple faults occur at the same time, the next fault number can be obtained after eliminating the fault with the smallest number. | ||
| 3224 | |||
| 3225 | (% style="text-align:center" %) | ||
| 3226 | [[image:图片45.png]] | ||
| 3227 | |||
| 3228 | * Monitoring is effective after SM249 is turned ON. | ||
| 3229 | * Detect X1 for 2 seconds, turn ON, set S900. | ||
| 3230 | * X4 is detected for 1 second, turn ON, set S901. | ||
| 3231 | * SM248 will act after any one of S900 to S999 is ON, and the output fault display YY6 will act. | ||
| 3232 | * Display the fault number to the D0 device. | ||
| 3233 | * Through the external fault diagnosis program, use the reset button M0 to turn off the activated state. Each time M0 turns ON, the action status of the new number is set in turn, and the new number that is already ON is reset. | ||
| 3234 | |||
| 3235 | == **ANR/Alarm Reset** == | ||
| 3236 | |||
| 3237 | |||
| 3238 | **ANR(P)** | ||
| 3239 | |||
| 3240 | The instruction to reset the small number that is ON in the alarm. | ||
| 3241 | |||
| 3242 | -[ANR] | ||
| 3243 | |||
| 3244 | **Content, range and data type** | ||
| 3245 | |||
| 3246 | |=**Parameter**|=**Content**|=**Range**|=**Data type**|=**Data type (label)** | ||
| 3247 | |=No|No parameter setting|-|-|- | ||
| 3248 | |||
| 3249 | **Device used** | ||
| 3250 | |||
| 3251 | |=(% rowspan="2" %)**instruction**|=(% rowspan="2" %)**Parameter**|=(% colspan="24" %)**Devices**|=**Index modification**|=((( | ||
| 3252 | **Pulse** | ||
| 3253 | |||
| 3254 | **extension** | ||
| 3255 | ))) | ||
| 3256 | |**X**|**Y**|**M**|**S**|**SM**|**T(bit)**|**C(bit)**|**LC(bit)**|**HSC(bit)**|**D.b**|**KnX**|**KnY**|**KnM**|**KnS**|**T**|**C**|**D**|**R**|**SD**|**LC**|**HSC**|**K**|**H**|**E**|**[D]**|**XXP** | ||
| 3257 | |ANR|No|(% colspan="26" %)No object device | ||
| 3258 | |||
| 3259 | **Features** | ||
| 3260 | |||
| 3261 | If the instruction input is ON, reset the active alarm in the alarm. | ||
| 3262 | |||
| 3263 | If multiple alarms are operating, reset the smaller number. If the input instruction is turned ON again, the next small number in the alarm that is operating will be reset. | ||
| 3264 | |||
| 3265 | (% style="text-align:center" %) | ||
| 3266 | [[image:图片46.png]] | ||
| 3267 | |||
| 3268 | **Related device** | ||
| 3269 | |||
| 3270 | |=**Devices**|=**Name**|=**Content** | ||
| 3271 | |=SM249|Signal alarm is valid|After SM249 is ON, the following SM248 and SD249 act. | ||
| 3272 | |=SM248|Signal alarm action|SM249 is ON, when any one of the states S900 to S999 is active, SM248 is ON. | ||
| 3273 | |=SD249|Signal alarm ON state minimum number|Save the smallest number of actions in S900 to S999. | ||
| 3274 | |||
| 3275 | (% class="box infomessage" %) | ||
| 3276 | ((( | ||
| 3277 | **✎Note: **If you use the ANR instruction, reset in sequence every cycle. | ||
| 3278 | |||
| 3279 | If the ANRP instruction is used, it will be executed in only one operation cycle. | ||
| 3280 | ))) | ||
| 3281 | |||
| 3282 | **Error code** | ||
| 3283 | |||
| 3284 | No operation error. | ||
| 3285 | |||
| 3286 | **Example** | ||
| 3287 | |||
| 3288 | The fault number is displayed by the signal alarm. | ||
| 3289 | |||
| 3290 | As shown below, when you write a program for diagnosing external faults, such as monitoring the content of SM249 (the smallest number in the ON state), the smallest number in the ON state among S900 to S999 will be displayed. When multiple faults occur at the same time, the next fault number can be obtained after eliminating the fault with the smallest number. | ||
| 3291 | |||
| 3292 | (% style="text-align:center" %) | ||
| 3293 | [[image:图片47.png]] | ||
| 3294 | |||
| 3295 | 1. Monitoring is effective after SM249 is turned ON. | ||
| 3296 | 1. Detect X1 for 2 seconds, turn ON, set S900. | ||
| 3297 | 1. X4 is detected for 1 second, turn ON, set S901. | ||
| 3298 | 1. SM248 will act after any one of S900 to S999 is ON, and the output fault display YY6 will act. | ||
| 3299 | 1. Display the fault number to the D0 device. | ||
| 3300 | 1. Through the external fault diagnosis program, use the reset button M0 to turn off the activated state. Each time M0 turns ON, the action status of the new number is set in turn, and the new number that is already ON is reset. | ||
| 3301 | |||
| 3302 | == BON/16-bit Data Bit Judgment == | ||
| 3303 | |||
| 3304 | **BON(P)** | ||
| 3305 | |||
| 3306 | Check whether the state of the BIN 16-bit data (n) bit of the device specified in (s) is ON or OFF, and output the result to the device specified in (d). | ||
| 3307 | |||
| 3308 | -[BON (s) (n) (d)] | ||
| 3309 | |||
| 3310 | **Content, range and data type** | ||
| 3311 | |||
| 3312 | |=**Parameter**|=**Content**|=**Range**|=**Data type**|=**Data type (label)** | ||
| 3313 | |=(s)|Data storage destination word device number|-|Signed BIN 16 bit|ANY16 | ||
| 3314 | |=(d)|Bit device number of drive|-|Bit|ANY16_BOOL | ||
| 3315 | |=(n)|The position of the bit to be judged|0 to 15|Signed BIN 16 bit|ANY16 | ||
| 3316 | |||
| 3317 | **Device used** | ||
| 3318 | |||
| 3319 | |=(% rowspan="2" %)**instruction**|=(% rowspan="2" %)**Parameter**|=(% colspan="24" %)**Devices**|=((( | ||
| 3320 | **Index** | ||
| 3321 | |||
| 3322 | **modification** | ||
| 3323 | )))|=((( | ||
| 3324 | **Pulse** | ||
| 3325 | |||
| 3326 | **extension** | ||
| 3327 | ))) | ||
| 3328 | |**X**|**Y**|**M**|**S**|**SM**|**T(bit)**|**C(bit)**|**LC(bit)**|**HSC(bit)**|**D.b**|**KnX**|**KnY**|**KnM**|**KnS**|**T**|**C**|**D**|**R**|**SD**|**LC**|**HSC**|**K**|**H**|**E**|**[D]**|**XXP** | ||
| 3329 | |(% rowspan="3" %)BON|Parameter 1| | | | | | | | | | |●|●|●|●|●|●|●|●|●| | |●|●| |●|● | ||
| 3330 | |Parameter 2| |●|●|●|●| | | | |●| | | | | | |●|●|●| | | | | |●|● | ||
| 3331 | |Parameter 3| | | | | | | | | | |●|●|●|●|●|●|●|●|●| | |●|●| |●|● | ||
| 3332 | |||
| 3333 | **Features** | ||
| 3334 | |||
| 3335 | Check whether the state of the BIN 16-bit data (n) bit of the device specified in (s) is ON or OFF, and output the result to the device specified in (d). | ||
| 3336 | |||
| 3337 | If the above result is ON, then (d)=ON, if it is OFF, then (d)=OFF. | ||
| 3338 | |||
| 3339 | If a constant (K) is specified in the device specified in (s), it will be automatically converted to BIN. | ||
| 3340 | |||
| 3341 | (% style="text-align:center" %) | ||
| 3342 | [[image:图片48.png]] | ||
| 3343 | |||
| 3344 | **Error code** | ||
| 3345 | |||
| 3346 | |=**Error code**|=**Content** | ||
| 3347 | |=4084H|The data input in (n) exceeds the specified range of 0 to 15. | ||
| 3348 | |=4085H|When the device specified in the read application instructions (s) and (n) exceeds the corresponding device range | ||
| 3349 | |=4086H|When the device specified in the write application instruction (d) exceeds the corresponding device range | ||
| 3350 | |||
| 3351 | **Example** | ||
| 3352 | |||
| 3353 | (% style="text-align:center" %) | ||
| 3354 | [[image:图片49.png]] | ||
| 3355 | |||
| 3356 | When n in D0 = the third bit is 1 (ON), M0 is set to 1 (ON). | ||
| 3357 | |||
| 3358 | (% style="text-align:center" %) | ||
| 3359 | [[image:图片50.png]] | ||
| 3360 | |||
| 3361 | == DBON/32-bit Data Bit Judgment == | ||
| 3362 | |||
| 3363 | **DBON(P)** | ||
| 3364 | |||
| 3365 | Check whether the state of the BIN 32-bit data (n) bit of the device specified in (s) is ON or OFF, and output the result to the device specified in (d). | ||
| 3366 | |||
| 3367 | -[DBON (s) (n) (d)] | ||
| 3368 | |||
| 3369 | **Content, range and data type** | ||
| 3370 | |||
| 3371 | |=**Parameter**|=**Content**|=**Range**|=**Data type**|=**Data type (label)** | ||
| 3372 | |=(s)|Data storage destination word device number|-|Signed BIN 32 bit|ANY32 | ||
| 3373 | |=(d)|Bit device number of drive|-|Bit|ANY32_BOOL | ||
| 3374 | |=(n)|The position of the bit to be judged|0 to 31|Signed BIN 32 bit|ANY32 | ||
| 3375 | |||
| 3376 | **Device used** | ||
| 3377 | |||
| 3378 | |=(% rowspan="2" %)**instruction**|=(% rowspan="2" %)**Parameter**|=(% colspan="24" %)**Devices**|=((( | ||
| 3379 | **Index** | ||
| 3380 | |||
| 3381 | **modification** | ||
| 3382 | )))|=((( | ||
| 3383 | **Pulse** | ||
| 3384 | |||
| 3385 | **extension** | ||
| 3386 | ))) | ||
| 3387 | |**X**|**Y**|**M**|**S**|**SM**|**T(bit)**|**C(bit)**|**LC(bit)**|**HSC(bit)**|**D.b**|**KnX**|**KnY**|**KnM**|**KnS**|**T**|**C**|**D**|**R**|**SD**|**LC**|**HSC**|**K**|**H**|**E**|**[D]**|**XXP** | ||
| 3388 | |(% rowspan="3" %)DBON|Parameter 1| | | | | | | | | | |●|●|●|●|●|●|●|●|●|●|●|●|●| |●|● | ||
| 3389 | |Parameter 2| |●|●|●|●| | | | |●| | | | | | |●|●|●| | | | | |●|● | ||
| 3390 | |Parameter 3| | | | | | | | | | |●|●|●|●|●|●|●|●|●|●|●|●|●| |●|● | ||
| 3391 | |||
| 3392 | **Features** | ||
| 3393 | |||
| 3394 | Check whether the BIN 32-bit data (n) bit status of the device specified in (s) is ON or OFF, and output the result to the device specified in (d). | ||
| 3395 | |||
| 3396 | If the above result is ON, then (d)=ON, if it is OFF, then (d)=OFF. | ||
| 3397 | |||
| 3398 | If a constant (K) is specified in the device specified in (s), it will be automatically converted to BIN. | ||
| 3399 | |||
| 3400 | (% style="text-align:center" %) | ||
| 3401 | [[image:图片51.png]] | ||
| 3402 | |||
| 3403 | **Error code** | ||
| 3404 | |||
| 3405 | |=**Error code**|=**Content** | ||
| 3406 | |=4084H|The data input in (n) exceeds the specified range of 0 to 31. | ||
| 3407 | |=4085H|When the device specified in the read application instructions (s) and (n) exceeds the corresponding device range | ||
| 3408 | |=4086H|When the device specified in the write application instruction (d) exceeds the corresponding device range | ||
| 3409 | |||
| 3410 | **Example** | ||
| 3411 | |||
| 3412 | When n in D0 = the third bit is 1 (ON), M0 is set to 1 (ON). | ||
| 3413 | |||
| 3414 | (% style="text-align:center" %) | ||
| 3415 | [[image:图片52.png]] | ||
| 3416 | |||
| 3417 | == ENCO/Encode == | ||
| 3418 | |||
| 3419 | **ENCO(P)** | ||
| 3420 | |||
| 3421 | Encode the data of the 2th (n)th power from (s) and store it in (d). | ||
| 3422 | |||
| 3423 | -[ENCO (s) (n) (d)] | ||
| 3424 | |||
| 3425 | **Content, range and data type** | ||
| 3426 | |||
| 3427 | |=**Parameter**|=**Content**|=**Range**|=**Data type**|=**Data type (label)** | ||
| 3428 | |=(s)|Start device for storing coded data|-|Bit/Signed BIN 16 bit|ANY_ELEMENTARY | ||
| 3429 | |=(d)|Device number storing the encoding result|-|Signed BIN 16 bit|ANY_ELEMENTARY | ||
| 3430 | |=(n)|Effective bit length|0 to 8|Signed BIN 16 bit|ANY16 | ||
| 3431 | |||
| 3432 | **Device used** | ||
| 3433 | |||
| 3434 | |=(% rowspan="2" %)**instruction**|=(% rowspan="2" %)**Parameter**|=(% colspan="24" %)**Devices**|=((( | ||
| 3435 | **Index** | ||
| 3436 | |||
| 3437 | **modification** | ||
| 3438 | )))|=((( | ||
| 3439 | **Pulse** | ||
| 3440 | |||
| 3441 | **extension** | ||
| 3442 | ))) | ||
| 3443 | |**X**|**Y**|**M**|**S**|**SM**|**T(bit)**|**C(bit)**|**LC(bit)**|**HSC(bit)**|**D.b**|**KnX**|**KnY**|**KnM**|**KnS**|**T**|**C**|**D**|**R**|**SD**|**LC**|**HSC**|**K**|**H**|**E**|**[D]**|**XXP** | ||
| 3444 | |(% rowspan="3" %)ENCO|Parameter 1|●|●|●|●|●| | | | | | | | | |●|●|●|●|●| | | | | |●|● | ||
| 3445 | |Parameter 2| | | | | | | | | | | |●|●|●|●|●|●|●|●| | | | | |●|● | ||
| 3446 | |Parameter 3| | | | | | | | | | |●|●|●|●|●|●|●|●|●| | |●|●| |●|● | ||
| 3447 | |||
| 3448 | **Features** | ||
| 3449 | |||
| 3450 | The BIN value corresponding to the bit from 2^^ (n)^^ bits of (s) to 1 is stored in (d). | ||
| 3451 | |||
| 3452 | |||
| 3453 | When (n)=0, it w | ||
| 3454 | |||
| 3455 | (% style="text-align:center" %) | ||
| 3456 | [[image:图片53.png]] | ||
| 3457 | |||
| 3458 | ill be no processing, and the content of the device specified in (d) will not change. | ||
| 3459 | |||
| 3460 | Bit devices are treated as 1 bit, and word devices are treated as 16 bits. | ||
| 3461 | |||
| 3462 | When multiple digits are 1, it will be processed at the upper position. | ||
| 3463 | |||
| 3464 | **Error code** | ||
| 3465 | |||
| 3466 | |=**Error code**|=**Content** | ||
| 3467 | |(% rowspan="3" %)4084H|In the bit device specification of (s), when (n) is other than 0 to 8. | ||
| 3468 | |In the word device specification of (s), when (n) is other than 0 to 4. | ||
| 3469 | |When the data of 2^^(n) ^^bits starting from (s) are all 0. | ||
| 3470 | |4085H|When the device specified in the read application instructions (s) and (n) exceeds the corresponding device range | ||
| 3471 | |4086H|When the device specified in the write application instruction (d) exceeds the corresponding device range | ||
| 3472 | |||
| 3473 | **Example** | ||
| 3474 | |||
| 3475 | (% style="text-align:center" %) | ||
| 3476 | [[image:图片54.png]] | ||
| 3477 | |||
| 3478 | When M20 is turned ON, the D0 device is 16 after encoding. | ||
| 3479 | |||
| 3480 | == **DECO/Decode** == | ||
| 3481 | |||
| 3482 | |||
| 3483 | **DECO(P)** | ||
| 3484 | |||
| 3485 | Decode the lower (n) bits of the device specified in (s), and store the result in the 2 (n)th power of the device specified in (d). | ||
| 3486 | |||
| 3487 | -[DECO (s) (n) (d)] | ||
| 3488 | |||
| 3489 | **Content, range and data type** | ||
| 3490 | |||
| 3491 | |=**Parameter**|=**Content**|=**Range**|=**Data type**|=**Data type (label)** | ||
| 3492 | |=(s)|Decoded data or the device number storing the decoded data|-|Bit/Signed BIN 16 bit|ANY_ELEMENTARY | ||
| 3493 | |=(d)|The start device storing the decoding result|-|Signed BIN 16 bit|ANY_ELEMENTARY | ||
| 3494 | |=(n)|Effective bit length|0 to 8|Signed BIN 16 bit|ANY16 | ||
| 3495 | |||
| 3496 | **Device used** | ||
| 3497 | |||
| 3498 | |=(% rowspan="2" %)**instruction**|=(% rowspan="2" %)**Parameter**|=(% colspan="24" %)**Devices**|=((( | ||
| 3499 | **Index** | ||
| 3500 | |||
| 3501 | **modification** | ||
| 3502 | )))|=((( | ||
| 3503 | **Pulse** | ||
| 3504 | |||
| 3505 | **extension** | ||
| 3506 | ))) | ||
| 3507 | |**X**|**Y**|**M**|**S**|**SM**|**T(bit)**|**C(bit)**|**LC(bit)**|**HSC(bit)**|**D.b**|**KnX**|**KnY**|**KnM**|**KnS**|**T**|**C**|**D**|**R**|**SD**|**LC**|**HSC**|**K**|**H**|**E**|**[D]**|**XXP** | ||
| 3508 | |(% rowspan="3" %)DECO|Parameter 1|●|●|●|●|●| | | | | | |●|●|●|●|●|●|●|●| | |●|●| |●|● | ||
| 3509 | |Parameter 2| |●|●|●|●| | | | | | | | | |●|●|●|●|●| | | | | |●|● | ||
| 3510 | |Parameter 3| | | | | | | | | | |●|●|●|●|●|●|●|●|●| | |●|●| |●|● | ||
| 3511 | |||
| 3512 | **Features** | ||
| 3513 | |||
| 3514 | Turn ON the position of (d) corresponding to the BIN value specified in the lower (n) bit of (s). | ||
| 3515 | |||
| 3516 | When (n)=0, it will be no processing, and the content of the device specified in (d) will not change. | ||
| 3517 | |||
| 3518 | Bit devices are treated as 1 bit, and word devices are treated as 16 bits. | ||
| 3519 | |||
| 3520 | (% style="text-align:center" %) | ||
| 3521 | [[image:图片55.png]] | ||
| 3522 | |||
| 3523 | **Error code** | ||
| 3524 | |||
| 3525 | |=**Error code**|=**Content** | ||
| 3526 | |(% rowspan="2" %)4084H|In the bit device specification of (d), when (n) is other than 0 to 8. | ||
| 3527 | |In the word device specification of (d), when (n) is other than 0 to 4. | ||
| 3528 | |4085H|When the device specified in the read application instructions (s) and (n) exceeds the corresponding device range | ||
| 3529 | |4086H|When the device specified in the write application instruction (d) exceeds the corresponding device range | ||
| 3530 | |||
| 3531 | **Example** | ||
| 3532 | |||
| 3533 | (% style="text-align:center" %) | ||
| 3534 | [[image:图片56.png]] | ||
| 3535 | |||
| 3536 | When M20 is ON, M3 will be turned ON. | ||
| 3537 | |||
| 3538 | == SUM/The ON Bits of 16-bit Data == | ||
| 3539 | |||
| 3540 | **SUM(P)** | ||
| 3541 | |||
| 3542 | Store the total number of bits at 1 in the BIN 16-bit data of the device specified in (s) to the device specified in (d). | ||
| 3543 | |||
| 3544 | -[SUM (s) (d)] | ||
| 3545 | |||
| 3546 | **Content, range and data type** | ||
| 3547 | |||
| 3548 | |=**Parameter**|=**Content**|=**Range**|=**Data type**|=**Data type (label)** | ||
| 3549 | |=(s)|The device start number that counts the total number of bits at 1|-|Signed BIN 16 bit|ANY16 | ||
| 3550 | |=(d)|The device start number of the total number of storage bits|-|Signed BIN 16 bit|ANY16 | ||
| 3551 | |||
| 3552 | **Device used** | ||
| 3553 | |||
| 3554 | |=(% rowspan="2" %)**instruction**|=(% rowspan="2" %)**Parameter**|=(% colspan="24" %)**Devices**|=((( | ||
| 3555 | **Index** | ||
| 3556 | |||
| 3557 | **modification** | ||
| 3558 | )))|=((( | ||
| 3559 | **Pulse** | ||
| 3560 | |||
| 3561 | **extension** | ||
| 3562 | ))) | ||
| 3563 | |**X**|**Y**|**M**|**S**|**SM**|**T(bit)**|**C(bit)**|**LC(bit)**|**HSC(bit)**|**D.b**|**KnX**|**KnY**|**KnM**|**KnS**|**T**|**C**|**D**|**R**|**SD**|**LC**|**HSC**|**K**|**H**|**E**|**[D]**|**XXP** | ||
| 3564 | |(% rowspan="2" %)SUM|Parameter 1| | | | | | | | | | |●|●|●|●|●|●|●|●|●| | |●|●| |●|● | ||
| 3565 | |Parameter 2| | | | | | | | | | | |●|●|●|●|●|●|●|●| | | | | |●|● | ||
| 3566 | |||
| 3567 | **Features** | ||
| 3568 | |||
| 3569 | Store the total number of bits at 1 in the BIN 16-bit data of the device specified in (s) to the device specified in (d). | ||
| 3570 | |||
| 3571 | When the BIN 16-bit data of the device specified in (s) is all 0, the zero flag (SM153) turns on. | ||
| 3572 | |||
| 3573 | (% style="text-align:center" %) | ||
| 3574 | [[image:图片57.png]] | ||
| 3575 | |||
| 3576 | 1. The total number of 1 (ON) is stored in BIN. | ||
| 3577 | 1. There are 8 in the example on the left. | ||
| 3578 | |||
| 3579 | **Error code** | ||
| 3580 | |||
| 3581 | |=**Error code**|=**Content** | ||
| 3582 | |=4085H|When the device specified in the read application instructions (s) exceeds the corresponding device range | ||
| 3583 | |=4086H|When the device specified in the write application instruction (d) exceeds the corresponding device range | ||
| 3584 | |||
| 3585 | **Example** | ||
| 3586 | |||
| 3587 | (% style="text-align:center" %) | ||
| 3588 | [[image:图片58.png]] | ||
| 3589 | |||
| 3590 | When M0 is ON, the number of ON bits in D0 is counted and stored in D1. The value after D1 is executed is 4. | ||
| 3591 | |||
| 3592 | == DSUM/The ON Bits of 32-bit Data == | ||
| 3593 | |||
| 3594 | **DSUM(P)** | ||
| 3595 | |||
| 3596 | Store the total number of bits at 1 in the BIN 32-bit data of the device specified in (s) to the device specified in (d). | ||
| 3597 | |||
| 3598 | -[SUM (s) (d)] | ||
| 3599 | |||
| 3600 | **Content, range and data type** | ||
| 3601 | |||
| 3602 | |=**Parameter**|=**Content**|=**Range**|=**Data type**|=**Data type (label)** | ||
| 3603 | |=(s)|The device start number that counts the total number of bits at 1|-|Signed BIN 32 bit|ANY32 | ||
| 3604 | |=(d)|The device start number of the total number of storage bits|-|Signed BIN 32 bit|ANY32 | ||
| 3605 | |||
| 3606 | **Device used** | ||
| 3607 | |||
| 3608 | |=(% rowspan="2" %)**instruction**|=(% rowspan="2" %)**Parameter**|=(% colspan="24" %)**Devices**|=((( | ||
| 3609 | **Index** | ||
| 3610 | |||
| 3611 | **modification** | ||
| 3612 | )))|=((( | ||
| 3613 | **Pulse** | ||
| 3614 | |||
| 3615 | **extension** | ||
| 3616 | ))) | ||
| 3617 | |**X**|**Y**|**M**|**S**|**SM**|**T(bit)**|**C(bit)**|**LC(bit)**|**HSC(bit)**|**D.b**|**KnX**|**KnY**|**KnM**|**KnS**|**T**|**C**|**D**|**R**|**SD**|**LC**|**HSC**|**K**|**H**|**E**|**[D]**|**XXP** | ||
| 3618 | |(% rowspan="2" %)DSUM|Parameter 1| | | | | | | | | | |●|●|●|●|●|●|●|●|●|●|●|●|●| |●|● | ||
| 3619 | |Parameter 2| | | | | | | | | | | |●|●|●|●|●|●|●|●|●|●| | | |●|● | ||
| 3620 | |||
| 3621 | **Features** | ||
| 3622 | |||
| 3623 | Store the total number of bits at 1 in the BIN 32-bit data of the device specified in (s) to the device specified in (d). | ||
| 3624 | |||
| 3625 | When the BIN 32-bit data of the device specified in (s) is all 0 (OFF), the zero flag (SM153) turns on. | ||
| 3626 | |||
| 3627 | (% style="text-align:center" %) | ||
| 3628 | [[image:图片59.png]] | ||
| 3629 | |||
| 3630 | The total number of 1 (ON) is stored in BIN. | ||
| 3631 | |||
| 3632 | There are 16 in the example on the left. | ||
| 3633 | |||
| 3634 | (% class="box infomessage" %) | ||
| 3635 | ((( | ||
| 3636 | **✎Note:** | ||
| 3637 | When the instruction input is OFF, the instruction will not be executed, and the output of the ON digits of the action will remain the same as before. | ||
| 3638 | ))) | ||
| 3639 | |||
| 3640 | **Error code** | ||
| 3641 | |||
| 3642 | |=**Error code**|=**Content** | ||
| 3643 | |=4085H|When the device specified in the read application instructions (s) exceeds the corresponding device range | ||
| 3644 | |=4086H|When the device specified in the write application instruction (d) exceeds the corresponding device range | ||
| 3645 | |||
| 3646 | **Example** | ||
| 3647 | |||
| 3648 | (% style="text-align:center" %) | ||
| 3649 | [[image:图片60.png]] | ||
| 3650 | |||
| 3651 | When M0 is ON, the number of ON bits in D0 is counted and stored in D10, and the value after D10 is executed is 4. | ||
| 3652 | |||
| 3653 | == MEAN/Average Value of 16-bit Data == | ||
| 3654 | |||
| 3655 | **MEAN(P)** | ||
| 3656 | |||
| 3657 | Store the total number of bits at 1 in the BIN 16-bit data of the device specified in (s) to the device specified in (d). | ||
| 3658 | |||
| 3659 | -[MEAN (s) (d) (n)] | ||
| 3660 | |||
| 3661 | **Content, range and data type** | ||
| 3662 | |||
| 3663 | |=**Parameter**|=**Content**|=**Range**|=**Data type**|=**Data type (label)** | ||
| 3664 | |=(s)|The device start number storing the data for average calculation|-|Signed BIN 16 bit|ANY16 | ||
| 3665 | |=(d)|The device start number storing the average value|-|Signed BIN 16 bit|ANY16 | ||
| 3666 | |=(n)|Number of data or the device number storing the number of data|1 to 32767|Signed BIN 16 bit|ANY16 | ||
| 3667 | |||
| 3668 | **Device used** | ||
| 3669 | |||
| 3670 | |=(% rowspan="2" %)**instruction**|=(% rowspan="2" %)**Parameter**|=(% colspan="24" %)**Devices**|=((( | ||
| 3671 | **Index** | ||
| 3672 | |||
| 3673 | **modification** | ||
| 3674 | )))|=((( | ||
| 3675 | **Pulse** | ||
| 3676 | |||
| 3677 | **extension** | ||
| 3678 | ))) | ||
| 3679 | |**X**|**Y**|**M**|**S**|**SM**|**T(bit)**|**C(bit)**|**LC(bit)**|**HSC(bit)**|**D.b**|**KnX**|**KnY**|**KnM**|**KnS**|**T**|**C**|**D**|**R**|**SD**|**LC**|**HSC**|**K**|**H**|**E**|**[D]**|**XXP** | ||
| 3680 | |(% rowspan="3" %)MEAN|Parameter 1| | | | | | | | | | |●|●|●|●|●|●|●|●|●| | | | | |●|● | ||
| 3681 | |Parameter 2| | | | | | | | | | | |●|●|●|●|●|●|●|●| | | | | |●|● | ||
| 3682 | |Parameter 3| | | | | | | | | | |●|●|●|●|●|●|●|●|●| | |●|●| |●|● | ||
| 3683 | |||
| 3684 | **Features** | ||
| 3685 | |||
| 3686 | Calculate the average value of the 16-bit data at (n) points starting from the device specified in (s) and store it in the device specified in (d). | ||
| 3687 | |||
| 3688 | The total is calculated from the algebraic sum and divided by (n). | ||
| 3689 | |||
| 3690 | The remainder is rounded off. | ||
| 3691 | |||
| 3692 | (% style="text-align:center" %) | ||
| 3693 | [[image:图片1.png]] | ||
| 3694 | |||
| 3695 | **Error code** | ||
| 3696 | |||
| 3697 | |**Error code**|**Content** | ||
| 3698 | |4084H|The data input by (n) in the application instruction exceeds the specifiable range. N≤0 | ||
| 3699 | |4085H|When the device specified in the read application instructions (s) and (n) exceeds the corresponding device range | ||
| 3700 | |4086H|When the device specified in the write application instruction (d) exceeds the corresponding device range | ||
| 3701 | |||
| 3702 | **Example** | ||
| 3703 | |||
| 3704 | (% style="text-align:center" %) | ||
| 3705 | [[image:图片2.png]] | ||
| 3706 | |||
| 3707 | Add the data of D0, D1, and D2 and save the value obtained after dividing by 3 in D10. The calculated average value is 6. | ||
| 3708 | |||
| 3709 | == DMEAN/Average Value of 16-bit Data == | ||
| 3710 | |||
| 3711 | **DMEAN(P)** | ||
| 3712 | |||
| 3713 | Store the total number of bits at 1 in the BIN 32-bit data of the device specified in (s) to the device specified in (d). | ||
| 3714 | |||
| 3715 | -[DMEAN (s) (d) (n)] | ||
| 3716 | |||
| 3717 | **Content, range and data type** | ||
| 3718 | |||
| 3719 | |=**Parameter**|=**Content**|=**Range**|=**Data type**|=**Data type (label)** | ||
| 3720 | |=(s)|The device start number storing the data for average calculation|-|Signed BIN 32 bit|ANY32 | ||
| 3721 | |=(d)|The device start number storing the average value|-|Signed BIN 32 bit|ANY32 | ||
| 3722 | |=(n)|Number of data or the device number storing the number of data|1 to 2147483647|Signed BIN 32 bit|ANY32 | ||
| 3723 | |||
| 3724 | **Device used** | ||
| 3725 | |||
| 3726 | |=(% rowspan="2" %)**instruction**|=(% rowspan="2" %)**Parameter**|=(% colspan="24" %)**Devices**|=**Index modification**|=((( | ||
| 3727 | **Pulse** | ||
| 3728 | |||
| 3729 | **extension** | ||
| 3730 | ))) | ||
| 3731 | |**X**|**Y**|**M**|**S**|**SM**|**T(bit)**|**C(bit)**|**LC(bit)**|**HSC(bit)**|**D.b**|**KnX**|**KnY**|**KnM**|**KnS**|**T**|**C**|**D**|**R**|**SD**|**LC**|**HSC**|**K**|**H**|**E**|**[D]**|**XXP** | ||
| 3732 | |(% rowspan="3" %)DMEAN|Parameter 1| | | | | | | | | | |●|●|●|●|●|●|●|●|●|●|●| | | |●|● | ||
| 3733 | |Parameter 2| | | | | | | | | | | |●|●|●|●|●|●|●|●|●|●| | | |●|● | ||
| 3734 | |Parameter 3| | | | | | | | | | |●|●|●|●|●|●|●|●|●|●|●|●|●| |●|● | ||
| 3735 | |||
| 3736 | **Features** | ||
| 3737 | |||
| 3738 | Calculate the mean value of BIN 32-bit data at (n) points starting from the device specified in (s) and store it in the device specified in (d). | ||
| 3739 | |||
| 3740 | The total is calculated from the algebraic sum and divided by (n). | ||
| 3741 | |||
| 3742 | The remainder is rounded off. | ||
| 3743 | |||
| 3744 | (% style="text-align:center" %) | ||
| 3745 | [[image:图片3.png]] | ||
| 3746 | |||
| 3747 | (% class="box infomessage" %) | ||
| 3748 | ((( | ||
| 3749 | **✎Note: ** | ||
| 3750 | When the device number exceeds, (n) is handled as a smaller value within the allowable range. | ||
| 3751 | ))) | ||
| 3752 | |||
| 3753 | **Error code** | ||
| 3754 | |||
| 3755 | |=**Error code**|=**Content** | ||
| 3756 | |=4084H|The data input in (n) exceeds the specifiable range. N≤0 | ||
| 3757 | |=4085H|When the device specified in the read application instructions (s) and (n) exceeds the corresponding device range | ||
| 3758 | |=4086H|When the device specified in the write application instruction (d) exceeds the corresponding device range | ||
| 3759 | |||
| 3760 | **Example** | ||
| 3761 | |||
| 3762 | (% style="text-align:center" %) | ||
| 3763 | [[image:图片4.png]] | ||
| 3764 | |||
| 3765 | |||
| 3766 | Add the data of D0, D2, and D4, and save the value obtained after dividing by 3 in D10 and D11, and the calculated average value is 6. | ||
| 3767 | |||
| 3768 | == SQR/16-bit Square Root == | ||
| 3769 | |||
| 3770 | **SQR(P)** | ||
| 3771 | |||
| 3772 | Calculate the square root of the BIN 16-bit data specified in (s), and store the calculation result in (d). | ||
| 3773 | |||
| 3774 | -[SQR (s) (d)] | ||
| 3775 | |||
| 3776 | **Content, range and data type** | ||
| 3777 | |||
| 3778 | |=**Parameter**|=**Content**|=**Range**|=**Data type**|=**Data type (label)** | ||
| 3779 | |=(s)|The data device storing for square root calculation|0 to +32767|Signed BIN 16 bit|ANY16 | ||
| 3780 | |=(d)|The device storing the calculated square root|-|Signed BIN 16 bit|ANY16 | ||
| 3781 | |||
| 3782 | **Device used** | ||
| 3783 | |||
| 3784 | |=(% rowspan="2" %)**instruction**|=(% rowspan="2" %)**Parameter**|=(% colspan="24" %)**Devices**|=**Index modification**|=((( | ||
| 3785 | **Pulse** | ||
| 3786 | |||
| 3787 | **extension** | ||
| 3788 | ))) | ||
| 3789 | |**X**|**Y**|**M**|**S**|**SM**|**T(bit)**|**C(bit)**|**LC(bit)**|**HSC(bit)**|**D.b**|**KnX**|**KnY**|**KnM**|**KnS**|**T**|**C**|**D**|**R**|**SD**|**LC**|**HSC**|**K**|**H**|**E**|**[D]**|**XXP** | ||
| 3790 | |(% rowspan="2" %)SQR|Parameter 1| | | | | | | | | | | | | | | | |●|●|●| | |●|●| |●|● | ||
| 3791 | |Parameter 2| | | | | | | | | | | | | | | | |●|●|●| | | | | |●|● | ||
| 3792 | |||
| 3793 | **Features** | ||
| 3794 | |||
| 3795 | Calculate the square root of the BIN 16-bit data specified in (s), and store the calculation result in (d). | ||
| 3796 | |||
| 3797 | (% style="text-align:center" %) | ||
| 3798 | [[image:图片1.png]] | ||
| 3799 | |||
| 3800 | (% class="box infomessage" %) | ||
| 3801 | ((( | ||
| 3802 | **✎Note: **The decimal point of operation result will be rounded off and become an integer. If rounding occurs, SM152 (borrow flag) turns ON. | ||
| 3803 | |||
| 3804 | When the operation result is really 0, SM153 (zero flag) turns ON. | ||
| 3805 | ))) | ||
| 3806 | |||
| 3807 | **Error code** | ||
| 3808 | |||
| 3809 | |**Error code**|**Content** | ||
| 3810 | |4084H|When a negative value is specified in (s). | ||
| 3811 | |4085H|When the device specified in the read application instructions (s) exceeds the corresponding device range | ||
| 3812 | |4086H|When the device specified in the write application instruction (d) exceeds the corresponding device range | ||
| 3813 | |||
| 3814 | **Example** | ||
| 3815 | |||
| 3816 | (% style="text-align:center" %) | ||
| 3817 | [[image:图片2.png]] | ||
| 3818 | |||
| 3819 | The square root of D0 is stored in D2, and the value of D0 is 100, so the value of D2 is 10. | ||
| 3820 | |||
| 3821 | == DSQR/32-bit Square Root == | ||
| 3822 | |||
| 3823 | **DSQR(P)** | ||
| 3824 | |||
| 3825 | Calculate the square root of the BIN 32-bit data specified in (s), and store the calculation result in (d). | ||
| 3826 | |||
| 3827 | -[DSQR (s) (d)] | ||
| 3828 | |||
| 3829 | **Content, range and data type** | ||
| 3830 | |||
| 3831 | |=**Parameter**|=**Content**|=**Range**|=**Data type**|=**Data type (label)** | ||
| 3832 | |=(s)|The data device storing for square root calculation|0 to 2147483647|Signed BIN 32 bit|ANY32 | ||
| 3833 | |=(d)|The device storing the calculated square root|-|Signed BIN 32 bit|ANY32 | ||
| 3834 | |||
| 3835 | **Device used** | ||
| 3836 | |||
| 3837 | |=(% rowspan="2" %)**instruction**|=(% rowspan="2" %)**Parameter**|=(% colspan="24" %)**Devices**|=**Index modification**|=((( | ||
| 3838 | **Pulse** | ||
| 3839 | |||
| 3840 | **extension** | ||
| 3841 | ))) | ||
| 3842 | |**X**|**Y**|**M**|**S**|**SM**|**T(bit)**|**C(bit)**|**LC(bit)**|**HSC(bit)**|**D.b**|**KnX**|**KnY**|**KnM**|**KnS**|**T**|**C**|**D**|**R**|**SD**|**LC**|**HSC**|**K**|**H**|**E**|**[D]**|**XXP** | ||
| 3843 | |(% rowspan="2" %)DSQR|Parameter 1| | | | | | | | | | | | | | | | |●|●|●|●|●|●|●| |●|● | ||
| 3844 | |Parameter 2| | | | | | | | | | | | | | | | |●|●|●|●|●| | | |●|● | ||
| 3845 | |||
| 3846 | **Features** | ||
| 3847 | |||
| 3848 | Calculate the square root of the BIN 32-bit data specified in (s) and store the calculation result in (d). | ||
| 3849 | |||
| 3850 | (% style="text-align:center" %) | ||
| 3851 | [[image:图片3.png]] | ||
| 3852 | |||
| 3853 | (% class="box infomessage" %) | ||
| 3854 | ((( | ||
| 3855 | **✎Note:**The decimal point of operation result will be rounded off and become an integer. If rounding occurs, SM152 (borrow flag) turns ON. | ||
| 3856 | |||
| 3857 | When the operation result is really 0, SM153 (zero flag) turns on. | ||
| 3858 | ))) | ||
| 3859 | |||
| 3860 | **Error code** | ||
| 3861 | |||
| 3862 | |=**Error code**|=**Content** | ||
| 3863 | |=4084H|When a negative value is specified in (s). | ||
| 3864 | |=4085H|When the device specified in the read application instructions (s) exceeds the corresponding device range | ||
| 3865 | |=4086H|When the device specified in the write application instruction (d) exceeds the corresponding device range | ||
| 3866 | |||
| 3867 | **Example** | ||
| 3868 | |||
| 3869 | (% style="text-align:center" %) | ||
| 3870 | [[image:图片4.png]] | ||
| 3871 | |||
| 3872 | The square root of D0 is stored in D2, and the value of D0 is 110, so the value in the D2 device is 10 (the fractional part is discarded), and the borrow flag SM152 is turned ON. | ||
| 3873 | |||
| 3874 | == WSUM/The Sum Value of 16-bit Data == | ||
| 3875 | |||
| 3876 | **WSUM(P)** | ||
| 3877 | |||
| 3878 | After adding all the BIN 16-bit data of point (n) starting from the device specified in (s), it is stored in the device specified in (d). | ||
| 3879 | |||
| 3880 | -[WSUM (s) (d) (n)] | ||
| 3881 | |||
| 3882 | **Content, range and data type** | ||
| 3883 | |||
| 3884 | |=**Parameter**|=**Content**|=**Range**|=**Data type**|=**Data type (label)** | ||
| 3885 | |=(s)|The device start number storing the data for sum value calculation|-|Signed BIN 16 bit|ANY16 | ||
| 3886 | |=(d)|The device start number storing the sum value|-|Signed BIN 32 bit|ANY32 | ||
| 3887 | |=(n)|Number of data|-|Signed BIN 16 bit|ANY16 | ||
| 3888 | |||
| 3889 | **Device used** | ||
| 3890 | |||
| 3891 | |=(% rowspan="2" %)**instruction**|=(% rowspan="2" %)**Parameter**|=(% colspan="24" %)**Devices**|=**Index modification**|=((( | ||
| 3892 | **Pulse** | ||
| 3893 | |||
| 3894 | **extension** | ||
| 3895 | ))) | ||
| 3896 | |**X**|**Y**|**M**|**S**|**SM**|**T(bit)**|**C(bit)**|**LC(bit)**|**HSC(bit)**|**D.b**|**KnX**|**KnY**|**KnM**|**KnS**|**T**|**C**|**D**|**R**|**SD**|**LC**|**HSC**|**K**|**H**|**E**|**[D]**|**XXP** | ||
| 3897 | |(% rowspan="3" %)WSUM|Parameter 1| | | | | | | | | | | | | | |●|●|●|●|●| | | | | |●|● | ||
| 3898 | |Parameter 2| | | | | | | | | | | |●|●|●|●|●|●|●|●| | | | | |●|● | ||
| 3899 | |Parameter 3| | | | | | | | | | |●|●|●|●|●|●|●|●|●| | |●|●| |●|● | ||
| 3900 | |||
| 3901 | **Features** | ||
| 3902 | |||
| 3903 | After adding all the BIN 16-bit data of point (n) starting from the device specified in (s), it is stored in the device specified in (d). | ||
| 3904 | |||
| 3905 | (% style="text-align:center" %) | ||
| 3906 | [[image:图片5.png]] | ||
| 3907 | |||
| 3908 | **Error code** | ||
| 3909 | |||
| 3910 | |=**Error code**|=**Content** | ||
| 3911 | |=4084H|When a negative value is specified in (n). | ||
| 3912 | |=4085H|When the device specified in the read application instructions (s) and (n) exceeds the corresponding device range | ||
| 3913 | |=4086H|When the device specified in the write application instruction (d) exceeds the corresponding device range | ||
| 3914 | |||
| 3915 | **Example** | ||
| 3916 | |||
| 3917 | (% style="text-align:center" %) | ||
| 3918 | [[image:图片6.png]] | ||
| 3919 | |||
| 3920 | When M0=ON, the total of 16-bit data of D0 to D2 is saved in [D100, D101], and the accounting result is 18. | ||
| 3921 | |||
| 3922 | == DWSUM/The Sum Value of 32-bit Data == | ||
| 3923 | |||
| 3924 | [[image:file:///C:\Users\ANNAXU~~1\AppData\Local\Temp\ksohtml3496\wps1.png]]**DWSUM(P)** | ||
| 3925 | |||
| 3926 | Add all the 32-bit BIN data of point (n) starting from the device specified in (s) and store it in the device specified in (d). | ||
| 3927 | |||
| 3928 | -[DWSUM (s) (d) (n)] | ||
| 3929 | |||
| 3930 | **Content, range and data type** | ||
| 3931 | |||
| 3932 | |=**Parameter**|=**Content**|=**Range**|=**Data type**|=**Data type (label)** | ||
| 3933 | |=(s)|The device start number storing the data for total value calculation|-|Signed BIN 32 bit|ANY32 | ||
| 3934 | |=(d)|The device start number storing the total value|-|Signed BIN64 bit|ANY64 | ||
| 3935 | |=(n)|Number of data|-|Signed BIN 32 bit|ANY32 | ||
| 3936 | |||
| 3937 | **Device used** | ||
| 3938 | |||
| 3939 | |=(% rowspan="2" %)**instruction**|=(% rowspan="2" %)**Parameter**|=(% colspan="24" %)**Devices**|=**Index modification**|=((( | ||
| 3940 | **Pulse** | ||
| 3941 | |||
| 3942 | **extension** | ||
| 3943 | ))) | ||
| 3944 | |**X**|**Y**|**M**|**S**|**SM**|**T(bit)**|**C(bit)**|**LC(bit)**|**HSC(bit)**|**D.b**|**KnX**|**KnY**|**KnM**|**KnS**|**T**|**C**|**D**|**R**|**SD**|**LC**|**HSC**|**K**|**H**|**E**|**[D]**|**XXP** | ||
| 3945 | |(% rowspan="3" %)DWSUM|Parameter 1| | | | | | | | | | | | | | |●|●|●|●|●|●|●| | | |●|● | ||
| 3946 | |Parameter 2| | | | | | | | | | | |●|●|●|●|●|●|●|●|●|●| | | |●|● | ||
| 3947 | |Parameter 3| | | | | | | | | | |●|●|●|●|●|●|●|●|●|●|●|●|●| |●|● | ||
| 3948 | |||
| 3949 | **Features** | ||
| 3950 | |||
| 3951 | Add all the 32-bit BIN data of point (n) starting from the device specified in (s) and store it in the device specified in (d). | ||
| 3952 | |||
| 3953 | (% style="text-align:center" %) | ||
| 3954 | [[image:图片7.png]] | ||
| 3955 | |||
| 3956 | (% class="box infomessage" %) | ||
| 3957 | ((( | ||
| 3958 | **✎Note:** | ||
| 3959 | When the number of bits is specified in (d), the value of n ranges from 1 to 8, such as K8 (32-bit instructions, such as K8M0) without K16 (64-bit instructions). | ||
| 3960 | ))) | ||
| 3961 | |||
| 3962 | **Error code** | ||
| 3963 | |||
| 3964 | |=**Error code**|=**Content** | ||
| 3965 | |=4084H|When a negative value is specified in (n). | ||
| 3966 | |=4085H|When the device specified in the read application instructions (s) and (n) exceeds the corresponding device range | ||
| 3967 | |=4086H|When the device specified in the write application instruction (d) exceeds the corresponding device range | ||
| 3968 | |||
| 3969 | **Example** | ||
| 3970 | |||
| 3971 | (% style="text-align:center" %) | ||
| 3972 | [[image:图片8.png]] | ||
| 3973 | |||
| 3974 | When M0=ON, the total of 16-bit data of D0 to D2 is saved in [D100, D101], and the accounting result is 18. | ||
| 3975 | |||
| 3976 | == SORT/16-bit Data Sorting == | ||
| 3977 | |||
| 3978 | **SORT** | ||
| 3979 | |||
| 3980 | Sort the data rows in ascending order based on the group data of column (n3) in the BIN 16-bit data table (sorting source) of (n1×n2) points specified in (s) and store them in the specified in (d) (N1×n2) points in the BIN 16-bit data table (after sorting). | ||
| 3981 | |||
| 3982 | -[SORT (s) (n1) (n2) (d) (n3)] | ||
| 3983 | |||
| 3984 | **Content, range and data type** | ||
| 3985 | |||
| 3986 | |=**Parameter**|=**Content**|=**Range**|=**Data type**|=**Data type (label)** | ||
| 3987 | |=(s)|The start device number storing the data table|-|Signed BIN 16 bit|ANY16 | ||
| 3988 | |=(n1)|Number of data (rows)|1 to 32|Signed BIN 16 bit|ANY16 | ||
| 3989 | |=(n2)|Number of group data (columns)|1 to 6|Signed BIN 16 bit|ANY16 | ||
| 3990 | |=(d)|The start device number storing the operation result|-|Signed BIN 16 bit|ANY16 | ||
| 3991 | |=(n3)|The column number of the group data (column) as the sorting basis|-|Signed BIN 16 bit|ANY16 | ||
| 3992 | |||
| 3993 | **Device used** | ||
| 3994 | |||
| 3995 | |=(% rowspan="2" %)**instruction**|=(% rowspan="2" %)**Parameter**|=(% colspan="24" %)**Devices**|=((( | ||
| 3996 | **Index** | ||
| 3997 | |||
| 3998 | **modification** | ||
| 3999 | )))|=((( | ||
| 4000 | **Pulse** | ||
| 4001 | |||
| 4002 | **extension** | ||
| 4003 | ))) | ||
| 4004 | |=**X**|**Y**|**M**|**S**|**SM**|**T(bit)**|**C(bit)**|**LC(bit)**|**HSC(bit)**|**D.b**|**KnX**|**KnY**|**KnM**|**KnS**|**T**|**C**|**D**|**R**|**SD**|**LC**|**HSC**|**K**|**H**|**E**|**[D]**|**XXP** | ||
| 4005 | |=(% rowspan="5" %)SORT|Parameter 1| | | | | | | | | | | | | | |●|●|●|●|●| | | | | |●| | ||
| 4006 | |=Parameter 2| | | | | | | | | | |●|●|●|●|●|●|●|●|●| | |●|●| |●| | ||
| 4007 | |=Parameter 3| | | | | | | | | | |●|●|●|●|●|●|●|●|●| | |●|●| |●| | ||
| 4008 | |=Parameter 4| | | | | | | | | | | | | | |●|●|●|●|●| | | | | |●| | ||
| 4009 | |=Parameter 5| | | | | | | | | | |●|●|●|●|●|●|●|●|●| | |●|●| |●| | ||
| 4010 | |||
| 4011 | **Features** | ||
| 4012 | |||
| 4013 | The BIN 16-bit data table (sorting source) of (n1×n2) points specified in (s), based on the group data of column (n3), sort the data rows in ascending order, and store them in (d). The (n1×n2) point of the BIN 16-bit data table (after sorting). | ||
| 4014 | |||
| 4015 | Take (n1)=K3, (n2)=K4 in the sort source as an example, the data table structure is as follows. In the case of a sorted data table, (s) should be replaced with (d). | ||
| 4016 | |||
| 4017 | |=(% colspan="2" rowspan="3" %) |=(% colspan="4" %)**Number of groups (n2) ((n2)=K4)** | ||
| 4018 | |**Column NO. 1**|**Column NO. 2**|**Column NO. 3**|**Column NO. 4** | ||
| 4019 | |**Management number**|**Height**|**Weight**|**Age** | ||
| 4020 | |(% rowspan="3" %)When the number of data (n1)=3|Line NO.1|(s)|(s) +3|(s) +6|(s) +9 | ||
| 4021 | |Line NO.2|(s)+1|(s) +4|(s) +7|(s) +10 | ||
| 4022 | |Line NO.3|(s)+2|(s) +5|(s) +8|(s) +11 | ||
| 4023 | |||
| 4024 | Data alignment starts when instruction input is ON, data alignment ends after (n1) scan, instruction execution end flag SM229 is set to ON. According to the source data sorted as follows, an example of the operation is shown below. In addition, by putting serial numbers such as management numbers in the first column in advance, the original row number can be judged based on the content, which is very convenient. | ||
| 4025 | |||
| 4026 | |=(% colspan="2" rowspan="3" %) |=(% colspan="4" %)**Number of groups (n2) ((n2)=K4)** | ||
| 4027 | |**Column NO. 1**|**Column NO. 2**|**Column NO. 3**|**Column NO. 4** | ||
| 4028 | |**Management number**|**Height**|**Weight**|**Age** | ||
| 4029 | |(% rowspan="10" %)When the number of data (n1) = 5|(% rowspan="2" %)Line NO.1|(s)|(s) +5|(s) +10|(s) +15 | ||
| 4030 | |1|150|45|20 | ||
| 4031 | |(% rowspan="2" %)Line NO.2|(s)+1|(s) +6|(s) +11|(s) +16 | ||
| 4032 | |2|180|50|40 | ||
| 4033 | |(% rowspan="2" %)Line NO.3|(s)+2|(s) +7|(s) +12|(s) +17 | ||
| 4034 | |3|160|70|30 | ||
| 4035 | |(% rowspan="2" %)Line NO.4|(s) +3|(s) +8|(s) +13|(s) +18 | ||
| 4036 | |4|100|20|8 | ||
| 4037 | |(% rowspan="2" %)Line NO.5|(s) +4|(s) +9|(s) +14|(s) +19 | ||
| 4038 | |5|150|50|45 | ||
| 4039 | |||
| 4040 | Press (n3)=K2 (column number 2) to execute the sorting result. | ||
| 4041 | |||
| 4042 | |=(% colspan="2" rowspan="3" %) |=(% colspan="4" %)**Number of groups (n2) ((n2)=K4)** | ||
| 4043 | |**Column NO.1**|**Column NO.2**|**Column NO.3**|**Column NO.4** | ||
| 4044 | |**Management number**|**Height**|**Weight**|**Age** | ||
| 4045 | |(% rowspan="10" %)When the number of data (n1) = 5|(% rowspan="2" %)Line NO.1|(d)|(d) +5|(d) +10|(d) +15 | ||
| 4046 | |4|100|20|8 | ||
| 4047 | |(% rowspan="2" %)Line NO.2|(d) +1|(d) +6|(d) +11|(d) +16 | ||
| 4048 | |1|150|45|20 | ||
| 4049 | |(% rowspan="2" %)Line NO.3|(d) +2|(d) +7|(d) +12|(d) +17 | ||
| 4050 | |5|150|50|45 | ||
| 4051 | |(% rowspan="2" %)Line NO.4|(d) +3|(d) +8|(d) +13|(d) +18 | ||
| 4052 | |3|160|70|30 | ||
| 4053 | |(% rowspan="2" %)Line NO.5|(d) +4|(d) +9|(d) +14|(d) +19 | ||
| 4054 | |2|180|50|40 | ||
| 4055 | |||
| 4056 | Press (n3)=K3 (column number 3) to execute the sorting result. | ||
| 4057 | |||
| 4058 | |=(% colspan="2" rowspan="3" %) |=(% colspan="4" %)**Number of groups (n2) ((n2)=K4)** | ||
| 4059 | |**Column NO.1**|**Column NO.2**|**Column NO.3**|**Column NO.4** | ||
| 4060 | |**Management number**|**Height**|**Weight**|**Age** | ||
| 4061 | |(% rowspan="10" %)When the number of data (n1) = 5|(% rowspan="2" %)Line NO.1|(d)|(d) +5|(d) +10|(d) +15 | ||
| 4062 | |4|100|20|8 | ||
| 4063 | |(% rowspan="2" %)Line NO.2|(d) +1|(d) +6|(d) +11|(d) +16 | ||
| 4064 | |1|150|45|20 | ||
| 4065 | |(% rowspan="2" %)Line NO.3|(d) +2|(d) +7|(d) +12|(d) +17 | ||
| 4066 | |2|180|50|40 | ||
| 4067 | |(% rowspan="2" %)Line NO.4|(d) +3|(d) +8|(d) +13|(d) +18 | ||
| 4068 | |5|150|50|45 | ||
| 4069 | |(% rowspan="2" %)Line NO.5|(d) +4|(d) +9|(d) +14|(d) +19 | ||
| 4070 | |3|160|70|30 | ||
| 4071 | |||
| 4072 | (% class="box infomessage" %) | ||
| 4073 | ((( | ||
| 4074 | **✎Note:**only ascending order is supported by SORT instruction . | ||
| 4075 | |||
| 4076 | Do not change the operand and data content during operation. | ||
| 4077 | |||
| 4078 | When executing again, the instruction input should be turned OFF once. | ||
| 4079 | |||
| 4080 | SORT instruction can drive at most one in the program. | ||
| 4081 | |||
| 4082 | When the same device is specified in (s) and (d), the source data is rewritten to the sorted data order. Please pay special attention not to change the content of (s) before the end of execution. | ||
| 4083 | ))) | ||
| 4084 | |||
| 4085 | |||
| 4086 | |||
| 4087 | |||
| 4088 | |||
| 4089 | |||
| 4090 | |||
| 4091 | |||
| 4092 | **Error code** | ||
| 4093 | |||
| 4094 | |=**Error code**|=**Content** | ||
| 4095 | |=(% rowspan="3" %)4084H|When the value specified in (n1) exceeds the range of 1 to 32 | ||
| 4096 | |=When the value specified in (n2) exceeds the range of 1 to 6 | ||
| 4097 | |=When the value specified in (n3) exceeds the range of 1 to n2 | ||
| 4098 | |=4085H|When the device specified in read application instruction (s), (n1), (n2 )and (n3) exceeds the corresponding device range | ||
| 4099 | |=4086H|When the device specified in the write application instruction (d) exceeds the corresponding device range | ||
| 4100 | |=4087H|When the (d) parameter in the application instruction uses an unsupported device | ||
| 4101 | |=4089H|The number of application instructions exceeds the limit. | ||
| 4102 | |||
| 4103 | **Example** | ||
| 4104 | |||
| 4105 | Refer to the function description example. | ||
| 4106 | |||
| 4107 | (% style="text-align:center" %) | ||
| 4108 | [[image:图片9.png]] | ||
| 4109 | |||
| 4110 | == SORT2/16-bit Data Sorting == | ||
| 4111 | |||
| 4112 | **SORT2(P)** | ||
| 4113 | |||
| 4114 | Sort the data rows in ascending or descending order based on the group data in column (n3), and store them in (d), based on the BIN 16-bit data table (sorting source) of (n1×n2) points specified in (s) In the BIN 16-bit data table (after sorting) of the specified (n1×n2) points. | ||
| 4115 | |||
| 4116 | -[SORT2 (s) (n1) (n2) (d) (n3)] | ||
| 4117 | |||
| 4118 | **Content, range and data type** | ||
| 4119 | |||
| 4120 | |=**Parameter**|=**Content**|=**Range**|=**Data type**|=**Data type (label)** | ||
| 4121 | |=(s)|The start device number storing the data table|-|Signed BIN 16 bit|ANY16 | ||
| 4122 | |=(n1)|Number of data (rows)|1 to 32|Signed BIN 16 bit|ANY16 | ||
| 4123 | |=(n2)|Number of group data (columns)|1 to 6|Signed BIN 16 bit|ANY16 | ||
| 4124 | |=(d)|The start device number storing the operation result|-|Signed BIN 16 bit|ANY16 | ||
| 4125 | |=(n3)|The column number of the group data (column) as the sorting basis|-|Signed BIN 16 bit|ANY16 | ||
| 4126 | |||
| 4127 | **Device used** | ||
| 4128 | |||
| 4129 | |=(% rowspan="2" %)**instruction**|=(% rowspan="2" %)**Parameter**|=(% colspan="24" %)**Devices**|=((( | ||
| 4130 | **Index** | ||
| 4131 | |||
| 4132 | **modification** | ||
| 4133 | )))|=((( | ||
| 4134 | **Pulse** | ||
| 4135 | |||
| 4136 | **extension** | ||
| 4137 | ))) | ||
| 4138 | |=**X**|**Y**|**M**|**S**|**SM**|**T(bit)**|**C(bit)**|**LC(bit)**|**HSC(bit)**|**D.b**|**KnX**|**KnY**|**KnM**|**KnS**|**T**|**C**|**D**|**R**|**SD**|**LC**|**HSC**|**K**|**H**|**E**|**[D]**|**XXP** | ||
| 4139 | |=(% rowspan="5" %)SORT2|Parameter 1| | | | | | | | | | | | | | |●|●|●|●|●| | | | | |●| | ||
| 4140 | |=Parameter 2| | | | | | | | | | |●|●|●|●|●|●|●|●|●| | |●|●| |●| | ||
| 4141 | |=Parameter 3| | | | | | | | | | |●|●|●|●|●|●|●|●|●| | |●|●| |●| | ||
| 4142 | |=Parameter 4| | | | | | | | | | | | | | |●|●|●|●|●| | | | | |●| | ||
| 4143 | |=Parameter 5| | | | | | | | | | |●|●|●|●|●|●|●|●|●| | |●|●| |●| | ||
| 4144 | |||
| 4145 | **Features** | ||
| 4146 | |||
| 4147 | Sort the data rows in ascending or descending order based on the group data in column (n3) and store them in (d) (N1×n2) point specified in the BIN 16-bit data table (after sorting). | ||
| 4148 | |||
| 4149 | Take (n1)=K3, (n2)=K4 in the sort source as an example, the data table structure is as follows. In the case of a sorted data table, (s) should be replaced with (d). | ||
| 4150 | |||
| 4151 | |=(% colspan="2" rowspan="3" %) |=(% colspan="4" %)**When the number of groups (n2) (n2) = K4** | ||
| 4152 | |**Column NO.1**|**Column NO.2**|**Column NO.3**|**Column NO.4** | ||
| 4153 | |**Management number**|**Height**|**Weight**|**Age** | ||
| 4154 | |(% rowspan="3" %)When the number of data (n1)=3|Line NO.1|(s)|(s)+1|(s) +2|(s) +3 | ||
| 4155 | |Line NO.2|(s) +4|(s) +5|(s) +6|(s) +7 | ||
| 4156 | |Line NO.3|(s) +8|(s) +9|(s) +10|(s) +100 | ||
| 4157 | |||
| 4158 | Sequence is set by the ON/OFF status of SM165 | ||
| 4159 | |||
| 4160 | |= |=**Sort order setting instruction** | ||
| 4161 | |SM165=ON|Descending | ||
| 4162 | |SM165=OFF|Ascending | ||
| 4163 | |||
| 4164 | Data alignment starts when instruction input is ON, data alignment ends after (n1) scan, instruction execution end flag SM229 is set to ON. | ||
| 4165 | |||
| 4166 | According to the source data sorted as follows, an example of the operation is shown below. In addition, by putting serial numbers such as management numbers in the first column in advance, the original row number can be judged based on the content, which is very convenient. | ||
| 4167 | |||
| 4168 | |=(% colspan="2" rowspan="3" %) |=(% colspan="4" %)**When the number of groups (n2) (n2) = K4** | ||
| 4169 | |**Column NO.1**|**Column NO.2**|**Column NO.3**|**Column NO.4** | ||
| 4170 | |**Management number**|**Height**|**Weight**|**Age** | ||
| 4171 | |(% rowspan="10" %)When the number of data (n1) = 5|(% rowspan="2" %)Line NO.1|(s)|(s)+1|(s) +2|(s) +3 | ||
| 4172 | |1|150|45|20 | ||
| 4173 | |(% rowspan="2" %)Line NO.2|(s) +4|(s) +5|(s) +6|(s) +7 | ||
| 4174 | |2|180|50|40 | ||
| 4175 | |(% rowspan="2" %)Line NO.3|(s) +8|(s) +9|(s) +10|(s) +100 | ||
| 4176 | |3|160|70|30 | ||
| 4177 | |(% rowspan="2" %)Line NO.4|(s) +12|(s) +13|(s) +14|(s) +15 | ||
| 4178 | |4|100|20|8 | ||
| 4179 | |(% rowspan="2" %)Line NO.5|(s) +16|(s) +17|(s) +18|(s) +19 | ||
| 4180 | |5|150|50|45 | ||
| 4181 | |||
| 4182 | Press (n3)=K2 (column number 2) to execute the sorting result (SM165=OFF in the case of ascending order) | ||
| 4183 | |||
| 4184 | |=(% colspan="2" rowspan="3" %) |=(% colspan="4" %)**When the number of groups (n2) (n2) = K4** | ||
| 4185 | |**Column NO.1**|**Column NO.2**|**Column NO.3**|**Column NO.4** | ||
| 4186 | |**Management number**|**Height**|**Weight**|**Age** | ||
| 4187 | |(% rowspan="10" %)When the number of data (n1) = 5|(% rowspan="2" %)Line NO.1|(d)|(d) +1|(d) +2|(d) +3 | ||
| 4188 | |4|100|20|8 | ||
| 4189 | |(% rowspan="2" %)Line NO.2|(d) +4|(d) +5|(d) +6|(d) +7 | ||
| 4190 | |1|150|45|20 | ||
| 4191 | |(% rowspan="2" %)Line NO.3|(d) +8|(d) +9|(d) +10|(d) +100 | ||
| 4192 | |5|150|50|45 | ||
| 4193 | |(% rowspan="2" %)Line NO.4|(d) +12|(d) +13|(d) +14|(d) +15 | ||
| 4194 | |3|160|70|30 | ||
| 4195 | |(% rowspan="2" %)Line NO.5|(d) +16|(d) +17|(d) +18|(d) +19 | ||
| 4196 | |2|180|50|40 | ||
| 4197 | |||
| 4198 | Press (n3)=K3 (column number 3) to execute the sorting result (SM165=ON in the case of ascending order) | ||
| 4199 | |||
| 4200 | |=(% colspan="2" rowspan="3" %) |=(% colspan="4" %)**When the number of groups (n2) (n2) = K4** | ||
| 4201 | |**Column NO.1**|**Column NO.2**|**Column NO.3**|**Column NO.4** | ||
| 4202 | |**Management number**|**Height**|**Weight**|**Age** | ||
| 4203 | |(% rowspan="10" %)When the number of data (n1) = 5|(% rowspan="2" %)Line NO.1|(d)|(d) +1|(d) +2|(d) +3 | ||
| 4204 | |3|160|70|30 | ||
| 4205 | |(% rowspan="2" %)Line NO.2|(d) +4|(d) +5|(d) +6|(d) +7 | ||
| 4206 | |2|180|50|40 | ||
| 4207 | |(% rowspan="2" %)Line NO.3|(d) +8|(d) +9|(d) +10|(d) +100 | ||
| 4208 | |5|150|50|45 | ||
| 4209 | |(% rowspan="2" %)Line NO.4|(d) +12|(d) +13|(d) +14|(d) +15 | ||
| 4210 | |1|150|45|20 | ||
| 4211 | |(% rowspan="2" %)Line NO.5|(d) +16|(d) +17|(d) +18|(d) +19 | ||
| 4212 | |4|100|20|8 | ||
| 4213 | |||
| 4214 | (% class="box infomessage" %) | ||
| 4215 | ((( | ||
| 4216 | **✎Note: **Do not change the operand and data content during operation. | ||
| 4217 | |||
| 4218 | When executing again, the instruction input should be turned OFF once. | ||
| 4219 | |||
| 4220 | The SORT2 instruction can only be written in the program to drive 2 at most. | ||
| 4221 | |||
| 4222 | When the same device is specified in (s) and (d), the source data is rewritten to the sorted data order. Please pay special attention not to change the content of (s) before the end of execution. | ||
| 4223 | |||
| 4224 | Do not overlap the source data and the sorted data. | ||
| 4225 | ))) | ||
| 4226 | |||
| 4227 | (% style="text-align:center" %) | ||
| 4228 | [[image:图片10.png]] | ||
| 4229 | |||
| 4230 | **Error code** | ||
| 4231 | |||
| 4232 | |=**Error code**|=**Content** | ||
| 4233 | |(% rowspan="3" %)4084H|When the value specified in (n1) exceeds the range of 1 to 32 | ||
| 4234 | |When the value specified in (n2) exceeds the range of 1 to 6 | ||
| 4235 | |When the value specified in (n3) exceeds the range of 1 to n2 | ||
| 4236 | |4085H|When the device specified in read application instruction (s), (d), (n1), (n2) and (n3) exceeds the corresponding device range | ||
| 4237 | |4086H|When the device specified in the write application instruction (d) exceeds the corresponding device range | ||
| 4238 | |4089H|The number of application instructions exceeded the limit. | ||
| 4239 | |||
| 4240 | **Example** | ||
| 4241 | |||
| 4242 | Refer to the function description example. | ||
| 4243 | |||
| 4244 | (% style="text-align:center" %) | ||
| 4245 | [[image:图片11.png]] | ||
| 4246 | |||
| 4247 | == DSORT2/32-bit Data Sorting == | ||
| 4248 | |||
| 4249 | **DSORT2(P)** | ||
| 4250 | |||
| 4251 | Sort the data rows in ascending or descending order based on the group data of column (n3) in the BIN 32-bit data table (sorting source) of (n1×n2) points specified in (s) and store them in (d) The specified (n1×n2) point BIN 32-bit data table (after sorting). | ||
| 4252 | |||
| 4253 | -[DSORT2 (s) (n1) (n2) (d) (n3)] | ||
| 4254 | |||
| 4255 | **Content, range and data type** | ||
| 4256 | |||
| 4257 | |=**Parameter**|=**Content**|=**Range**|=**Data type**|=**Data type (label)** | ||
| 4258 | |=(s)|The start device number storing the data table|-|Signed BIN 32 bit|ANY32 | ||
| 4259 | |=(n1)|Number of data (rows)|1 to 32|Signed BIN 32 bit|ANY32 | ||
| 4260 | |=(n2)|Number of group data (columns)|1 to 6|Signed BIN 32 bit|ANY32 | ||
| 4261 | |=(d)|The start device number storing the operation result|-|Signed BIN 32 bit|ANY32 | ||
| 4262 | |=(n3)|The column number of the group data (column) as the sorting basis|-|Signed BIN 32 bit|ANY32 | ||
| 4263 | |||
| 4264 | **Device used** | ||
| 4265 | |||
| 4266 | |=(% rowspan="2" %)**instruction**|=(% rowspan="2" %)**Parameter**|=(% colspan="24" %)**Devices**|=**Index modification**|=((( | ||
| 4267 | **Pulse** | ||
| 4268 | |||
| 4269 | **extension** | ||
| 4270 | ))) | ||
| 4271 | |**X**|**Y**|**M**|**S**|**SM**|**T(bit)**|**C(bit)**|**LC(bit)**|**HSC(bit)**|**D.b**|**KnX**|**KnY**|**KnM**|**KnS**|**T**|**C**|**D**|**R**|**SD**|**LC**|**HSC**|**K**|**H**|**E**|**[D]**|**XXP** | ||
| 4272 | |(% rowspan="5" %)DSORT2|Parameter 1| | | | | | | | | | | | | | |●|●|●|●|●|●|●| | | |●| | ||
| 4273 | |Parameter 2| | | | | | | | | | |●|●|●|●|●|●|●|●|●|●|●|●|●| |●| | ||
| 4274 | |Parameter 3| | | | | | | | | | |●|●|●|●|●|●|●|●|●|●|●|●|●| |●| | ||
| 4275 | |Parameter 4| | | | | | | | | | | | | | |●|●|●|●|●|●|●| | | |●| | ||
| 4276 | |Parameter 5| | | | | | | | | | |●|●|●|●|●|●|●|●|●|●|●|●|●| |●| | ||
| 4277 | |||
| 4278 | **Features** | ||
| 4279 | |||
| 4280 | Sort the data rows in ascending or descending order based on the group data in the (n3) column of the (n1×n2) point BIN 32-bit data table (sorting source) specified in (s), and store to (d) (N1×n2) specified in the BIN 32-bit data table (after sorting). | ||
| 4281 | |||
| 4282 | Take (n1)=K3, (n2)=K4 in the sort source as an example, the data table structure is as follows. In the case of a sorted data table, (s) should be replaced with (d). | ||
| 4283 | |||
| 4284 | |=(% colspan="2" rowspan="3" %) |=(% colspan="4" %)**When the number of groups (n2) (n2) = K4** | ||
| 4285 | |**Column NO.1**|**Column NO.2**|**Column NO.3**|**Column NO.4** | ||
| 4286 | |**Management number**|**Height**|**Weight**|**Age** | ||
| 4287 | |(% rowspan="3" %)When the number of data (n1)=3|Line NO.1|(s)+1, (s)|(s)+3, (s)+2|(s)+5, (s)+4|(s) +7, (s) +6 | ||
| 4288 | |Line NO.2|(s) +9, (s) +8|(s)+11, (s)+10|(s) +13, (s) +12|(s) +15, (s) +14 | ||
| 4289 | |Line NO.3|(s) +17, (s) +16|(s) +19, (s) +18|(s) +21, (s) +20|(s) +23, (s) +22 | ||
| 4290 | |||
| 4291 | Sequence is set by the ON/OFF status of SM165 | ||
| 4292 | |||
| 4293 | |= |=**Sort order setting instructions** | ||
| 4294 | |SM165=ON|Descending | ||
| 4295 | |SM165=OFF|Ascending | ||
| 4296 | |||
| 4297 | Data alignment starts when instruction input is ON, data alignment ends after (n1) scan, instruction execution end flag SM229 is set to ON. | ||
| 4298 | |||
| 4299 | According to the source data sorted as follows, an example of the operation is shown below. In addition, by putting serial numbers such as management numbers in the first column in advance, the original row number can be judged based on the content, which is very convenient. | ||
| 4300 | |||
| 4301 | |||
| 4302 | |=(% colspan="2" rowspan="3" %) |=(% colspan="4" %)**When the number of groups (n2) (n2) = K4** | ||
| 4303 | |**Column NO.1**|**Column NO.2**|**Column NO.3**|**Column NO.4** | ||
| 4304 | |**Management number**|**height**|**body weight**|**age** | ||
| 4305 | |(% rowspan="10" %)When the number of data (n1) = 5|(% rowspan="2" %)Line NO.1|(s)+1, (s)|(s)+3, (s)+2|(s)+5, (s)+4|(s) +7, (s) +6 | ||
| 4306 | |1|150|45|20 | ||
| 4307 | |(% rowspan="2" %)Line NO.2|(s) +9, (s) +8|(s)+11, (s)+10|(s) +13, (s) +12|(s) +15, (s) +14 | ||
| 4308 | |2|180|50|40 | ||
| 4309 | |(% rowspan="2" %)Line NO.3|(s) +17, (s) +16|(s) +19, (s) +18|(s) +21, (s) +20|(s) +23, (s) +22 | ||
| 4310 | |3|160|70|30 | ||
| 4311 | |(% rowspan="2" %)Line NO.4|(s) +25, (s) +24|(s) +27, (s) +26|(s) +29, (s) +28|(s) +31, (s) +30 | ||
| 4312 | |4|100|20|8 | ||
| 4313 | |(% rowspan="2" %)Line NO.5|(s) +33, (s) +32|(s) +35, (s) +34|(s) +37, (s) +36|(s) +39, (s) +38 | ||
| 4314 | |5|150|50|45 | ||
| 4315 | |||
| 4316 | Press (n3)=K2 (column NO.2) to execute the sorting result (SM165=OFF in the case of ascending order) | ||
| 4317 | |||
| 4318 | |=(% colspan="2" rowspan="3" %) |=(% colspan="4" %)**When the number of groups (n2) (n2) = K4** | ||
| 4319 | |**Column NO.1**|**Column NO.2**|**Column NO.3**|**Column NO.4** | ||
| 4320 | |**Management number**|**height**|**body weight**|**age** | ||
| 4321 | |(% rowspan="10" %)When the number of data (n1) = 5|(% rowspan="2" %)Line NO.1|(s)+1, (s)|(s)+3, (s)+2|(s)+5, (s)+4|(s) +7, (s) +6 | ||
| 4322 | |4|100|20|8 | ||
| 4323 | |(% rowspan="2" %)Line NO.2|(s) +9, (s) +8|(s)+11, (s)+10|(s) +13, (s) +12|(s) +15, (s) +14 | ||
| 4324 | |1|150|45|20 | ||
| 4325 | |(% rowspan="2" %)Line NO.3|(s) +17, (s) +16|(s) +19, (s) +18|(s) +21, (s) +20|(s) +23, (s) +22 | ||
| 4326 | |5|150|50|45 | ||
| 4327 | |(% rowspan="2" %)Line NO.4|(s) +25, (s) +24|(s) +27, (s) +26|(s) +29, (s) +28|(s) +31, (s) +30 | ||
| 4328 | |3|160|70|30 | ||
| 4329 | |(% rowspan="2" %)Line NO.5|(s) +33, (s) +32|(s) +35, (s) +34|(s) +37, (s) +36|(s) +39, (s) +38 | ||
| 4330 | |2|180|50|40 | ||
| 4331 | |||
| 4332 | Press (n3)=K3 (column NO.3) to execute the sorting result (SM165=ON in the case of ascending order) | ||
| 4333 | |||
| 4334 | |=(% colspan="2" rowspan="3" %) |=(% colspan="4" %)**When the number of groups (n2) (n2) = K4** | ||
| 4335 | |**Column NO.1**|**Column NO.2**|**Column NO.3**|**Column NO.4** | ||
| 4336 | |**Management number**|**height**|**body weight**|**age** | ||
| 4337 | |(% rowspan="10" %)When the number of data (n1) = 5|(% rowspan="2" %)Line NO.1|(s)+1, (s)|(s)+3, (s)+2|(s)+5, (s)+4|(s) +7, (s) +6 | ||
| 4338 | |3|160|70|30 | ||
| 4339 | |(% rowspan="2" %)Line NO.2|(s) +9, (s) +8|(s)+11, (s)+10|(s) +13, (s) +12|(s) +15, (s) +14 | ||
| 4340 | |2|180|50|40 | ||
| 4341 | |(% rowspan="2" %)Line NO.3|(s) +17, (s) +16|(s) +19, (s) +18|(s) +21, (s) +20|(s) +23, (s) +22 | ||
| 4342 | |5|150|50|45 | ||
| 4343 | |(% rowspan="2" %)Line NO.4|(s) +25, (s) +24|(s) +27, (s) +26|(s) +29, (s) +28|(s) +31, (s) +30 | ||
| 4344 | |1|150|45|20 | ||
| 4345 | |(% rowspan="2" %)Line NO.5|(s) +33, (s) +32|(s) +35, (s) +34|(s) +37, (s) +36|(s) +39, (s) +38 | ||
| 4346 | |4|100|20|8 | ||
| 4347 | |||
| 4348 | **✎Note: ** | ||
| 4349 | |||
| 4350 | Do not change the operand and data content during operation. | ||
| 4351 | |||
| 4352 | When executing again, the instruction input should be turned OFF once. | ||
| 4353 | |||
| 4354 | The SORT2 instruction can only be written twice in the program. | ||
| 4355 | |||
| 4356 | When the same device is specified in (s) and (d), the source data is rewritten to the sorted data order. Please pay special attention not to change the content of (s) before the end of execution. | ||
| 4357 | |||
| 4358 | Do not overlap the source data and the sorted data. | ||
| 4359 | |||
| 4360 | |||
| 4361 | **DSORT2(P)** | ||
| 4362 | |||
| 4363 | Sort the data rows in ascending or descending order based on the group data of column (n3) in the BIN 32-bit data table (sorting source) of (n1×n2) points specified in (s) and store them in (d) The specified (n1×n2) point BIN 32-bit data table (after sorting). | ||
| 4364 | |||
| 4365 | -[DSORT2 (s) (n1) (n2) (d) (n3)] | ||
| 4366 | |||
| 4367 | **Content, range and data type** | ||
| 4368 | |||
| 4369 | |**Parameter**|**Content**|**Range**|**Data type**|**Data type (label)** | ||
| 4370 | |(s)|The start device number storing the data table|-|Signed BIN 32 bit|ANY32 | ||
| 4371 | |(n1)|Number of data (rows)|1 to 32|Signed BIN 32 bit|ANY32 | ||
| 4372 | |(n2)|Number of group data (columns)|1 to 6|Signed BIN 32 bit|ANY32 | ||
| 4373 | |(d)|The start device number storing the operation result|-|Signed BIN 32 bit|ANY32 | ||
| 4374 | |(n3)|The column number of the group data (column) as the sorting basis|-|Signed BIN 32 bit|ANY32 | ||
| 4375 | |||
| 4376 | **Device used** | ||
| 4377 | |||
| 4378 | |(% rowspan="2" %)**instruction**|(% rowspan="2" %)**Parameter**|(% colspan="24" %)**Devices**|**Index modification**|((( | ||
| 4379 | **Pulse** | ||
| 4380 | |||
| 4381 | **extension** | ||
| 4382 | ))) | ||
| 4383 | |**X**|**Y**|**M**|**S**|**SM**|**T(bit)**|**C(bit)**|**LC(bit)**|**HSC(bit)**|**D.b**|**KnX**|**KnY**|**KnM**|**KnS**|**T**|**C**|**D**|**R**|**SD**|**LC**|**HSC**|**K**|**H**|**E**|**[D]**|**XXP** | ||
| 4384 | |(% rowspan="5" %)DSORT2|Parameter 1| | | | | | | | | | | | | | |●|●|●|●|●|●|●| | | |●| | ||
| 4385 | |Parameter 2| | | | | | | | | | |●|●|●|●|●|●|●|●|●|●|●|●|●| |●| | ||
| 4386 | |Parameter 3| | | | | | | | | | |●|●|●|●|●|●|●|●|●|●|●|●|●| |●| | ||
| 4387 | |Parameter 4| | | | | | | | | | | | | | |●|●|●|●|●|●|●| | | |●| | ||
| 4388 | |Parameter 5| | | | | | | | | | |●|●|●|●|●|●|●|●|●|●|●|●|●| |●| | ||
| 4389 | |||
| 4390 | **Features** | ||
| 4391 | |||
| 4392 | Sort the data rows in ascending or descending order based on the group data in the (n3) column of the (n1×n2) point BIN 32-bit data table (sorting source) specified in (s), and store to (d) (N1×n2) specified in the BIN 32-bit data table (after sorting). | ||
| 4393 | |||
| 4394 | Take (n1)=K3, (n2)=K4 in the sort source as an example, the data table structure is as follows. In the case of a sorted data table, (s) should be replaced with (d). | ||
| 4395 | |||
| 4396 | |(% colspan="2" rowspan="3" %) |(% colspan="4" %)**When the number of groups (n2) (n2) = K4** | ||
| 4397 | |**Column NO.1**|**Column NO.2**|**Column NO.3**|**Column NO.4** | ||
| 4398 | |**Management number**|**Height**|**Weight**|**Age** | ||
| 4399 | |(% rowspan="3" %)When the number of data (n1)=3|Line NO.1|(s)+1, (s)|(s)+3, (s)+2|(s)+5, (s)+4|(s) +7, (s) +6 | ||
| 4400 | |Line NO.2|(s) +9, (s) +8|(s)+11, (s)+10|(s) +13, (s) +12|(s) +15, (s) +14 | ||
| 4401 | |Line NO.3|(s) +17, (s) +16|(s) +19, (s) +18|(s) +21, (s) +20|(s) +23, (s) +22 | ||
| 4402 | |||
| 4403 | Sequence is set by the ON/OFF status of SM165 | ||
| 4404 | |||
| 4405 | | |**Sort order setting instructions** | ||
| 4406 | |SM165=ON|Descending | ||
| 4407 | |SM165=OFF|Ascending | ||
| 4408 | |||
| 4409 | Data alignment starts when instruction input is ON, data alignment ends after (n1) scan, instruction execution end flag SM229 is set to ON. | ||
| 4410 | |||
| 4411 | According to the source data sorted as follows, an example of the operation is shown below. In addition, by putting serial numbers such as management numbers in the first column in advance, the original row number can be judged based on the content, which is very convenient. | ||
| 4412 | |||
| 4413 | |||
| 4414 | |(% colspan="2" rowspan="3" %) |(% colspan="4" %)**When the number of groups (n2) (n2) = K4** | ||
| 4415 | |**Column NO.1**|**Column NO.2**|**Column NO.3**|**Column NO.4** | ||
| 4416 | |**Management number**|**height**|**body weight**|**age** | ||
| 4417 | |(% rowspan="10" %)When the number of data (n1) = 5|(% rowspan="2" %)Line NO.1|(s)+1, (s)|(s)+3, (s)+2|(s)+5, (s)+4|(s) +7, (s) +6 | ||
| 4418 | |1|150|45|20 | ||
| 4419 | |(% rowspan="2" %)Line NO.2|(s) +9, (s) +8|(s)+11, (s)+10|(s) +13, (s) +12|(s) +15, (s) +14 | ||
| 4420 | |2|180|50|40 | ||
| 4421 | |(% rowspan="2" %)Line NO.3|(s) +17, (s) +16|(s) +19, (s) +18|(s) +21, (s) +20|(s) +23, (s) +22 | ||
| 4422 | |3|160|70|30 | ||
| 4423 | |(% rowspan="2" %)Line NO.4|(s) +25, (s) +24|(s) +27, (s) +26|(s) +29, (s) +28|(s) +31, (s) +30 | ||
| 4424 | |4|100|20|8 | ||
| 4425 | |(% rowspan="2" %)Line NO.5|(s) +33, (s) +32|(s) +35, (s) +34|(s) +37, (s) +36|(s) +39, (s) +38 | ||
| 4426 | |5|150|50|45 | ||
| 4427 | |||
| 4428 | Press (n3)=K2 (column NO.2) to execute the sorting result (SM165=OFF in the case of ascending order) | ||
| 4429 | |||
| 4430 | |(% colspan="2" rowspan="3" %) |(% colspan="4" %)**When the number of groups (n2) (n2) = K4** | ||
| 4431 | |**Column NO.1**|**Column NO.2**|**Column NO.3**|**Column NO.4** | ||
| 4432 | |**Management number**|**height**|**body weight**|**age** | ||
| 4433 | |(% rowspan="10" %)When the number of data (n1) = 5|(% rowspan="2" %)Line NO.1|(s)+1, (s)|(s)+3, (s)+2|(s)+5, (s)+4|(s) +7, (s) +6 | ||
| 4434 | |4|100|20|8 | ||
| 4435 | |(% rowspan="2" %)Line NO.2|(s) +9, (s) +8|(s)+11, (s)+10|(s) +13, (s) +12|(s) +15, (s) +14 | ||
| 4436 | |1|150|45|20 | ||
| 4437 | |(% rowspan="2" %)Line NO.3|(s) +17, (s) +16|(s) +19, (s) +18|(s) +21, (s) +20|(s) +23, (s) +22 | ||
| 4438 | |5|150|50|45 | ||
| 4439 | |(% rowspan="2" %)Line NO.4|(s) +25, (s) +24|(s) +27, (s) +26|(s) +29, (s) +28|(s) +31, (s) +30 | ||
| 4440 | |3|160|70|30 | ||
| 4441 | |(% rowspan="2" %)Line NO.5|(s) +33, (s) +32|(s) +35, (s) +34|(s) +37, (s) +36|(s) +39, (s) +38 | ||
| 4442 | |2|180|50|40 | ||
| 4443 | |||
| 4444 | Press (n3)=K3 (column NO.3) to execute the sorting result (SM165=ON in the case of ascending order) | ||
| 4445 | |||
| 4446 | |(% colspan="2" rowspan="3" %) |(% colspan="4" %)**When the number of groups (n2) (n2) = K4** | ||
| 4447 | |**Column NO.1**|**Column NO.2**|**Column NO.3**|**Column NO.4** | ||
| 4448 | |**Management number**|**height**|**body weight**|**age** | ||
| 4449 | |(% rowspan="10" %)When the number of data (n1) = 5|(% rowspan="2" %)Line NO.1|(s)+1, (s)|(s)+3, (s)+2|(s)+5, (s)+4|(s) +7, (s) +6 | ||
| 4450 | |3|160|70|30 | ||
| 4451 | |(% rowspan="2" %)Line NO.2|(s) +9, (s) +8|(s)+11, (s)+10|(s) +13, (s) +12|(s) +15, (s) +14 | ||
| 4452 | |2|180|50|40 | ||
| 4453 | |(% rowspan="2" %)Line NO.3|(s) +17, (s) +16|(s) +19, (s) +18|(s) +21, (s) +20|(s) +23, (s) +22 | ||
| 4454 | |5|150|50|45 | ||
| 4455 | |(% rowspan="2" %)Line NO.4|(s) +25, (s) +24|(s) +27, (s) +26|(s) +29, (s) +28|(s) +31, (s) +30 | ||
| 4456 | |1|150|45|20 | ||
| 4457 | |(% rowspan="2" %)Line NO.5|(s) +33, (s) +32|(s) +35, (s) +34|(s) +37, (s) +36|(s) +39, (s) +38 | ||
| 4458 | |4|100|20|8 | ||
| 4459 | |||
| 4460 | (% class="box infomessage" %) | ||
| 4461 | ((( | ||
| 4462 | **✎Note:**Do not change the operand and data content during operation. | ||
| 4463 | |||
| 4464 | When executing again, the instruction input should be turned OFF once. | ||
| 4465 | |||
| 4466 | The SORT2 instruction can only be written twice in the program. | ||
| 4467 | |||
| 4468 | When the same device is specified in (s) and (d), the source data is rewritten to the sorted data order. Please pay special attention not to change the content of (s) before the end of execution. | ||
| 4469 | |||
| 4470 | Do not overlap the source data and the sorted data. | ||
| 4471 | ))) | ||
| 4472 | |||
| 4473 | (% style="text-align:center" %) | ||
| 4474 | [[image:图片12.png]] | ||
| 4475 | |||
| 4476 | **Error code** | ||
| 4477 | |||
| 4478 | |=**Error code**|=**Content** | ||
| 4479 | |=(% rowspan="3" %)4084H|When the value specified in (n1) exceeds the range of 1 to 32 | ||
| 4480 | |=When the value specified in (n2) exceeds the range of 1 to 6 | ||
| 4481 | |=When the value specified in (n3) exceeds the range of 1 to n2 | ||
| 4482 | |=4085H|When the device specified in read application instruction (s), (d), (n1), (n2 )and (n3) exceeds the corresponding device range | ||
| 4483 | |=4086H|When the device specified in the write application instruction (d) exceeds the corresponding device range | ||
| 4484 | |=4089H|The number of application instructions exceeded the limit. | ||
| 4485 | |||
| 4486 | **Example** | ||
| 4487 | |||
| 4488 | Refer to the function description example. | ||
| 4489 | |||
| 4490 | (% style="text-align:center" %) | ||
| 4491 | [[image:图片13.png]] | ||
| 4492 | |||
| 4493 | == SWAP/16-bit Data High and Low Byte Swap == | ||
| 4494 | |||
| 4495 | **SWAP(P) ** | ||
| 4496 | |||
| 4497 | Swap the high and low 8-bit value of the device specified in (d). | ||
| 4498 | |||
| 4499 | -[SWAP (d)] | ||
| 4500 | |||
| 4501 | **Content, range and data type** | ||
| 4502 | |||
| 4503 | |=**Parameter**|=**Content**|=**Range**|=**Data type**|=**Data type (label)** | ||
| 4504 | |(d)|Word device with high and low byte swap|-|Signed BIN 16 bit|ANY16 | ||
| 4505 | |||
| 4506 | **Device used** | ||
| 4507 | |||
| 4508 | |=(% rowspan="2" %)**instruction**|=(% rowspan="2" %)**Parameter**|=(% colspan="24" %)**Devices**|=((( | ||
| 4509 | **Index** | ||
| 4510 | |||
| 4511 | **modification** | ||
| 4512 | )))|=((( | ||
| 4513 | **Pulse** | ||
| 4514 | |||
| 4515 | **extension** | ||
| 4516 | ))) | ||
| 4517 | |**X**|**Y**|**M**|**S**|**SM**|**T(bit)**|**C(bit)**|**LC(bit)**|**HSC(bit)**|**D.b**|**KnX**|**KnY**|**KnM**|**KnS**|**T**|**C**|**D**|**R**|**SD**|**LC**|**HSC**|**K**|**H**|**E**|**[D]**|**XXP** | ||
| 4518 | |SWAP|Parameter 1| | | | | | | | | | | |●|●|●|●|●|●|●|●| | | | | |●|● | ||
| 4519 | |||
| 4520 | **Features** | ||
| 4521 | |||
| 4522 | Convert the high and low 8-bit value of the device specified in (d). | ||
| 4523 | |||
| 4524 | (% style="text-align:center" %) | ||
| 4525 | [[image:图片14.png]] | ||
| 4526 | |||
| 4527 | **Error code** | ||
| 4528 | |||
| 4529 | |=**Error code**|=**Content** | ||
| 4530 | |=4085H|When the device specified in the read application instruction (d) exceeds the corresponding device range | ||
| 4531 | |=4086H|When the device specified in the write application instruction (d) exceeds the corresponding device range | ||
| 4532 | |||
| 4533 | **Example** | ||
| 4534 | |||
| 4535 | (% style="text-align:center" %) | ||
| 4536 | [[image:图片15.png]] | ||
| 4537 | |||
| 4538 | When the rising edge of M0 is triggered, swap the low 8 bits and high 8 bits of D0 to get H8F2A. | ||
| 4539 | |||
| 4540 | == DSWAP/32-bit Data High and Low Byte Swap == | ||
| 4541 | |||
| 4542 | **DSWAP(P)** | ||
| 4543 | |||
| 4544 | The devices specified in (d) and (d)+1 will be converted to the high and low 8-bit values respectively. | ||
| 4545 | |||
| 4546 | -[DSWAP (d)] | ||
| 4547 | |||
| 4548 | **Content, range and data type** | ||
| 4549 | |||
| 4550 | |=**Parameter**|=**Content**|=**Range**|=**Data type**|=**Data type (label)** | ||
| 4551 | |=(d)|Word device with high and low byte swap|-|Signed BIN 32 bit|ANY32 | ||
| 4552 | |||
| 4553 | **Device used** | ||
| 4554 | |||
| 4555 | |=(% rowspan="2" %)**instruction**|=(% rowspan="2" %)**Parameter**|=(% colspan="24" %)**Devices**|=((( | ||
| 4556 | **Index** | ||
| 4557 | |||
| 4558 | **modification** | ||
| 4559 | )))|=((( | ||
| 4560 | **Pulse** | ||
| 4561 | |||
| 4562 | **extension** | ||
| 4563 | ))) | ||
| 4564 | |**X**|**Y**|**M**|**S**|**SM**|**T(bit)**|**C(bit)**|**LC(bit)**|**HSC(bit)**|**D.b**|**KnX**|**KnY**|**KnM**|**KnS**|**T**|**C**|**D**|**R**|**SD**|**LC**|**HSC**|**K**|**H**|**E**|**[D]**|**XXP** | ||
| 4565 | |DSWAP|Parameter 1| | | | | | | | | | | |●|●|●|●|●|●|●|●|●|●| | | |●|● | ||
| 4566 | |||
| 4567 | **Features** | ||
| 4568 | |||
| 4569 | The devices specified in (d) and (d)+1 will be converted to the upper and lower 8-bit values respectively. | ||
| 4570 | |||
| 4571 | (% style="text-align:center" %) | ||
| 4572 | [[image:图片16.png]] | ||
| 4573 | |||
| 4574 | (% class="box infomessage" %) | ||
| 4575 | ((( | ||
| 4576 | **✎Note: ** | ||
| 4577 | If continuous execution instructions are used, conversion will be performed every scan cycle. | ||
| 4578 | ))) | ||
| 4579 | |||
| 4580 | **Error code** | ||
| 4581 | |||
| 4582 | |=**Error code**|=**Content** | ||
| 4583 | |4085H|When the device specified in the read application instruction (d) exceeds the corresponding device range | ||
| 4584 | |4086H|When the device specified in the write application instruction (d) exceeds the corresponding device range | ||
| 4585 | |||
| 4586 | **Example** | ||
| 4587 | |||
| 4588 | (% style="text-align:center" %) | ||
| 4589 | [[image:图片17.png]] | ||
| 4590 | |||
| 4591 | When the rising edge of M0 is triggered, the low 8 bits and the high 8 bits of D0 and D1 are swapped, and D0=H8F2A, D1=H3412 are obtained. | ||
| 4592 | |||
| 4593 | (% style="text-align:center" %) | ||
| 4594 | [[image:图片18.png]] | ||
| 4595 | |||
| 4596 | == BTOW/Byte Unit Data Merge == | ||
| 4597 | |||
| 4598 | **BTOW(P)** | ||
| 4599 | |||
| 4600 | Combine the low 8 bits of (n) bytes of BIN 16-bit data stored after the device number specified in (s) into word units and store it after the device number specified in (d). | ||
| 4601 | |||
| 4602 | -[BTOW (s) (d) (n)] | ||
| 4603 | |||
| 4604 | **Content, range and data type** | ||
| 4605 | |||
| 4606 | |=**Parameter**|=**Content**|=**Range**|=**Data type**|=**Data type (label)** | ||
| 4607 | |(s)|The start device that stores the data merging in byte units|-|Signed BIN 16 bit|ANY16 | ||
| 4608 | |(d)|The start device that stores the result of merging in byte units|-|Signed BIN 16 bit|ANY16 | ||
| 4609 | |(n)|Number of byte data merged|0-32767|Signed BIN 16 bit|ANY16 | ||
| 4610 | |||
| 4611 | **Device used** | ||
| 4612 | |||
| 4613 | |=(% rowspan="2" %)**instruction**|=(% rowspan="2" %)**Parameter**|=(% colspan="24" %)**Devices**|=((( | ||
| 4614 | **Index** | ||
| 4615 | |||
| 4616 | **modification** | ||
| 4617 | )))|=((( | ||
| 4618 | **Pulse** | ||
| 4619 | |||
| 4620 | **extension** | ||
| 4621 | ))) | ||
| 4622 | |**X**|**Y**|**M**|**S**|**SM**|**T(bit)**|**C(bit)**|**LC(bit)**|**HSC(bit)**|**D.b**|**KnX**|**KnY**|**KnM**|**KnS**|**T**|**C**|**D**|**R**|**SD**|**LC**|**HSC**|**K**|**H**|**E**|**[D]**|**XXP** | ||
| 4623 | |(% rowspan="3" %)BTOW|Parameter 1| | | | | | | | | | | | | | |●|●|●|●|●| | | | | |●|● | ||
| 4624 | |Parameter 2| | | | | | | | | | | | | | |●|●|●|●|●| | | | | |●|● | ||
| 4625 | |Parameter 3| | | | | | | | | | |●|●|●|●|●|●|●|●|●| | |●|●| |●|● | ||
| 4626 | |||
| 4627 | **Features** | ||
| 4628 | |||
| 4629 | After the device number specified in (s), the lower 8 bits of the 16-bit BIN data stored in (n) bytes are combined into word units and stored in the device number specified in (d) or later. | ||
| 4630 | |||
| 4631 | The upper 8 bits of (n) word data stored after the device number specified in (s) will be ignored. In addition, when (n) is an odd number, 0 is stored in the upper 8 bits of the device storing the (n)th byte of data. | ||
| 4632 | |||
| 4633 | (% style="text-align:center" %) | ||
| 4634 | [[image:图片19.png]] | ||
| 4635 | |||
| 4636 | £: the £th byte data; | ||
| 4637 | |||
| 4638 | (1): Ignore the high byte | ||
| 4639 | |||
| 4640 | *1: Carry below the decimal point. | ||
| 4641 | |||
| 4642 | **Example** | ||
| 4643 | |||
| 4644 | When (n)=5, the data up to the lower 8 bits of (s)+(s)+4 is stored in (d)+(d)+2. | ||
| 4645 | |||
| 4646 | (% style="text-align:center" %) | ||
| 4647 | [[image:图片20.png]] | ||
| 4648 | |||
| 4649 | (1): When (n)=5 | ||
| 4650 | |||
| 4651 | (2): Change to 00H | ||
| 4652 | |||
| 4653 | By setting the number of bytes in (n), the range of byte data specified in (s) and the range of the device storing the combined data specified in (d) will be automatically determined. | ||
| 4654 | |||
| 4655 | When the number of bytes specified in (n) is 0, no processing is performed. | ||
| 4656 | |||
| 4657 | The upper 8 bits of the byte data storage device specified in (s) will be ignored, and the lower 8 bits will be the target. | ||
| 4658 | |||
| 4659 | **Example** | ||
| 4660 | |||
| 4661 | When the low 8 bits of D11 to D16 is stored in D12 to D14. | ||
| 4662 | |||
| 4663 | (% style="text-align:center" %) | ||
| 4664 | [[image:图片21.png]] | ||
| 4665 | |||
| 4666 | Even if the device range storing the data before merging overlaps the device rangestoring merged data, it will be handled as normal. | ||
| 4667 | |||
| 4668 | |**Device range storing the data before merging**|**Device range for storing merged data** | ||
| 4669 | |(S)+0 to (s)+(n)-1|(D) to (d) + (n/2-1) | ||
| 4670 | |||
| 4671 | **Error code** | ||
| 4672 | |||
| 4673 | |=**Error code**|=**Content** | ||
| 4674 | |=4084H|The value specified in (n) exceed range of 0 to 32767 | ||
| 4675 | |=4085H|When the device specified in the write application instruction (s),(d) and (n) exceeds the corresponding device range | ||
| 4676 | |||
| 4677 | **Example** | ||
| 4678 | |||
| 4679 | (% style="text-align:center" %) | ||
| 4680 | [[image:图片22.png]] | ||
| 4681 | |||
| 4682 | When M0 is ON, the data of D20 to D25 is separated according to byte units, and then stored in D10 to D12. | ||
| 4683 | |||
| 4684 | (% style="text-align:center" %) | ||
| 4685 | [[image:图片23.png]] | ||
| 4686 | |||
| 4687 | == WTOB/Byte Unit Data Separation == | ||
| 4688 | |||
| 4689 | **WTOB(P)** | ||
| 4690 | |||
| 4691 | After separating the BIN 16-bit data stored after the device number specified in (s) into (n) bytes, store it after the device number specified in (d). | ||
| 4692 | |||
| 4693 | -[WTOB (s) (d) (n)] | ||
| 4694 | |||
| 4695 | **Content, range and data type** | ||
| 4696 | |||
| 4697 | |=**Parameter**|=**Content**|=**Range**|=**Data type**|=**Data type (label)** | ||
| 4698 | |=(s)|The start device that stores the data separation in byte unit|-|Signed BIN 16 bit|ANY16 | ||
| 4699 | |=(d)|The start device that stores the result of separation in byte unit|-|Signed BIN 16 bit|ANY16 | ||
| 4700 | |=(n)|Number of byte data separated|0-32767|Signed BIN 16 bit|ANY16 | ||
| 4701 | |||
| 4702 | **Device used** | ||
| 4703 | |||
| 4704 | |=(% rowspan="2" %)**instruction**|=(% rowspan="2" %)**Parameter**|=(% colspan="24" %)**Devices**|=**Index modification**|=((( | ||
| 4705 | **Pulse** | ||
| 4706 | |||
| 4707 | **extension** | ||
| 4708 | ))) | ||
| 4709 | |**X**|**Y**|**M**|**S**|**SM**|**T(bit)**|**C(bit)**|**LC(bit)**|**HSC(bit)**|**D.b**|**KnX**|**KnY**|**KnM**|**KnS**|**T**|**C**|**D**|**R**|**SD**|**LC**|**HSC**|**K**|**H**|**E**|**[D]**|**XXP** | ||
| 4710 | |(% rowspan="3" %)WTOB|Parameter 1| | | | | | | | | | | | | | |●|●|●|●|●| | | | | |●|● | ||
| 4711 | |Parameter 2| | | | | | | | | | | | | | |●|●|●|●|●| | | | | |●|● | ||
| 4712 | |Parameter 3| | | | | | | | | | | | | | | | |●|●|●| | |●|●| |●|● | ||
| 4713 | |||
| 4714 | **Features** | ||
| 4715 | |||
| 4716 | After separating the BIN 16-bit data stored after the device number specified in (s) into (n) bytes, store it after the device number specified in (d). | ||
| 4717 | |||
| 4718 | (% style="text-align:center" %) | ||
| 4719 | [[image:图片24.png]] | ||
| 4720 | |||
| 4721 | 1. High byte; | ||
| 4722 | 1. Low byte; | ||
| 4723 | 1. High byte data; | ||
| 4724 | 1. Low byte data; | ||
| 4725 | 1. *1: Carry below the decimal point. | ||
| 4726 | |||
| 4727 | **Example** | ||
| 4728 | |||
| 4729 | In the case of (n)=5, store the data up to the lower 8 bits of (s) to (s)+2 in (d) to (d)+4: | ||
| 4730 | |||
| 4731 | (% style="text-align:center" %) | ||
| 4732 | [[image:图片25.png]] | ||
| 4733 | |||
| 4734 | 1. (N)=5 is ignored. | ||
| 4735 | 1. (N)=5. | ||
| 4736 | |||
| 4737 | By setting the number of bytes in (n), the range of BIN 16-bit data specified in (s) and the range of the device storing the byte data specified in (d) will be automatically determined. | ||
| 4738 | |||
| 4739 | When the number of bytes specified in (n) is 0, no processing is performed. | ||
| 4740 | |||
| 4741 | 00H is automatically stored in the upper 8 bits of the byte data storage device specified in (d). | ||
| 4742 | |||
| 4743 | **Example** | ||
| 4744 | |||
| 4745 | When D12 to D14 is stored in the low 8 bits of D11 to D16 | ||
| 4746 | |||
| 4747 | (% style="text-align:center" %) | ||
| 4748 | [[image:图片26.png]] | ||
| 4749 | |||
| 4750 | Even if the device range storing the data before merging overlaps the device rangestoring merged data, it will be handled as normal. | ||
| 4751 | |||
| 4752 | |=**Device range storing the data before merging**|=**Device range storing separated data** | ||
| 4753 | |(s) to (s) + (n/2-1)|(d)+0 to (d)+(n)-1 | ||
| 4754 | |||
| 4755 | **Error code** | ||
| 4756 | |||
| 4757 | |=**Error code**|=**Content** | ||
| 4758 | |=4084H|The value specified by (n) exceed the range of 0 to 32767 | ||
| 4759 | |=4085H|When the device specified in read application instruction (s) and (n) exceeds the corresponding device range | ||
| 4760 | |=4086H|When the device specified in the write application instruction (d) exceeds the corresponding device range | ||
| 4761 | |||
| 4762 | **Example** | ||
| 4763 | |||
| 4764 | (% style="text-align:center" %) | ||
| 4765 | [[image:图片27.png]] | ||
| 4766 | |||
| 4767 | When M0 is ON, the data of D10 to D12 are separated according to byte units, and then stored in D20 to D25. | ||
| 4768 | |||
| 4769 | (% style="text-align:center" %) | ||
| 4770 | [[image:图片28.png]] | ||
| 4771 | |||
| 4772 | == DIS/4-bit Separation of 16-bit Data == | ||
| 4773 | |||
| 4774 | **DIS(P)** | ||
| 4775 | |||
| 4776 | Store the data of the low (n) bits (1 bit of 4 bits) of the BIN 16-bit data specified in (s) into the low 4-bit of the (n) point starting from the device specified in (d). | ||
| 4777 | |||
| 4778 | -[DIS (s) (d) (n)] | ||
| 4779 | |||
| 4780 | **Content, range and data type** | ||
| 4781 | |||
| 4782 | |=**Parameter**|=**Content**|=**Range**|=**Data type**|=**Data type (label)** | ||
| 4783 | |=(s)|The start device storing the data before separation|-|Signed BIN 16 bit|ANY16 | ||
| 4784 | |=(d)|The start device storing separated data|-|Signed BIN 16 bit|ANY16 | ||
| 4785 | |=(n)|Separation number (0 means no processing)|0-4|Signed BIN 16 bit|ANY16 | ||
| 4786 | |||
| 4787 | **Device used** | ||
| 4788 | |||
| 4789 | |=(% rowspan="2" %)**instruction**|=(% rowspan="2" %)**Parameter**|=(% colspan="24" %)**Devices**|=((( | ||
| 4790 | **Index** | ||
| 4791 | |||
| 4792 | **modification** | ||
| 4793 | )))|=((( | ||
| 4794 | **Pulse** | ||
| 4795 | |||
| 4796 | **extension** | ||
| 4797 | ))) | ||
| 4798 | |**X**|**Y**|**M**|**S**|**SM**|**T(bit)**|**C(bit)**|**LC(bit)**|**HSC(bit)**|**D.b**|**KnX**|**KnY**|**KnM**|**KnS**|**T**|**C**|**D**|**R**|**SD**|**LC**|**HSC**|**K**|**H**|**E**|**[D]**|**XXP** | ||
| 4799 | |(% rowspan="3" %)DIS|Parameter 1| | | | | | | | | | |●|●|●|●|●|●|●|●|●| | |●|●| |●|● | ||
| 4800 | |Parameter 2| | | | | | | | | | | | | | |●|●|●|●|●| | | | | |●|● | ||
| 4801 | |Parameter 3| | | | | | | | | | |●|●|●|●|●|●|●|●|●| | |●|●| |●|● | ||
| 4802 | |||
| 4803 | **Features** | ||
| 4804 | |||
| 4805 | Store the low-(n) bit (1 bits of 4 bits) of the BIN 16-bit data specified in (s) in the low 4-bit of the (n) point starting from the device specified in (d). | ||
| 4806 | |||
| 4807 | (% style="text-align:center" %) | ||
| 4808 | [[image:图片29.png]] | ||
| 4809 | |||
| 4810 | The hig-12 bit of the point (n) starting from the device specified in (s) will become 0. | ||
| 4811 | |||
| 4812 | When (n)=0, it will become no processing, and the content of point (n) starting from the device of (d) will not change. | ||
| 4813 | |||
| 4814 | **Error code** | ||
| 4815 | |||
| 4816 | |=**Error code**|=**Content** | ||
| 4817 | |=4084H|The data in (n) exceed the range of 0 to 4 | ||
| 4818 | |=4085H|When the device specified in read application instruction (s) and (n) exceeds the corresponding device range | ||
| 4819 | |=4086H|When the device specified in the write application instruction (d) exceeds the corresponding device range | ||
| 4820 | |||
| 4821 | **Example** | ||
| 4822 | |||
| 4823 | (% style="text-align:center" %) | ||
| 4824 | [[image:图片30.png]] | ||
| 4825 | |||
| 4826 | When M0 is ON, D0 is separated every 4 bits and stored in D10 to D12. The result is D10 = HF, D11 = H8, D12 = HA. | ||
| 4827 | |||
| 4828 | == UNI/4-bit Combination of 16-bit Data == | ||
| 4829 | |||
| 4830 | **UNI(P)** | ||
| 4831 | |||
| 4832 | Combine the low 4 bits of the BIN 16-bit data of point (n) starting from the device specified in (s) into the BIN 16-bit device specified in (d). | ||
| 4833 | |||
| 4834 | -[UNI (s) (d) (n)] | ||
| 4835 | |||
| 4836 | **Content, range and data type** | ||
| 4837 | |||
| 4838 | |=**Parameter**|=**Content**|=**Range**|=**Data type**|=**Data type (label)** | ||
| 4839 | |=(s)|The start device storing the data before merging|-|Signed BIN 16 bit|ANY16 | ||
| 4840 | |=(d)|The start device storing the merged data|-|Signed BIN 16 bit|ANY16 | ||
| 4841 | |=(n)|Number of merger|0-4|Signed BIN 16 bit|ANY16 | ||
| 4842 | |||
| 4843 | **Device used** | ||
| 4844 | |||
| 4845 | |=(% rowspan="2" %)**instruction**|=(% rowspan="2" %)**Parameter**|=(% colspan="24" %)**Devices**|=((( | ||
| 4846 | **Index** | ||
| 4847 | |||
| 4848 | **modification** | ||
| 4849 | )))|=((( | ||
| 4850 | **Pulse** | ||
| 4851 | |||
| 4852 | **extension** | ||
| 4853 | ))) | ||
| 4854 | |**X**|**Y**|**M**|**S**|**SM**|**T(bit)**|**C(bit)**|**LC(bit)**|**HSC(bit)**|**D.b**|**KnX**|**KnY**|**KnM**|**KnS**|**T**|**C**|**D**|**R**|**SD**|**LC**|**HSC**|**K**|**H**|**E**|**[D]**|**XXP** | ||
| 4855 | |(% rowspan="3" %)UNI|Parameter 1| | | | | | | | | | | | | | |●|●|●|●|●| | | | | |●|● | ||
| 4856 | |Parameter 2| | | | | | | | | | | |●|●|●|●|●|●|●|●| | | | | |●|● | ||
| 4857 | |Parameter 3| | | | | | | | | | |●|●|●|●|●|●|●|●|●| | |●|●| |●|● | ||
| 4858 | |||
| 4859 | **Features** | ||
| 4860 | |||
| 4861 | Combine the low 4 bits of the BIN 16-bit data at point (n) starting from the device specified in (s) into the BIN 16-bit device specified in (d). | ||
| 4862 | |||
| 4863 | (% style="text-align:center" %) | ||
| 4864 | [[image:图片31.png]] | ||
| 4865 | |||
| 4866 | The high (4-n) bits of the device specified in (d) will become 0. | ||
| 4867 | |||
| 4868 | When (n)=0, it will become no processing, and the content of the device in (d) will not change. | ||
| 4869 | |||
| 4870 | **Error code** | ||
| 4871 | |||
| 4872 | |=**Code**|=**Content** | ||
| 4873 | |=4084H|The data in (n) exceed the range of 0 to 4 | ||
| 4874 | |=4085H|When the device specified in read application instruction (s) and (n) exceeds the corresponding device range | ||
| 4875 | |=4086H|When the device specified in the write application instruction (d) exceeds the corresponding device range | ||
| 4876 | |||
| 4877 | **Example** | ||
| 4878 | |||
| 4879 | (% style="text-align:center" %) | ||
| 4880 | [[image:图片32.png]] | ||
| 4881 | |||
| 4882 | When M0 is ON, the low 4 bits of D0 to D3 are combined and stored in D10, the value is H236F. | ||
| 4883 | |||
| 4884 | == ZRST/Data Batch Reset == | ||
| 4885 | |||
| 4886 | [[image:file:///C:\Users\ANNAXU~~1\AppData\Local\Temp\ksohtml3496\wps2.png]]**ZRST(P)** | ||
| 4887 | |||
| 4888 | Perform a batch reset between the devices specified in (d1) and (d2) of the same type. It is used when interrupting operation, performing initial operation, or resetting control data. | ||
| 4889 | |||
| 4890 | -[ZRST ( d1) (d2)] | ||
| 4891 | |||
| 4892 | **Content, range and data type** | ||
| 4893 | |||
| 4894 | |=**Parameter**|=**Content**|=**Range**|=**Data type**|=**Data type (label)** | ||
| 4895 | |=(d1)|The start bit or word device number of batch reset|-|Bit/Signed BIN 16 bit|ANY_ELEMENTARY | ||
| 4896 | |=(d2)|The final bit or word device number of batch reset|-|Bit/Signed BIN 16 bit|ANY_ELEMENTARY | ||
| 4897 | |||
| 4898 | **Device used** | ||
| 4899 | |||
| 4900 | |=(% rowspan="2" %)**instruction**|=(% rowspan="2" %)**Parameter**|=(% colspan="24" %)**Devices**|=((( | ||
| 4901 | **Index** | ||
| 4902 | |||
| 4903 | **modification** | ||
| 4904 | )))|=((( | ||
| 4905 | **Pulse** | ||
| 4906 | |||
| 4907 | **extension** | ||
| 4908 | ))) | ||
| 4909 | |**X**|**Y**|**M**|**S**|**SM**|**T(bit)**|**C(bit)**|**LC(bit)**|**HSC(bit)**|**D.b**|**KnX**|**KnY**|**KnM**|**KnS**|**T**|**C**|**D**|**R**|**SD**|**LC**|**HSC**|**K**|**H**|**E**|**[D]**|**XXP** | ||
| 4910 | |(% rowspan="2" %)ZRST|Parameter 1| |●|●|●|●| | | | | |●|●|●|●|●|●|●|●|●|●|●| | | |●|● | ||
| 4911 | |Parameter 2| |●|●|●|●| | | | | |●|●|●|●|●|●|●|●|●|●|●| | | |●|● | ||
| 4912 | |||
| 4913 | **Features** | ||
| 4914 | |||
| 4915 | Perform batch reset between the devices specified in (d1) and (d2) of the same type. | ||
| 4916 | |||
| 4917 | (% style="text-align:center" %) | ||
| 4918 | [[image:图片33.png]] | ||
| 4919 | |||
| 4920 | When (d1) and (d2) are bit devices, write OFF (reset) in the entire device range of (d1) to (d2). | ||
| 4921 | |||
| 4922 | (% style="text-align:center" %) | ||
| 4923 | [[image:图片34.png]] | ||
| 4924 | |||
| 4925 | When (d1) and (d2) are word devices, write K0 in the entire device range of (d1) to (d2). | ||
| 4926 | |||
| 4927 | |||
| 4928 | As a separate reset instruction for the device, the RST instruction can be used for bit devices or word devices. | ||
| 4929 | |||
| 4930 | (% style="text-align:center" %) | ||
| 4931 | [[image:图片35.png]] | ||
| 4932 | |||
| 4933 | Reset M0 | ||
| 4934 | |||
| 4935 | Reset the current value of T0 | ||
| 4936 | |||
| 4937 | Reset D0 | ||
| 4938 | |||
| 4939 | |||
| 4940 | The batch write instruction of constant (for example: K0) has FMOV (P) instruction, which can write 0 to word devices (including bit device specification). | ||
| 4941 | |||
| 4942 | (% style="text-align:center" %) | ||
| 4943 | [[image:图片36.png]] | ||
| 4944 | |||
| 4945 | Write K0 in D0 to D99. | ||
| 4946 | |||
| 4947 | (% class="box infomessage" %) | ||
| 4948 | ((( | ||
| 4949 | **✎Note:**Please specify the same type number for (d1) and (d2), and make (d1) number <(d2) number. When (d1) number ≥ (d2) number, only 1 point will be reset for the device specified in (d1). | ||
| 4950 | |||
| 4951 | ZRST(P) instruction is a 16-bit instruction, which can specify (LC) and (HSC) devices for (d1) and (d2). | ||
| 4952 | ))) | ||
| 4953 | |||
| 4954 | **Error code** | ||
| 4955 | |||
| 4956 | |=**Error code**|=**Content** | ||
| 4957 | |=4084H|When the device type specified in (d1) is different from the device type specified in (d2). | ||
| 4958 | |=4085H|When the device specified in the read application instruction (d1) and (d2) exceeds the corresponding device range | ||
| 4959 | |=4086H|When the device specified in the write application instruction (d1) exceeds the corresponding device range | ||
| 4960 | |||
| 4961 | **Example** | ||
| 4962 | |||
| 4963 | (% style="text-align:center" %) | ||
| 4964 | [[image:图片37.png]] | ||
| 4965 | |||
| 4966 | The function of this ladder diagram instruction is to set the value of the D0 to D100 device to 0. | ||
| 4967 | |||
| 4968 | == ZSET/Data Batch Set == | ||
| 4969 | |||
| 4970 | **ZSET(P)** | ||
| 4971 | |||
| 4972 | Perform a batch set between the devices specified in (d1) and (d2) of the same type. | ||
| 4973 | |||
| 4974 | (% style="text-align:center" %) | ||
| 4975 | [[image:图片38.png]] | ||
| 4976 | |||
| 4977 | **Content, range and data type** | ||
| 4978 | |||
| 4979 | |=**Parameter**|=**Content**|=**Range**|=**Data type**|=**Data type(label)** | ||
| 4980 | |=(d1)|The start bit device number of batch set|-|Bit|ANY_BOOL | ||
| 4981 | |=(d2)|The final bit device number of batch set|-|Bit|ANY_BOOL | ||
| 4982 | |||
| 4983 | **Device used** | ||
| 4984 | |||
| 4985 | |=(% rowspan="2" %)**instruction**|=(% rowspan="2" %)**Parameter**|=(% colspan="24" %)**Devices**|=**Index modification** | ||
| 4986 | |**X**|**Y**|**M**|**S**|**SM**|**T(bit)**|**C(bit)**|**LC(bit)**|**HSC(bit)**|**D.b**|**KnX**|**KnY**|**KnM**|**KnS**|**T**|**C**|**D**|**R**|**SD**|**LC**|**HSC**|**K**|**H**|**E**|**[D]** | ||
| 4987 | |(% rowspan="2" %)ZSET|Parameter 1| |●|●|●|●| | | | |●| | | | | | | | | | | | | | |● | ||
| 4988 | |Parameter 2| |●|●|●|●| | | | |●| | | | | | | | | | | | | | |● | ||
| 4989 | |||
| 4990 | **Features** | ||
| 4991 | |||
| 4992 | ·Perform a batch set between the devices specified in (d1) and (d2) of the same type. | ||
| 4993 | |||
| 4994 | ·Write ON (set) in the entire device range of (d1) to (d2) | ||
| 4995 | |||
| 4996 | (% style="text-align:center" %) | ||
| 4997 | [[image:图片1.png]] | ||
| 4998 | |||
| 4999 | ·As a separate set instruction for the device, the SET instruction can be used for bit devices. | ||
| 5000 | |||
| 5001 | (% style="text-align:center" %) | ||
| 5002 | [[image:图片2.png]] | ||
| 5003 | |||
| 5004 | (% class="box infomessage" %) | ||
| 5005 | ((( | ||
| 5006 | **✎Note: ** | ||
| 5007 | Please specify the same type number for (d1) and (d2), and make (d1) number <(d2) number. When (d1) number ≥ (d2) number, only 1 point will be set for the device specified in (d1). | ||
| 5008 | ))) | ||
| 5009 | |||
| 5010 | **Error code** | ||
| 5011 | |||
| 5012 | |=**Error code**|=**Content** | ||
| 5013 | |=4084H|When the device type specified in (d1) is different from the device type specified in (d2). | ||
| 5014 | |=4085H|When the device specified in the read application instruction (d1) and (d2) exceeds the corresponding device range | ||
| 5015 | |=4086H|When the device specified in the write application instruction (d1) exceeds the corresponding device range | ||
| 5016 | |=4087H|When the device type specified in (d1) and (d2) are not bit device. | ||
| 5017 | |||
| 5018 | **Example** | ||
| 5019 | |||
| 5020 | (% style="text-align:center" %) | ||
| 5021 | [[image:图片3.png]] | ||
| 5022 | |||
| 5023 | The function of this LAD instruction is to set the value of the M1 to M4 device to ON. | ||
| 5024 | |||
| 5025 | |||
| 5026 | == CRC/Cyclic Redundancy Check instruction == | ||
| 5027 | |||
| 5028 | **CRC(P)** | ||
| 5029 | |||
| 5030 | Calculate the CRC (Cyclic Redundancy Check) value, which is one of the error checking methods used in communications. In addition to CRC, error checking methods include parity and | ||
| 5031 | |||
| 5032 | Sum check (checksum), calculate horizontal parity check value and sum check value can use CCD(P) instruction . And this instruction is used in the generator polynomial that generates the CRC value (CRC-16) | ||
| 5033 | |||
| 5034 | "X 16 +X 15 +X 2 +1". | ||
| 5035 | |||
| 5036 | -[CRC(P) (s) (d) (n)] | ||
| 5037 | |||
| 5038 | **Content, range and data type** | ||
| 5039 | |||
| 5040 | |=**Parameter**|=**Content**|=**Range**|=**Data type**|=**Data type (label)** | ||
| 5041 | |=(s)|The device start number storing the data of CRC value generated objects |-|Signed BIN16|ANY16 | ||
| 5042 | |=(d)|The destination device number of the generated CRC value|-|Signed BIN16|ANY16 | ||
| 5043 | |=(n)|The number of 8-bit data (bytes) for calculating the CRC value or the number of the device storing the number of data|1 to 256|Unsigned BIN16|ANY16_U | ||
| 5044 | |||
| 5045 | **Device used** | ||
| 5046 | |||
| 5047 | |=(% rowspan="2" %)**instruction**|=(% rowspan="2" %)**Parameter**|=(% colspan="24" %)**Devices**|=((( | ||
| 5048 | **Index** | ||
| 5049 | |||
| 5050 | **modification** | ||
| 5051 | )))|=((( | ||
| 5052 | **Pulse** | ||
| 5053 | |||
| 5054 | **extension** | ||
| 5055 | ))) | ||
| 5056 | |**X**|**Y**|**M**|**S**|**SM**|**T(bit)**|**C(bit)**|**LC(bit)**|**HSC(bit)**|**D.b**|**KnX**|**KnY**|**KnM**|**KnS**|**T**|**C**|**D**|**R**|**SD**|**LC**|**HSC**|**K**|**H**|**E**|**[D]**|**XXP** | ||
| 5057 | |(% rowspan="3" %)CRC|Parameter 1| | | | | | | | | | |●|●|●|●|●|●|●|●|●| | | | | |●|● | ||
| 5058 | |Parameter 2| | | | | | | | | | | |●|●|●|●|●|●|●|●| | | | | |●|● | ||
| 5059 | |Parameter 3| | | | | | | | | | |●|●|●|●|●|●|●|●|●| | |●|●| | |● | ||
| 5060 | |||
| 5061 | **Features** | ||
| 5062 | |||
| 5063 | Start with the device specified in (s), generate the CRC value of 8-bit data (byte unit) at (n) point, and store it in (d). | ||
| 5064 | |||
| 5065 | The mode used by this instruction in calculation includes 16-bit conversion mode and 8-bit conversion mode. For the operation of each mode, please refer to the following content. | ||
| 5066 | |||
| 5067 | 1. 16-bit conversion mode (when SM161=OFF) | ||
| 5068 | |||
| 5069 | Calculate the upper 8 bits (byte) and lower 8 bits (byte) of the (s) device. The result is stored in 16 bits of 1 point of the device specified in (d). In the case of the following program, perform the conversion as shown below. | ||
| 5070 | |||
| 5071 | (% style="text-align:center" %) | ||
| 5072 | [[image:图片4.png]] | ||
| 5073 | |||
| 5074 | |(% colspan="3" rowspan="3" %) |(% colspan="3" %)**Example (s)=D100, (d)=D0, (n)=6** | ||
| 5075 | |(% rowspan="2" %)**Devices**|(% colspan="2" %)**Content of object data** | ||
| 5076 | |**8-bit**|**16-bit** | ||
| 5077 | |(% rowspan="9" %)CRC value generation target data storage destination|(% rowspan="2" %)(s)|Low byte|D100 low|01H|0301H | ||
| 5078 | |High byte|D100 high|03H| | ||
| 5079 | |(% rowspan="2" %)(s)+1|Low byte|D101 low|03H|0203H | ||
| 5080 | |High byte|D101 high|02H| | ||
| 5081 | |(% rowspan="2" %)(s)+2|Low byte|D102 low|00H|1400H | ||
| 5082 | |High byte|D102 high|14H| | ||
| 5083 | |...| |(% colspan="3" %) | ||
| 5084 | |(% rowspan="2" %)(s)+(n)/2-1|Low byte|(% colspan="3" rowspan="2" %) | ||
| 5085 | |High byte | ||
| 5086 | |(% rowspan="2" %)CRC value storage target|(% rowspan="2" %)(d)|Low byte|D0 low|E4H|41E4H | ||
| 5087 | |High byte|D0 high|41H| | ||
| 5088 | |||
| 5089 | 2. 8-bit conversion mode (when SM8161=ON) | ||
| 5090 | |||
| 5091 | In 8-bit conversion mode, only the lower 8 bits (lower byte) of the (s) device are operated on. As a result, 2 points are used starting from the device specified in (d), the lower 8 bits (bytes) are stored in (d), and the upper 8 bits (bytes) are stored in (d)+1. | ||
| 5092 | |||
| 5093 | In the case of the following program, perform the conversion as shown below. | ||
| 5094 | |||
| 5095 | |(% colspan="3" rowspan="2" %) |(% colspan="2" %)**Example) (s)=D100, (d)=D0, (n)=6** | ||
| 5096 | |**Devices**|**Content of object data** | ||
| 5097 | |(% rowspan="8" %)CRC value generation target data storage destination|(s)|Low byte|D100 low|01H | ||
| 5098 | |(s)+1|Low byte|D101 low|03H | ||
| 5099 | |(s)+2|Low byte|D102 low|03H | ||
| 5100 | |(s)+3|Low byte|D103 low|02H | ||
| 5101 | |(s)+4|Low byte|D104 low|00H | ||
| 5102 | |(s)+5|Low byte|D105 low|14H | ||
| 5103 | |(% colspan="2" %)...|(% colspan="2" %) | ||
| 5104 | |(s)+(n)-1|Low byte|(% colspan="2" %) | ||
| 5105 | |(% rowspan="2" %)CRC value storage target|(d)|Low byte|D0|E4H | ||
| 5106 | |(d)+1|Low byte|D1|41H | ||
| 5107 | |||
| 5108 | In the CRC(P) instruction, the generator polynomial of the CRC value (CRC-16) uses "X16+X15+X2+1", but there are also many standardized generator polynomials for the CRC value. If the generator polynomial is different, it will become a completely different CRC value, which should be noted. The main CRC value generator polynomials are shown below. | ||
| 5109 | |||
| 5110 | |=**Name**|=**Generator polynomial** | ||
| 5111 | |=CRC-12|X^^12^^+X^^11^^+X^^3^^+X^^2^^+X+1 | ||
| 5112 | |=CRC-16|X^^16^^+X^^15^^+X^^2^^+1 | ||
| 5113 | |=CRC-32|X^^32^^+X^^26^^+X^^23^^+X^^22^^+X^^16^^+X^^12^^+X^^11^^+X^^10^^+X^^8^^+X^^7^^+X^^5^^+X^^4^^+X^^2^^+X+1 | ||
| 5114 | |=CRC-CCITT|X^^16^^+X^^12^^+X^^5^^+1 | ||
| 5115 | |||
| 5116 | (% class="box infomessage" %) | ||
| 5117 | ((( | ||
| 5118 | **✎Note: | ||
| 5119 | **When (s1) use KnX, KnY, KnM, KnS, n must be specified as 4. | ||
| 5120 | ))) | ||
| 5121 | |||
| 5122 | **Error code** | ||
| 5123 | |||
| 5124 | |=**Error code**|=**Content** | ||
| 5125 | |=4084H|The range of (n) exceeds 1 to 256 | ||
| 5126 | |=4085H|The data address of (s) to be converted exceeds the device range | ||
| 5127 | |=4086H|The (d) write address exceeds the device range | ||
| 5128 | |=4087H|Unsupported device type is used by (s) and (d) | ||
| 5129 | |||
| 5130 | **Example** | ||
| 5131 | |||
| 5132 | * 16-bit conversion mode | ||
| 5133 | |||
| 5134 | (% style="text-align:center" %) | ||
| 5135 | [[image:图片6.png]] | ||
| 5136 | |||
| 5137 | * 8-bit conversion mode | ||
| 5138 | |||
| 5139 | (% style="text-align:center" %) | ||
| 5140 | [[image:图片7.png]] | ||
| 5141 | |||
| 5142 | = Matrix Input instructions = | ||
| 5143 | |||
| 5144 | == MTR/Matrix Input == | ||
| 5145 | |||
| 5146 | [[image:file:///C:\Users\ANNAXU~~1\AppData\Local\Temp\ksohtml11864\wps1.png]]**MTR** | ||
| 5147 | |||
| 5148 | The instruction to read the input signal (switch) of 8 points multiply by n columns in the time division method of 8 input and (n) output (transistor). | ||
| 5149 | |||
| 5150 | -[MTR (s) (d1) (d2) (n)] | ||
| 5151 | |||
| 5152 | **Content, range and data type** | ||
| 5153 | |||
| 5154 | |=**Parameter**|=**Content**|=**Range**|=**Data type**|=**Data type (label)** | ||
| 5155 | |(s)|The start device (X) number X000, X010, X020 of the row signal input of the matrix is up to the final input X number. 8 consecutively occupied.|The lowest bit number of X can only be 0|((( | ||
| 5156 | Bit | ||
| 5157 | |||
| 5158 | |||
| 5159 | )))|ANY_BOOL | ||
| 5160 | |(d1)|The starting device (Y) number of the column signal output of the matrix is Y000, Y010, Y020... to the final output Y number. 8 consecutively occupied.|The lowest bit number of Y can only be 0|Bit|ANY_BOOL | ||
| 5161 | |(d2)|The start device (Y, M, S) number of the ON output destination address is Y000, Y010, Y020..., M000, M010, M020..., S000, S010, S020... until the final Y, M, S number. Y occupies 8*(n) continuously, and the others occupy 10*(n) continuously.|-|Bit|ANY_BOOL | ||
| 5162 | |(n)|Set the number of columns in the matrix input.|2 to 8|Unsigned BIN 16 bit|ANY16_U | ||
| 5163 | |||
| 5164 | **Device used** | ||
| 5165 | |||
| 5166 | |=(% rowspan="2" %)**instruction**|=(% rowspan="2" %)**Parameter**|=(% colspan="24" %)**Devices**|=((( | ||
| 5167 | **Index** | ||
| 5168 | |||
| 5169 | **modification** | ||
| 5170 | )))|=((( | ||
| 5171 | **Pulse** | ||
| 5172 | |||
| 5173 | **extension** | ||
| 5174 | ))) | ||
| 5175 | |**X**|**Y**|**M**|**S**|**SM**|**T(bit)**|**C(bit)**|**LC(bit)**|**HSC(bit)**|**D.b**|**KnX**|**KnY**|**KnM**|**KnS**|**T**|**C**|**D**|**R**|**SD**|**LC**|**HSC**|**K**|**H**|**E**|**[D]**|**XXP** | ||
| 5176 | |(% rowspan="4" %)MTR|Parameter 1|●| | | | | | | | | | | | | | | | | | | | | | | | | | ||
| 5177 | |Parameter 2| |●| | | | | | | | | | | | | | | | | | | | | | | | | ||
| 5178 | |Parameter 3| |●|●|●|●| | | | | | | | | | | | | | | | | | | | | | ||
| 5179 | |Parameter 4| | | | | | | | | | | | | | | | | | | | | |●|●| | | | ||
| 5180 | |||
| 5181 | **Features** | ||
| 5182 | |||
| 5183 | (% style="text-align:center" %) | ||
| 5184 | [[image:图片8.png]] | ||
| 5185 | |||
| 5186 | This instruction generally uses the normally ON contact SM100. | ||
| 5187 | |||
| 5188 | (% style="text-align:center" %) | ||
| 5189 | [[image:图片9.png]] | ||
| 5190 | |||
| 5191 | According to the example in the figure: | ||
| 5192 | |||
| 5193 | M10 will turn ON when Y30 and X30 are connected, M14 will be ON when Y30 and X34 are connected, M26 will be ON when Y31 and X36 are connected | ||
| 5194 | |||
| 5195 | (D2) is recommended to use a minimum of 0, mainly when using an address such as M4, the first start is M4, and then it will continue to occupy M11, which is inconvenient to calculate and view, so it is recommended to use a software with a minimum of 0 element. | ||
| 5196 | |||
| 5197 | **Special device used** | ||
| 5198 | |||
| 5199 | |**Devices**|**Content** | ||
| 5200 | |SM229|SM229 will turn ON after one cycle of execution is completed | ||
| 5201 | |||
| 5202 | (% class="box infomessage" %) | ||
| 5203 | ((( | ||
| 5204 | **✎Note: ** | ||
| 5205 | The MTR instruction can only run one instruction at the same time. | ||
| 5206 | ))) | ||
| 5207 | |||
| 5208 | **Error code** | ||
| 5209 | |||
| 5210 | |=**Error code**|=**Content** | ||
| 5211 | |(% rowspan="2" %)4085H|The read address of (s) and (n) exceeds the device range | ||
| 5212 | |(s) use the numbered device whose low bit is not 0 | ||
| 5213 | |(% rowspan="2" %)4086HA|The write address of (d1) and (d2) exceeds the device range | ||
| 5214 | |(d2) use the numbered device whose low bit is not 0 | ||
| 5215 | |4084H|(n) is not in the range of 2 to 8 | ||
| 5216 | |4089H|Multiple MTR instructions are executed at the same time | ||
| 5217 | |||
| 5218 | = Convenient instructions = | ||
| 5219 | |||
| 5220 | == ABSD/BIN 16-bit Data Absolute Method == | ||
| 5221 | |||
| 5222 | [[image:file:///C:\Users\ANNAXU~~1\AppData\Local\Temp\ksohtml11864\wps2.png]]**ABSD** | ||
| 5223 | |||
| 5224 | Create multiple output modes corresponding to the current counter (BIN 16-bit value). | ||
| 5225 | |||
| 5226 | -[ABSD (s1) (s2) (d) (n)] | ||
| 5227 | |||
| 5228 | **Content, range and data type** | ||
| 5229 | |||
| 5230 | |=**Parameter**|=**Content**|=**Range**|=**Data type**|=**Data type (label)** | ||
| 5231 | |=(s1)|((( | ||
| 5232 | The start device number storing the data table | ||
| 5233 | |||
| 5234 | (rising edge point and falling edge point) | ||
| 5235 | )))|-|Signed BIN 16 bit|ANY16 | ||
| 5236 | |=(s2)|The counter number used for monitoring of the current value compared to the data table|-|Signed BIN 16 bit|ANY16 | ||
| 5237 | |=(d)|The number of points of the output start device|-|Bit|ANY16_BOOL | ||
| 5238 | |=(n)|Number of table rows and output bit device points|1 to 64|Signed BIN 16 bit|ANY16 | ||
| 5239 | |||
| 5240 | **Device used** | ||
| 5241 | |||
| 5242 | |=(% rowspan="2" %)**instruction**|=(% rowspan="2" %)**Parameter**|=(% colspan="24" %)**Devices**|=((( | ||
| 5243 | **Index** | ||
| 5244 | |||
| 5245 | **modification** | ||
| 5246 | )))|=((( | ||
| 5247 | **Pulse** | ||
| 5248 | |||
| 5249 | **extension** | ||
| 5250 | ))) | ||
| 5251 | |**X**|**Y**|**M**|**S**|**SM**|**T(bit)**|**C(bit)**|**LC(bit)**|**HSC(bit)**|**D.b**|**KnX**|**KnY**|**KnM**|**KnS**|**T**|**C**|**D**|**R**|**SD**|**LC**|**HSC**|**K**|**H**|**E**|**[D]**|**XXP** | ||
| 5252 | |(% rowspan="4" %)ABSD|Parameter 1| | | | | | | | | | |●|●|●|●|●|●|●|●|●| | | | | |●| | ||
| 5253 | |Parameter 2| | | | | | | | | | | | | | | |●| | | | | | | | |●| | ||
| 5254 | |Parameter 3| |●|●|●|●| | | | |●| | | | | | | | | | | | | | |●| | ||
| 5255 | |Parameter 4| | | | | | | | | | |●|●|●|●|●|●|●|●|●| | |●|●| |●| | ||
| 5256 | |||
| 5257 | **Features** | ||
| 5258 | |||
| 5259 | Take the turntable to rotate 1 revolution (0 to 360 degrees) to control the output ON/OFF as an example. (1 degree, 1 pulse angle signal) | ||
| 5260 | |||
| 5261 | Compare the data table of row (n) starting from (s1) (row (n) multiply by 2 points) with the current value of the counter (s2), from (d) to continuous (n) in the course of one revolution The output is ON/OFF control up to the point. | ||
| 5262 | |||
| 5263 | (% style="text-align:center" %) | ||
| 5264 | [[image:图片10.png]] | ||
| 5265 | |||
| 5266 | Use the transfer instruction to write the following data into (s1) to (s1)+2(n)-1 in advance. For example, the rising edge point data stores 16-bit data to even-numbered devices in advance, and the falling edge point data stores 16-bit data to odd-numbered devices in advance. | ||
| 5267 | |||
| 5268 | |=(% colspan="2" %)**Rising edge point**|=(% colspan="2" %)**Falling edge point**|=(% rowspan="2" %)**Object output** | ||
| 5269 | |**-**|**Data value (example)**|**-**|**Data value (example)** | ||
| 5270 | |(S1)|40|(S1)+1|140|(D) | ||
| 5271 | |(S1)+2|100|(S1) +3|200|(D) +1 | ||
| 5272 | |(S1) +4|160|(S1) +5|60|(D) +2 | ||
| 5273 | |(S1) +6|240|(S1) +7|280|(D) +3 | ||
| 5274 | |...|(% rowspan="2" %)-|...|(% rowspan="2" %)-|... | ||
| 5275 | |(S1)+2(n)-2|(S1)+2(n)-1|(D) +n-1 | ||
| 5276 | |||
| 5277 | If the instruction input is set to ON, (d) is the start, (n) point is the output mode as shown below. Each rising edge point and falling edge point can be individually changed by rewriting the data from (s1) to (s1)+2(n)-1. | ||
| 5278 | |||
| 5279 | (% style="text-align:center" %) | ||
| 5280 | [[image:图片11.png]] | ||
| 5281 | |||
| 5282 | (% class="box infomessage" %) | ||
| 5283 | ((( | ||
| 5284 | **✎Note: **When specifying the number of bit devices in (s1), the device number should be a multiple of 16 (0, 16, 32, 64...), and only K4 should be specified for the number of bits. | ||
| 5285 | |||
| 5286 | The number of target output points is determined by the value of (n). (1≤(n)≤64) | ||
| 5287 | |||
| 5288 | Even if the instruction input is turned off, the output does not change. | ||
| 5289 | ))) | ||
| 5290 | |||
| 5291 | **Error code** | ||
| 5292 | |||
| 5293 | |=**Error code**|=**Content** | ||
| 5294 | |=4084H|When the value specified in (n) exceeds the range of 1 to 64 | ||
| 5295 | |=4085H|When the device specified in the read application instruction (s1), (s2 )and (n) exceeds the corresponding device range | ||
| 5296 | |=4086H|When the device specified in the write application instruction (d) exceeds the corresponding device range | ||
| 5297 | |||
| 5298 | **Example** | ||
| 5299 | |||
| 5300 | Refer to the example in the function description. | ||
| 5301 | |||
| 5302 | == DABSD/BIN 32-bit Data Absolute Method == | ||
| 5303 | |||
| 5304 | **DABSD** | ||
| 5305 | |||
| 5306 | Create multiple output modes corresponding to the current counter (BIN 32-bit value). | ||
| 5307 | |||
| 5308 | -[DABSD (s1) (s2) (d) (n)] | ||
| 5309 | |||
| 5310 | **Content, range and data type** | ||
| 5311 | |||
| 5312 | |=**Parameter**|=**Content**|=**Range**|=**Data type**|=**Data type (label)** | ||
| 5313 | |=(s1)|((( | ||
| 5314 | The start device number storing the data table | ||
| 5315 | |||
| 5316 | (rising edge point and falling edge point) | ||
| 5317 | )))|-|Signed BIN 32 bit|ANY32 | ||
| 5318 | |=(s2)|The counter number used for monitoring of the current value compared to the data table|-|Signed BIN 32 bit|ANY32 | ||
| 5319 | |=(d)|The number of points of the output start device|-|Bit|ANY16_BOOL | ||
| 5320 | |=(n)|Number of table rows and output bit device points|1 to 64|Signed BIN 32 bit|ANY32 | ||
| 5321 | |||
| 5322 | **Device used** | ||
| 5323 | |||
| 5324 | |=(% rowspan="2" %)**instruction**|=(% rowspan="2" %)**Parameter**|=(% colspan="24" %)**Devices**|=**Index modification**|=((( | ||
| 5325 | **Pulse** | ||
| 5326 | |||
| 5327 | **extension** | ||
| 5328 | ))) | ||
| 5329 | |**X**|**Y**|**M**|**S**|**SM**|**T(bit)**|**C(bit)**|**LC(bit)**|**HSC(bit)**|**D.b**|**KnX**|**KnY**|**KnM**|**KnS**|**T**|**C**|**D**|**R**|**SD**|**LC**|**HSC**|**K**|**H**|**E**|**[D]**|**XXP** | ||
| 5330 | |(% rowspan="4" %)DABSD|Parameter 1| | | | | | | | | | |●|●|●|●|●|●|●|●|●|●|●| | | |●| | ||
| 5331 | |Parameter 2| | | | | | | | | | | | | | | |●| | | |●|●| | | |●| | ||
| 5332 | |Parameter 3| |●|●|●|●| | | | |●| | | | | | | | | | | | | | |●| | ||
| 5333 | |Parameter 4| | | | | | | | | | |●|●|●|●|●|●|●|●|●|●|●|●|●| |●| | ||
| 5334 | |||
| 5335 | **Features** | ||
| 5336 | |||
| 5337 | Take the turntable to rotate 1 revolution (0 to 360 degrees) to control the output ON/OFF as an example. (1 degree, 1 pulse angle signal) | ||
| 5338 | |||
| 5339 | Compare the data table of row (n) starting from (s1) (row (n) × 4 points) with the current value of the counter (s2), from (d) to continuous (n) in the course of one revolution The output is ON/OFF control up to the point. | ||
| 5340 | |||
| 5341 | (% style="text-align:center" %) | ||
| 5342 | [[image:图片12.png]] | ||
| 5343 | |||
| 5344 | Use the transfer instruction to write the following data into (s1), (s1)+1 to (s1)+4(n)-2, (s1)+4(n)-1 in advance. For example, the rising edge point data stores 32-bit data to even-numbered devices in advance, and the falling edge point data stores 32-bit data to odd-numbered devices in advance. | ||
| 5345 | |||
| 5346 | |=(% colspan="2" %)**Rising edge point**|=(% colspan="2" %)**Falling edge point**|=(% rowspan="2" %)**Object output** | ||
| 5347 | |**-**|**Data value (example)**|**-**|**Data value (example)** | ||
| 5348 | |(S1)+1, (S1)|40|(S1)+3, (S1)+2|140|(D) | ||
| 5349 | |(S1)+5, (S1)+4|100|(S1) +7, (S1) +6|200|(D) +1 | ||
| 5350 | |(S1) +9, (S1) +8|160|(S1)+11, (S1)+10|60|(D) +2 | ||
| 5351 | |(S1) +13, (S1) +12|240|(S1) +15, (S1) +14|280|(D) +3 | ||
| 5352 | |...|(% rowspan="2" %)-|...|(% rowspan="2" %)-|... | ||
| 5353 | |((( | ||
| 5354 | (S1)+4(n)-3, | ||
| 5355 | |||
| 5356 | (S1)+4(n)-4 | ||
| 5357 | )))|((( | ||
| 5358 | (S1)+4(n)-1, | ||
| 5359 | |||
| 5360 | (S1)+4(n)-2 | ||
| 5361 | )))|(D) +n-1 | ||
| 5362 | |||
| 5363 | If the instruction input is set to ON, (d) is the start, (n) point is the output mode as shown below. Each rising edge point and falling edge point can be individually changed by rewriting the data from (s1) to (s1)+2(n)-1. | ||
| 5364 | |||
| 5365 | (% style="text-align:center" %) | ||
| 5366 | [[image:图片13.png]] | ||
| 5367 | |||
| 5368 | (% class="box infomessage" %) | ||
| 5369 | ((( | ||
| 5370 | **✎Note: **The high-speed counter can be specified in the DABSD instruction. When a high-speed counter is specified, the current value of the counter will have a response delay due to the scan cycle in the output mode. | ||
| 5371 | |||
| 5372 | When specifying the number of bit devices in (s1), the device number should be a multiple of 16 (0, 16, 32, 64...), and only K8 should be specified for the number of bits. | ||
| 5373 | |||
| 5374 | The number of target output points is determined by the value of (n). (1≤(n)≤64) | ||
| 5375 | |||
| 5376 | Even if the instruction input is turned off, the output does not change. | ||
| 5377 | ))) | ||
| 5378 | |||
| 5379 | **Error code** | ||
| 5380 | |||
| 5381 | |=**Error code**|=**Content** | ||
| 5382 | |=4084H|When the value specified in (n) exceeds the range of 1 to 64 | ||
| 5383 | |=4085H|When the device specified in the read application instruction (s1), (s2 )and (n) exceeds the corresponding device range | ||
| 5384 | |=4086H|When the device specified in the write application instruction (d) exceeds the corresponding device range | ||
| 5385 | |||
| 5386 | **Example** | ||
| 5387 | |||
| 5388 | Refer to the example in the function description. | ||
| 5389 | |||
| 5390 | == SER/16-bit Data Search == | ||
| 5391 | |||
| 5392 | **SER(P)** | ||
| 5393 | |||
| 5394 | Search the same data and the maximum and minimum values from the data table. | ||
| 5395 | |||
| 5396 | -[SER (s1) (s2) (d) (n)] | ||
| 5397 | |||
| 5398 | **Content, range and data type** | ||
| 5399 | |||
| 5400 | |=**Parameter**|=**Content**|=**Range**|=**Data type**|=**Data type (label)** | ||
| 5401 | |=(s1)|Search for the start device number of the same data, maximum value, and minimum value|-|Signed BIN 16 bit|ANY16 | ||
| 5402 | |=(s2)|Search for the value of the same data or its storage destination device number|-|Signed BIN 16 bit|ANY16 | ||
| 5403 | |=(d)|Search for the same data, maximum value, minimum value and store the start device number|-|Signed BIN 16 bit|ANY16 | ||
| 5404 | |=(n)|Search the number of same data, maximum and minimum|1 to 256|Signed BIN 16 bit|ANY16 | ||
| 5405 | |||
| 5406 | **Device used** | ||
| 5407 | |||
| 5408 | |=(% rowspan="2" %)**instruction**|=(% rowspan="2" %)**Parameter**|=(% colspan="24" %)**Devices**|=((( | ||
| 5409 | **Index** | ||
| 5410 | |||
| 5411 | **modification** | ||
| 5412 | )))|=((( | ||
| 5413 | **Pulse** | ||
| 5414 | |||
| 5415 | **extension** | ||
| 5416 | ))) | ||
| 5417 | |**X**|**Y**|**M**|**S**|**SM**|**T(bit)**|**C(bit)**|**LC(bit)**|**HSC(bit)**|**D.b**|**KnX**|**KnY**|**KnM**|**KnS**|**T**|**C**|**D**|**R**|**SD**|**LC**|**HSC**|**K**|**H**|**E**|**[D]**|**XXP** | ||
| 5418 | |(% rowspan="3" %)SER|Parameter 1| | | | | | | | | | |●|●|●|●|●|●|●|●|●| | | | | |●|● | ||
| 5419 | |Parameter 2| | | | | | | | | | |●|●|●|●|●|●|●|●|●| | |● |● | |●|● | ||
| 5420 | |Parameter 3| | | | | | | | | | | |●|●|●|●|●|●|●|●| | | | | |●|● | ||
| 5421 | | |Parameter 4| | | | | | | | | | |●|●|●|●|●|●|●|●|●| | |●|●| |●|● | ||
| 5422 | |||
| 5423 | **Features** | ||
| 5424 | |||
| 5425 | For (s1) as the first (n) data, search for the same data as the BIN 16-bit data of (s2), and store the result in (d) to (d)+4. | ||
| 5426 | |||
| 5427 | In the case of the same data, the number of the same data, the first/final position, and the maximum and minimum positions of the same data are stored in the device with the first 5 points (d). | ||
| 5428 | |||
| 5429 | If there is no identical data, the number of identical data, the first/final position, and the maximum and minimum positions of the same data are stored in the device with the first 5 points (d). However, in (d) is the first 3 points of the device (the number of the same data, the first ~\~\ final position), 0 is stored. | ||
| 5430 | |||
| 5431 | • The structure and data examples of the search result table are as follows. (N=10) | ||
| 5432 | |||
| 5433 | |=(% rowspan="2" %)**The searched device (s1)**|=(% rowspan="2" %)((( | ||
| 5434 | **The value of the** | ||
| 5435 | |||
| 5436 | **searched data (s1)** | ||
| 5437 | )))|=(% rowspan="2" %)((( | ||
| 5438 | **Comparison data** | ||
| 5439 | |||
| 5440 | **(S2) value** | ||
| 5441 | )))|=(% rowspan="2" %)**Data location**|=(% colspan="3" %)**search results** | ||
| 5442 | |**Maximum value (d) +4**|**Consistent (d)**|**Minimum value (d+3)** | ||
| 5443 | |(s1)|K100|(% rowspan="10" %)K100|0| |○(First time)| | ||
| 5444 | |(s1)+1|K111|1| | | | ||
| 5445 | |(s1)+2|K100|2| |○| | ||
| 5446 | |(s1) +3|K98|3| | | | ||
| 5447 | |(s1) +4|K123|4| | | | ||
| 5448 | |(s1) +5|K66|5| | |○ | ||
| 5449 | |(s1) +6|K100|6| |○ (final)| | ||
| 5450 | |(s1) +7|K95|7| | | | ||
| 5451 | |(s1) +8|210|8|○| | | ||
| 5452 | |(s1) +9|K88|9| | | | ||
| 5453 | |||
| 5454 | • The search result table based on the above example is shown below. | ||
| 5455 | |||
| 5456 | |=**Device number**|=**Content**|=**Search result items** | ||
| 5457 | |(d)|3|Number of identical data | ||
| 5458 | |(d) +1|0|The position of the same data (first time) | ||
| 5459 | |(d) +2|6|The position of the same data (last time) | ||
| 5460 | |(d) +3|5|The final position of the minimum | ||
| 5461 | |(d) +4|8|The final position of maximum | ||
| 5462 | |||
| 5463 | (% class="box infomessage" %) | ||
| 5464 | ((( | ||
| 5465 | **✎Note: **Perform algebraic size comparison. (-10<2) | ||
| 5466 | |||
| 5467 | When there are multiple minimum and maximum values in the data, the positions behind each are stored. | ||
| 5468 | |||
| 5469 | If driven by this instruction, the search result (d) occupies 5 points of (d), (d)+1, (d)+2, (d)+3, (d)+4. Be careful not to overlap with the device used for machine control. | ||
| 5470 | ))) | ||
| 5471 | |||
| 5472 | **Error code** | ||
| 5473 | |||
| 5474 | |=**Error code**|=**Content** | ||
| 5475 | |=4084H|When the value specified in (n) exceeds the range of 0 to 256 | ||
| 5476 | |=4085H|When the device specified in read application instruction (s1), (s2), (d) and (n) exceeds the corresponding device range | ||
| 5477 | |=4086H|When the device specified in the write application instruction (d) exceeds the corresponding device range | ||
| 5478 | |||
| 5479 | **Example** | ||
| 5480 | |||
| 5481 | Refer to the example in the function description. | ||
| 5482 | |||
| 5483 | == DSER/32-bit Data Search == | ||
| 5484 | |||
| 5485 | [[image:file:///C:\Users\ANNAXU~~1\AppData\Local\Temp\ksohtml11864\wps3.png]]**DSER(P)** | ||
| 5486 | |||
| 5487 | Search the same data and the maximum and minimum values from the data table. | ||
| 5488 | |||
| 5489 | -[DSER (s1) (s2) (d) (n)] | ||
| 5490 | |||
| 5491 | **Content, range and data type** | ||
| 5492 | |||
| 5493 | |=**Parameter**|=**Content**|=**Range**|=**Data type**|=**Data type (label)** | ||
| 5494 | |=(s1)|Search for the start device number of the same data, maximum value, and minimum value|-|Signed BIN 32 bit|ANY32 | ||
| 5495 | |=(s2)|Search for the value of the same data or its storage destination device number|-|Signed BIN 32 bit|ANY32 | ||
| 5496 | |=(d)|Search for the same data, maximum value, minimum value and store the start device number|-|Signed BIN 32 bit|ANY32 | ||
| 5497 | |=(n)|Search the number of same data, maximum and minimum|1 to 128|Signed BIN 32 bit|ANY32 | ||
| 5498 | |||
| 5499 | **Device used** | ||
| 5500 | |||
| 5501 | |=(% rowspan="2" %)**instruction**|=(% rowspan="2" %)**Parameter**|=(% colspan="24" %)**Devices**|=((( | ||
| 5502 | **Index** | ||
| 5503 | |||
| 5504 | **modification** | ||
| 5505 | )))|=((( | ||
| 5506 | **Pulse** | ||
| 5507 | |||
| 5508 | **extension** | ||
| 5509 | ))) | ||
| 5510 | |**X**|**Y**|**M**|**S**|**SM**|**T(bit)**|**C(bit)**|**LC(bit)**|**HSC(bit)**|**D.b**|**KnX**|**KnY**|**KnM**|**KnS**|**T**|**C**|**D**|**R**|**SD**|**LC**|**HSC**|**K**|**H**|**E**|**[D]**|**XXP** | ||
| 5511 | |(% rowspan="3" %)DSER|Parameter 1| | | | | | | | | | |●|●|●|●|●|●|●|●|●|●|●| | | |●|● | ||
| 5512 | |Parameter 2| | | | | | | | | | |●|●|●|●|●|●|●|●|●|●|●|●|●| |●|● | ||
| 5513 | |Parameter 3| | | | | | | | | | | |●|●|●|●|●|●|●|●|●|●| | | |●|● | ||
| 5514 | | |Parameter 4| | | | | | | | | | |●|●|●|●|●|●|●|●|●|●|●|●|●| |●|● | ||
| 5515 | |||
| 5516 | **Features** | ||
| 5517 | |||
| 5518 | For (s1)+1, (s1) as the initial (n) data, search for the same data as the BIN 32-bit data of (s2)+1, (s2), and store the result in (d)+1, (D) to (d) +9, (d) +8. | ||
| 5519 | |||
| 5520 | In the case of the same data, the number of the same data, the first/final position and the maximum and minimum values are stored in a 5-point BIN 32-bit data device starting with (d)+1 and (d) position. | ||
| 5521 | |||
| 5522 | In the case of no identical data, the number of identical data, the first/final position and the maximum and minimum values are stored in the device with (d)+1 and (d) as the starting BIN 32-bit data with 5 points position. However, 0 is stored in the 32-bit 3-point device (the number of the same data, the first~\~\last position) with (d)+1 and (d) as the starting BIN. | ||
| 5523 | |||
| 5524 | • The structure and data examples of the search result table are as follows. (N=10) | ||
| 5525 | |||
| 5526 | |=(% rowspan="2" %)**The searched device (S1)**|=(% rowspan="2" %)**The value of the searched data (S1)**|=(% rowspan="2" %)**Comparison data (S2) value**|=(% rowspan="2" %)**Data location**|=(% colspan="3" %)**search results** | ||
| 5527 | |**Maximum value (d) +4**|**Consistent (d)**|**Minimum value (d+3)** | ||
| 5528 | |(S1)+1, (S1)|K100|(% rowspan="10" %)K100|0| |○ (First time)| | ||
| 5529 | |(S1)+3, (S1)+2|K111|1| | | | ||
| 5530 | |(S1)+5, (S1)+4|K100|2| |○| | ||
| 5531 | |(S1) +7, (S1) +6|K98|3| | | | ||
| 5532 | |(S1) +9, (S1) +8|K123|4| | | | ||
| 5533 | |(S1)+11, (S1)+10|K66|5| | |○ | ||
| 5534 | |(S1) +13, (S1) +12|K100|6| |○ (final)| | ||
| 5535 | |(S1) +15, (S1) +14|K95|7| | | | ||
| 5536 | |(S1) +17, (S1) +16|210|8|○| | | ||
| 5537 | |(S1) +19, (S1) +18|K88|9| | | | ||
| 5538 | |||
| 5539 | • The search result table based on the above example is shown below. | ||
| 5540 | |||
| 5541 | |=**Device number**|=**Content**|=**Search result items** | ||
| 5542 | |(d)+1, (d)|3|Number of identical data | ||
| 5543 | |(d)+3, (d)+2|0|The position of the same data (first time) | ||
| 5544 | |(d) +5, (d) +4|6|The position of the same data (last time) | ||
| 5545 | |(d) +7, (d) +6|5|The final position of the minimum | ||
| 5546 | |(d) +9, (d) +8|8|The final position of maximum | ||
| 5547 | |||
| 5548 | (% class="box infomessage" %) | ||
| 5549 | ((( | ||
| 5550 | **✎Note: **Perform algebraic size comparison. (-10<2) | ||
| 5551 | |||
| 5552 | When there are multiple minimum and maximum values in the data, the positions behind each are stored. | ||
| 5553 | |||
| 5554 | If driven by this instruction, the search result (d) occupies [(d)+1, (d)], [(d)+3, (d)+2,], [(d)+5, (d)+ 4], [(d)+7, (d)+6], [(d)+9, (d)+8] 5 points. Be careful not to overlap with the device used for machine control. | ||
| 5555 | ))) | ||
| 5556 | |||
| 5557 | **Error code** | ||
| 5558 | |||
| 5559 | |=**Error code**|=**Content** | ||
| 5560 | |4084H|When the value specified in (n) exceeds the range of 0 to 128 | ||
| 5561 | |4085H|When the device specified in read application instruction (s1), (s2), (d) and (n) exceeds the corresponding device range | ||
| 5562 | |4086H|When the device specified in the write application instruction (d) exceeds the corresponding device range | ||
| 5563 | |||
| 5564 | **Example** | ||
| 5565 | |||
| 5566 | Refer to the example in the function description. | ||
| 5567 | |||
| 5568 | == ALT/Bit Device Output Inversion == | ||
| 5569 | |||
| 5570 | **ALT(P)** | ||
| 5571 | |||
| 5572 | If the input turns ON, the bit device is inverted (ON→OFF). | ||
| 5573 | |||
| 5574 | -[ALT (d)] | ||
| 5575 | |||
| 5576 | **Content, range and data type** | ||
| 5577 | |||
| 5578 | |=**Parameter**|=**Content**|=**Range**|=**Data type**|=**Data type (label)** | ||
| 5579 | |(d)|Alternate output device number|-|Bit|ANY16_BOOL | ||
| 5580 | |||
| 5581 | **Device used** | ||
| 5582 | |||
| 5583 | |=(% rowspan="2" %)**instruction**|=(% rowspan="2" %)**Parameter**|=(% colspan="24" %)**Devices**|=((( | ||
| 5584 | **Index** | ||
| 5585 | |||
| 5586 | **modification** | ||
| 5587 | )))|=((( | ||
| 5588 | **Pulse** | ||
| 5589 | |||
| 5590 | **extension** | ||
| 5591 | ))) | ||
| 5592 | |**X**|**Y**|**M**|**S**|**SM**|**T(bit)**|**C(bit)**|**LC(bit)**|**HSC(bit)**|**D.b**|**KnX**|**KnY**|**KnM**|**KnS**|**T**|**C**|**D**|**R**|**SD**|**LC**|**HSC**|**K**|**H**|**E**|**[D]**|**XXP** | ||
| 5593 | |ALT|Parameter 1| |●|●|●|●| | | | |●| | | | | | | | | | | | | | |●|● | ||
| 5594 | |||
| 5595 | **Features** | ||
| 5596 | |||
| 5597 | Alternating output (level 1) | ||
| 5598 | |||
| 5599 | Each time the instruction input changes from OFF→ON, the bit device specified in (d) is turned OFF→ON inverted. | ||
| 5600 | |||
| 5601 | (% style="text-align:center" %) | ||
| 5602 | [[image:图片14.png]] | ||
| 5603 | |||
| 5604 | (% style="text-align:center" %) | ||
| 5605 | [[image:图片15.png]] | ||
| 5606 | |||
| 5607 | Divided frequency output (through alternate output (2 levels)) | ||
| 5608 | |||
| 5609 | Combine multiple ALTP instructions to perform frequency division output. | ||
| 5610 | |||
| 5611 | (% style="text-align:center" %) | ||
| 5612 | [[image:图片16.png]] | ||
| 5613 | |||
| 5614 | (% style="text-align:center" %) | ||
| 5615 | [[image:图片17.png]] | ||
| 5616 | |||
| 5617 | (% class="box infomessage" %) | ||
| 5618 | ((( | ||
| 5619 | **✎Note:** | ||
| 5620 | If you program with the ALT instruction, the action will be reversed every operation cycle. To reverse the action by the instruction ON→OFF, use the ALT instruction (pulse execution type) or set the instruction contact to LDP (pulse execution type). | ||
| 5621 | ))) | ||
| 5622 | |||
| 5623 | **Error code** | ||
| 5624 | |||
| 5625 | |=**Error code**|=**Content** | ||
| 5626 | |=4085H|When the device specified in the read application instruction (d) exceeds the corresponding device range | ||
| 5627 | |=4086H|When the device specified in the write application instruction (d) exceeds the corresponding device range | ||
| 5628 | |||
| 5629 | **Example** | ||
| 5630 | |||
| 5631 | (1)Start/stop via an input. | ||
| 5632 | |||
| 5633 | 1. After pressing the button X4, start the action of output Y1 and stop the action of Y0. | ||
| 5634 | 1. After pressing the button X4 again, stop the action of output Y1 and start the action of Y0. | ||
| 5635 | |||
| 5636 | (% style="text-align:center" %) | ||
| 5637 | [[image:图片18.png]] | ||
| 5638 | |||
| 5639 | (2)Flashing action | ||
| 5640 | |||
| 5641 | 1. When input X6 is ON, the contact of timer T2 will act instantaneously every 5 seconds. | ||
| 5642 | 1. The contact of T2 makes the output Y7 alternately ON/OFF every time it is ON. | ||
| 5643 | |||
| 5644 | (% style="text-align:center" %) | ||
| 5645 | [[image:图片19.png]] | ||
| 5646 | |||
| 5647 | (% style="text-align:center" %) | ||
| 5648 | [[image:图片20.png]] | ||
| 5649 | |||
| 5650 | == INCD/BIN 16-bit Data Relative Method == | ||
| 5651 | |||
| 5652 | **INCD** | ||
| 5653 | |||
| 5654 | Use a pair of counters to create multiple output modes. | ||
| 5655 | |||
| 5656 | -[INCD (s1) (s2) (d) (n)] | ||
| 5657 | |||
| 5658 | **Content, range and data type** | ||
| 5659 | |||
| 5660 | |=**Parameter**|=**Content**|=**Range**|=**Data type**|=**Data type (label)** | ||
| 5661 | |(s1)|The start device number storing the set value|-|Signed BIN 16 bit|ANY16 | ||
| 5662 | |(s2)|The start number of counter for current value monitoring|-|Signed BIN 16 bit|ANY16 | ||
| 5663 | |(d)|The start bit device number of output|-|Bit|ANY16_BOOL | ||
| 5664 | |(n)|Number of output bit device points|1 to 64|Signed BIN 16 bit|ANY16 | ||
| 5665 | |||
| 5666 | **Device used** | ||
| 5667 | |||
| 5668 | |=(% rowspan="2" %)**instruction**|=(% rowspan="2" %)**Parameter**|=(% colspan="24" %)**Devices**|=((( | ||
| 5669 | **Index** | ||
| 5670 | |||
| 5671 | **modification** | ||
| 5672 | )))|=((( | ||
| 5673 | **Pulse** | ||
| 5674 | |||
| 5675 | **extension** | ||
| 5676 | ))) | ||
| 5677 | |**X**|**Y**|**M**|**S**|**SM**|**T(bit)**|**C(bit)**|**LC(bit)**|**HSC(bit)**|**D.b**|**KnX**|**KnY**|**KnM**|**KnS**|**T**|**C**|**D**|**R**|**SD**|**LC**|**HSC**|**K**|**H**|**E**|**[D]**|**XXP** | ||
| 5678 | |(% rowspan="4" %)INCD|Parameter 1| | | | | | | | | | |●|●|●|●|●|●|●|●|●| | | | | |●| | ||
| 5679 | |Parameter 2| | | | | | | | | | | | | | | |●| | | | | | | | |●| | ||
| 5680 | |Parameter 3| |●|●|●|●| | | | |●| | | | | | | | | | | | | | |●| | ||
| 5681 | |Parameter 4| | | | | | | | | | |●|●|●|●|●|●|●|●|●| | |●|●| |●| | ||
| 5682 | |||
| 5683 | **Features** | ||
| 5684 | |||
| 5685 | Compare the data table of row (n) starting from (s1) (row (n) × 2 points occupied) with the current value of the counter (s2), reset if they match, and control the output on/off in turn. | ||
| 5686 | |||
| 5687 | **Example** | ||
| 5688 | |||
| 5689 | The operation is explained by the following circuit example. (S2) Take up 2 points. C0 and C1 are equivalent to this in the following timing chart. | ||
| 5690 | |||
| 5691 | (% style="text-align:center" %) | ||
| 5692 | [[image:图片21.png]] | ||
| 5693 | |||
| 5694 | It is assumed that the following data is written using the transfer instruction in advance. | ||
| 5695 | |||
| 5696 | |(% colspan="2" %)**Storage device**|(% colspan="2" %)**Output** | ||
| 5697 | |**-**|**Data value (example)**|**-**|**Example** | ||
| 5698 | |(S1)|D300=20|(D)|M0 | ||
| 5699 | |(S1)+1|D301=30|(D) +1|M1 | ||
| 5700 | |(S1)+2|D302=10|(D) +2|M2 | ||
| 5701 | |(S1) +3|D303=40|(D) +3|M3 | ||
| 5702 | |...|....|...|... | ||
| 5703 | |(S1)+(n)-1|-|(D) +n-1|- | ||
| 5704 | |||
| 5705 | Timing diagram | ||
| 5706 | |||
| 5707 | (% style="text-align:center" %) | ||
| 5708 | [[image:图片22.png]] | ||
| 5709 | |||
| 5710 | If the instruction contact turns on, the M0 output turns on. | ||
| 5711 | |||
| 5712 | The output (M0) is reset when the current value of C0 reaches the comparison value D300, the count value of the process counter C1 is +1, and the current value of the counter C0 is also reset. | ||
| 5713 | |||
| 5714 | The next output M1 turns ON. | ||
| 5715 | |||
| 5716 | Compare the current value of C0 with the comparison value D301. When the comparison value is reached, the output M1 is reset, the count value of the process counter C1 is +1, and the current value of the counter C0 is also reset. | ||
| 5717 | |||
| 5718 | Compare the same to the point (K4) specified in (n). (1≤(n)≤64) | ||
| 5719 | |||
| 5720 | After the final process specified in (n) is completed, the execution end flag SM229 turns ON for 1 operation cycle. SM229 is the instruction execution end flag used in multiple instructions, so it should be used as a contact after the instruction to execute the end flag dedicated to the instruction. | ||
| 5721 | |||
| 5722 | Return to the beginning and repeat output. | ||
| 5723 | |||
| 5724 | (% class="box infomessage" %) | ||
| 5725 | ((( | ||
| 5726 | **✎Note:**In (s1), when specifying the device number by specifying the digits of the bit device, the device number should be a multiple of 16 (0, 16, 32, 64...). | ||
| 5727 | |||
| 5728 | Up to 4 INCD instructions can be driven simultaneously in the program. | ||
| 5729 | ))) | ||
| 5730 | |||
| 5731 | **Error code** | ||
| 5732 | |||
| 5733 | |=**Error code**|=**Content** | ||
| 5734 | |4084H|When the value specified in (n) exceeds the range of 1 to 64 | ||
| 5735 | |4085H|When the device specified in read application instruction (s1), (s2), (d) and (n) exceeds the corresponding device range | ||
| 5736 | |4086H|When the device specified in the write application instruction (s2) and (d) exceeds the corresponding device range | ||
| 5737 | |4089H|The number of instruction drives exceeds the limit. | ||
| 5738 | |||
| 5739 | **Example** | ||
| 5740 | |||
| 5741 | Refer to the example in the function description. | ||
| 5742 | |||
| 5743 | == RAMP/Control Ramp Signal == | ||
| 5744 | |||
| 5745 | **RAM(P)** | ||
| 5746 | |||
| 5747 | Obtain data that changes between the start (initial value) and end (target value) two values specified (n) times. | ||
| 5748 | |||
| 5749 | -[RAMP (s1) (s2) (d) (n)] | ||
| 5750 | |||
| 5751 | **Content, range and data type** | ||
| 5752 | |||
| 5753 | |=**Parameter**|=**Content**|=**Range**|=**Data type**|=**Data type (label)** | ||
| 5754 | |(s1)|The device number that stores the initial value of the set ramp|-|Signed BIN 16 bit|ANY16 | ||
| 5755 | |(s2)|The device number that stores the set ramp target value|-|Signed BIN 16 bit|ANY16 | ||
| 5756 | |(d)|The device number that stores the current value data of ramp|-|Signed BIN 16 bit|ANY16 | ||
| 5757 | |(n)|Ramp transition time (scan period)|1-32767|Signed BIN 16 bit|ANY16 | ||
| 5758 | |||
| 5759 | **Device used** | ||
| 5760 | |||
| 5761 | |=(% rowspan="2" %)**instruction**|=(% rowspan="2" %)**Parameter**|=(% colspan="24" %)**Devices**|=((( | ||
| 5762 | **Index** | ||
| 5763 | |||
| 5764 | **modification** | ||
| 5765 | )))|=((( | ||
| 5766 | **Pulse** | ||
| 5767 | |||
| 5768 | **extension** | ||
| 5769 | ))) | ||
| 5770 | |**X**|**Y**|**M**|**S**|**SM**|**T(bit)**|**C(bit)**|**LC(bit)**|**HSC(bit)**|**D.b**|**KnX**|**KnY**|**KnM**|**KnS**|**T**|**C**|**D**|**R**|**SD**|**LC**|**HSC**|**K**|**H**|**E**|**[D]**|**XXP** | ||
| 5771 | |(% rowspan="4" %)RAMP|Parameter 1| | | | | | | | | | |●|●|●|●|●|●|●|●|●| | | | | |●| | ||
| 5772 | |Parameter 2| | | | | | | | | | |●|●|●|●|●|●|●|●|●| | | | | |●| | ||
| 5773 | |Parameter 3| | | | | | | | | | | | | | |●|●|●|●|●| | | | | |●| | ||
| 5774 | |Parameter 4| | | | | | | | | | |●|●|●|●|●|●|●|●|●| | |●|●| |●| | ||
| 5775 | |||
| 5776 | **Features** | ||
| 5777 | |||
| 5778 | Specify the start value (s1) and the value to end (s2) in advance. If the instruction input is turned ON, the value divided by the number of times specified in (n) will be added to (s1) in sequence in each operation cycle The value of is stored in (d). This instruction and analog output can be combined to output soft start/stop instructions. | ||
| 5779 | |||
| 5780 | (% style="text-align:center" %) | ||
| 5781 | [[image:图片23.png]] | ||
| 5782 | |||
| 5783 | (d)+1 stores the number of scans (0→n times). | ||
| 5784 | |||
| 5785 | The time from the start to the end value requires operation cycle×(n) scan. | ||
| 5786 | |||
| 5787 | If the input instruction is turned OFF during operation, it will be in the execution interrupt state ((d): current value data retention. (d)+1 scan times clear), if it is turned ON again, (d) will be cleared (S1) Restart the action. | ||
| 5788 | |||
| 5789 | After the transition is completed, the instruction execution completed flag SM229 will act, and the value of (d) will return to the value of (s1). | ||
| 5790 | |||
| 5791 | (% style="text-align:center" %) | ||
| 5792 | [[image:图片24.png]] | ||
| 5793 | |||
| 5794 | In the case of obtaining the calculation result at a certain time interval (constant scan mode), write the specified scan time to SD120 (a value slightly longer than the actual scan time), and turn on SM120. For example, when the value is specified as 20 ms and n=100 times, the value of (d) changes from (s1) to (s2) in 2 seconds. | ||
| 5795 | |||
| 5796 | The value of the constant scan mode can also be set by the parameter setting of the engineering tool (the constant scan execution interval setting of the CPU parameter). | ||
| 5797 | |||
| 5798 | According to the ON/OFF action of the mode flag SM226, the content of (d) is changed as shown below. | ||
| 5799 | |||
| 5800 | (% style="text-align:center" %) | ||
| 5801 | [[image:图片25.png]] | ||
| 5802 | |||
| 5803 | (% class="box infomessage" %) | ||
| 5804 | ((( | ||
| 5805 | **✎Note: ** | ||
| 5806 | When the power failure retention device (retention area) is specified in (d), the instruction input remains ON. When the CPU module is set to RUN (start), clear (d) in advance. | ||
| 5807 | ))) | ||
| 5808 | |||
| 5809 | **Error code** | ||
| 5810 | |||
| 5811 | |=**Error code**|=**Content** | ||
| 5812 | |4084H|When the value specified in (n) exceeds the specified range of 1 to 32767 | ||
| 5813 | |4085H|When the device specified in read application instruction (s1), (s2), (d) and (n) exceeds the corresponding device range | ||
| 5814 | |4086H|When the device specified in the write application instruction (d) exceeds the corresponding device range | ||
| 5815 | |||
| 5816 | **Example** | ||
| 5817 | |||
| 5818 | (% style="text-align:center" %) | ||
| 5819 | [[image:图片26.png]] | ||
| 5820 | |||
| 5821 | As in the above procedure, turn SM120 ON, and the program will run with a constant scan cycle (the value in SD120 is 10ms). When M0=ON, it changes from 10 to 100 within 100×10ms. | ||
| 5822 | |||
| 5823 | == ROTC/Rotary Table Proximity Control == | ||
| 5824 | |||
| 5825 | **ROTC** | ||
| 5826 | |||
| 5827 | In order to take out the items on the rotating table, take out the window according to the requirements, and make the rotating table rotate nearby. | ||
| 5828 | |||
| 5829 | -[ROTC (s) (n1) (n2) (d)] | ||
| 5830 | |||
| 5831 | **Content, range and data type** | ||
| 5832 | |||
| 5833 | |=**Parameter**|=(% colspan="2" %)**Content**|=**Range**|=**Data type**|=**Data type (label)** | ||
| 5834 | |(% rowspan="3" %)(s)|(% rowspan="3" %)The specified register of the calling condition (pre-set according to the transfer instruction)|(s)+0: Register for counting|(% rowspan="3" %)-|(% rowspan="3" %)Signed BIN 16 bit|(% rowspan="3" %)ANY16 | ||
| 5835 | |(s)+1: Call the window number setting | ||
| 5836 | |(s)+2: Call the item number setting | ||
| 5837 | |(n1)|(% colspan="2" %)Number of divisions|2 to 32767|Signed BIN 16 bit|ANY16 | ||
| 5838 | |(n2)|(% colspan="2" %)Singular in low speed zone|0 to 32767|Signed BIN 16 bit|ANY16 | ||
| 5839 | |(% rowspan="8" %)((( | ||
| 5840 | |||
| 5841 | |||
| 5842 | (d) | ||
| 5843 | )))|(% rowspan="8" %)The specified bit of the calling condition (constitutes an internal contact circuit driven in advance from the input signal (X))|(d): phase A signal|(% rowspan="8" %)-|(% rowspan="8" %)Signed BIN 16 bit|(% rowspan="8" %)ANY16 | ||
| 5844 | |(d)+1: phase B signal | ||
| 5845 | |(d)+2: zero point detection signal | ||
| 5846 | |(d)+3: high-speed forward rotation | ||
| 5847 | |(d)+4: low speed forward rotation | ||
| 5848 | |(d)+5: stop | ||
| 5849 | |(d)+6: low speed reverse rotation | ||
| 5850 | |(d)+7: high-speed reverse rotation | ||
| 5851 | |||
| 5852 | **Device used** | ||
| 5853 | |||
| 5854 | |=(% rowspan="2" %)**instruction**|=(% rowspan="2" %)**Parameter**|=(% colspan="24" %)**Devices**|=((( | ||
| 5855 | **Index** | ||
| 5856 | |||
| 5857 | **modification** | ||
| 5858 | )))|=((( | ||
| 5859 | **Pulse** | ||
| 5860 | |||
| 5861 | **extension** | ||
| 5862 | ))) | ||
| 5863 | |**X**|**Y**|**M**|**S**|**SM**|**T(bit)**|**C(bit)**|**LC(bit)**|**HSC(bit)**|**D.b**|**KnX**|**KnY**|**KnM**|**KnS**|**T**|**C**|**D**|**R**|**SD**|**LC**|**HSC**|**K**|**H**|**E**|**[D]**|**XXP** | ||
| 5864 | |(% rowspan="4" %)ROTC|Parameter 1| | | | | | | | | | | | | | | | |●|●|●| | | | | |●| | ||
| 5865 | |Parameter 2| | | | | | | | | | |●|●|●|●|●|●|●|●|●| | |●|●| |●| | ||
| 5866 | |Parameter 3| | | | | | | | | | |●|●|●|●|●|●|●|●|●| | |●|●| |●| | ||
| 5867 | |Parameter 4| |●|●|●|●| | | | |●| | | | | | | | | | | | | | |●| | ||
| 5868 | |||
| 5869 | **Features** | ||
| 5870 | |||
| 5871 | In order to take out the items on the rotating table divided into n1 (=10) as shown in the figure below, take out the inserted window as required, and rotate the rotating table nearby under the condition of n2 or (s), (d) . If the following operating conditions are specified, (d)+3 to (d)+7 can be used for forward/reverse, high-speed/low-speed/stop output. | ||
| 5872 | |||
| 5873 | (% style="text-align:center" %) | ||
| 5874 | [[image:图片27.png]] | ||
| 5875 | |||
| 5876 | Set up the switch X2 that is used to detect the two-phase shape (X0, X1) of the forward/reverse rotation of the rotary table and window 0. Replace X0 to X2 with (d) to (d) +2 internal contacts. The start device number specified in X or (d) can be arbitrary. | ||
| 5877 | |||
| 5878 | (% style="text-align:center" %) | ||
| 5879 | [[image:图片28.png]] | ||
| 5880 | |||
| 5881 | (s) is a counter, which counts how many items come to window 0. | ||
| 5882 | |||
| 5883 | (s)+1 set the number of the window to be called. | ||
| 5884 | |||
| 5885 | (s)+2 sets the number of the recalled item. | ||
| 5886 | |||
| 5887 | Specify the number of divisions (n1) and low-speed operation section (n2) of the rotary table. | ||
| 5888 | |||
| 5889 | (% class="box infomessage" %) | ||
| 5890 | ((( | ||
| 5891 | **✎Note: **If the instruction input is turned ON to drive the instruction, the result of (d)+3 to (d)+7 will be automatically obtained. If the instruction input is turned off, (d)+3 to (d)+7 will turn off. | ||
| 5892 | |||
| 5893 | As an example, when the rotation detection signal ((d) to (d)+2) is set to 10 actions within 1 division interval, the division number setting, calling window number setting, and article number setting should all be 10 Times the value. In this way, the setting value of the low-speed section can be set to the middle value of the number of divisions, etc. | ||
| 5894 | |||
| 5895 | When the instruction input is ON and the 0 point detection signal (M2) is turned ON, the content of the counting register (s) is cleared to 0. It is necessary to perform this clear operation in advance before starting operation. | ||
| 5896 | |||
| 5897 | At most 4 ROTC instructions can be executed at the same time. | ||
| 5898 | ))) | ||
| 5899 | |||
| 5900 | **Error code** | ||
| 5901 | |||
| 5902 | |=**Error code**|=**Content** | ||
| 5903 | |(% rowspan="5" %)4084H|When the value specified in (n1) exceeds the range of 2 to 32767 | ||
| 5904 | |When the value specified in (n2) exceeds the range of 0 to 32767 | ||
| 5905 | |When the values specified in (n1) and (n2) meet the condition of (n1)<(n2) | ||
| 5906 | |When one of (s), (s)+1 and (s)+2 is negative. | ||
| 5907 | |When one of (s), (s)+1 and (s)+2 is (n1) or more. | ||
| 5908 | |4085H|When the device specified in read application instruction (s1), (n1), (n2) and (d) exceeds the corresponding device range | ||
| 5909 | |4086H|When the device specified in the write application instruction (s2) and (d) exceeds the corresponding device range | ||
| 5910 | |4089H|The number of instructions to be executed exceeds the limit. | ||
| 5911 | |||
| 5912 | **Example** | ||
| 5913 | |||
| 5914 | (% style="text-align:center" %) | ||
| 5915 | [[image:图片29.png]] | ||
| 5916 | |||
| 5917 | |||
| 5918 | |=**Variable**|=**Features**|=**Instructions**|=**Variable**|=**Function**|=**Instructions** | ||
| 5919 | |D200|Used as a counting register|(% rowspan="3" %)The 3 units are pre-set by the user program|M3|Run at forward direction at high velocity|(% rowspan="3" %)((( | ||
| 5920 | When X0 is ON, the result of M3 to M7 could be automatically obtained. | ||
| 5921 | |||
| 5922 | |||
| 5923 | |||
| 5924 | ))) | ||
| 5925 | |D201|Call window number setting|M4|Run at forward direction at low velocity | ||
| 5926 | |D202|Call work piece number setting|M5|Stop | ||
| 5927 | |||
| 5928 | |M0|Phase A signal|(% rowspan="3" %)((( | ||
| 5929 | The user program executes before each scan of this statement: | ||
| 5930 | |||
| 5931 | [[image:1709803261707-909.png]] | ||
| 5932 | |||
| 5933 | |||
| 5934 | )))|M6|Run at reverse direction at low velocity|(% rowspan="3" %)When X0 is OFF, M3 to M7 are all OFF. | ||
| 5935 | |M1|Phase B signal|M7|Run at reverse direction at high velocity | ||
| 5936 | |M2|Zero point detection signal| | | ||
| 5937 | |||
| 5938 | == STMR/Special Function Timer == | ||
| 5939 | |||
| 5940 | **STMR** | ||
| 5941 | |||
| 5942 | Use the 4 points starting from the device specified in (d) to perform 4 types of timer output. | ||
| 5943 | |||
| 5944 | -[STMR (s1) (s2) (d)] | ||
| 5945 | |||
| 5946 | **Content, range and data type** | ||
| 5947 | |||
| 5948 | |=**Parameter**|=**Content**|=**Range**|=**Data type**|=**Data type (label)** | ||
| 5949 | |(s1)|Timer number used: T0 to T511 (100ms timer)|-|Device Name|ANY16 | ||
| 5950 | |(s2)|Timer setting value|1-32767|Signed BIN 16 bit|ANY16 | ||
| 5951 | |(d)|The start bit number of the output (occupies 4 points)|-|Bit|ANYBIT_ARRAY | ||
| 5952 | |||
| 5953 | **Device used** | ||
| 5954 | |||
| 5955 | |=(% rowspan="2" %)**instruction**|=(% rowspan="2" %)**Parameter**|=(% colspan="24" %)**Devices**|=((( | ||
| 5956 | **Index** | ||
| 5957 | |||
| 5958 | **modification** | ||
| 5959 | )))|=((( | ||
| 5960 | **Pulse** | ||
| 5961 | |||
| 5962 | **extension** | ||
| 5963 | ))) | ||
| 5964 | |**X**|**Y**|**M**|**S**|**SM**|**T(bit)**|**C(bit)**|**LC(bit)**|**HSC(bit)**|**D.b**|**KnX**|**KnY**|**KnM**|**KnS**|**T**|**C**|**D**|**R**|**SD**|**LC**|**HSC**|**K**|**H**|**E**|**[D]**|**XXP** | ||
| 5965 | |(% rowspan="3" %)STMR|Parameter 1| | | | | | | | | | | | | | |●| | | | | | | | | |●| | ||
| 5966 | |Parameter 2| | | | | | | | | | |●|●|●|●|●|●|●|●|●| | |●|●| |●| | ||
| 5967 | |Parameter 3| |●|●|●|●| | | | |●| | | | | | | | | | | | | | |●| | ||
| 5968 | |||
| 5969 | **Features** | ||
| 5970 | |||
| 5971 | Use the 4 points starting from the device specified in (d) to perform 4 types of timer output. | ||
| 5972 | |||
| 5973 | (% style="text-align:center" %) | ||
| 5974 | [[image:图片30.png]] | ||
| 5975 | |||
| 5976 | 1. The instruction of STMR instruction | ||
| 5977 | 1. The setting value specified in (S2) | ||
| 5978 | |||
| 5979 | (% style="text-align:center" %) | ||
| 5980 | [[image:图片31.png]] | ||
| 5981 | |||
| 5982 | The blink will be in (d)+3 normally closed contact through the following program which turns on/off the STMR instruction (T10 is allocated in (s1), K100 is allocated in (s2), and M0 is allocated in (d)) Output to (d)+1, (d)+2. | ||
| 5983 | |||
| 5984 | (% style="text-align:center" %) | ||
| 5985 | [[image:图片33.png]] | ||
| 5986 | |||
| 5987 | The setting value of (S2) can be specified in the range of 1 to 32767 (1 to 3276.7 seconds). | ||
| 5988 | |||
| 5989 | (% class="box infomessage" %) | ||
| 5990 | ((( | ||
| 5991 | **✎Note: **The timer number specified by this instruction cannot be reused with other general circuits (OUT instructions, etc.). In the case of repetition, the timer action cannot be executed correctly. | ||
| 5992 | |||
| 5993 | The timer specified in (s1) is regarded as a 100ms timer, starting from the rising edge of the instruction contact. | ||
| 5994 | |||
| 5995 | Occupy the device specified in 4 points (d) at the beginning. Be careful not to overlap with the device used for machine control. | ||
| 5996 | |||
| 5997 | When the instruction contact is turned off, (d), (d)+1, (d)+3 will turn off after the set time. (D) +2 and timer (s1) are reset immediately. | ||
| 5998 | ))) | ||
| 5999 | |||
| 6000 | **Error code** | ||
| 6001 | |||
| 6002 | |=**Error code**|=**Content** | ||
| 6003 | |4084H|When the value specified in (s2) is less or equal to 0 | ||
| 6004 | |4085H|When the device specified in the read application instruction (s2) and (d) exceeds the corresponding device range | ||
| 6005 | |||
| 6006 | **Example** | ||
| 6007 | |||
| 6008 | (% style="text-align:center" %) | ||
| 6009 | [[image:图片34.png]] | ||
| 6010 | |||
| 6011 | (% style="text-align:center" %) | ||
| 6012 | [[image:图片35.png]] | ||
| 6013 | |||
| 6014 | Y0: When X10 changes from Off→On, Y0=On, when X10 changes from On→Off, Y0=Off after a delay of 10 seconds. | ||
| 6015 | |||
| 6016 | Y1: When X10 changes from On→Off, make Y1=On output once for 10 seconds. | ||
| 6017 | |||
| 6018 | Y2: When X10 changes from Off to On, output Y2=On once for 10 | ||
| 6019 | |||
| 6020 | Y3: When X10 changes from Off to On, Y3=On after 10 seconds of delay. When X10 changes from On to Off, Y3=Off after 10 seconds | ||
| 6021 | |||
| 6022 | If the component (d)+3 is introduced into the instruction stream, the oscillator output can be easily realized (this function can also be realized by the ALT instruction), as shown in the following figure: | ||
| 6023 | |||
| 6024 | (% style="text-align:center" %) | ||
| 6025 | [[image:图片36.png]] | ||
| 6026 | |||
| 6027 | (% style="text-align:center" %) | ||
| 6028 | [[image:图片37.png]] | ||
| 6029 | |||
| 6030 | == TTMR/Demonstration Timer == | ||
| 6031 | |||
| 6032 | **TTMR** | ||
| 6033 | |||
| 6034 | Test the time when the TTMR instruction is ON. It is used when adjusting the timer setting time with buttons. | ||
| 6035 | |||
| 6036 | -[TTMR (d) (s)] | ||
| 6037 | |||
| 6038 | **Content, range and data type** | ||
| 6039 | |||
| 6040 | |=**Parameter**|=**Content**|=**Range**|=**Data type**|=**Data type (label)** | ||
| 6041 | |(d)|Device for storing teaching data|-|Signed BIN 16 bit|ANY16 | ||
| 6042 | |(s)|Multiplying ratio of teaching data|0-2|Signed BIN 16 bit|ANY16 | ||
| 6043 | |||
| 6044 | **Device used** | ||
| 6045 | |||
| 6046 | |=(% rowspan="2" %)**instruction**|=(% rowspan="2" %)**Parameter**|=(% colspan="24" %)**Devices**|=((( | ||
| 6047 | **Index** | ||
| 6048 | |||
| 6049 | **modification** | ||
| 6050 | )))|=((( | ||
| 6051 | **Pulse** | ||
| 6052 | |||
| 6053 | **extension** | ||
| 6054 | ))) | ||
| 6055 | |**X**|**Y**|**M**|**S**|**SM**|**T(bit)**|**C(bit)**|**LC(bit)**|**HSC(bit)**|**D.b**|**KnX**|**KnY**|**KnM**|**KnS**|**T**|**C**|**D**|**R**|**SD**|**LC**|**HSC**|**K**|**H**|**E**|**[D]**|**XXP** | ||
| 6056 | |(% rowspan="2" %)TTMR|Parameter 1| | | | | | | | | | | | | | |●|●|●|●|●| | | | | |●| | ||
| 6057 | |Parameter 2| | | | | | | | | | |●|●|●|●|●|●|●|●|●| | |●|●| |●| | ||
| 6058 | |||
| 6059 | **Features** | ||
| 6060 | |||
| 6061 | Measure the time of the execution instruction (button) in seconds, multiply it by the magnification (10^^S^^) specified in (s) and store it in the device specified in (d). | ||
| 6062 | |||
| 6063 | [[image:file:///C:\Users\Administrator\AppData\Local\Temp\ksohtml7464\wps2.jpg]] | ||
| 6064 | |||
| 6065 | (% style="text-align:center" %) | ||
| 6066 | [[image:企业微信截图_17580029957928.png||height="259" width="538"]] | ||
| 6067 | |||
| 6068 | For the time stored in (d), when the execution time is[[image:图片1.png]] (unit: second), the actual value of (d) is as follows according to the magnification specified in (s). | ||
| 6069 | |||
| 6070 | |**(s)**|**Magnification**|**(D)** | ||
| 6071 | |K0|((( | ||
| 6072 | (% style="text-align:center" %) | ||
| 6073 | [[image:图片2.png]] | ||
| 6074 | )))|(D) ×1 | ||
| 6075 | |K1|((( | ||
| 6076 | (% style="text-align:center" %) | ||
| 6077 | [[image:图片3.png]] | ||
| 6078 | )))|(D)×10 | ||
| 6079 | |K2|((( | ||
| 6080 | (% style="text-align:center" %) | ||
| 6081 | [[image:图片4.png]] | ||
| 6082 | )))|(D) ×100 | ||
| 6083 | |||
| 6084 | |**(s)**|**(d)**|**(d)+1 (unit: 100 milliseconds)** | ||
| 6085 | |K0 (unit: second)| |(d)+1 =(d)×10 | ||
| 6086 | |K1 (unit: 100 milliseconds)| |(d)+1 =(d) | ||
| 6087 | |K2 (unit: 10 milliseconds)| |(d)+1 =(d)/10 | ||
| 6088 | |||
| 6089 | **✎Note: ** | ||
| 6090 | |||
| 6091 | If the instruction contact turns from ON→OFF, the current value of the execution time (d)+1 is cleared, and the teaching time (d) does not change. | ||
| 6092 | |||
| 6093 | Occupy the device specified in the 2 teaching time (d) at the beginning. Be careful not to overlap with the device used for machine control. | ||
| 6094 | |||
| 6095 | **Error code** | ||
| 6096 | |||
| 6097 | |**Error code**|**Content** | ||
| 6098 | |4084H|When the value specified in (n) exceeds the range of 0 to 2 | ||
| 6099 | |4085H|When the device specified in read application instruction (d) and (s) exceeds the corresponding device range | ||
| 6100 | |4086H|When the device specified in the write application instruction (d) exceeds the corresponding device range | ||
| 6101 | |||
| 6102 | **Example** | ||
| 6103 | |||
| 6104 | Example 1 | ||
| 6105 | |||
| 6106 | = **External IO instructions** = | ||
| 6107 | |||
| 6108 | == **ARWS/Arrow Switch** == | ||
| 6109 | |||
| 6110 | **ARWS** | ||
| 6111 | |||
| 6112 | Use the arrow switches for digit movement and increase or decrease of digit values to input data instructions. | ||
| 6113 | |||
| 6114 | -[ARWS (s) (d1) (d2) (n)] | ||
| 6115 | |||
| 6116 | **Content, range and data type** | ||
| 6117 | |||
| 6118 | |**Parameter**|**Content**|**Range**|**Data type**|**Data type (label)** | ||
| 6119 | |(s)|The start device number that input|-|BIN16 bit|ANY_BOOL | ||
| 6120 | |(d1)|The word device number storing BCD conversion data|-|BIN16 bit|ANY_BOOL | ||
| 6121 | |(d2)|The start bit device (Y) that connect the display of the 7-segment digital tube|0 to 9999|BIN16 bit|ANY16_S | ||
| 6122 | |(n)|Specify the number of digits displayed by the 7-segment digital tube (Setting range: K0 to K3)|0 to 3|BIN16 bit|ANY16_S | ||
| 6123 | |||
| 6124 | **Device used** | ||
| 6125 | |||
| 6126 | |(% rowspan="2" %)**instruction**|(% rowspan="2" %)**Parameter**|(% colspan="24" %)**Devices**|((( | ||
| 6127 | **Index** | ||
| 6128 | |||
| 6129 | **modification** | ||
| 6130 | )))|((( | ||
| 6131 | **Pulse** | ||
| 6132 | |||
| 6133 | **extension** | ||
| 6134 | ))) | ||
| 6135 | |**X**|**Y**|**M**|**S**|**SM**|**T(bit)**|**C(bit)**|**LC(bit)**|**HSC(bit)**|**D.b**|**KnX**|**KnY**|**KnM**|**KnS**|**T**|**C**|**D**|**R**|**SD**|**LC**|**HSC**|**K**|**H**|**E**|**[D]**|**XXP** | ||
| 6136 | |(% rowspan="4" %)ARWS|Parameter 1|●|●|●|●|●| | | | |●| | | | | | | | | | | | | | |●| | ||
| 6137 | |Parameter 2| | | | | | | | | | | | | | |●|●|●|●|●| | | | | |●| | ||
| 6138 | |Parameter 3| |●| | | | | | | | | | | | | | | | | | | | | | |●| | ||
| 6139 | |Parameter 4| | | | | | | | | | | | | | | | | | | | | |●|●| | | | ||
| 6140 | |||
| 6141 | **Features** | ||
| 6142 | |||
| 6143 | 16-bit operation (ARWS). The 16-bit BIN value from 0 to 9999 is stored in D+1. For the sake of convenience, the following description is displayed in BCD conversion. | ||
| 6144 | |||
| 6145 | When the instruction input is ON, the ARWS instruction will operate as shown below[[image:1758526599000-920.png]] | ||
| 6146 | |||
| 6147 | Display and operation part of the content | ||
| 6148 | |||
| 6149 | [[image:1758552469974-996.png]] | ||
| 6150 | |||
| 6151 | |||
| 6152 | (1) The digit specification of n displayed by the 7-segment digital tube with BCD code | ||
| 6153 | |||
| 6154 | A 4-digit (10^^3^^ digit) is used as an example in the following operation description, . | ||
| 6155 | |||
| 6156 | (2) The action of the digit selection switch (S+2, S+3) | ||
| 6157 | |||
| 6158 | 1)The action when input S+2 with reduced digits is ON.Each time the switch is pressed, the number of digits specification is changed according to 10^^3^^ →10^^2^^ →10^^1^^ →10^^0^^ →10^^3.^^ | ||
| 6159 | |||
| 6160 | 2)The action when the input S+3 with increased digits is ON. Each time the switch is pressed, the number of digits specification is changed according to 10^^3 ^^→ 10^^0 ^^→ 10^^1 ^^→ 10^^2 ^^→ 10^^3^^. | ||
| 6161 | |||
| 6162 | (3) The action of the LED for displaying the selected digits (D2+4 to D2+7). The specified number of digits can be displayed by LED by strobe signal D2+4 to D2+7. | ||
| 6163 | |||
| 6164 | (4) The operation of the data change switch in units of digits (S, S+1). The data is changed for the number of digits specified by the "digit selection switch" above. | ||
| 6165 | |||
| 6166 | 1) Increase the action when the input is ON. Each time the switch is pressed, the content of D1 changes according to 0→1→2→...→8→9→0→1. | ||
| 6167 | |||
| 6168 | 2) Reduce the action when the input is ON. Each time the switch is pressed, the content of D1 changes according to 0→9→8→7...1→0→9. | ||
| 6169 | |||
| 6170 | These contents can be displayed in the 7-segment digital tube display. | ||
| 6171 | |||
| 6172 | As shown above, through a series of operations, you can write the target value into D1 while viewing the 7-segment display. | ||
| 6173 | |||
| 6174 | **✎Note:** | ||
| 6175 | |||
| 6176 | * The setting of parameter n | ||
| 6177 | |||
| 6178 | Please refer to the parameter setting of SEGL (FNC 74) instruction. The setting range is 0 to 3. | ||
| 6179 | |||
| 6180 | * The output format of the programmable controller, please use a transistor output type programmable controller. | ||
| 6181 | * About scan time (operation cycle) and display timing | ||
| 6182 | * The ARWS instruction is executed synchronously with the scan time (operation cycle) of the programmable controller. | ||
| 6183 | * In order to perform a series of displays, the scan time of the programmable controller needs to exceed 10ms. | ||
| 6184 | * When it is less than 10ms, please use the constant scan mode and run with a scan time longer than 10ms. | ||
| 6185 | * Number of occupied points of the device | ||
| 6186 | |||
| 6187 | 1. The input of the device s occupies 4 points. | ||
| 6188 | 1. The output of the device d2 occupies 8 points. | ||
| 6189 | |||
| 6190 | * Restrictions on the times of the uses of instructions | ||
| 6191 | |||
| 6192 | Only one ARWS instruction can be used in the program. | ||
| 6193 | |||
| 6194 | **Error code** | ||
| 6195 | |||
| 6196 | |**Error code**|**Content** | ||
| 6197 | |4084H|The data input in the application instruction (d1) and (d2) exceeds the specified range | ||
| 6198 | |4085H|The output result of the read application instruction (s), (d1) and (d2) exceeds the device range | ||
| 6199 | |4086H|The output result of the write application instruction (d1) and (d2) exceeds the device range | ||
| 6200 | |||
| 6201 | **Example** | ||
| 6202 | |||
| 6203 | [[image:1758552725118-406.png]] | ||
| 6204 | |||
| 6205 | |||
| 6206 | The corresponding hardware wiring is shown in the figure below, and the PLC should be transistor output type: | ||
| 6207 | |||
| 6208 | [[image:1758552774857-894.png]] | ||
| 6209 | |||
| 6210 | |||
| 6211 | (1) The digital tube in the figure shows the value of D0. Press X10 to X13 to modify the value. The value of D0 can only be between 0 and 9999. | ||
| 6212 | |||
| 6213 | (2) When X20 is ON, the cursor position is thousands. Each time the back key (X12) is pressed, the specified position is switched in the order of "thousands → hundred → ten → pieces → thousand"; if the forward key (X13) is pressed, the switching sequence is reversed; the cursor position is determined by the strobe pulse signal (YO04 to YOO7) LED indication of connection. | ||
| 6214 | |||
| 6215 | (3) For the cursor position, each time you press the increment key (X11), the content of the position changes by 0 → 1→ 2→……8→9→0→1, and when you press the decrement key (X10), press 0 →9→8→7→…… 1→0→9 changes, the modified value takes effect immediately. | ||
| 6216 | |||
| 6217 | = [[image:file:///C:\Users\z\AppData\Local\Temp\ksohtml6496\wps1.png]]**DSW/Numeric key input** = | ||
| 6218 | |||
| 6219 | **DSW** | ||
| 6220 | |||
| 6221 | This instruction is to read the state of the matrix type setting switch, with 4 BCD setting switches as a group, and store the setting value in the specified unit after reading it. Up to 2 groups of setting switches can be read. | ||
| 6222 | |||
| 6223 | -[DSW (s) (d1) (d2) (n)] | ||
| 6224 | |||
| 6225 | **Content, range and data type** | ||
| 6226 | |||
| 6227 | |**Parameter**|**Content**|**Range**|**Data type**|**Data type (label)** | ||
| 6228 | |(s)|The start device (X) number connected to the digital switch (occupies 4 points)|-|Bit|ANY_BOOL | ||
| 6229 | |(d1)|((( | ||
| 6230 | The start device (Y) number that strobe signal outputed | ||
| 6231 | |||
| 6232 | (occupies 4 points) | ||
| 6233 | )))|-|Bit|ANY_BOOL | ||
| 6234 | |(d2)|The device number that stores the value of the digital switch (occupies n points)|0 to 9999|Signed BIN16|ANY16_S | ||
| 6235 | |(n)|Number of groups of digital switches (4 digits a group) (n=1 or 2)|1 to 2|Signed BIN16|ANY16_S | ||
| 6236 | |||
| 6237 | **Device used** | ||
| 6238 | |||
| 6239 | |(% rowspan="2" %)**Instruction**|(% rowspan="2" %)**Parameter**|(% colspan="24" %)**Devices**|((( | ||
| 6240 | **Index** | ||
| 6241 | |||
| 6242 | **modification** | ||
| 6243 | )))|((( | ||
| 6244 | **Pulse** | ||
| 6245 | |||
| 6246 | **extension** | ||
| 6247 | ))) | ||
| 6248 | |**X**|**Y**|**M**|**S**|**SM**|**T(bit)**|**C(bit)**|**LC(bit)**|**HSC(bit)**|**D.b**|**KnX**|**KnY**|**KnM**|**KnS**|**T**|**C**|**D**|**R**|**SD**|**LC**|**HSC**|**K**|**H**|**E**|**[D]**|**XXP** | ||
| 6249 | |(% rowspan="4" %)DSW|Parameter 1|●| | | | | | | | | | | | | | | | | | | | | | | |●| | ||
| 6250 | |Parameter 2| |●| | | | | | | | | | | | | | | | | | | | | | |●| | ||
| 6251 | |Parameter 3| | | | | | | | | | | | | | |●|●|●|●|●| | | | | |●| | ||
| 6252 | |Parameter 4| | | | | | | | | | | | | | | | | | | | | |●|●| | | | ||
| 6253 | |||
| 6254 | **Features** | ||
| 6255 | |||
| 6256 | This instruction is to read the state of the matrix type setting switch, with 4 BCD setting switches as a group, and store the setting value in the specified unit after reading it. Up to 2 groups of setting switches can be read. | ||
| 6257 | |||
| 6258 | (1) About the input value (d1) | ||
| 6259 | |||
| 6260 | 4 digits from 0 to 9,999 could be read. | ||
| 6261 | |||
| 6262 | Data is saved in BIN (binary number) value. | ||
| 6263 | |||
| 6264 | The first group is saved in (d2), and the second group is saved in (d2)+1. | ||
| 6265 | |||
| 6266 | (2) Specification of the number of groups n | ||
| 6267 | |||
| 6268 | * When using 4 digits/1 group×1 [n=K1] pass the strobe signal | ||
| 6269 | |||
| 6270 | From (s) to [(s)+3], sequentially read the BCD 4-digit digital switches connected in (d1) to [(d1)+3], and save the value as BIN value in (d2). | ||
| 6271 | |||
| 6272 | * When using 4 digits/1 group×2 [n=K2] pass the strobe signal | ||
| 6273 | |||
| 6274 | From (s) to [(s)+3], sequentially read the BCD 4-digit digital switches connected in (d1) to [(d1)+3], and save the value as BIN value in (d2). | ||
| 6275 | |||
| 6276 | Through the strobe signal (d1) to [(d1)+3], read the BCD 4-digit digital switch connected in (s)+4 to [(s)+7] in turn, and save its value as a BIN value To (d2)+1. | ||
| 6277 | |||
| 6278 | **✎Note: ** | ||
| 6279 | |||
| 6280 | (1) When the instruction contact is OFF | ||
| 6281 | |||
| 6282 | Even if it is OFF, the content of (d2) does not change, but from (d1) to [(d1)+3] all become OFF. | ||
| 6283 | |||
| 6284 | (2) Occupied points of the device | ||
| 6285 | |||
| 6286 | 1) When using 4 digits 2 groups (n=K2), 2 points starting from (d2) are occupied. | ||
| 6287 | |||
| 6288 | 2) When it is 4 digits and 1 group (s), 4 points are occupied, and when it is 4 digits and 2 groups, 8 points are occupied. | ||
| 6289 | |||
| 6290 | (3) When connecting a digital switch with less than 4 digits | ||
| 6291 | |||
| 6292 | For unused digits, the strobe signal <output for specified digits> (d1) does not need to be wired, but even if there are unused digits, its output is already occupied by this instruction, so it cannot be used for other purposes. Be sure to leave unused output empty. | ||
| 6293 | |||
| 6294 | (4) It is recommended to use transistor output type | ||
| 6295 | |||
| 6296 | In order to read the value of the digital switch continuously, be sure to use a transistor output type programmable controller. | ||
| 6297 | |||
| 6298 | (5) About digital switches | ||
| 6299 | |||
| 6300 | Please use a digital switch of BCD output type. | ||
| 6301 | |||
| 6302 | (6) About the read timing of keyboard input | ||
| 6303 | |||
| 6304 | In order to prevent reading omissions caused by the filter delay of keyboard input, please use the “Constant Scan Mode” and “Timer Interrupt” functions flexibly. | ||
| 6305 | |||
| 6306 | (7) The limit number of instructions | ||
| 6307 | |||
| 6308 | A maximum of two can be used at the same time | ||
| 6309 | |||
| 6310 | **Related device** | ||
| 6311 | |||
| 6312 | |**Devices**|**Name**|**Content** | ||
| 6313 | |SM229|End of instruction execution|After a reading cycle is over, SM229 will be set for a scan cycle | ||
| 6314 | |||
| 6315 | **Error code** | ||
| 6316 | |||
| 6317 | |**Error code**|**Content** | ||
| 6318 | |4084H|The data input in the application instruction (n) and (d2) exceeds the specified range | ||
| 6319 | |4085H|The output result of the read application instruction (s) and (d2) exceeds the device range | ||
| 6320 | |4086H|The output result of the write application instruction (d1) and (d2) exceeds the device range | ||
| 6321 | |4089H|The number of application instructions exceeds the limit | ||
| 6322 | |||
| 6323 | **Example** | ||
| 6324 | |||
| 6325 | Program | ||
| 6326 | |||
| 6327 | [[image:file:///C:\Users\z\AppData\Local\Temp\ksohtml6496\wps2.jpg]][[image:1758553361414-300.png]] | ||
| 6328 | |||
| 6329 | Wiring diagram | ||
| 6330 | |||
| 6331 | [[image:file:///C:\Users\z\AppData\Local\Temp\ksohtml6496\wps3.jpg]][[image:1758553386520-904.png]] | ||
| 6332 | |||
| 6333 | * DSW operates while M1 (digital switch read input) is ON. | ||
| 6334 | |||
| 6335 | DSW will operate until the end of one cycle of operation and the instruction execution end flag (SM229) turns ON. | ||
| 6336 | |||
| 6337 | = **HKY/Hexadecimal Numeric Key Input** = | ||
| 6338 | |||
| 6339 | **HKY** | ||
| 6340 | |||
| 6341 | Use the keyboard (16 keys) of 0 to F to input, set the numerical value (0 to 9) and operating conditions (A to F function keys) and other instructions for data input. | ||
| 6342 | |||
| 6343 | When the extended function is ON, the hexadecimal number of the 0 to F keys could be used for keyboard input. | ||
| 6344 | |||
| 6345 | -[HKY (s) (d1) (d2) (d3)] | ||
| 6346 | |||
| 6347 | **Content, range and data type** | ||
| 6348 | |||
| 6349 | |**Parameter**|**Content**|**Range**|**Data type**|**Data type (label)** | ||
| 6350 | |(s)|The start bit device (X) number that input 16-key (occupies 4 points)|-|Bit|ANY_BOOL | ||
| 6351 | |(d1)|The start device (Y) number that outputs (occupies 4 points)|-|Bit|ANY_BOOL | ||
| 6352 | |(d2)|The device number that stores the value input from the 16 keys|0 to 9999|BIN16 bit|ANY16_S | ||
| 6353 | |(d3)|The start bit device number whose key is ON (occupies 8 points)|-|BIN16 bit|ANY16_S | ||
| 6354 | |||
| 6355 | **Device used** | ||
| 6356 | |||
| 6357 | |(% rowspan="2" %)**Instruction**|(% rowspan="2" %)**Parameter**|(% colspan="24" %)**Devices**|((( | ||
| 6358 | **Index** | ||
| 6359 | |||
| 6360 | **modification** | ||
| 6361 | )))|((( | ||
| 6362 | **Pulse** | ||
| 6363 | |||
| 6364 | **extension** | ||
| 6365 | ))) | ||
| 6366 | |**X**|**Y**|**M**|**S**|**SM**|**T(bit)**|**C(bit)**|**LC(bit)**|**HSC(bit)**|**D.b**|**KnX**|**KnY**|**KnM**|**KnS**|**T**|**C**|**D**|**R**|**SD**|**LC**|**HSC**|**K**|**H**|**E**|**[D]**|**XXP** | ||
| 6367 | |(% rowspan="4" %)HKY|Parameter 1|●| | | | | | | | | | | | | | | | | | | | | | | |●| | ||
| 6368 | |Parameter 2| |●| | | | | | | | | | | | | | | | | | | | | | |●| | ||
| 6369 | |Parameter 3| | | | | | | | | | | | | | |●|●|●|●|●| | | | | |●| | ||
| 6370 | |Parameter 4| |●|●|●|●| | | | |●| | | | | | | | | | | | | | |●| | ||
| 6371 | |||
| 6372 | **Features** | ||
| 6373 | |||
| 6374 | 16-bit operation (HKY) | ||
| 6375 | |||
| 6376 | Scan the input [S to S+3] and column output [D1 to D1+3] signals connected with 16 keys (0 to F), press the 0 to 9 keys, the value will be saved in D2, and the keyboard detection will be output to D3 +7 in. | ||
| 6377 | |||
| 6378 | In addition, after pressing the A to F keys, the key information corresponding to the keyboard [D3 to D3+5] is ON, and the keyboard detection is output to D3+6. | ||
| 6379 | |||
| 6380 | 1. About using the keys 0 to 9 to input the values D3, D3+7 | ||
| 6381 | |||
| 6382 | If it is more than 9,999, overflow from the high digit. The entered value is stored in D2 as BIN (binary number). | ||
| 6383 | |||
| 6384 | When any key from 0 to 9 is pressed, the keyboard detection output D3+7 is ON. | ||
| 6385 | |||
| 6386 | 1. Information about A to F keys D3 to D3+6 | ||
| 6387 | |||
| 6388 | Corresponding to the A to F keys, the first 6 o'clock of D3 is ON. When any key from A to F is pressed, the keyboard detection output D3+6 is ON. | ||
| 6389 | |||
| 6390 | |**Keyboard**|**Key information** | ||
| 6391 | |A|D3 | ||
| 6392 | |B|D3+1 | ||
| 6393 | |C|D3+2 | ||
| 6394 | |D|D3+3 | ||
| 6395 | |E|D3+4 | ||
| 6396 | |F|D3+5 | ||
| 6397 | |||
| 6398 | **Extensions** | ||
| 6399 | |||
| 6400 | After SM167 is ON and the extended function becomes valid, the data of the hexadecimal keys from 0 to F is saved in BIN mode. | ||
| 6401 | |||
| 6402 | Except for the following, it is the same as the above-mentioned [Function and Operation Description]. | ||
| 6403 | |||
| 6404 | The hexadecimal data input using the 0 to F keys is written into D2 as it is. | ||
| 6405 | |||
| 6406 | 1. Regarding the numerical input using the 0 to F keys D2 | ||
| 6407 | |||
| 6408 | When it is FFFF or more, overflow from the upper digits. | ||
| 6409 | |||
| 6410 | For example, when inputting 1→2→3→B→F, “23BF" is saved in D2 in BIN mode. When F is input, 1 overflows. | ||
| 6411 | |||
| 6412 | [[image:file:///C:\Users\z\AppData\Local\Temp\ksohtml6496\wps5.jpg]] | ||
| 6413 | |||
| 6414 | **✎Note** | ||
| 6415 | |||
| 6416 | * Restrictions on the number of uses of instructions | ||
| 6417 | |||
| 6418 | HKY instructions, only one of them can be used in the program. | ||
| 6419 | |||
| 6420 | * When the keyboard is pressed simultaneously | ||
| 6421 | |||
| 6422 | When multiple keys are pressed at the same time, the key pressed first is effective. | ||
| 6423 | |||
| 6424 | * When the instruction contact is OFF | ||
| 6425 | |||
| 6426 | Even if it is OFF, the content of D2 does not change, but D3 to D3 +7 all become OFF. | ||
| 6427 | |||
| 6428 | * Number of occupied points of the device | ||
| 6429 | |||
| 6430 | When 16 keys are connected, 4 points from the start device S of input (X) are occupied. | ||
| 6431 | |||
| 6432 | When 16 keys are connected, 4 points from the start device D1 of output (Y) are occupied. | ||
| 6433 | |||
| 6434 | It occupies 8 points from the start device D3 for key information output. | ||
| 6435 | |||
| 6436 | Please do not to overlap with the devices used in other controls of the machine. | ||
| 6437 | |||
| 6438 | D3 to D3+5: A to F key key information | ||
| 6439 | |||
| 6440 | D3+6: Keyboard detection output of A to F keys | ||
| 6441 | |||
| 6442 | D3+7: 0-9 key keyboard detection output | ||
| 6443 | |||
| 6444 | * About the read timing of keyboard input | ||
| 6445 | |||
| 6446 | HKY instruction is executed synchronously with the operation cycle of the programmable controller. | ||
| 6447 | |||
| 6448 | It takes 8 operation cycles to complete a series of keyboard scans. | ||
| 6449 | |||
| 6450 | In order to prevent reading omissions caused by the filter delay of keyboard input, please use the [Constant Scan Mode] and [Timer Interrupt] functions flexibly. | ||
| 6451 | |||
| 6452 | * 6. Output form | ||
| 6453 | |||
| 6454 | Please use a transistor output type programmable controller. | ||
| 6455 | |||
| 6456 | **Related device** | ||
| 6457 | |||
| 6458 | |**Devices**|**Name**|**Content** | ||
| 6459 | |SM229|End of instruction execution|((( | ||
| 6460 | OFF: (d1) to (d1)+3 is being scanned, or the instruction is not executed | ||
| 6461 | |||
| 6462 | ON: (d1) to (d1)+3 cyclic output operation (1 to 4 digit scan) and then turn ON | ||
| 6463 | ))) | ||
| 6464 | |||
| 6465 | **Error code** | ||
| 6466 | |||
| 6467 | |**Error code**|**Content** | ||
| 6468 | |4085H|The output result of the read application instruction (s) and (d2) exceeds the device range | ||
| 6469 | |4086H|The output result of the write application instruction (d1), (d2) and (d3) exceeds the device range | ||
| 6470 | |||
| 6471 | **Example** | ||
| 6472 | |||
| 6473 | Program | ||
| 6474 | |||
| 6475 | [[image:file:///C:\Users\z\AppData\Local\Temp\ksohtml6496\wps6.jpg]] | ||
| 6476 | |||
| 6477 | |||
| 6478 | Wiring diagram | ||
| 6479 | |||
| 6480 | [[image:file:///C:\Users\z\AppData\Local\Temp\ksohtml6496\wps7.jpg]] | ||
| 6481 | |||
| 6482 | When inputting [1]→[2]→[3]→[B]→[F], save "23BF" in D0 in BIN mode. | ||
| 6483 | |||
| 6484 | When [F] is input, [1] overflows. | ||
| 6485 | |||
| 6486 | |||
| 6487 | === **6.7.4 DHKY/32 System Numeric Key Input** === | ||
| 6488 | |||
| 6489 | [[image:file:///C:\Users\z\AppData\Local\Temp\ksohtml6496\wps8.png]]**DHKY** | ||
| 6490 | |||
| 6491 | Use the keyboard (16 keys) of 0 to F to input, set numerical value (0 to 9) and operating conditions (A to F function keys) and other instructions for data input. | ||
| 6492 | |||
| 6493 | When the extended function is ON, the hexadecimal number of 0 to F key can be used for keyboard input. | ||
| 6494 | |||
| 6495 | -[DHKY (s) (d1) (d2) (d3)] | ||
| 6496 | |||
| 6497 | **Content, range and data type** | ||
| 6498 | |||
| 6499 | |**Parameter**|**Content**|**Range**|**Data type**|**Data type (label)** | ||
| 6500 | |(s)|The start bit device (X) number that input 16-key (occupies 4 points)|-|Bit|ANY_BOOL | ||
| 6501 | |(d1)|The start device (Y) number that outputs (occupies 4 points)|-|Bit|ANY_BOOL | ||
| 6502 | |(d2)|The device number that stores the value input from the 16 keys|0 to 99999999|BIN32 bit|ANY32_S | ||
| 6503 | |(d3)|The start bit device number whose key is ON (occupies 8 points)|-|BIN16 bit|ANY16_S | ||
| 6504 | |||
| 6505 | **Device used** | ||
| 6506 | |||
| 6507 | |(% rowspan="2" %)**Instruction**|(% rowspan="2" %)**Parameter**|(% colspan="24" %)**Devices**|((( | ||
| 6508 | **Index** | ||
| 6509 | |||
| 6510 | **modification** | ||
| 6511 | )))|((( | ||
| 6512 | **Pulse** | ||
| 6513 | |||
| 6514 | **extension** | ||
| 6515 | ))) | ||
| 6516 | |**X**|**Y**|**M**|**S**|**SM**|**T(bit)**|**C(bit)**|**LC(bit)**|**HSC(bit)**|**D.b**|**KnX**|**KnY**|**KnM**|**KnS**|**T**|**C**|**D**|**R**|**SD**|**LC**|**HSC**|**K**|**H**|**E**|**[D]**|**XXP** | ||
| 6517 | |(% rowspan="4" %)DHKY|Parameter 1|●| | | | | | | | | | | | | | | | | | | | | | | |●| | ||
| 6518 | |Parameter 2| |●| | | | | | | | | | | | | | | | | | | | | | |●| | ||
| 6519 | |Parameter 3| | | | | | | | | | | | | | |●|●|●|●|●|●|●| | | |●| | ||
| 6520 | |Parameter 4| |●|●|●|●| | | | |●| | | | | | | | | | | | | | |●| | ||
| 6521 | |||
| 6522 | **Features** | ||
| 6523 | |||
| 6524 | 32-bit operation (DHKY) | ||
| 6525 | |||
| 6526 | Scan the input [S to S+3] and column output [D1 to D1+3] signals connected with 16 keys (0 to F), press the 0 to 9 keys, and the value will be saved in [D2+1, D2] , The keyboard detection is output to D3+7. | ||
| 6527 | |||
| 6528 | In addition, after pressing the A to F keys, the key information corresponding to the keyboard [D3 to D3+5] is ON, and the keyboard detection is output to D3+6. | ||
| 6529 | |||
| 6530 | 1. Regarding the use of keys from 0 to 9 to input values [D2+1, D2], D3+7 | ||
| 6531 | |||
| 6532 | If it is 99,999,999 or more, overflow from the high digit. | ||
| 6533 | |||
| 6534 | The entered value is stored in [D2+1, D2] as BIN (binary number). | ||
| 6535 | |||
| 6536 | When any key from 0 to 9 is pressed, the keyboard detection output D3+7 is ON. | ||
| 6537 | |||
| 6538 | 1. Button information about A to F keys D3 to D3+6 | ||
| 6539 | |||
| 6540 | For keyboard press information, please refer to 16-bit operation (HKY) on the previous page | ||
| 6541 | |||
| 6542 | **extensions** | ||
| 6543 | |||
| 6544 | After SM167 is ON and the extended function becomes valid, the data of the hexadecimal keys from 0 to F is saved in BIN mode. | ||
| 6545 | |||
| 6546 | Except for the following, it is the same as the above-mentioned “Function and Operation Description”. | ||
| 6547 | |||
| 6548 | The hexadecimal data input using the 0 to F keys are written in [D2+1, D2] as they are. | ||
| 6549 | |||
| 6550 | 1. Regarding the numerical input using 0 to F keys [D2+1, D2] | ||
| 6551 | |||
| 6552 | -When it is FFFFFFFF or more, overflow from the upper digits. | ||
| 6553 | |||
| 6554 | For example, when inputting [9]→[2]→[3]→[B]→[F]→[A]→[F], save "923BFAF" in [D2+1, D2] in BIN mode. | ||
| 6555 | |||
| 6556 | **✎Note** | ||
| 6557 | |||
| 6558 | * Restrictions on the number of uses of instructions | ||
| 6559 | |||
| 6560 | Only one of the DHKY instructions can be used in the program. | ||
| 6561 | |||
| 6562 | * When the keyboard is pressed simultaneously | ||
| 6563 | |||
| 6564 | When multiple keys are pressed at the same time, the key pressed first is effective. | ||
| 6565 | |||
| 6566 | * When the instruction contact is OFF | ||
| 6567 | |||
| 6568 | Even if it is OFF, the content of D2 does not change, but D3 to D3 +7 all become OFF. | ||
| 6569 | |||
| 6570 | * Number of occupied points of the device | ||
| 6571 | |||
| 6572 | When 16 keys are connected, 4 points from the start device S of input (X) are occupied. | ||
| 6573 | |||
| 6574 | When 16 keys are connected, 4 points from the start device D1 of output (Y) are occupied. | ||
| 6575 | |||
| 6576 | It occupies 8 points from the start device D3 for key information output. | ||
| 6577 | |||
| 6578 | Please be careful not to overlap with the devices used in other controls of the machine. | ||
| 6579 | |||
| 6580 | D3 to D3+5: A to F key key information | ||
| 6581 | |||
| 6582 | D3+6: Keyboard detection output of A to F keys | ||
| 6583 | |||
| 6584 | D3+7: 0-9 key keyboard detection output | ||
| 6585 | |||
| 6586 | * About the read timing of keyboard input | ||
| 6587 | |||
| 6588 | The DHKY instruction is executed synchronously with the operation cycle of the programmable controller. | ||
| 6589 | |||
| 6590 | It takes 8 operation cycles to complete a series of keyboard scans. | ||
| 6591 | |||
| 6592 | In order to prevent reading omissions caused by the filter delay of keyboard input, please use the “Constant Scan Mode” and “Timer Interrupt” functions flexibly. | ||
| 6593 | |||
| 6594 | * Output form | ||
| 6595 | |||
| 6596 | Please use a transistor output type programmable controller. | ||
| 6597 | |||
| 6598 | **Related device** | ||
| 6599 | |||
| 6600 | |**Devices**|**Name**|**Content** | ||
| 6601 | |SM229|End of instruction execution|((( | ||
| 6602 | OFF: (d1) to (d1)+3 is being scanned, or the instruction is not executed | ||
| 6603 | |||
| 6604 | ON: (d1) to (d1)+3 cyclic output operation (1 to 4 digit scan) and then turn ON | ||
| 6605 | ))) | ||
| 6606 | |||
| 6607 | **Error code** | ||
| 6608 | |||
| 6609 | |**Error code**|**Content** | ||
| 6610 | |4085H|The output result of the read application instruction (s) and (d2) exceeds the device range | ||
| 6611 | |4086H|The output result of the write application instruction (d1), (d2) and (d3) exceeds the device range | ||
| 6612 | |||
| 6613 | **Example** | ||
| 6614 | |||
| 6615 | Program | ||
| 6616 | |||
| 6617 | [[image:file:///C:\Users\z\AppData\Local\Temp\ksohtml6496\wps9.jpg]] | ||
| 6618 | |||
| 6619 | .Wiring diagram | ||
| 6620 | |||
| 6621 | [[image:file:///C:\Users\z\AppData\Local\Temp\ksohtml6496\wps10.jpg]] | ||
| 6622 | |||
| 6623 | When inputting 1→2→3→B→F→5→7→6, save "123BF576" in BIN to [D1,D0]. | ||
| 6624 | |||
| 6625 | |||
| 6626 | === [[image:file:///C:\Users\z\AppData\Local\Temp\ksohtml6496\wps11.png]]**6.7.5 PR/ASCII Code Printing** === | ||
| 6627 | |||
| 6628 | **PR** | ||
| 6629 | |||
| 6630 | This instruction is to output ASCII data in parallel to the output (Y). | ||
| 6631 | |||
| 6632 | -[PR (s) (d)] | ||
| 6633 | |||
| 6634 | **Content, range and data type** | ||
| 6635 | |||
| 6636 | |**Parameter**|**Content**|**Range**|**Data type**|**Data type (label)** | ||
| 6637 | |(s)|Start number of the device storing ASCII code data| |String (ASCII code only)|ANY_ASC | ||
| 6638 | |(d)|The start number Y of output ASCII code data|-|Bit|ANY_BOOL | ||
| 6639 | |||
| 6640 | **Device used** | ||
| 6641 | |||
| 6642 | |(% rowspan="2" %)**instruction**|(% rowspan="2" %)**Parameter**|(% colspan="24" %)**Devices**|((( | ||
| 6643 | **Index** | ||
| 6644 | |||
| 6645 | **modification** | ||
| 6646 | )))|((( | ||
| 6647 | **Pulse** | ||
| 6648 | |||
| 6649 | **extension** | ||
| 6650 | ))) | ||
| 6651 | |**X**|**Y**|**M**|**S**|**SM**|**T(bit)**|**C(bit)**|**LC(bit)**|**HSC(bit)**|**D.b**|**KnX**|**KnY**|**KnM**|**KnS**|**T**|**C**|**D**|**R**|**SD**|**LC**|**HSC**|**K**|**H**|**E**|**[D]**|**XXP** | ||
| 6652 | |(% rowspan="2" %)PR|Parameter 1| | | | | | | | | | | | | | |●|●|●|●|●| | | | | |●| | ||
| 6653 | |Parameter 2| |●| | | | | | | | | | | | | | | | | | | | | | |●| | ||
| 6654 | |||
| 6655 | **Features** | ||
| 6656 | |||
| 6657 | The ASCII code stored in the lower 8 bits (1 byte) of (S) to (S)+7 is output to (D) to (D)+7 character by character in a time division manner. | ||
| 6658 | |||
| 6659 | The ASCII code saved in is shown below, and the following timing diagram is based on this example. | ||
| 6660 | |||
| 6661 | The sequence of sending starts from (S) = "A", and ends with (S) + 7 = "H" for this purpose, sending eight bytes. | ||
| 6662 | |||
| 6663 | [[image:file:///C:\Users\z\AppData\Local\Temp\ksohtml6496\wps12.jpg]] | ||
| 6664 | |||
| 6665 | Timing diagram | ||
| 6666 | |||
| 6667 | [[image:file:///C:\Users\z\AppData\Local\Temp\ksohtml6496\wps13.png]] | ||
| 6668 | |||
| 6669 | **Related device** | ||
| 6670 | |||
| 6671 | |**Devices**|**Name**|**Content** | ||
| 6672 | |SM227|PR mode|((( | ||
| 6673 | OFF: 8 bytes serial output (fixed to 8 characters) | ||
| 6674 | |||
| 6675 | ON: 16 bytes serial output (1 to 16 characters) | ||
| 6676 | ))) | ||
| 6677 | |||
| 6678 | **✎Note** | ||
| 6679 | |||
| 6680 | * instruction input and instruction action | ||
| 6681 | |||
| 6682 | instruction input=ON: Even if the instruction is continuously ON or the pulse instruction is executed, as long as the output of one cycle ends, the execution ends. | ||
| 6683 | |||
| 6684 | SM229 only works when SM227=ON. | ||
| 6685 | |||
| 6686 | instruction input=OFF: all outputs are OFF. | ||
| 6687 | |||
| 6688 | * Relationship with scan time (operation time) | ||
| 6689 | |||
| 6690 | The instruction is executed synchronously with the scan time. | ||
| 6691 | |||
| 6692 | When the scan time is short, you can use the constant scan mode to drive; when the scan time is longer, you can use the timer interrupt drive. | ||
| 6693 | |||
| 6694 | * About the output of the programmable controller | ||
| 6695 | |||
| 6696 | Please use a transistor output type programmable controller. | ||
| 6697 | |||
| 6698 | * When 00H (NUL) exists in the data (when SM227=ON) | ||
| 6699 | |||
| 6700 | After the instruction is executed, the remaining data is not output. | ||
| 6701 | |||
| 6702 | In addition, SM229 maintains an operation cycle ON. | ||
| 6703 | |||
| 6704 | * Restrictions on the number of uses of instructions | ||
| 6705 | |||
| 6706 | Only one PR instruction can be used in the program. | ||
| 6707 | |||
| 6708 | **Error code** | ||
| 6709 | |||
| 6710 | |**Error code**|**Content** | ||
| 6711 | |4085H|The output result of the read application instruction (s) exceeds the device range | ||
| 6712 | |4086H|The output result of the write application instruction (d) exceeds the device range | ||
| 6713 | |||
| 6714 | **Example** | ||
| 6715 | |||
| 6716 | Program | ||
| 6717 | |||
| 6718 | [[image:file:///C:\Users\z\AppData\Local\Temp\ksohtml6496\wps14.jpg]] | ||
| 6719 | |||
| 6720 | If the ASCII code in D200 to D203 is "Stopped", the corresponding output port signal and its timing are as follows: | ||
| 6721 | |||
| 6722 | [[image:file:///C:\Users\z\AppData\Local\Temp\ksohtml6496\wps15.png]] | ||
| 6723 | |||
| 6724 | |||
| 6725 | |||
| 6726 | === [[image:file:///C:\Users\z\AppData\Local\Temp\ksohtml6496\wps16.png]]**6.7.6 SEGD/Numeric Key Input** === | ||
| 6727 | |||
| 6728 | **SEGD(P)** | ||
| 6729 | |||
| 6730 | instruction to light up the 7-segment digital tube (1 digit). | ||
| 6731 | |||
| 6732 | -[SEGD (s) (d)] | ||
| 6733 | |||
| 6734 | **Content, range and data type** | ||
| 6735 | |||
| 6736 | |**Parameter**|**Content**|**Range**|**Data type**|**Data type (label)** | ||
| 6737 | |(s)|Decoded start word device|-32767 to 32767|Bit|ANY_BOOL | ||
| 6738 | |(d)|Word device number for storing 7-segment display data|-32767 to 32767|Bit|ANY_BOOL | ||
| 6739 | |||
| 6740 | **Device used** | ||
| 6741 | |||
| 6742 | |(% rowspan="2" %)**instruction**|(% rowspan="2" %)**Parameter**|(% colspan="24" %)**Devices**|((( | ||
| 6743 | **Index** | ||
| 6744 | |||
| 6745 | **modification** | ||
| 6746 | )))|((( | ||
| 6747 | **Pulse** | ||
| 6748 | |||
| 6749 | **extension** | ||
| 6750 | ))) | ||
| 6751 | |**X**|**Y**|**M**|**S**|**SM**|**T(bit)**|**C(bit)**|**LC(bit)**|**HSC(bit)**|**D.b**|**KnX**|**KnY**|**KnM**|**KnS**|**T**|**C**|**D**|**R**|**SD**|**LC**|**HSC**|**K**|**H**|**E**|**[D]**|**XXP** | ||
| 6752 | |(% rowspan="2" %)SEGD|Parameter 1| | | | | | | | | | |●|●|●|●|●|●|●|●|●| | |●|●| |●|● | ||
| 6753 | |Parameter 2| | | | | | | | | | | |●|●|●|●|●|●|●|●| | | | | |●|● | ||
| 6754 | |||
| 6755 | **Features** | ||
| 6756 | |||
| 6757 | Decode the low 4-digit (1 digit) of 0 to F (hexadecimal number) of (S) into 7-segment display data and save it in the low 8-digit of (d). | ||
| 6758 | |||
| 6759 | 1.7-segment code decode table | ||
| 6760 | |||
| 6761 | [[image:file:///C:\Users\z\AppData\Local\Temp\ksohtml6496\wps17.jpg]] | ||
| 6762 | |||
| 6763 | **✎Note** | ||
| 6764 | |||
| 6765 | Number of occupied points of the device: The low 8 bits of the output of the device (S) are occupied, and the high 8 bits do not change. | ||
| 6766 | |||
| 6767 | **Error code** | ||
| 6768 | |||
| 6769 | |**Error code**|**Content** | ||
| 6770 | |4085H|The output result of the read application instruction (s) and (d) exceeds the device range | ||
| 6771 | |4086H|The output result of the write application instruction (d) exceeds the device range | ||
| 6772 | |||
| 6773 | **Example** | ||
| 6774 | |||
| 6775 | [[image:file:///C:\Users\z\AppData\Local\Temp\ksohtml6496\wps18.jpg]] | ||
| 6776 | |||
| 6777 | When M0 is set, the lower 4 bits of the data in D0 are decoded and output to the Y10 to Y17 ports. The corresponding table for translation is shown in the above table (7-segment code decoding table). The table does not need to be prepared by the user, and the comparison table is already available in the PLC system. | ||
| 6778 | |||
| 6779 | |||
| 6780 | === [[image:file:///C:\Users\z\AppData\Local\Temp\ksohtml6496\wps19.png]]**6.7.7 SEGL/7SEG Vode Hour and Minute Display** === | ||
| 6781 | |||
| 6782 | **SEGL** | ||
| 6783 | |||
| 6784 | Control 1 or 2 groups of 4-digit 7-segment digital tube display instructions with latch. | ||
| 6785 | |||
| 6786 | -[SEGL (s) (d) (n)] | ||
| 6787 | |||
| 6788 | **Content, range and data type** | ||
| 6789 | |||
| 6790 | |**Parameter**|**Content**|**Range**|**Data type**|**Data type (label)** | ||
| 6791 | |(s)|Start word device for BCD conversion|0 to 9999|BIN16 bit|ANY16 | ||
| 6792 | |(d)|The starting Y number to be output|-|Bit|ANY_BOOL | ||
| 6793 | |(n)|Parameter number [Setting range: K0(H0) to K7(H7)]|0 to 7|BIN16/32 bit|ANY16_U | ||
| 6794 | |||
| 6795 | **Device used** | ||
| 6796 | |||
| 6797 | |(% rowspan="2" %)**instruction**|(% rowspan="2" %)**Parameter**|(% colspan="24" %)**Devices**|((( | ||
| 6798 | **Index** | ||
| 6799 | |||
| 6800 | **modification** | ||
| 6801 | )))|((( | ||
| 6802 | **Pulse** | ||
| 6803 | |||
| 6804 | **extension** | ||
| 6805 | ))) | ||
| 6806 | |**X**|**Y**|**M**|**S**|**SM**|**T(bit)**|**C(bit)**|**LC(bit)**|**HSC(bit)**|**D.b**|**KnX**|**KnY**|**KnM**|**KnS**|**T**|**C**|**D**|**R**|**SD**|**LC**|**HSC**|**K**|**H**|**E**|**[D]**|**XXP** | ||
| 6807 | |(% rowspan="3" %)SEGL|Parameter 1| | | | | | | | | | |●|●|●|●|●|●|●|●|●| | |●|●| |●| | ||
| 6808 | |Parameter 2| |●| | | | | | | | | | | | | | | | | | | | | | |●| | ||
| 6809 | |Parameter 3| | | | | | | | | | | | | | | | | | | | | |●|●| | | | ||
| 6810 | |||
| 6811 | **Features** | ||
| 6812 | |||
| 6813 | Convert the 4-bit value of (s) into BCD data, and use the time-division method to sequentially output each 1 digit to a 7-segment digital tube with BCD decoding. (s) is valid when BIN data in the range of 0 to 9999. | ||
| 6814 | |||
| 6815 | The parameter (n) should be set as follows based on the positive and negative logic on the programmable controller side and the positive and negative logic on the 7-segment side. | ||
| 6816 | |||
| 6817 | |(% rowspan="2" %)**Programmable controller output logic**|(% rowspan="2" %)**Data input**|(% rowspan="2" %)**Strobe signal**|(% colspan="2" %)**Parameter n** | ||
| 6818 | |((( | ||
| 6819 | **4 digits** | ||
| 6820 | |||
| 6821 | **in 1 group** | ||
| 6822 | )))|((( | ||
| 6823 | **4 digits** | ||
| 6824 | |||
| 6825 | **in 2 groups** | ||
| 6826 | ))) | ||
| 6827 | |(% rowspan="4" %)Negative logic|(% rowspan="2" %)Negative logic (consistent)|Negative logic (consistent)|0|4 | ||
| 6828 | |Positive logic (inconsistent)|1|5 | ||
| 6829 | |(% rowspan="2" %)Positive logic (inconsistent)|Negative logic (consistent)|2|6 | ||
| 6830 | |Positive logic (inconsistent)|3|7 | ||
| 6831 | |(% rowspan="4" %)Positive logic|(% rowspan="2" %)Positive logic (consistent)|Negative logic (consistent)|0|4 | ||
| 6832 | |Positive logic (inconsistent)|1|5 | ||
| 6833 | |(% rowspan="2" %)Negative logic (inconsistent)|Negative logic (consistent)|2|6 | ||
| 6834 | |Positive logic (inconsistent)|3|7 | ||
| 6835 | |||
| 6836 | 1. When using 4 digits in 1 group (n=K0 to 3) | ||
| 6837 | |||
| 6838 | After converting the 4-digit value of (s) from BIN→BCD, use the time division method to output each digit in turn from (d) to (d)+3. In addition, the strobe signal output (d)+4 to (d)+7 is also output in a time-division manner, locked to the 7-terminal display of the first group of 4 digits | ||
| 6839 | |||
| 6840 | 1. When using 4 digits in 2 groups (n=K4 to 7) | ||
| 6841 | |||
| 6842 | 1. 4-digit group 1 | ||
| 6843 | |||
| 6844 | After converting the 4-digit value of (s) from BIN→BCD, use the time division method to output each digit in turn from (d) to (d)+3. The strobe signal output (d)+4 to (d)+7 is output in time-division manner in turn, locked to the 7-segment display of the first group of 4 digits. | ||
| 6845 | |||
| 6846 | 1. 4-digit group 2 | ||
| 6847 | |||
| 6848 | After converting the 4-digit value of (s)+1 from BIN+BCD, use the time division method to output each digit in turn from (d)+10 to (d)+13. The strobe signal output (d)+4 to (d)+7 is output in a time-division manner in turn, locked to the 7-segment display of the second group of digits. | ||
| 6849 | |||
| 6850 | **✎Note** | ||
| 6851 | |||
| 6852 | * About the time required to update the 7-segment 4-digit display | ||
| 6853 | |||
| 6854 | The time required to update the 4-digit display (1 group or 2 groups) is 12 times the scan time (operation time). | ||
| 6855 | |||
| 6856 | * Action when instruction input is OFF | ||
| 6857 | |||
| 6858 | When the instruction input is ON, the action is repeated. However, if the instruction contact turns off during an action, the action will be interrupted. When it is ON again, it will start from the original action. | ||
| 6859 | |||
| 6860 | * Occupied points of the device | ||
| 6861 | |||
| 6862 | When using 4 digits in 1 group: 1 point from the start device specified in S is occupied. | ||
| 6863 | |||
| 6864 | Occupy 8 points from the start device specified in D. Even when the number of bits is small, the occupied points cannot be used for other purposes. | ||
| 6865 | |||
| 6866 | When using 4 digits 2 groups: 2 points from the start device specified in S are occupied. | ||
| 6867 | |||
| 6868 | Occupy 12 points from the start device specified in D. Even when the number of bits is small, the occupied points cannot be used for other purposes. | ||
| 6869 | |||
| 6870 | * About scan time (operation cycle) and display timing | ||
| 6871 | |||
| 6872 | The SEGL instruction is executed synchronously with the scan time (operation cycle) of the programmable controller. | ||
| 6873 | |||
| 6874 | In order to perform a series of displays, the scan time of the programmable controller needs to exceed 10ms. | ||
| 6875 | |||
| 6876 | When it is less than 10ms, please use the constant scan mode and run with a scan time longer than 10ms. | ||
| 6877 | |||
| 6878 | * Regarding the output format of the programmable controller | ||
| 6879 | |||
| 6880 | Please use a transistor output type programmable controller. | ||
| 6881 | |||
| 6882 | * Limit number of instructions | ||
| 6883 | |||
| 6884 | At most 2 instructions can be used at the same time. | ||
| 6885 | |||
| 6886 | Related device | ||
| 6887 | |||
| 6888 | |**Devices**|**Name**|**Content** | ||
| 6889 | |SM229|End of instruction execution|After the processing is completed, SM229 is ON for one scan cycle | ||
| 6890 | |||
| 6891 | Error code | ||
| 6892 | |||
| 6893 | |**Error code**|**Content** | ||
| 6894 | |4084H|The data input in the application instruction (n) exceeds the specified range | ||
| 6895 | |4085H|The output result of the read application instruction (s) exceeds the device range | ||
| 6896 | |4086H|The output result of the write application instruction (d) exceeds the device range | ||
| 6897 | |4089H|The number of application instructions exceeds the limit | ||
| 6898 | |||
| 6899 | **Example** | ||
| 6900 | |||
| 6901 | Program | ||
| 6902 | |||
| 6903 | [[image:file:///C:\Users\z\AppData\Local\Temp\ksohtml6496\wps20.jpg]] | ||
| 6904 | |||
| 6905 | The corresponding hardware wiring is shown in the following figure. The content of D0 is displayed on the first group of digital tubes, and the content of D1 is displayed on the second group of digital tubes. If the reading of D0 or D1 exceeds 9999, the program will run into an error: | ||
| 6906 | |||
| 6907 | [[image:file:///C:\Users\z\AppData\Local\Temp\ksohtml6496\wps21.png]] | ||
| 6908 | |||
| 6909 | The digital tube used in the wiring diagram has its own display data latch, 7-segment decoding and driving, and 7-segment digital of negative logic type (when the input port is low, it means that the input data is 1, or is strobed) Show tube. During display processing, PLC's Y4 to Y7 ports will scan automatically, and only one port is ON each time as a bit strobe signal. At this time, the data on Y0 to Y3 ports is the BCD code data sent to the corresponding bit. When the bit strobe signal turns from ON→OFF, it is latched into the latch in the digital tube. After internal decoding and driving, the digital tube displays the number. The PLC system cyclically processes Y4 to Y7 in turn, until all 4 bits are processed. In the same way, Y10 to Y13 are the data output ports of the second group of 4-digit digital tubes, which share the bit strobe lines of Y4 to Y7. The processing methods are the same, and the display processing of the two groups is performed at the same time. In the example, if D0=K2468 and D1=K9753, the first group will display 2 4 6 8 and the second group will display 9 7 5 3. | ||
| 6910 | |||
| 6911 | It takes 12 scan cycles to complete a display refresh. After the processing is completed: According to the positive and negative logic of the programmable controller, the positive and negative logic of the seven-segment code, etc., select according to the following principles: | ||
| 6912 | |||
| 6913 | For a group of 4 digits, n=0 to 3. When two groups of 4 digits, n= 4 to 7. | ||
| 6914 | |||
| 6915 | |**Display group number**|(% colspan="4" %)**Group 1**|(% colspan="4" %)**Group 2** | ||
| 6916 | |Y data output polarity|(% colspan="2" %)PNP|(% colspan="2" %)NPN|(% colspan="2" %)PNP|(% colspan="2" %)NPN | ||
| 6917 | |Strobe and data polarity|Identical|Opposite|Identical|Opposite|Identical|Opposite|Identical|Opposite | ||
| 6918 | |the value of n|0|1|2|3|4|5|6|7 | ||
| 6919 | |||
| 6920 | === | ||
| 6921 | **6.7.8 TKY/Numeric Key Input** === | ||
| 6922 | |||
| 6923 | [[image:file:///C:\Users\z\AppData\Local\Temp\ksohtml6496\wps22.png]]**TKY** | ||
| 6924 | |||
| 6925 | Use the keyboard (number keys) of 0 to 9 to input instructions for setting data such as timers and counters. | ||
| 6926 | |||
| 6927 | -[TKY (s) (d1) (d2)] | ||
| 6928 | |||
| 6929 | **Content, range and data type** | ||
| 6930 | |||
| 6931 | |**Parameter**|**Content**|**Range**|**Data type**|**Data type (label)** | ||
| 6932 | |(s)|The start bit device that input the numeric key (occupies 10 points)|-|Bit|ANY_BOOL | ||
| 6933 | |(d1)|Word device number for storing data|0 to 9999|Signed BIN16|ANY16_S | ||
| 6934 | |(d2)|The start bit device number whose key start bit device is ON (occupies 11 points)|-|Bit|ANY_BOOL | ||
| 6935 | |||
| 6936 | **Device used** | ||
| 6937 | |||
| 6938 | |(% rowspan="2" %)**instruction**|(% rowspan="2" %)**Parameter**|(% colspan="24" %)**Devices**|((( | ||
| 6939 | **Index** | ||
| 6940 | |||
| 6941 | **modification** | ||
| 6942 | )))|((( | ||
| 6943 | **Pulse** | ||
| 6944 | |||
| 6945 | **extension** | ||
| 6946 | ))) | ||
| 6947 | |**X**|**Y**|**M**|**S**|**SM**|**T(bit)**|**C(bit)**|**LC(bit)**|**HSC(bit)**|**D.b**|**KnX**|**KnY**|**KnM**|**KnS**|**T**|**C**|**D**|**R**|**SD**|**LC**|**HSC**|**K**|**H**|**E**|**[D]**|**XXP** | ||
| 6948 | |(% rowspan="3" %)TKY|Parameter 1|●|●|●|●|●| | | | |●| | | | | | | | | | | | | | |●| | ||
| 6949 | |Parameter 2| | | | | | | | | | | |●|●|●|●|●|●|●|●| | | | | |●| | ||
| 6950 | |Parameter 3| |●|●|●|●| | | | |●| | | | | | | | | | | | | | |●| | ||
| 6951 | |||
| 6952 | **Features** | ||
| 6953 | |||
| 6954 | Input [(s) to +9] to the connected number keys and press the keyboard, save the input value in (d1), and output in (d2) to +10 | ||
| 6955 | |||
| 6956 | Keyboard input information and detected keyboard output. | ||
| 6957 | |||
| 6958 | 1. About the input value (d1) | ||
| 6959 | |||
| 6960 | If it is more than 9,999, overflow from the high digit. | ||
| 6961 | |||
| 6962 | The entered value is saved in BIN (binary number). | ||
| 6963 | |||
| 6964 | After pressing the number keys in the order of ①, ②, ③, ④, it is stored as 2130 in (d1). | ||
| 6965 | |||
| 6966 | 1. About (d2) to 10 of key information | ||
| 6967 | |||
| 6968 | (d2) to 9 key information, according to the pressed key ON/OFF. | ||
| 6969 | |||
| 6970 | When any key from 0 to 9 is pressed, the keyboard detection output of (d2) +10 is ON. | ||
| 6971 | |||
| 6972 | [[image:file:///C:\Users\z\AppData\Local\Temp\ksohtml6496\wps23.png]] | ||
| 6973 | |||
| 6974 | **✎Note** | ||
| 6975 | |||
| 6976 | * When the keyboard is pressed simultaneously | ||
| 6977 | |||
| 6978 | When multiple keys are pressed at the same time, only the key pressed first is effective. | ||
| 6979 | |||
| 6980 | * When the instruction contact is OFF | ||
| 6981 | |||
| 6982 | Even if it is OFF, the content of (d2) will not change, but (d2) to (d2)+10 will be OFF. | ||
| 6983 | |||
| 6984 | * Occupied points of the device | ||
| 6985 | |||
| 6986 | **✎ **Connect the input of the number keys, occupying 10 points from (s). | ||
| 6987 | |||
| 6988 | Even when the number key is not connected (not used), since (d2) is already occupied, it cannot be used for other purposes. | ||
| 6989 | |||
| 6990 | **✎ **It occupies 11 points from the start device (d2) for key information output. | ||
| 6991 | |||
| 6992 | Please be careful not to overlap with the devices used in other controls of the machine. | ||
| 6993 | |||
| 6994 | (D2) to (d2)+9: Turn ON according to the input of number keys 0 to 9. | ||
| 6995 | |||
| 6996 | (D2)+10: It is ON when any key between 0 to 9 is pressed. (Keyboard detection output) | ||
| 6997 | |||
| 6998 | * Restrictions on the number of uses of instructions | ||
| 6999 | |||
| 7000 | Only one of the TKY instruction or DTKY instruction can be used in the program. | ||
| 7001 | |||
| 7002 | **Error code** | ||
| 7003 | |||
| 7004 | |**Error code**|**Content** | ||
| 7005 | |4085H|The output result of the read application instruction (s) exceeds the device range | ||
| 7006 | |4086H|The output result of the write application instruction (d) exceeds the device range | ||
| 7007 | |||
| 7008 | **Example** | ||
| 7009 | |||
| 7010 | [[image:file:///C:\Users\z\AppData\Local\Temp\ksohtml6496\wps24.jpg]] | ||
| 7011 | |||
| 7012 | To input the number "2013", press the keys 2, 0, 1, 3 (X2, X0, X1, X3) in order. The operation of the PLC internal variables is shown in the figure below. | ||
| 7013 | |||
| 7014 | [[image:file:///C:\Users\z\AppData\Local\Temp\ksohtml6496\wps25.png]][[image:file:///C:\Users\z\AppData\Local\Temp\ksohtml6496\wps26.jpg]] | ||
| 7015 | |||
| 7016 | |||
| 7017 | |||
| 7018 | === **6.7.9 DTKY/Numeric Key Input** === | ||
| 7019 | |||
| 7020 | [[image:file:///C:\Users\z\AppData\Local\Temp\ksohtml6496\wps27.png]]**DTKY** | ||
| 7021 | |||
| 7022 | Use the 4 points starting from the device specified in (d) to perform 4 types of timer output. | ||
| 7023 | |||
| 7024 | -[STMR (s1) (s2) (d)] | ||
| 7025 | |||
| 7026 | **Content, range and data type** | ||
| 7027 | |||
| 7028 | |**Parameter**|**Content**|**Range**|**Data type**|**Data type (label)** | ||
| 7029 | |(s)|The start bit device that input the numeric key (occupies 10 points)|-|Bit|ANY_BOOL | ||
| 7030 | |(d1)|Word device number for storing data|0 to 99999999|Signed BIN32|ANY32_S | ||
| 7031 | |(d2)|The start bit device number whose key start bit device is ON [occupies 11 points]|-|Bit|ANY_BOOL | ||
| 7032 | |||
| 7033 | **Device used** | ||
| 7034 | |||
| 7035 | |(% rowspan="2" %)**instruction**|(% rowspan="2" %)**Parameter**|(% colspan="24" %)**Devices**|**Index modification**|((( | ||
| 7036 | **Pulse** | ||
| 7037 | |||
| 7038 | **extension** | ||
| 7039 | ))) | ||
| 7040 | |**X**|**Y**|**M**|**S**|**SM**|**T(bit)**|**C(bit)**|**LC(bit)**|**HSC(bit)**|**D.b**|**KnX**|**KnY**|**KnM**|**KnS**|**T**|**C**|**D**|**R**|**SD**|**LC**|**HSC**|**K**|**H**|**E**|**[D]**|**XXP** | ||
| 7041 | |(% rowspan="3" %)DTKY|Parameter 1|●|●|●|●|●| | | | |●| | | | | | | | | | | | | | |●| | ||
| 7042 | |Parameter 2| | | | | | | | | | | |●|●|●|●|●|●|●|●|●|●| | | |●| | ||
| 7043 | |Parameter 3| |●|●|●|●| | | | |●| | | | | | | | | | | | | | |●| | ||
| 7044 | |||
| 7045 | **Features** | ||
| 7046 | |||
| 7047 | Input [(s) to +9] to the connected number keys and press the keyboard, save the input value in (d1), and output in (d2) to +10 | ||
| 7048 | |||
| 7049 | Keyboard input information and detected keyboard output. | ||
| 7050 | |||
| 7051 | 1. About the input value (d1) | ||
| 7052 | |||
| 7053 | If it is more than 9,999, overflow from the high digit. | ||
| 7054 | |||
| 7055 | The entered value is saved in BIN (binary number). | ||
| 7056 | |||
| 7057 | 1. (d2) to 10 of key information | ||
| 7058 | |||
| 7059 | (d2) to +9 key information, according to the pressed key ON/OFF. | ||
| 7060 | |||
| 7061 | When any key from 0 to 9 is pressed, the keyboard detection output of (d2) +10 is ON. | ||
| 7062 | |||
| 7063 | [[image:file:///C:\Users\z\AppData\Local\Temp\ksohtml6496\wps28.png]] | ||
| 7064 | |||
| 7065 | **✎Note** | ||
| 7066 | |||
| 7067 | * When the keyboard is pressed simultaneously | ||
| 7068 | * When multiple keys are pressed at the same time, only the key pressed first is effective. | ||
| 7069 | * When the instruction contact is OFF | ||
| 7070 | |||
| 7071 | Even if it is OFF, the content of (d2) will not change, but (d2) to (d2)+10 will be OFF. | ||
| 7072 | |||
| 7073 | * Occupied points of the device | ||
| 7074 | |||
| 7075 | **✎** Connect the input of the number keys, occupying 10 points from (s). | ||
| 7076 | |||
| 7077 | Even when the number key is not connected (not used), since (d2) is already occupied, it cannot be used for other purposes. | ||
| 7078 | |||
| 7079 | **✎** It occupies 11 points from the start device (d2) for key information output. | ||
| 7080 | |||
| 7081 | Please be careful not to overlap with the devices used in other controls of the machine. | ||
| 7082 | |||
| 7083 | (D2) to (d2)+9: Turn ON according to the input of number keys 0 to 9. | ||
| 7084 | |||
| 7085 | (D2)+10: It is ON when any key between 0 to 9 is pressed. (Keyboard detection output) | ||
| 7086 | |||
| 7087 | * Restrictions on the number of uses of instructions | ||
| 7088 | |||
| 7089 | Only one of the TKY instruction or DTKY instruction can be used in the program. | ||
| 7090 | |||
| 7091 | **Error code** | ||
| 7092 | |||
| 7093 | |**Error code**|**Content** | ||
| 7094 | |4085H|The output result of the read application instruction (s) and (d1) exceeds the device range | ||
| 7095 | |4086H|The output result of the write application instruction (d1) and (d2) exceeds the device range | ||
| 7096 | |||
| 7097 | **Example** | ||
| 7098 | |||
| 7099 | [[image:file:///C:\Users\z\AppData\Local\Temp\ksohtml6496\wps29.jpg]] | ||
| 7100 | |||
| 7101 | When X20 is on, if you want to input the number "20205689", press 2, 0, 2, 0, 5, 6, 8, 9 (X2, X0, X2, X0, X5, X6, X10, X11) in sequence , Then (the value in (D1,D0) is 20205689) | ||
| 7102 | |||
| 7103 |