Wiki source code of 10 Floating point
Last modified by Wecon on 2025/09/03 21:03
Show last authors
| author | version | line-number | content |
|---|---|---|---|
| 1 | == **CHKFLT/Single precision real number check command** == | ||
| 2 | |||
| 3 | **CHKFLT(P)** | ||
| 4 | Check whether the data specified in (s) is a real number and store the result in the start soft component specified in (d) | ||
| 5 | PLC Editor2 version that supports this command: 2.3.1 and above | ||
| 6 | -[CHKFLT (s) (d)] | ||
| 7 | **Content, range and data type** | ||
| 8 | |||
| 9 | |**Parameter**|**Content**|**Range**|**Data type**|**Data type (label)** | ||
| 10 | |(s)|Checked data or the starting device number that store the checked data|-|Single precision real number|ANYREAL_32 | ||
| 11 | |(d)|Start bit device number of output check result (occupies 4 points)|-|Bit|ANYBIT_ARRAY | ||
| 12 | |||
| 13 | **Device used** | ||
| 14 | |||
| 15 | |(% rowspan="2" %)**Instruction**|(% rowspan="2" %)**Parameter**|(% colspan="24" %)**Devices**|((( | ||
| 16 | **Offset** | ||
| 17 | |||
| 18 | **modification** | ||
| 19 | )))|**Dword extension**|((( | ||
| 20 | **Pulse** | ||
| 21 | |||
| 22 | **extension** | ||
| 23 | ))) | ||
| 24 | |**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]**|**DXX**|**XXP** | ||
| 25 | |(% rowspan="2" %)CHKFLT|Parameter 1| | | | | | | | | | | | | | | | |●|●| |●| | | |●|●| |● | ||
| 26 | |Parameter 2| |●|●|●| | | | | |●| | | | | | | | | | | | | | | | |● | ||
| 27 | |||
| 28 | **Features** | ||
| 29 | |||
| 30 | Check the data stored in (s) and determine whether it is a standard number, non-numeric, infinite, or non-standard number, corresponding to the states of (d), (d+1), (d+2), and (d+3). | ||
| 31 | |||
| 32 | **Descriptions** | ||
| 33 | |||
| 34 | **Numbers expressed as floating point numbers** | ||
| 35 | |||
| 36 | The following types of floating-point numbers are available | ||
| 37 | |||
| 38 | |(% rowspan="2" %)**mantissa(f)**|(% colspan="3" %)**Index (e)** | ||
| 39 | |**0**|**Non-zero and non-all-1**|**All 1 (255)** | ||
| 40 | |0|0|(% rowspan="2" %)Standard figures|Infinity | ||
| 41 | |Non-0|Non-standard figures|NaN | ||
| 42 | |||
| 43 | (% class="box infomessage" %) | ||
| 44 | ((( | ||
| 45 | **✎Note**: Non-standard numbers are numbers whose absolute values are too small to be expressed as standard numbers. Non-standard numbers have fewer significant digits. If the calculation result is a non-standard number (including intermediate results), the number of significant digits will be reduced. | ||
| 46 | ))) | ||
| 47 | |||
| 48 | **Standard figures** | ||
| 49 | Standard numbers represent real numbers. The sign bit 0 for positive numbers and 1 for negative numbers. | ||
| 50 | |||
| 51 | Exponent (e) will be represented from 1 to 254, and the actual exponent will be less than 127, i.e. -126 to 127. | ||
| 52 | |||
| 53 | The mantissa (f) is expressed from 0 to 2^^23^^-1, in the actual mantissa, the bit 2^^23^^ is 1 and the binary decimal point follows it immediately. | ||
| 54 | Standard figures are shown as below: | ||
| 55 | |||
| 56 | [[image:0.png]] | ||
| 57 | |||
| 58 | For example: [[image:图片11.png]] | ||
| 59 | sign: - | ||
| 60 | |||
| 61 | Index: 128-127=1 | ||
| 62 | |||
| 63 | mantissa: [[image:图片12.png]] | ||
| 64 | |||
| 65 | value: [[image:图片13.png]] | ||
| 66 | **Non-standard figures** | ||
| 67 | A non-standard figure represents a real number with a very small absolute value. The sign bit is 0 for a positive number and 1 for a negative number. | ||
| 68 | |||
| 69 | The exponent (e) is 0 and the actual exponent is -126. | ||
| 70 | |||
| 71 | The mantissa (f) is represented from 0 to 2^^23^^-1, in the actual mantissa, bit 2^^23^^ is 0, and the binary decimal point immediately follows it. | ||
| 72 | |||
| 73 | Non-standard figure are shown as below: | ||
| 74 | [[image:图片14.png]] | ||
| 75 | For example:[[image:图片15.png]] | ||
| 76 | sign:- | ||
| 77 | |||
| 78 | Index:-126 | ||
| 79 | |||
| 80 | mantissa:[[image:图片16.png]] | ||
| 81 | |||
| 82 | Value: [[image:图片17.png]] | ||
| 83 | **Zero** | ||
| 84 | +0.0 and -0.0 values can be represented by setting signs, 0 for positive numbers and 1 for negative numbers. Both the exponent and the mantissa are 0. +0.0 and -0.0 are both equal to 0.0. | ||
| 85 | **Infinity** | ||
| 86 | +∞ and -∞ values can be represented by setting signs, 0 for positive numbers and 1 for negative numbers. The exponent is 255 (2^^8^^-1) and the mantissa is 0. | ||
| 87 | **NaN** | ||
| 88 | NaN (not a number) is generated when calculations such as 0.0/0.0, ∞/∞, or ∞-∞ result in a value other than a number or infinity. The exponent is 255 (28-1), and the mantissa is non-zero. | ||
| 89 | |||
| 90 | (% class="box infomessage" %) | ||
| 91 | ((( | ||
| 92 | **✎Note**: No NaN sign or mantissa area value (not non-zero) defined. | ||
| 93 | ))) | ||
| 94 | |||
| 95 | **Error code** | ||
| 96 | |||
| 97 | |**Error code**|**Content** | ||
| 98 | |4085H|The write address in (s) exceeds the device range | ||
| 99 | |4086H|The write address in (d) exceeds the device range | ||
| 100 | |||
| 101 | **Example** | ||
| 102 | |||
| 103 | (% style="text-align:center" %) | ||
| 104 | [[image:图片18.png]] | ||
| 105 | |||
| 106 | M0 is ON, if D0 is a standard number (in the range of single-precision real numbers), then M100 is ON. | ||
| 107 | |||
| 108 | M2 is ON, if D4 is a non-numeric value (NAN), then M109 is ON. | ||
| 109 | |||
| 110 | (% style="text-align:center" %) | ||
| 111 | [[image:图片19.png]] | ||
| 112 | |||
| 113 | M9 set ON, if infinity in D18, then M138 set ON. | ||
| 114 | |||
| 115 | M10 is set to ON, and if D20 is a non-standard number, M143 is set to ON. | ||
| 116 | |||
| 117 | == **DACOS/Single precision real number COS-1 operation** == | ||
| 118 | |||
| 119 | **DACOS(P)** | ||
| 120 | |||
| 121 | After calculating the COS^^ -1^^ (arc cosine) value of the angle specified in (s), the calculation result is stored in the device number specified in (d). | ||
| 122 | |||
| 123 | -[DACOS (s) (d)] | ||
| 124 | |||
| 125 | **Content, range and data type** | ||
| 126 | |||
| 127 | |**Parameter**|**Content**|**Range**|**Data type**|**Data type (label)** | ||
| 128 | |(s)|The angle data for COS^^ -1 ^^(arc cosine) calculation or the start device number that stores the angle data|0, 2^^-126^^ ≤~|(s)~|<1|Single precision real number|ANYREAL_32 | ||
| 129 | |(d)|The start device number that stores operation result|0 to π|Single precision real number|ANYREAL_32 | ||
| 130 | |||
| 131 | **Device used** | ||
| 132 | |||
| 133 | |(% rowspan="2" %)**Instruction**|(% rowspan="2" %)**Parameter**|(% colspan="8" %)**Devices**|((( | ||
| 134 | **Offset modification** | ||
| 135 | )))|((( | ||
| 136 | **Pulse extension** | ||
| 137 | ))) | ||
| 138 | |**T**|**C**|**D**|**R**|**SD**|**LC**|**HSC**|**E**|**[D]**|**XXP** | ||
| 139 | |(% rowspan="2" %)DACOS|Parameter 1|●|●|●|●|●|●|●|●|●|● | ||
| 140 | |Parameter 2|●|●|●|●|●|●|●| |●|● | ||
| 141 | |||
| 142 | **Features** | ||
| 143 | |||
| 144 | After calculating the COS^^ -1^^ (arc cosine) value of the angle specified in (s), the calculation result is stored in the device number specified in (d). | ||
| 145 | |||
| 146 | (% style="text-align:center" %) | ||
| 147 | [[image:07-4 Basic instructions_html_1d54af00326bfd13.png||height="146" width="750"]] | ||
| 148 | |||
| 149 | The COS value specified in (s) can be set within the range of -1.0 to 1.0. | ||
| 150 | |||
| 151 | The angle (calculation result) stored in (d) stores the value from 0 to π in radians. | ||
| 152 | |||
| 153 | Related device are as follows: | ||
| 154 | |||
| 155 | |(% rowspan="2" %)**Devices**|(% rowspan="2" %)**Name**|(% colspan="2" %)**Content** | ||
| 156 | |**Condition**|**Operation** | ||
| 157 | |SM153|Zero|The operation result is zero|The zero flag (SM153) turns ON. | ||
| 158 | |SM152|Borrow|The absolutevalue of operation result<2^^ -126^^|The value of (d) becomes the minimum value of 32-bit real numbers (2^^ -126^^), and the borrow flag (SM152) turns ON. | ||
| 159 | |||
| 160 | **Error code** | ||
| 161 | |||
| 162 | |**Error code**|**Content** | ||
| 163 | |4085H|The write address in (s) exceeds the device range | ||
| 164 | |4086H|The write address in (d) exceeds the device range | ||
| 165 | |4084H|When the content of the device specified by (s) is an irregular number, a non-number, ±∞ and exceeds -1.0 to 1.0 | ||
| 166 | |||
| 167 | **Example** | ||
| 168 | |||
| 169 | (% style="text-align:center" %) | ||
| 170 | [[image:07-4 Basic instructions_html_885edcd9627207d6.png]] | ||
| 171 | |||
| 172 | Calculate the arc cosine value of 0.4 and the result is 1.159279. | ||
| 173 | |||
| 174 | (% style="text-align:center" %) | ||
| 175 | [[image:07-4 Basic instructions_html_2ba11468018e2085.png]] | ||
| 176 | |||
| 177 | == **DASIN/Single precision real number SIN^^-1^^ operation** == | ||
| 178 | |||
| 179 | **DASIN(P)** | ||
| 180 | |||
| 181 | After calculating the SIN -1 (arc sine) value of the angle specified in (s), the calculation result is stored in the device number specified in (d). | ||
| 182 | |||
| 183 | -[DASIN (s) (d)] | ||
| 184 | |||
| 185 | **Content, range and data type** | ||
| 186 | |||
| 187 | |**Parameter**|**Content**|**Range**|**Data type**|**Data type (label)** | ||
| 188 | |(s)|The angle data for SIN^^ -1 ^^(arcsine) calculation or the start device number that stores the angle data|0, 2^^-126 ^^≤~|(s)~|<1|Single precision real number|ANYREAL_32 | ||
| 189 | |(d)|The start device number that stores operation result|-π/2 to π/2|Single precision real number|ANYREAL_32 | ||
| 190 | |||
| 191 | **Device used** | ||
| 192 | |||
| 193 | |(% rowspan="2" %)**Instruction**|(% rowspan="2" %)**Parameter**|(% colspan="8" %)**Devices**|**Offset modification**|((( | ||
| 194 | **Pulse extension** | ||
| 195 | ))) | ||
| 196 | |**T**|**C**|**D**|**R**|**SD**|**LC**|**HSC**|**E**|**[D]**|**XXP** | ||
| 197 | |(% rowspan="2" %)DASIN|Parameter 1|●|●|●|●|●|●|●|●|●|● | ||
| 198 | |Parameter 2|●|●|●|●|●|●|●| |●|● | ||
| 199 | |||
| 200 | **Features** | ||
| 201 | |||
| 202 | • After calculating the SIN-1 (arc sine) value of the angle specified in (s), the calculation result is stored in the device number specified in (d). | ||
| 203 | |||
| 204 | (% style="text-align:center" %) | ||
| 205 | [[image:07-4 Basic instructions_html_b761aabc996479fd.jpg||height="147" width="750"]] | ||
| 206 | |||
| 207 | The SIN^^-1^^ value specified in (s) can be set within the range of -1.0 to 1.0. | ||
| 208 | |||
| 209 | The angle (calculation result) stored in (d) is stored in the unit of radians (-π/2) to (π/2). | ||
| 210 | |||
| 211 | • The related devices are as follows. | ||
| 212 | |||
| 213 | |(% rowspan="2" %)**Devices**|(% rowspan="2" %)**Name**|(% colspan="2" %)**Content** | ||
| 214 | |**Condition**|**Operation** | ||
| 215 | |SM153|Zero|The operation result is zero|The zero flag (SM153) turns ON. | ||
| 216 | |SM152|Borrow|The absolute value of operation result<2^^ -126^^|The value of (d) becomes the minimum value of 32-bit real numbers (2^^ -126)^^, and the borrow flag (SM152) turns ON. | ||
| 217 | |||
| 218 | **Error code** | ||
| 219 | |||
| 220 | |**Error code**|**Content** | ||
| 221 | |4085H|The write address in (s) exceeds the device range | ||
| 222 | |4086H|The write address in (d) exceeds the device range | ||
| 223 | |4084H|When the content of the device specified by (s) is an irregular number, a non-number, ±∞ and exceeds -1.0 to 1.0 | ||
| 224 | |||
| 225 | **Example** | ||
| 226 | |||
| 227 | (% style="text-align:center" %) | ||
| 228 | [[image:07-4 Basic instructions_html_f04baf9f1228ef1a.png]] | ||
| 229 | |||
| 230 | Calculate the arc sine of 0.4 and the result is 0.4115168. | ||
| 231 | |||
| 232 | (% style="text-align:center" %) | ||
| 233 | [[image:07-4 Basic instructions_html_a34c74dd396286cc.png]] | ||
| 234 | |||
| 235 | == **DATAN/Single precision real number TAN^^-1^^ operation** == | ||
| 236 | |||
| 237 | **DATAN(P)** | ||
| 238 | |||
| 239 | After calculating the TAN -1 (arctangent) value of the angle specified in (s), the calculation result is stored in the device number specified in (d). | ||
| 240 | |||
| 241 | -[DATAN (s) (d)] | ||
| 242 | |||
| 243 | **Content, range and data type** | ||
| 244 | |||
| 245 | |**Parameter**|**Content**|**Range**|**Data type**|**Data type (label)** | ||
| 246 | |(s)|The angle data for TAN^^ -1 ^^(arctangent) calculation or the start device number that stores the angle data|0, 2^^ -126^^ ≤~|(s)~|< 2^^ 128^^|Single precision real number|ANYREAL_32 | ||
| 247 | |(d)|The start device number that stores operation result|-π/2 to π/2|Single precision real number|ANYREAL_32 | ||
| 248 | |||
| 249 | **Device use** | ||
| 250 | |||
| 251 | |(% rowspan="2" %)**Instruction**|(% rowspan="2" %)**Parameter**|(% colspan="8" %)**Devices**|((( | ||
| 252 | **Offset modification** | ||
| 253 | )))|((( | ||
| 254 | **Pulse extension** | ||
| 255 | ))) | ||
| 256 | |**T**|**C**|**D**|**R**|**SD**|**LC**|**HSC**|**E**|**[D]**|**XXP** | ||
| 257 | |(% rowspan="2" %)DATAN|Parameter 1|●|●|●|●|●|●|●|●|●|● | ||
| 258 | |Parameter 2|●|●|●|●|●|●|●| |●|● | ||
| 259 | |||
| 260 | **Features** | ||
| 261 | |||
| 262 | Calculate the TAN -1 ((arctangent) value of the angle specified in (s), and store the calculation result in the device number specified in (d). | ||
| 263 | |||
| 264 | (% style="text-align:center" %) | ||
| 265 | [[image:07-4 Basic instructions_html_22e258131c9a385d.jpg||height="147" width="750"]] | ||
| 266 | |||
| 267 | The angle (calculation result) stored in (d) is stored in the unit of radians (-π/2) to (π/2). | ||
| 268 | |||
| 269 | • The related devices are as follows. | ||
| 270 | |||
| 271 | |(% rowspan="2" %)**Devices**|(% rowspan="2" %)**Name**|(% colspan="2" %)**Content** | ||
| 272 | |**Condition**|**Operation** | ||
| 273 | |SM153|Zero|The operation result is zero|The zero flag (SM153) turns ON. | ||
| 274 | |SM152|Borrow|The absolute value of operation result<2^^ -126^^|The value of (d) becomes the minimum value of 32-bit real numbers (2^^ -126^^), and the borrow flag (SM152) turns ON. | ||
| 275 | |||
| 276 | **Error code** | ||
| 277 | |||
| 278 | |**Error code**|**Content** | ||
| 279 | |4085H|The write address in (s) exceeds the device range | ||
| 280 | |4086H|The write address in (d) exceeds the device range | ||
| 281 | |4084H|When the content of the device specified by (s) is an irregular number, a non-number and ±∞ | ||
| 282 | |||
| 283 | **Example** | ||
| 284 | |||
| 285 | (% style="text-align:center" %) | ||
| 286 | [[image:07-4 Basic instructions_html_879f0218e034638d.png]] | ||
| 287 | |||
| 288 | Calculate the arctangent value of 4.6 and the result is 1.356736 | ||
| 289 | |||
| 290 | (% style="text-align:center" %) | ||
| 291 | [[image:07-4 Basic instructions_html_8140342c4fc71d8f.png]] | ||
| 292 | |||
| 293 | == **DCOS/Single precision real number COS operation** == | ||
| 294 | |||
| 295 | **DCOS (P)** | ||
| 296 | |||
| 297 | After calculating the COS (cosine) value of the angle specified in (s), the calculation result is stored in the device number specified in (d). | ||
| 298 | |||
| 299 | -[DCOS (s) (d)] | ||
| 300 | |||
| 301 | **Content, range and data type** | ||
| 302 | |||
| 303 | |**Parameter**|**Content**|**Range**|**Data type**|**Data type (label)** | ||
| 304 | |(s)|The angle data for COS^^ ^^(cosine) calculation or the start device number that stores the angle data|0, 2^^-126^^ ≤~|(s)~|< 2^^128^^|Single precision real number|ANYREAL_32 | ||
| 305 | |(d)|The start device number that stores operation result|-|Single precision real number|ANYREAL_32 | ||
| 306 | |||
| 307 | **Device used** | ||
| 308 | |||
| 309 | |(% rowspan="2" %)**Instruction**|(% rowspan="2" %)**Parameter**|(% colspan="8" %)**Devices**|((( | ||
| 310 | **Offset modification** | ||
| 311 | )))|((( | ||
| 312 | **Pulse extension** | ||
| 313 | ))) | ||
| 314 | |**T**|**C**|**D**|**R**|**SD**|**LC**|**HSC**|**E**|**[D]**|**XXP** | ||
| 315 | |(% rowspan="2" %)DCOS|Parameter 1|●|●|●|●|●|●|●|●|●|● | ||
| 316 | |Parameter 2|●|●|●|●|●|●|●| |●|● | ||
| 317 | |||
| 318 | **Features** | ||
| 319 | |||
| 320 | After calculating the COS (cosine) value of the angle specified in (s), store the calculation result in the device number specified in (d). | ||
| 321 | |||
| 322 | (% style="text-align:center" %) | ||
| 323 | [[image:07-4 Basic instructions_html_ccff62c43e5b23a5.jpg||height="147" width="750"]] | ||
| 324 | |||
| 325 | For the angle specified in (s), set it in radians (angle×π÷180). | ||
| 326 | |||
| 327 | • The related devices are as follows. | ||
| 328 | |||
| 329 | |(% rowspan="2" %)**Devices**|(% rowspan="2" %)**Name**|(% colspan="2" %)**Content** | ||
| 330 | |**Condition**|**Operation** | ||
| 331 | |SM153|zero|The operation result is zero|The zero flag (SM153) turns ON. | ||
| 332 | |SM152|Borrow|The absolute value of operation result<2^^-126^^|The value of (d) becomes the minimum value of 32-bit real numbers (2^^-126^^), and the borrow flag (SM152) turns ON. | ||
| 333 | |||
| 334 | **Error code** | ||
| 335 | |||
| 336 | |**Error code**|**Content** | ||
| 337 | |4085H|The write address in (s) exceeds the device range | ||
| 338 | |4086H|The write address in (d) exceeds the device range | ||
| 339 | |4084H|When the content of the device specified by (s) is an irregular number, a non-number and ±∞ | ||
| 340 | |||
| 341 | **Example** | ||
| 342 | |||
| 343 | (% style="text-align:center" %) | ||
| 344 | [[image:07-4 Basic instructions_html_c9d38107f2eb8417.png]] | ||
| 345 | |||
| 346 | Calculate the cosine value of 1.3 and the result is 2.674989E-1 | ||
| 347 | |||
| 348 | (% style="text-align:center" %) | ||
| 349 | [[image:07-4 Basic instructions_html_7a03285baa3b7bb8.png]] | ||
| 350 | |||
| 351 | == **DCOSH/Single precision real number COSH operation** == | ||
| 352 | |||
| 353 | **DCOSH(P)** | ||
| 354 | |||
| 355 | After calculating the DCOSH (hyperbolic cosine) value of the angle specified in (s), the calculation result is stored in the device number specified in (d). | ||
| 356 | |||
| 357 | -[DCOSH (s) (d)] | ||
| 358 | |||
| 359 | **Content, range and data type** | ||
| 360 | |||
| 361 | |**Parameter**|**Content**|**Range**|**Data type**|**Data type (label)** | ||
| 362 | |(s)|The angle data for DCOSH (hyperbolic cosine) calculation or the device start number that stores the angle data|0, 2^^-126^^ ≤~|(s)~|< 2^^128^^|Single precision real number|ANYREAL_32 | ||
| 363 | |(d)|The start device number that stores operation result|-|Single precision real number|ANYREAL_32 | ||
| 364 | |||
| 365 | **Device used** | ||
| 366 | |||
| 367 | |(% rowspan="2" %)**Instruction**|(% rowspan="2" %)**Parameter**|(% colspan="8" %)**Devices**|((( | ||
| 368 | **Offset modification** | ||
| 369 | )))|((( | ||
| 370 | **Pulse extension** | ||
| 371 | ))) | ||
| 372 | |**T**|**C**|**D**|**R**|**SD**|**LC**|**HSC**|**E**|**[D]**|**XXP** | ||
| 373 | |(% rowspan="2" %)DCOSH|Parameter 1|●|●|●|●|●|●|●|●|●|● | ||
| 374 | |Parameter 2|●|●|●|●|●|●|●| |●|● | ||
| 375 | |||
| 376 | **Features** | ||
| 377 | |||
| 378 | • After calculating the DCOSH (hyperbolic cosine) value of the angle specified in (s), the calculation result is stored in the device number specified in (d). | ||
| 379 | |||
| 380 | (% style="text-align:center" %) | ||
| 381 | [[image:07-4 Basic instructions_html_ea688860451bada2.jpg||height="147" width="750"]] | ||
| 382 | |||
| 383 | This instruction is to take the COSH value of a binary floating point number. The calculation formula is cosh value=(e s +e -s )/2. | ||
| 384 | |||
| 385 | • The related devices are as follows. | ||
| 386 | |||
| 387 | |(% rowspan="2" %)**Devices**|(% rowspan="2" %)**Name**|(% colspan="2" %)**Content** | ||
| 388 | |**Condition**|**Operation** | ||
| 389 | |SM151|carry|The absolute value of the operation result>2^^128^^|The value of (d) becomes the maximum value of 32-bit real numbers (2^^128^^ ), and the carry flag (SM151) turns on. | ||
| 390 | |||
| 391 | **Error code** | ||
| 392 | |||
| 393 | |**Error code**|**Content** | ||
| 394 | |4085H|The write address in (s) exceeds the device range | ||
| 395 | |4086H|The write address in (d) exceeds the device range | ||
| 396 | |4084H|When the content of the device specified by (s) is an irregular number, a non-number and ±∞ | ||
| 397 | |||
| 398 | **Example** | ||
| 399 | |||
| 400 | (% style="text-align:center" %) | ||
| 401 | [[image:07-4 Basic instructions_html_1e0d4c6b98ac391c.png]] | ||
| 402 | |||
| 403 | Calculate the hyperbolic cosine value of 2.5, and the result is 6.132289 | ||
| 404 | |||
| 405 | (% style="text-align:center" %) | ||
| 406 | [[image:07-4 Basic instructions_html_a651ea5a4e166f5.png]] | ||
| 407 | |||
| 408 | == **DSIN/Single precision real number SIN operation** == | ||
| 409 | |||
| 410 | **DSIN(P)** | ||
| 411 | |||
| 412 | After calculating the SIN (sine) value of the angle specified in (s), the calculation result is stored in the device number specified in (d). | ||
| 413 | |||
| 414 | -[DSIN (s) (d)] | ||
| 415 | |||
| 416 | **Content, range and data type** | ||
| 417 | |||
| 418 | |**Parameter**|**Content**|**Range**|**Data type**|**Data type (label)** | ||
| 419 | |(s)|The angle data for SIN (sine) calculation or the device start number that stores the angle data|0, 2^^-126^^ ≤~|(s)~|< 2^^128^^|Single precision real number|ANYREAL_32 | ||
| 420 | |(d)|The start device number that stores operation result|-|Single precision real number|ANYREAL_32 | ||
| 421 | |||
| 422 | **Device used** | ||
| 423 | |||
| 424 | |(% rowspan="2" %)**Instruction**|(% rowspan="2" %)**Parameter**|(% colspan="8" %)**Devices**|((( | ||
| 425 | **Offset modification** | ||
| 426 | )))|((( | ||
| 427 | **Pulse extension** | ||
| 428 | ))) | ||
| 429 | |**T**|**C**|**D**|**R**|**SD**|**LC**|**HSC**|**E**|**[D]**|**XXP** | ||
| 430 | |(% rowspan="2" %)DSIN|Parameter 1|●|●|●|●|●|●|●|●|●|● | ||
| 431 | |Parameter 2|●|●|●|●|●|●|●| |●|● | ||
| 432 | |||
| 433 | **Features** | ||
| 434 | |||
| 435 | After calculating the SIN (sine) value of the angle specified in (s), the calculation result is stored in the device number specified in (d). | ||
| 436 | |||
| 437 | (% style="text-align:center" %) | ||
| 438 | [[image:07-4 Basic instructions_html_e48d48c6c681642d.jpg||height="147" width="750"]] | ||
| 439 | |||
| 440 | For the angle specified in (s), set it in radians (angle×π÷180). | ||
| 441 | |||
| 442 | • The related devices are as follows. | ||
| 443 | |||
| 444 | |(% rowspan="2" %)**Devices**|(% rowspan="2" %)**Name**|(% colspan="2" %)**Content** | ||
| 445 | |**Condition**|**Operation** | ||
| 446 | |SM153|Zero|The operation result is zero|The zero flag (SM153) turns ON. | ||
| 447 | |SM152|Borrow|The absolute value of operation result <2 -126|The value of (d) becomes the minimum value of a 32-bit real number (2^^ -126^^), and the borrow flag (SM152) turns on. | ||
| 448 | |||
| 449 | **Error code** | ||
| 450 | |||
| 451 | |**Error code**|**Content** | ||
| 452 | |4085H|The write address in (s) exceeds the device range | ||
| 453 | |4086H|The write address in (d) exceeds the device range | ||
| 454 | |4084H|When the content of the device specified by (s) is an irregular number, a non-number and ±∞ | ||
| 455 | |||
| 456 | **Example** | ||
| 457 | |||
| 458 | (% style="text-align:center" %) | ||
| 459 | [[image:07-4 Basic instructions_html_fc0dfb1a9c6fba8f.png]] | ||
| 460 | |||
| 461 | Calculate the sine of 1.4 and the result is 0.9854497 | ||
| 462 | |||
| 463 | (% style="text-align:center" %) | ||
| 464 | [[image:07-4 Basic instructions_html_cfa3cd51aa79494a.png]] | ||
| 465 | |||
| 466 | == **DSINH/Single precision real number SINH operation** == | ||
| 467 | |||
| 468 | **DSINH(P)** | ||
| 469 | |||
| 470 | After calculating the SINH (hyperbolic sine) value of the angle specified in (s), the calculation result is stored in the device number specified in (d). | ||
| 471 | |||
| 472 | -[DSINH (s) (d)] | ||
| 473 | |||
| 474 | **Content, range and data type** | ||
| 475 | |||
| 476 | |**Parameter**|**Content**|**Range**|**Data type**|**Data type (label)** | ||
| 477 | |(s)|The angle data for SINH (hyperbolic sine) calculation or the device start number that stores the angle data|0, 2^^-126^^ ≤~|(s)~|< 2^^128^^|Single precision real number|ANYREAL_32 | ||
| 478 | |(d)|The start device number that stores operation result|-|Single precision real number|ANYREAL_32 | ||
| 479 | |||
| 480 | **Device used** | ||
| 481 | |||
| 482 | |(% rowspan="2" %)**Instruction**|(% rowspan="2" %)**Parameter**|(% colspan="8" %)**Devices**|((( | ||
| 483 | **Offset modification** | ||
| 484 | )))|((( | ||
| 485 | **Pulse extension** | ||
| 486 | ))) | ||
| 487 | |**T**|**C**|**D**|**R**|**SD**|**LC**|**HSC**|**E**|**[D]**|**XXP** | ||
| 488 | |(% rowspan="2" %)DSINH|Parameter 1|●|●|●|●|●|●|●|●|●|● | ||
| 489 | |Parameter 2|●|●|●|●|●|●|●| |●|● | ||
| 490 | |||
| 491 | **Features** | ||
| 492 | |||
| 493 | After calculating the SINH (hyperbolic sine) value of the angle specified in (s), the calculation result is stored in the device number specified in (d). | ||
| 494 | |||
| 495 | (% style="text-align:center" %) | ||
| 496 | [[image:07-4 Basic instructions_html_71f07052c9842130.jpg||height="147" width="750"]] | ||
| 497 | |||
| 498 | The instruction is to take the SINH value from a binary floating point number. The calculation formula is sinh value = (e s -e -s )/2. | ||
| 499 | |||
| 500 | The related devices are shown below. | ||
| 501 | |||
| 502 | |(% rowspan="2" %)**Devices**|(% rowspan="2" %)**Name**|(% colspan="2" style="text-align:center; vertical-align:middle" %)**Content** | ||
| 503 | |**Condition**|**Operation** | ||
| 504 | |SM153|Zero|The operation result is zero|The zero flag (SM153) turns ON. | ||
| 505 | |SM152|Borrow|The absolute value of operation result <2^^-126^^|The value of (d) becomes the minimum value of a 32-bit real number (2^^-126^^), and the borrow flag (SM152) turns on. | ||
| 506 | |SM151|Carry|The absolute value of operation result > 2^^128^^|The value of (d) becomes the maximum value of 32-bit real numbers (2^^128^^), and the carry flag (SM151) turns on. | ||
| 507 | |||
| 508 | **Error code** | ||
| 509 | |||
| 510 | |**Error code**|**Content** | ||
| 511 | |4085H|The write address in (s) exceeds the device range | ||
| 512 | |4086H|The write address in (d) exceeds the device range | ||
| 513 | |4084H|When the content of the device specified by (s) is an irregular number, a non-number and ±∞ | ||
| 514 | |||
| 515 | **Example** | ||
| 516 | |||
| 517 | (% style="text-align:center" %) | ||
| 518 | [[image:07-4 Basic instructions_html_bd9cf1509e4b17a3.png]] | ||
| 519 | |||
| 520 | Calculate the hyperbolic sine value of 3.2 and the result is 12.24588 | ||
| 521 | |||
| 522 | (% style="text-align:center" %) | ||
| 523 | [[image:07-4 Basic instructions_html_85a3dbf0a41eceb4.png]] | ||
| 524 | |||
| 525 | == **DTAN/Single precision real number TAN operation** == | ||
| 526 | |||
| 527 | **DTAN(P)** | ||
| 528 | |||
| 529 | After calculating the TAN (tangent) value of the angle specified in (s), the calculation result is stored in the device number specified in (d). | ||
| 530 | |||
| 531 | -[DTAN (s) (d)] | ||
| 532 | |||
| 533 | **Content, range and data type** | ||
| 534 | |||
| 535 | |**Parameter**|**Content**|**Range**|**Data type**|**Data type (label)** | ||
| 536 | |(s)|The angle data for TAN (tangent) calculation or the device start number that stores the angle data|0, 2^^-126^^ ≤~|(s)~|< 2^^128^^|Single precision real number|ANYREAL_32 | ||
| 537 | |(d)|The start device number that stores operation result|-|Single precision real number|ANYREAL_32 | ||
| 538 | |||
| 539 | **Device used** | ||
| 540 | |||
| 541 | |(% rowspan="2" %)**Instruction**|(% rowspan="2" %)**Parameter**|(% colspan="8" %)**Devices**|((( | ||
| 542 | **Offset modification** | ||
| 543 | )))|((( | ||
| 544 | **Pulse extension** | ||
| 545 | ))) | ||
| 546 | |**T**|**C**|**D**|**R**|**SD**|**LC**|**HSC**|**E**|**[D]**|**XXP** | ||
| 547 | |(% rowspan="2" %)DTAN|Parameter 1|●|●|●|●|●|●|●|●|●|● | ||
| 548 | |Parameter 2|●|●|●|●|●|●|●| |●|● | ||
| 549 | |||
| 550 | **Features** | ||
| 551 | |||
| 552 | After calculating the TAN (tangent) value of the angle specified in (s), the calculation result is stored in the device number specified in (d). | ||
| 553 | |||
| 554 | (% style="text-align:center" %) | ||
| 555 | [[image:07-4 Basic instructions_html_4c63c99c66440195.jpg||height="147" width="750"]] | ||
| 556 | |||
| 557 | For the angle specified in (s), set it in radians (angle×π÷180). | ||
| 558 | |||
| 559 | The related devices are shown below. | ||
| 560 | |||
| 561 | |(% rowspan="2" %)**Devices**|(% rowspan="2" %)**Name**|(% colspan="2" %)**Content** | ||
| 562 | |**Condition**|**Operation** | ||
| 563 | |SM153|Zero|The operation result is zero|The zero flag (SM153) turns ON. | ||
| 564 | |SM152|Borrow|The absolute value of operation result <2^^-126^^|The value of (d) becomes the minimum value of a 32-bit real number (2^^-126^^), and the borrow flag (SM152) turns on. | ||
| 565 | |SM151|Carry|The absolute value of operation result> 2^^128^^|The value of (d) becomes the maximum value of 32-bit real numbers (2^^128^^), and the carry flag (SM151) turns on. | ||
| 566 | |||
| 567 | **Error code** | ||
| 568 | |||
| 569 | |**Error code**|**Content** | ||
| 570 | |4085H|The write address in (s) exceeds the device range | ||
| 571 | |4086H|The write address in (d) exceeds the device range | ||
| 572 | |4084H|When the content of the device specified by (s) is an irregular number, a non-number and ±∞ | ||
| 573 | |||
| 574 | **Example** | ||
| 575 | |||
| 576 | (% style="text-align:center" %) | ||
| 577 | [[image:07-4 Basic instructions_html_7208ec767e3aef35.png]] | ||
| 578 | |||
| 579 | Calculate the tangent of 1.4 and the result is 5.797883 | ||
| 580 | |||
| 581 | (% style="text-align:center" %) | ||
| 582 | [[image:07-4 Basic instructions_html_6f34d46f6d977d51.png]] | ||
| 583 | |||
| 584 | == **DATANH/Single precision real number TANH operation** == | ||
| 585 | |||
| 586 | **DTANH(P)** | ||
| 587 | |||
| 588 | After calculating the DTANH (hyperbolic tangent) value of the angle specified in (s), the calculation result is stored in the device number specified in (d). | ||
| 589 | |||
| 590 | -[DTANH (s) (d)] | ||
| 591 | |||
| 592 | **Content, range and data type** | ||
| 593 | |||
| 594 | |**Parameter**|**Content**|**Range**|**Data type**|**Data type (label)** | ||
| 595 | |(s)|The angle data for DTANH (hyperbolic tangent) calculation or the device start number that stores the angle data|0, 2^^-126^^ ≤~|(s)~|< 2^^128^^|Single precision real number|ANYREAL_32 | ||
| 596 | |(d)|The start device number that stores operation result|-|Single precision real number|ANYREAL_32 | ||
| 597 | |||
| 598 | **Device used** | ||
| 599 | |||
| 600 | |(% rowspan="2" %)**Instruction**|(% rowspan="2" %)**Parameter**|(% colspan="8" %)**Devices**|((( | ||
| 601 | **Offset modification** | ||
| 602 | )))|((( | ||
| 603 | **Pulse extension** | ||
| 604 | ))) | ||
| 605 | |**T**|**C**|**D**|**R**|**SD**|**LC**|**HSC**|**E**|**[D]**|**XXP** | ||
| 606 | |(% rowspan="2" %)DTANH|Parameter 1|●|●|●|●|●|●|●|●|●|● | ||
| 607 | |Parameter 2|●|●|●|●|●|●|●| |●|● | ||
| 608 | |||
| 609 | **Features** | ||
| 610 | |||
| 611 | After calculating the DTANH (hyperbolic tangent) value of the angle specified in (s), the calculation result is stored in the device number specified in (d). | ||
| 612 | |||
| 613 | (% style="text-align:center" %) | ||
| 614 | [[image:07-4 Basic instructions_html_54dcaec8cd41ef8d.jpg||height="147" width="750"]] | ||
| 615 | |||
| 616 | The instruction is to take the TANH value of a binary floating point number. The calculation formula is tanh value=(e^^ s^^ -e^^ -s^^ )/(e^^ s^^ +e ^^-s ^^). | ||
| 617 | |||
| 618 | The related devices are shown below. | ||
| 619 | |||
| 620 | |(% rowspan="2" %)**Device**|(% rowspan="2" %)**Name**|(% colspan="2" %)**Content** | ||
| 621 | |**Condition**|**Operation** | ||
| 622 | |SM153|Zero|The operation result is zero|The zero flag (SM153) turns ON. | ||
| 623 | |SM152|Borrow|The absolute value of operation result <2^^ -126^^|The value of (d) becomes the minimum value of a 32-bit real number (2^^-126^^), and the borrow flag (SM152) turns on. | ||
| 624 | |||
| 625 | **Error code** | ||
| 626 | |||
| 627 | |**Error code**|**Content** | ||
| 628 | |4085H|The write address in (s) exceeds the device range | ||
| 629 | |4086H|The write address in (d) exceeds the device range | ||
| 630 | |4084H|When the content of the device specified by (s) is an irregular number, a non-number and ±∞ | ||
| 631 | |||
| 632 | **Example** | ||
| 633 | |||
| 634 | (% style="text-align:center" %) | ||
| 635 | [[image:07-4 Basic instructions_html_61112a0662b87075.png]] | ||
| 636 | |||
| 637 | Calculate the hyperbolic tangent of 2.5, and the result is 0.9866143 | ||
| 638 | |||
| 639 | (% style="text-align:center" %) | ||
| 640 | [[image:07-4 Basic instructions_html_cd730cfed534289c.png]] | ||
| 641 | |||
| 642 | == **DDEG/Single precision real number radian → angle conversion** == | ||
| 643 | |||
| 644 | **DDEG(P)** | ||
| 645 | |||
| 646 | Convert the size unit of the angle from the radian unit specified in (s) to the degree unit (DEG. unit), and store it in the device number specified in (d). | ||
| 647 | |||
| 648 | -[DDEG (s) (d)] | ||
| 649 | |||
| 650 | **Content, range and data type** | ||
| 651 | |||
| 652 | |**Parameter**|**Content**|**Range**|**Data type**|**Data type (label)** | ||
| 653 | |(s)|The radian angle that converts the degree unit or the device start number that stores the radian angle|0, 2^^ -126^^ ≤~|(s)~|< 2^^ 128^^|Single precision real number|ANYREAL_32 | ||
| 654 | |(d)|The device start number that stores the value converted in degrees|-π/2 to π/2|Single precision real number|ANYREAL_32 | ||
| 655 | |||
| 656 | **Device used** | ||
| 657 | |||
| 658 | |(% rowspan="2" %)**Instruction**|(% rowspan="2" %)**Parameter**|(% colspan="8" %)**Devices**|**Offset modification**|((( | ||
| 659 | **Pulse extension** | ||
| 660 | ))) | ||
| 661 | |**T**|**C**|**D**|**R**|**SD**|**LC**|**HSC**|**E**|**[D]**|**XXP** | ||
| 662 | |(% rowspan="2" %)DDEG|Parameter 1|●|●|●|●|●|●|●|●|●|● | ||
| 663 | |Parameter 2|●|●|●|●|●|●|●| |●|● | ||
| 664 | |||
| 665 | **Features** | ||
| 666 | |||
| 667 | The angle size unit is converted from the radian unit specified in (s) to the degree unit (DEG. unit), and then stored in the device number specified in (d). | ||
| 668 | |||
| 669 | (% style="text-align:center" %) | ||
| 670 | [[image:07-4 Basic instructions_html_5012a87396e561ec.jpg||height="147" width="750"]] | ||
| 671 | |||
| 672 | The conversion from degree unit to radian unit is performed as follows. | ||
| 673 | |||
| 674 | Radian unit = degree unit * 180/π | ||
| 675 | |||
| 676 | • The related devices are as follows. | ||
| 677 | |||
| 678 | |(% rowspan="2" %)**Devices**|(% rowspan="2" %)**Name**|(% colspan="2" style="text-align:center; vertical-align:middle" %)**Content** | ||
| 679 | |**Condition**|**Operation** | ||
| 680 | |SM153|Zero|((( | ||
| 681 | The operation result of is zero | ||
| 682 | |||
| 683 | (when the mantissa part is zero) | ||
| 684 | )))|The zero flag (SM153) turns ON. | ||
| 685 | |SM151|Carry|The absolute value of the operation result>2^^128^^|The value of (d) becomes the maximum value of 32-bit real numbers (2^^128^^ ), and the carry flag (SM151) turns on. | ||
| 686 | |||
| 687 | **Error code** | ||
| 688 | |||
| 689 | |**Error code**|**Content** | ||
| 690 | |4085H|The write address in (s) exceeds the device range | ||
| 691 | |4086H|The write address in (d) exceeds the device range | ||
| 692 | |4084H|When the content of the device specified by (s) is an irregular number, a non-number and ±∞ | ||
| 693 | |||
| 694 | **Example** | ||
| 695 | |||
| 696 | (% style="text-align:center" %) | ||
| 697 | [[image:07-4 Basic instructions_html_9e5201f683152a94.png]] | ||
| 698 | |||
| 699 | The result is 194.8057 | ||
| 700 | |||
| 701 | (% style="text-align:center" %) | ||
| 702 | [[image:07-4 Basic instructions_html_e89d1df11aad30e2.png]] | ||
| 703 | |||
| 704 | == **DRAD/Single precision real number conversion angle → radian conversion** == | ||
| 705 | |||
| 706 | **DRAD(P)** | ||
| 707 | |||
| 708 | The angle size unit is converted from the degree unit (DEG. unit) specified in (s) to the radian unit and stored in the device number specified in (d). | ||
| 709 | |||
| 710 | -[DRAD (s) (d)] | ||
| 711 | |||
| 712 | **Content, range and data type** | ||
| 713 | |||
| 714 | |**Parameter**|**Content**|**Range**|**Data type**|**Data type (label)** | ||
| 715 | |(s)|The radian angle that converts the degree unit or the device start number that stores the angle|0, 2^^-126^^ ≤~|(s)~|< 2^^128^^|Single precision real number|ANYREAL_32 | ||
| 716 | |(d)|The device start number that stores the value converted in degrees|-|Single precision real number|ANYREAL_32 | ||
| 717 | |||
| 718 | **Device used** | ||
| 719 | |||
| 720 | |(% rowspan="2" %)**Instruction**|(% rowspan="2" %)**Parameter**|(% colspan="8" %)**Devices**|((( | ||
| 721 | **Offset modification** | ||
| 722 | )))|((( | ||
| 723 | **Pulseextension** | ||
| 724 | ))) | ||
| 725 | |**T**|**C**|**D**|**R**|**SD**|**LC**|**HSC**|**E**|**[D]**|**XXP** | ||
| 726 | |(% rowspan="2" %)DRAD|Parameter 1|●|●|●|●|●|●|●|●|●|● | ||
| 727 | |Parameter 2|●|●|●|●|●|●|●| |●| | ||
| 728 | |||
| 729 | **Features** | ||
| 730 | |||
| 731 | The angle size unit is converted from the degree unit (DEG. unit) specified in (s) to the radian unit and stored in the device number specified in (d). | ||
| 732 | |||
| 733 | (% style="text-align:center" %) | ||
| 734 | [[image:07-4 Basic instructions_html_e4a7086b5e720f61.jpg||height="152" width="750"]] | ||
| 735 | |||
| 736 | Degree unit → radian unit | ||
| 737 | |||
| 738 | The conversion is performed as follows. | ||
| 739 | |||
| 740 | Radian unit = degree unit*π/180 | ||
| 741 | |||
| 742 | • The related devices are as follows. | ||
| 743 | |||
| 744 | |(% rowspan="2" %)**Devices**|(% rowspan="2" %)**Name**|(% colspan="2" %)**Content** | ||
| 745 | |**Condition**|**Operation** | ||
| 746 | |SM153|Zero|The operation result is zero|The zero flag (SM153) turns ON. | ||
| 747 | |SM152|Borrow|The absolute value of operation result <2^^-126^^|The value of (d) becomes the minimum value of a 32-bit real number (2^^-126^^), and the borrow flag (SM152) turns on. | ||
| 748 | |||
| 749 | **Error code** | ||
| 750 | |||
| 751 | |**Error code**|**Content** | ||
| 752 | |4085H|The write address in (s) exceeds the device range | ||
| 753 | |4086H|The write address in (d) exceeds the device range | ||
| 754 | |4084H|When the content of the device specified by (s) is an irregular number, a non-number and ±∞ | ||
| 755 | |||
| 756 | **Example** | ||
| 757 | |||
| 758 | (% style="text-align:center" %) | ||
| 759 | [[image:07-4 Basic instructions_html_4b275938dd16ef26.png]] | ||
| 760 | |||
| 761 | The result is 1.047197 | ||
| 762 | |||
| 763 | (% style="text-align:center" %) | ||
| 764 | [[image:07-4 Basic instructions_html_25fff8df04cad311.png]] | ||
| 765 | |||
| 766 | == **DEADD/Single precision real number addition operation** == | ||
| 767 | |||
| 768 | **DEADD(P)** | ||
| 769 | |||
| 770 | Add the binary floating point data specified in (s1) and the binary floating point data specified in (s2), and store the result in the device specified in (d). | ||
| 771 | |||
| 772 | -[DEADD (s1 ) (s2) (d)] | ||
| 773 | |||
| 774 | **Content, range and data type** | ||
| 775 | |||
| 776 | |**Parameter**|**Content**|**Range**|**Data type**|**Data type (label)** | ||
| 777 | |(s1)|The added data or the device start number that stores the added data|0, 2^^-126^^ ≤~|(s)~|< 2 ^^128^^|Single precision real number|ANYREAL_32 | ||
| 778 | |(s2)|Addition data or the device start number that stores the addition data|0, 2^^-126^^ ≤~|(s)~|< 2^^128^^|Single precision real number|ANYREAL_32 | ||
| 779 | |(d)|the device start number that stores the operation result|-|Single precision real number|ANYREAL_32 | ||
| 780 | |||
| 781 | **Device used** | ||
| 782 | |||
| 783 | |(% rowspan="2" %)**Instruction**|(% rowspan="2" %)**Parameter**|(% colspan="10" %)**Devices**|**Offset modification**|((( | ||
| 784 | **Pulse extension** | ||
| 785 | ))) | ||
| 786 | |**T**|**C**|**D**|**R**|**SD**|**LC**|**HSC**|**K**|**H**|**E**|**[D]**|**XXP** | ||
| 787 | |(% rowspan="3" %)DEADD|Parameter 1|●|●|●|●|●|●|●|●|●|●|●|● | ||
| 788 | |Parameter 2|●|●|●|●|●|●|●|●|●|●|●|● | ||
| 789 | |Parameter 3|●|●|●|●|●|●|●| | | |●|● | ||
| 790 | |||
| 791 | **Features** | ||
| 792 | |||
| 793 | Add the binary floating point data specified in (s1) and the binary floating point data specified in (s2), and store the result of the addition in the device specified in (d). | ||
| 794 | |||
| 795 | (% style="text-align:center" %) | ||
| 796 | [[image:07-4 Basic instructions_html_6f210e9a8aa28eba.jpg||height="93" width="750"]] | ||
| 797 | |||
| 798 | When constants (K, H) to (s1), (s2) are specified, the value is automatically converted to a binary floating point data. | ||
| 799 | |||
| 800 | (% style="text-align:center" %) | ||
| 801 | [[image:07-4 Basic instructions_html_1652c9e4d98e3010.png||height="109" width="750"]] | ||
| 802 | |||
| 803 | • The related devices are as follows. | ||
| 804 | |||
| 805 | |(% rowspan="2" %)**Devices**|(% rowspan="2" %)**Name**|(% colspan="2" style="text-align:center; vertical-align:middle" %)**Content** | ||
| 806 | |**Condition**|**Operation** | ||
| 807 | |SM153|Zero|The operation result is zero|The zero flag (SM153) turns ON. | ||
| 808 | |SM152|Borrow|The absolute value of operation result <2^^-126^^|The value of (d) becomes the minimum value of a 32-bit real number (2^^-126^^), and the borrow flag (SM152) turns on. | ||
| 809 | |SM151|Carry|The absolute value of operation result> 2^^128^^|The value of (d) becomes the maximum value of 32-bit real numbers (2^^128^^), and the carry flag (SM151) turns on. | ||
| 810 | |||
| 811 | **Error code** | ||
| 812 | |||
| 813 | |**Error code**|**Content** | ||
| 814 | |4085H|The write address in (s1) and (s2) exceed the device range | ||
| 815 | |4086H|The write address in (d) exceeds the device range | ||
| 816 | |4084H|When the content of the device specified by (s1) and (s2) is an irregular number, a non-number and ±∞ | ||
| 817 | |||
| 818 | **Example** | ||
| 819 | |||
| 820 | (% style="text-align:center" %) | ||
| 821 | [[image:07-4 Basic instructions_html_13ff1ac03d5ca563.png]] | ||
| 822 | |||
| 823 | The result is 1.2 + 63.2 = 64.4 | ||
| 824 | |||
| 825 | (% style="text-align:center" %) | ||
| 826 | [[image:07-4 Basic instructions_html_e3faf7d5bccf5e10.png]] | ||
| 827 | |||
| 828 | == **DESUB/Single precision real number subtraction operation** == | ||
| 829 | |||
| 830 | **DESUB(P)** | ||
| 831 | |||
| 832 | Subtract the binary floating point data specified in (s1) and the binary floating point data specified in (s2), and store the result in the device specified in (d). | ||
| 833 | |||
| 834 | -[DESUB (s1) (s2) (d)] | ||
| 835 | |||
| 836 | **Content, range and data type** | ||
| 837 | |||
| 838 | |**Parameter**|**Content**|**Range**|**Data type**|**Data type (label)** | ||
| 839 | |(s1)|The subtracted data or the device start number that stores the subtracted data|0, 2^^ -126^^ ≤~|(s)~|< 2 ^^128^^|Single precision real number|ANYREAL_32 | ||
| 840 | |(s2)|subtract data or the device start number that stores the subtracted data|0, 2^^ -126^^ ≤~|(s)~|< 2^^ 128^^|Single precision real number|ANYREAL_32 | ||
| 841 | |(d)|the device start number that stores the operation result|-|Single precision real number|ANYREAL_32 | ||
| 842 | |||
| 843 | **Device used** | ||
| 844 | |||
| 845 | |(% rowspan="2" %)**Instruction**|(% rowspan="2" %)**Parameter**|(% colspan="10" %)**Devices**|((( | ||
| 846 | **Offset modification** | ||
| 847 | )))|((( | ||
| 848 | **Pulse extension** | ||
| 849 | ))) | ||
| 850 | |**T**|**C**|**D**|**R**|**SD**|**LC**|**HSC**|**K**|**H**|**E**|**[D]**|**XXP** | ||
| 851 | |(% rowspan="3" %)DESUB|Parameter 1|●|●|●|●|●|●|●|●|●|●|●|● | ||
| 852 | |Parameter 2|●|●|●|●|●|●|●|●|●|●|●|● | ||
| 853 | |Parameter 3|●|●|●|●|●|●|●| | | |●|● | ||
| 854 | |||
| 855 | **Features** | ||
| 856 | |||
| 857 | • Subtract the binary floating point data specified in (s1) and the binary floating point data specified in (s2), and store the subtraction result in the device specified in (d). | ||
| 858 | |||
| 859 | (% style="text-align:center" %) | ||
| 860 | [[image:07-4 Basic instructions_html_577448d0279d0375.png||height="103" width="750"]] | ||
| 861 | |||
| 862 | When constants (K, H) to (s1), (s2) are specified, the value is automatically converted to a binary floating point data. | ||
| 863 | |||
| 864 | (% style="text-align:center" %) | ||
| 865 | [[image:07-4 Basic instructions_html_e4d629ef553ada07.png||height="102" width="750"]] | ||
| 866 | |||
| 867 | • The related devices are as follows. | ||
| 868 | |||
| 869 | |(% rowspan="2" %)**Devices**|(% rowspan="2" %)**Name**|(% colspan="2" style="text-align:center; vertical-align:middle" %)**Content** | ||
| 870 | |**Condition**|**Operation** | ||
| 871 | |SM153|Zero|The operation result is zero|The zero flag (SM153) turns ON. | ||
| 872 | |SM152|Borrow|The absolute value of operation result <2^^-126^^|The value of (d) becomes the minimum value of a 32-bit real number (2^^-126^^), and the borrow flag (SM152) turns on. | ||
| 873 | |SM151|Carry|The absolute value of operation result> 2^^128^^|The value of (d) becomes the maximum value of 32-bit real numbers (2^^128^^), and the carry flag (SM151) turns on. | ||
| 874 | |||
| 875 | **Error code** | ||
| 876 | |||
| 877 | |**Error code**|**Content** | ||
| 878 | |4085H|The write address in (s1) and (s2) exceeds the device range | ||
| 879 | |4086H|The write address in (d) exceeds the device range | ||
| 880 | |4084H|When the content of the device specified by (s1) and (s2) is an irregular number, a non-number and ±∞ | ||
| 881 | |||
| 882 | **Example** | ||
| 883 | |||
| 884 | (% style="text-align:center" %) | ||
| 885 | [[image:07-4 Basic instructions_html_871ed78f6fb9c4b7.png]] | ||
| 886 | |||
| 887 | The calculation result is 1.2-63.2 = -62 | ||
| 888 | |||
| 889 | (% style="text-align:center" %) | ||
| 890 | [[image:07-4 Basic instructions_html_f2798624e990436.png]] | ||
| 891 | |||
| 892 | == **DEMUL/Single precision real number multiplication operation** == | ||
| 893 | |||
| 894 | **DEMUL(P)** | ||
| 895 | |||
| 896 | Multiply the binary floating point data specified in (s1) and the binary floating point data specified in (s2), and store the result in the device specified in (d). | ||
| 897 | |||
| 898 | -[DEMUL (s1) (s2) (d)] | ||
| 899 | |||
| 900 | **Content, range and data type** | ||
| 901 | |||
| 902 | |**Parameter**|(% style="width:461px" %)**Content**|(% style="width:171px" %)**Range**|(% style="width:233px" %)**Data type**|**Data type (label)** | ||
| 903 | |(s1)|(% style="width:461px" %)((( | ||
| 904 | The multiplication data or the device start number that stores the multiplication data | ||
| 905 | )))|(% style="width:171px" %)0, 2^^-126^^ ≤~|(s)~|< 2^^128^^|(% style="width:233px" %)Single precision real number|ANYREAL_32 | ||
| 906 | |(s2)|(% style="width:461px" %)((( | ||
| 907 | Multiplication operation data or the device start number that stores the multiplication data | ||
| 908 | )))|(% style="width:171px" %)0, 2^^-126 ^^≤~|(s)~|< 2^^ 128^^|(% style="width:233px" %)Single precision real number|ANYREAL_32 | ||
| 909 | |(d)|(% style="width:461px" %)the device start number that stores the operation result|(% style="width:171px" %)-|(% style="width:233px" %)Single precision real number|ANYREAL_32 | ||
| 910 | |||
| 911 | **Device used** | ||
| 912 | |||
| 913 | |(% rowspan="2" %)**Instruction**|(% rowspan="2" %)**Parameter**|(% colspan="10" %)**Devices**|**Offset modification**|((( | ||
| 914 | **Pulse extension** | ||
| 915 | ))) | ||
| 916 | |**T**|**C**|**D**|**R**|**SD**|**LC**|**HSC**|**K**|**H**|**E**|**[D]**|**XXP** | ||
| 917 | |(% rowspan="3" %)DEMUL|Parameter 1|●|●|●|●|●|●|●|●|●|●|●|● | ||
| 918 | |Parameter 2|●|●|●|●|●|●|●|●|●|●|●|● | ||
| 919 | |Parameter 3|●|●|●|●|●|●|●| | | |●|● | ||
| 920 | |||
| 921 | **Features** | ||
| 922 | |||
| 923 | Multiply the binary floating point data specified in (s1) and the binary floating point data specified in (s2), and store the multiplication result in the device specified in (d). | ||
| 924 | |||
| 925 | (% style="text-align:center" %) | ||
| 926 | [[image:07-4 Basic instructions_html_c16d5df912044cb7.png||height="118" width="750"]] | ||
| 927 | |||
| 928 | When constants (K, H) to (s1), (s2) are specified, the value is automatically converted to a binary floating point data. | ||
| 929 | |||
| 930 | (% style="text-align:center" %) | ||
| 931 | [[image:07-4 Basic instructions_html_795de2922dee9c7c.png||height="128" width="750"]] | ||
| 932 | |||
| 933 | • The related devices are as follows. | ||
| 934 | |||
| 935 | |(% rowspan="2" %)**Devices**|(% rowspan="2" %)**Name**|(% colspan="2" %)**Content** | ||
| 936 | |**Condition**|**Operation** | ||
| 937 | |SM153|Zero|The operation result is zero|The zero flag (SM153) turns ON. | ||
| 938 | |SM152|Borrow|The absolute value of operation result <2^^-126^^|The value of (d) becomes the minimum value of a 32-bit real number (2^^-126^^), and the borrow flag (SM152) turns on. | ||
| 939 | |SM151|Carry|The absolute value of operation result> 2^^128^^|The value of (d) becomes the maximum value of 32-bit real numbers (2^^128^^), and the carry flag (SM151) turns on. | ||
| 940 | |||
| 941 | **Error code** | ||
| 942 | |||
| 943 | |**Error code**|**Content** | ||
| 944 | |4085H|The write address in (s1) and (s2) exceeds the device range | ||
| 945 | |4086H|The write address in (d) exceeds the device range | ||
| 946 | |4084H|When the content of the device specified by (s1) and (s2) is an irregular number, a non-number and ±∞ | ||
| 947 | |||
| 948 | **Example** | ||
| 949 | |||
| 950 | (% style="text-align:center" %) | ||
| 951 | [[image:07-4 Basic instructions_html_db96563c17c8f345.png]] | ||
| 952 | |||
| 953 | The calculated result: 1.2*63.2 = 75.84 | ||
| 954 | |||
| 955 | (% style="text-align:center" %) | ||
| 956 | [[image:07-4 Basic instructions_html_56aeca4f8877052d.png]] | ||
| 957 | |||
| 958 | == **DEDIV/Single precision real number division operation** == | ||
| 959 | |||
| 960 | **DEDIV(P)** | ||
| 961 | |||
| 962 | Divide the binary floating point data specified in (s1) and the binary floating point data specified in (s2), and store the result in the device specified in (d). | ||
| 963 | |||
| 964 | -[DEDIV (s1) (s2) (d)] | ||
| 965 | |||
| 966 | **Content, range and data type** | ||
| 967 | |||
| 968 | |**Parameter**|**Content**|**Range**|**Data type**|**Data type (label)** | ||
| 969 | |(s1)|The divided data or the device start number that stores the devided data|0, 2^^ -126^^ ≤~|(s)~|< 2^^ 128^^|Single precision real number|ANYREAL_32 | ||
| 970 | |(s2)|Division operation data or the device start number that stores the division operation data|0, 2^^ -126 ^^≤~|(s)~|< 2^^ 128^^|Single precision real number|ANYREAL_32 | ||
| 971 | |(d)|the device start number that stores the operation result|-|Single precision real number|ANYREAL_32 | ||
| 972 | |||
| 973 | **Device used** | ||
| 974 | |||
| 975 | |(% rowspan="2" %)**Instruction**|(% rowspan="2" %)**Parameter**|(% colspan="10" %)**Devices**|**Offset modification**|((( | ||
| 976 | **Pulse extension** | ||
| 977 | ))) | ||
| 978 | |**T**|**C**|**D**|**R**|**SD**|**LC**|**HSC**|**K**|**H**|**E**|**[D]**|**XXP** | ||
| 979 | |(% rowspan="3" %)DEDIV|Parameter 1|●|●|●|●|●|●|●|●|●|●|●|● | ||
| 980 | |Parameter 2|●|●|●|●|●|●|●|●|●|●|●|● | ||
| 981 | |Parameter 3|●|●|●|●|●|●|●| | | |●|● | ||
| 982 | |||
| 983 | **Features** | ||
| 984 | |||
| 985 | Divide the binary floating point data specified in (s1) and the binary floating point data specified in (s2), and store the result of the division in the device specified in (d). | ||
| 986 | |||
| 987 | (% style="text-align:center" %) | ||
| 988 | [[image:07-4 Basic instructions_html_fda4e3ca7850365d.png||height="126" width="750"]] | ||
| 989 | |||
| 990 | When constants (K, H) to (s1), (s2) are specified, the value is automatically converted to a binary floating point data. | ||
| 991 | |||
| 992 | (% style="text-align:center" %) | ||
| 993 | [[image:07-4 Basic instructions_html_a8fe2dd5c84983cd.png||height="127" width="750"]] | ||
| 994 | |||
| 995 | • The related devices are as follows. | ||
| 996 | |||
| 997 | |(% rowspan="2" %)**Devices**|(% rowspan="2" %)**Name**|(% colspan="2" %)**Content** | ||
| 998 | |**Condition**|**Operating** | ||
| 999 | |SM153|Zero|The operation result is zero|The zero flag (SM153) turns ON. | ||
| 1000 | |SM152|Borrow|The absolute value of operation result <2^^-126^^|The value of (d) becomes the minimum value of a 32-bit real number (2^^-126^^), and the borrow flag (SM152) turns on. | ||
| 1001 | |SM151|Carry|The absolute value of operation result> 2^^128^^|The value of (d) becomes the maximum value of 32-bit real numbers (2^^128^^), and the carry flag (SM151) turns on. | ||
| 1002 | |||
| 1003 | **Error code** | ||
| 1004 | |||
| 1005 | |**Error code**|**Content** | ||
| 1006 | |4085H|The write address in (s1) and (s2) exceeds the device range | ||
| 1007 | |4086H|The write address in (d) exceeds the device range | ||
| 1008 | |4084H|When the content of the device specified by (s1) and (s2) is an irregular number, a non-number and ±∞ | ||
| 1009 | |4080H|(s2) value is 0 | ||
| 1010 | |||
| 1011 | **Example** | ||
| 1012 | |||
| 1013 | (% style="text-align:center" %) | ||
| 1014 | [[image:07-4 Basic instructions_html_831bbc3074039899.png]] | ||
| 1015 | |||
| 1016 | Get the calculation result: 63.2 / 1.2 = 52.66666667 | ||
| 1017 | |||
| 1018 | (% style="text-align:center" %) | ||
| 1019 | [[image:07-4 Basic instructions_html_9b034a1885d38a16.png]] | ||
| 1020 | |||
| 1021 | == **DEMOD/Single precision real number remainder operation** == | ||
| 1022 | |||
| 1023 | **DEMOD(P)** | ||
| 1024 | |||
| 1025 | Perform division operation on the single-precision real number specified in (s1) and the single-precision real number specified in (s2), and store the remainder operation result in the device specified in (d). | ||
| 1026 | PLC Editor2 version that supports this instruction: 2.3.1 and above | ||
| 1027 | |||
| 1028 | -[DEMOD (s1) (s2) (d)] | ||
| 1029 | |||
| 1030 | **Content, range and data type** | ||
| 1031 | |||
| 1032 | |**Parameter**|**Content**|**Range**|**Data type**|**Data type (label)** | ||
| 1033 | |(s1)|The divided data or the device start number that stores the devided data|0, 2^^ -126^^ ≤~|(s)~|< 2^^ 128^^|Single precision real number|ANYREAL_32 | ||
| 1034 | |(s2)|Remainder operation data or the device start number that stores the remainder operation data|0, 2^^ -126 ^^≤~|(s)~|< 2^^ 128^^|Single precision real number|ANYREAL_32 | ||
| 1035 | |(d)|The start number of the device that stores the result of the remainder operation|-|Single precision real number|ANYREAL_32 | ||
| 1036 | |||
| 1037 | **Device used** | ||
| 1038 | |||
| 1039 | |(% rowspan="2" %)**Instruction**|(% rowspan="2" %)**Parameter**|(% colspan="24" %)**Devices**|**Offset modification**|((( | ||
| 1040 | **Pulse** | ||
| 1041 | |||
| 1042 | **extension** | ||
| 1043 | ))) | ||
| 1044 | |**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** | ||
| 1045 | |(% rowspan="3" %)DEMOD|Parameter 1| | | | | | | | | | | | | | | | |●|●| |●| | | |●| |● | ||
| 1046 | |Parameter 2| | | | | | | | | | | | | | | | |●|●| |●| | | |●| |● | ||
| 1047 | |Parameter 3| | | | | | | | | | | | | | | | |●|●| |●| | | | | |● | ||
| 1048 | |||
| 1049 | **Features** | ||
| 1050 | |||
| 1051 | Perform division operation on the single-precision real number specified in (s1) and the single-precision real number specified in (s2), and store the remainder operation result in the device specified in (d). | ||
| 1052 | |||
| 1053 | (% style="text-align:center" %) | ||
| 1054 | [[image:图片20.png]] | ||
| 1055 | |||
| 1056 | **Error code** | ||
| 1057 | |||
| 1058 | |**Error code**|**Content** | ||
| 1059 | |4080H|The input divisor in (s2) is 0 | ||
| 1060 | |4081H|Computational data overflow in (d) | ||
| 1061 | |4084H|When the content of the device specified by (s1) and (s2) is an irregular number, a non-number and ±∞ | ||
| 1062 | |4085H|The write address in (s1) and (s2) exceeds the device range | ||
| 1063 | |4086H|The write address in (d) exceeds the device range | ||
| 1064 | |||
| 1065 | **Example** | ||
| 1066 | |||
| 1067 | (% style="text-align:center" %) | ||
| 1068 | [[image:图片21.png]] | ||
| 1069 | |||
| 1070 | M21 is set to ON, resulting in the calculation: 10 % 3 = 1.000000E+00 | ||
| 1071 | |||
| 1072 | == **DEMOV/Single precision real data transmission** == | ||
| 1073 | |||
| 1074 | **DEMOV(P)** | ||
| 1075 | |||
| 1076 | Transfer the binary floating point data data stored in the device specified in (s) to the device specified in (d). | ||
| 1077 | |||
| 1078 | -[DEMOV (s) (d)] | ||
| 1079 | |||
| 1080 | **Content, range and data type** | ||
| 1081 | |||
| 1082 | |**Parameter**|**Content**|**Range**|**Data type**|**Data type (label)** | ||
| 1083 | |(s)|The transmitted data or the device that stores the transmitted data|0, 2^^ -126^^ ≤~|(s)~|< 2^^ 128^^|Single precision real number|ANYREAL_32 | ||
| 1084 | |(d)|The device number that stores the transmit destination data|-|Single precision real number|ANYREAL_32 | ||
| 1085 | |||
| 1086 | **Device used** | ||
| 1087 | |||
| 1088 | |(% rowspan="2" %)**Instruction**|(% rowspan="2" %)**Parameter**|(% colspan="8" %)**Devices**|((( | ||
| 1089 | **Offset modification** | ||
| 1090 | )))|((( | ||
| 1091 | **Pulse extension** | ||
| 1092 | ))) | ||
| 1093 | |**T**|**C**|**D**|**R**|**SD**|**LC**|**HSC**|**E**|**[D]**|**XXP** | ||
| 1094 | |(% rowspan="2" %)DEMOV|Parameter 1|●|●|●|●|●|●|●|●|●|● | ||
| 1095 | |Parameter 2|●|●|●|●|●|●|●| |●|● | ||
| 1096 | |||
| 1097 | **Features** | ||
| 1098 | |||
| 1099 | Transfer the binary floating point data data stored in the device specified in (s) to the device specified in (d). | ||
| 1100 | |||
| 1101 | (% style="text-align:center" %) | ||
| 1102 | [[image:07-4 Basic instructions_html_6de5db97105df5e4.png||height="177" width="750"]] | ||
| 1103 | |||
| 1104 | **Error code** | ||
| 1105 | |||
| 1106 | |**Error code**|**Content** | ||
| 1107 | |4085H|(s) read address exceeds the device range | ||
| 1108 | |4086H|(d) write address exceeds the device range | ||
| 1109 | |||
| 1110 | **Example** | ||
| 1111 | |||
| 1112 | (% style="text-align:center" %) | ||
| 1113 | [[image:07-4 Basic instructions_html_599a89027182c054.png]] | ||
| 1114 | |||
| 1115 | Assign 3.265 to R10 | ||
| 1116 | |||
| 1117 | (% style="text-align:center" %) | ||
| 1118 | [[image:07-4 Basic instructions_html_6d4e836a40c7c638.png]] | ||
| 1119 | |||
| 1120 | == **DEBCD/Binary floating point → decimal floating point conversion** == | ||
| 1121 | |||
| 1122 | **DEBCD(P)** | ||
| 1123 | |||
| 1124 | After converting the binary floating point specified in (s) into a decimal floating point, it is stored in the device specified in (d). | ||
| 1125 | |||
| 1126 | -[DEBCD (s) (d)] | ||
| 1127 | |||
| 1128 | **Content, range and data type** | ||
| 1129 | |||
| 1130 | |**Parameter**|**Content**|**Range**|**Data type**|**Data type (label)** | ||
| 1131 | |(s)|The device number that stores the binary floating point data|0, 2^^ -126^^ ≤~|(s)~|< 2^^ 128^^|Single precision real number|ANYREAL_32 | ||
| 1132 | |(d)|The device number that stores the converted decimal floating point data|-|Real number|ANY32 | ||
| 1133 | |||
| 1134 | **Device used** | ||
| 1135 | |||
| 1136 | |(% rowspan="2" %)**Instruction**|(% rowspan="2" %)**Parameter**|(% colspan="8" %)**Devices**|**Offset modification**|((( | ||
| 1137 | **Pulse extension** | ||
| 1138 | ))) | ||
| 1139 | |**T**|**C**|**D**|**R**|**SD**|**LC**|**HSC**|**E**|**[D]**|**XXP** | ||
| 1140 | |(% rowspan="2" %)DEBCD|Parameter 1|●|●|●|●|●|●|●|●|●|● | ||
| 1141 | |Parameter 2|●|●|●|●|●|●|●| |●|● | ||
| 1142 | |||
| 1143 | **Features** | ||
| 1144 | |||
| 1145 | After converting the binary floating point specified in (s) into a decimal floating point, it is stored in the device specified in (d). | ||
| 1146 | |||
| 1147 | (% style="text-align:center" %) | ||
| 1148 | [[image:07-4 Basic instructions_html_85083a492d193f3e.png||height="363" width="750"]] | ||
| 1149 | |||
| 1150 | (% class="box infomessage" %) | ||
| 1151 | ((( | ||
| 1152 | ✎**Note**: All floating-point operations are performed in binary floating-point. However, the binary floating point is a difficult-to-understand value (special monitoring method), so by converting it into a decimal floating point operation, it is convenient for peripheral equipment to monitor and so on. | ||
| 1153 | ))) | ||
| 1154 | |||
| 1155 | **Error code** | ||
| 1156 | |||
| 1157 | |**Error code**|**Content** | ||
| 1158 | |4085H|The write address in (s) exceeds the device range | ||
| 1159 | |4086H|The write address in (d) exceeds the device range | ||
| 1160 | |4084H|When the content of the device specified by (s) is an irregular number, a non-number and ±∞ | ||
| 1161 | |||
| 1162 | **Example** | ||
| 1163 | |||
| 1164 | (% style="text-align:center" %) | ||
| 1165 | [[image:07-4 Basic instructions_html_53ab848a0a88b9f5.png]] | ||
| 1166 | |||
| 1167 | Get the result: 5600 ×10 -5 | ||
| 1168 | |||
| 1169 | (% style="text-align:center" %) | ||
| 1170 | [[image:07-4 Basic instructions_html_9e583145721b18e6.png]] | ||
| 1171 | |||
| 1172 | == **DEBIN/Decimal floating point → binary floating point conversion** == | ||
| 1173 | |||
| 1174 | **DEBIN(P)** | ||
| 1175 | |||
| 1176 | Convert the decimal floating point specified in (s) to binary floating point and store it in the device specified in (d). | ||
| 1177 | |||
| 1178 | -[DEBIN (s) (d)] | ||
| 1179 | |||
| 1180 | **Content, range and data type** | ||
| 1181 | |||
| 1182 | |**Parameter**|**Content**|**Range**|**Data type**|**Data type (label)** | ||
| 1183 | |(s)|The device number that stores the decimal floating point data|-|Real|ANY32 | ||
| 1184 | |(d)|The device number that stores the converted binary floating point data|-|Single precision real number|ANYREAL_32 | ||
| 1185 | |||
| 1186 | **Device used** | ||
| 1187 | |||
| 1188 | |(% rowspan="2" %)**Instruction**|(% rowspan="2" %)**Parameter**|(% colspan="7" %)**Devices**|**Offset modification**|((( | ||
| 1189 | **Pulse extension** | ||
| 1190 | ))) | ||
| 1191 | |**T**|**C**|**D**|**R**|**SD**|**LC**|**HSC**|**[D]**|**XXP** | ||
| 1192 | |(% rowspan="2" %)DEBIN|Parameter 1|●|●|●|●|●|●|●|●|● | ||
| 1193 | |Parameter 2|●|●|●|●|●|●|●|●|● | ||
| 1194 | |||
| 1195 | **Features** | ||
| 1196 | |||
| 1197 | Convert the decimal floating point specified in (s) to binary floating point and store it in the device specified in (d). | ||
| 1198 | |||
| 1199 | (% style="text-align:center" %) | ||
| 1200 | [[image:07-4 Basic instructions_html_8e73df2965105337.png||height="355" width="750"]] | ||
| 1201 | |||
| 1202 | • The related devices are as follows. | ||
| 1203 | |||
| 1204 | |(% rowspan="2" %)**Devices**|(% rowspan="2" %)**Name**|(% colspan="2" %)**Content** | ||
| 1205 | |**Condition**|**Operation** | ||
| 1206 | |SM153|Zero|The operation result is zero|The zero flag (SM153) turns ON. | ||
| 1207 | |SM152|Borrow|The absolute value of operation result <2^^-126^^|The value of (d) becomes the minimum value of a 32-bit real number (2^^-126^^), and the borrow flag (SM152) turns on. | ||
| 1208 | |SM151|Carry|The absolute value of operation result> 2^^128^^|The value of (d) becomes the maximum value of 32-bit real numbers (2^^128^^), and the carry flag (SM151) turns on. | ||
| 1209 | |||
| 1210 | **Error code** | ||
| 1211 | |||
| 1212 | |**Error code**|**Content** | ||
| 1213 | |4085H|(s) read address exceeds the device range | ||
| 1214 | |4086H|(d) write address exceeds the device range | ||
| 1215 | |||
| 1216 | **Example** | ||
| 1217 | |||
| 1218 | (% style="text-align:center" %) | ||
| 1219 | [[image:07-4 Basic instructions_html_3234b8e203f3f4ea.png]] | ||
| 1220 | |||
| 1221 | The result after conversion: | ||
| 1222 | |||
| 1223 | (% style="text-align:center" %) | ||
| 1224 | [[image:07-4 Basic instructions_html_e90f11a2faf5172d.png]] | ||
| 1225 | |||
| 1226 | == **DENEG/Single precision real number sign inversion** == | ||
| 1227 | |||
| 1228 | **DENEG(P)** | ||
| 1229 | |||
| 1230 | After inverting the sign of the single precision real number of the device specified in (d), it is stored in the device specified in (d). | ||
| 1231 | |||
| 1232 | -[DEBEG (d)] | ||
| 1233 | |||
| 1234 | **Content, range and data type** | ||
| 1235 | |||
| 1236 | |**Parameter**|**Content**|**Range**|**Data type**|**Data type (label)** | ||
| 1237 | |(d)|The device start number that stores the sign-inverted binary floating point data|-|Single precision real number|ANYREAL_32 | ||
| 1238 | |||
| 1239 | **Device used** | ||
| 1240 | |||
| 1241 | |(% rowspan="2" %)**Instruction**|(% rowspan="2" %)**Parameter**|(% colspan="7" %)**Devices**|((( | ||
| 1242 | **Offset modification** | ||
| 1243 | )))|((( | ||
| 1244 | **Pulse extension** | ||
| 1245 | ))) | ||
| 1246 | |**T**|**C**|**D**|**R**|**SD**|**LC**|**HSC**|**[D]**|**XXP** | ||
| 1247 | |DENEG|Parameter 1|●|●|●|●|●|●|●|●|● | ||
| 1248 | |||
| 1249 | **Features** | ||
| 1250 | |||
| 1251 | The sign of the binary floating point data of the device specified in (d) is inverted and stored in the device specified in (d). | ||
| 1252 | |||
| 1253 | (% style="text-align:center" %) | ||
| 1254 | [[image:07-4 Basic instructions_html_a112a6581e1c30f3.png||height="153" width="750"]] | ||
| 1255 | |||
| 1256 | Used when inverting positive and negative signs. | ||
| 1257 | |||
| 1258 | **Error code** | ||
| 1259 | |||
| 1260 | |**Error code**|**Content** | ||
| 1261 | |4086H|The write address in (d) exceeds the device range | ||
| 1262 | |||
| 1263 | **Example** | ||
| 1264 | |||
| 1265 | (% style="text-align:center" %) | ||
| 1266 | [[image:07-4 Basic instructions_html_6a8429d00293f3fb.png]] | ||
| 1267 | |||
| 1268 | It becomes -1.43 after conversion | ||
| 1269 | |||
| 1270 | (% style="text-align:center" %) | ||
| 1271 | [[image:07-4 Basic instructions_html_d73e2eb81f0f6455.png]] | ||
| 1272 | |||
| 1273 | == **DECMP/Single precision real number comparison** == | ||
| 1274 | |||
| 1275 | **DECMP(P)** | ||
| 1276 | |||
| 1277 | Compare two data (binary floating point data), and output their large, small, and consistent results to the bit device (3 points). | ||
| 1278 | |||
| 1279 | -[DECMP (s1) (s2) (d)] | ||
| 1280 | |||
| 1281 | **Content, range and data type** | ||
| 1282 | |||
| 1283 | |**Parameter**|**Content**|**Range**|**Data type**|**Data type (label)** | ||
| 1284 | |(s1)|Comparison data or the device number that stores the comparison data|0, 2^^ -126 ^^≤~|(s)~|< 2 ^^128^^|Single precision real number|ANYREAL_32 | ||
| 1285 | |(s2)|Comparison data or the device number that stores the comparison data|0, 2^^ -126 ^^≤~|(s)~|< 2^^ 128^^|Single precision real number|ANYREAL_32 | ||
| 1286 | |(d)|The start bit device number that outputs the comparison result (occupies 3 points)|-|Bit|ANYBIT_ARRAY | ||
| 1287 | |||
| 1288 | **Device used** | ||
| 1289 | |||
| 1290 | |(% rowspan="2" %)**Instruction**|(% rowspan="2" %)**Parameter**|(% colspan="15" %)**Devices**|((( | ||
| 1291 | **Offset modification** | ||
| 1292 | )))|((( | ||
| 1293 | **Pulse extension** | ||
| 1294 | ))) | ||
| 1295 | |**Y**|**M**|**S**|**SM**|**D.b**|**T**|**C**|**D**|**R**|**SD**|**LC**|**HSC**|**K**|**H**|**E**|**[D]**|**XXP** | ||
| 1296 | |(% rowspan="3" %)DECMP|Parameter 1| | | | | |●|●|●|●|●|●|●|●|●|●|●|● | ||
| 1297 | |Parameter 2| | | | | |●|●|●|●|●|●|●|●|●|●|●|● | ||
| 1298 | |Parameter 3|●|●|●|●|●| | | | | | | | | | |●|● | ||
| 1299 | |||
| 1300 | **Features** | ||
| 1301 | |||
| 1302 | Compare the comparison value (s1) and the comparison source (s2) as a floating point comparison. According to the result of small, consistent, and large, one of (d), (d)+1, (d)+2 turns ON. | ||
| 1303 | |||
| 1304 | (% style="text-align:center" %) | ||
| 1305 | [[image:07-4 Basic instructions_html_b61bf734c719a219.png||height="525" width="750"]] | ||
| 1306 | |||
| 1307 | (1): Even if the command input is turned OFF and the DECMP command is not executed, (d) to (d)+2 will keep the state before X0 is turned OFF. | ||
| 1308 | |||
| 1309 | When the constant (K, H) to the device specified in (s1), (s2) is specified, the value BIN→binary floating point data conversion is processed automatically | ||
| 1310 | |||
| 1311 | ✎**Note: **The device specified in (d) occupies 3 points [(d), (d)+1, (d)+2]. Please be careful not to overlap with devices used for other purposes. | ||
| 1312 | |||
| 1313 | **Error code** | ||
| 1314 | |||
| 1315 | |**Error code**|**Content** | ||
| 1316 | |4085H|The write address in (s1) or (s2) exceeds the device range | ||
| 1317 | |4086H|The write address in (d) exceeds the device range | ||
| 1318 | |4084H|When the content of the device specified by (s) or (s2) is an irregular number, a non-number and ±∞ | ||
| 1319 | |||
| 1320 | **Example** | ||
| 1321 | |||
| 1322 | (% style="text-align:center" %) | ||
| 1323 | [[image:07-4 Basic instructions_html_a21356a1f3833783.png]] | ||
| 1324 | |||
| 1325 | Since the floating point number in R30 is greater than the floating point number in D30, M12 turns ON. | ||
| 1326 | |||
| 1327 | (% style="text-align:center" %) | ||
| 1328 | [[image:07-4 Basic instructions_html_dfe39a7a2289219f.png]] | ||
| 1329 | |||
| 1330 | == **DEZCP/Binary floating point bandwidth comparison** == | ||
| 1331 | |||
| 1332 | **DEZCP(P)** | ||
| 1333 | |||
| 1334 | Compare the comparison range and data (binary floating point) of high and low 2 points, and output the result of its large, small, and bandwidth to the bit device (3 points). | ||
| 1335 | |||
| 1336 | -[DEZCP (s1) (s2) (s3) (d)] | ||
| 1337 | |||
| 1338 | **Content, range and data type** | ||
| 1339 | |||
| 1340 | |**Parameter**|**Content**|**Range**|**Data type**|**Data type (label)** | ||
| 1341 | |(s1)|Comparison data or the device number that stores the comparison data|0, 2^^ -126 ^^≤~|(s)~|< 2 ^^128^^|Single precision real number|ANYREAL_32 | ||
| 1342 | |(s2)|Comparison data or the device number that stores the comparison data|0, 2^^ -126 ^^≤~|(s)~|< 2 ^^128^^|Single precision real number|ANYREAL_32 | ||
| 1343 | |(s3)|Comparison data or the device number that stores the comparison data|0, 2^^ -126 ^^≤~|(s)~|< 2 ^^128^^|Single precision real number|ANYREAL_32 | ||
| 1344 | |(d)|The start bit device number that outputs the comparison result (occupies 3 points)|-|Bit|ANYBIT_ARRAY | ||
| 1345 | |||
| 1346 | **Device used** | ||
| 1347 | |||
| 1348 | |(% rowspan="2" %)**Instruction**|(% rowspan="2" %)**Parameter**|(% colspan="15" %)**Devices**|((( | ||
| 1349 | **Offset modification** | ||
| 1350 | )))|((( | ||
| 1351 | **Pulse extension** | ||
| 1352 | ))) | ||
| 1353 | |**Y**|**M**|**S**|**SM**|**D.b**|**T**|**C**|**D**|**R**|**SD**|**LC**|**HSC**|**K**|**H**|**E**|**[D]**|**XXP** | ||
| 1354 | |(% rowspan="4" %)DEZCP|Parameter 1| | | | | |●|●|●|●|●|●|●|●|●|●|●|● | ||
| 1355 | |Parameter 2| | | | | |●|●|●|●|●|●|●|●|●|●|●|● | ||
| 1356 | |Parameter 3| | | | | |●|●|●|●|●|●|●|●|●|●|●|● | ||
| 1357 | |Parameter 4|●|●|●|●|●| | | | | | | | | | |●|● | ||
| 1358 | |||
| 1359 | **Features** | ||
| 1360 | |||
| 1361 | Compare the comparison value (s1), (s2) and the comparison source (s3) as a floating point comparison, according to its small, range, and large result, one of (d), (d)+1, (d)+2 The bit turns ON. | ||
| 1362 | |||
| 1363 | (% style="text-align:center" %) | ||
| 1364 | [[image:07-4 Basic instructions_html_fbddd25097272877.png]] | ||
| 1365 | |||
| 1366 | (1): Even if the instruction input is turned OFF and DEZCP instruction is not executed, (d) to (d)+2 will keep the state before X0 is turned OFF. | ||
| 1367 | |||
| 1368 | When the constant (K, H) to the device specified in (s1), (s2), (s3) is specified, the value is automatically converted from BIN to binary floating point for processing. | ||
| 1369 | |||
| 1370 | (% class="box infomessage" %) | ||
| 1371 | ((( | ||
| 1372 | ✎**Note: **The device specified in (d) occupies 3 points [(d), (d)+1, (d)+2]. Please be careful not to overlap with devices used for other purposes. | ||
| 1373 | ))) | ||
| 1374 | |||
| 1375 | Please set the size relationship of the comparison data as [(s1)+1,(s1)]≤[(s2)+1,(s2)]. In the case of [(s1)+1,(s1)]>[(s2)+1,(s2)], it is regarded as the value of [(s2)+1,(s2)] and [(s1)+1, (s1)] Same for comparison. | ||
| 1376 | |||
| 1377 | **Error code** | ||
| 1378 | |||
| 1379 | |**Error code**|**Content** | ||
| 1380 | |4085H|The write address in (s1),(s2) and (s3) exceeds the device range | ||
| 1381 | |4086H|The write address in (d) exceeds the device range | ||
| 1382 | |4084H|When the content of the device specified by (s1), (s2) and (s3) is an irregular number, a non-number and ±∞ | ||
| 1383 | |||
| 1384 | **Example** | ||
| 1385 | |||
| 1386 | (% style="text-align:center" %) | ||
| 1387 | [[image:07-4 Basic instructions_html_3729c4d994f143e6.png]] | ||
| 1388 | |||
| 1389 | Since 2.45 is greater than 1.456 and 2.45 is less than 2356, M41 is set to ON | ||
| 1390 | |||
| 1391 | (% style="text-align:center" %) | ||
| 1392 | [[image:07-4 Basic instructions_html_ccf3482ec6075388.png]] | ||
| 1393 | |||
| 1394 | == **DESQR/Single precision real square root** == | ||
| 1395 | |||
| 1396 | **DESQR(P)** | ||
| 1397 | |||
| 1398 | After the square root of the value specified in (s) is calculated, the calculation result is stored in the device specified in (d). | ||
| 1399 | |||
| 1400 | -[DESQR (s) (d)] | ||
| 1401 | |||
| 1402 | **Content, range and data type** | ||
| 1403 | |||
| 1404 | |**Parameter**|**Content**|**Range**|**Data type**|**Data type (label)** | ||
| 1405 | |(s)|The data for square root operation or the device start number that stores the data|0, 2^^ -126^^ ≤~|(s)~|< 2^^ 128^^|Single precision real number|ANYREAL_32 | ||
| 1406 | |(d)|The device start number stores operation result|-|Single precision real number|ANYREAL_32 | ||
| 1407 | |||
| 1408 | **Device used** | ||
| 1409 | |||
| 1410 | |(% rowspan="2" %)**Instruction**|(% rowspan="2" %)**Parameter**|(% colspan="10" %)**Devices**|**Offset modification**|((( | ||
| 1411 | **Pulse extension** | ||
| 1412 | ))) | ||
| 1413 | |**T**|**C**|**D**|**R**|**SD**|**LC**|**HSC**|**K**|**H**|**E**|**[D]**|**XXP** | ||
| 1414 | |(% rowspan="2" %)DESQR|Parameter 1|●|●|●|●|●|●|●|●|●|●|●|● | ||
| 1415 | |Parameter 2|●|●|●|●|●|●|●| | | |●|● | ||
| 1416 | |||
| 1417 | **Features** | ||
| 1418 | |||
| 1419 | • After the square root of the value specified in (s) is calculated, the calculation result is stored in the device number specified in (d). | ||
| 1420 | |||
| 1421 | (% style="text-align:center" %) | ||
| 1422 | [[image:07-4 Basic instructions_html_199ef6dbe154d991.png||height="152" width="750"]] | ||
| 1423 | |||
| 1424 | The value specified in (s) can only be set to a positive number. (Cannot perform operations with negative numbers.) | ||
| 1425 | |||
| 1426 | • The related devices are as follows. | ||
| 1427 | |||
| 1428 | |(% rowspan="2" %)**Devices**|(% rowspan="2" %)**Name**|(% colspan="2" style="text-align:center; vertical-align:middle" %)**Content** | ||
| 1429 | |**Condition**|**Operation** | ||
| 1430 | |SM153|Zero|The operation result is zero|The zero flag (SM153) turns ON. | ||
| 1431 | |||
| 1432 | **Error code** | ||
| 1433 | |||
| 1434 | |**Error code**|**Content** | ||
| 1435 | |4085H|The write address in (s) exceeds the device range | ||
| 1436 | |4086H|The write address in (d) exceeds the device range | ||
| 1437 | |4084H|When the content of the device specified by (s) is an irregular number, a non-number and ±∞ | ||
| 1438 | |||
| 1439 | **Example** | ||
| 1440 | |||
| 1441 | (% style="text-align:center" %) | ||
| 1442 | [[image:07-4 Basic instructions_html_a6ea534f6d60ad68.png]] | ||
| 1443 | |||
| 1444 | Get the result: D0 is a floating point number 2 | ||
| 1445 | |||
| 1446 | (% style="text-align:center" %) | ||
| 1447 | [[image:07-4 Basic instructions_html_8e2e25a646ff38ee.png]] | ||
| 1448 | |||
| 1449 | == **DESTR/Single precision real number → string conversion** == | ||
| 1450 | |||
| 1451 | **DESTR(P)** | ||
| 1452 | |||
| 1453 | Convert the binary floating point data data stored in the device specified in (s1) into a character string according to the display specification stored after the device number specified in (s2), and store it in the device number specified in (d) or later . | ||
| 1454 | |||
| 1455 | -[DESTR (s1) (s2) (d)] | ||
| 1456 | |||
| 1457 | **Content, range and data type** | ||
| 1458 | |||
| 1459 | |**Parameter**|(% style="width:812px" %)**Content**|(% style="width:168px" %)**Range**|**Data type**|**Data type (label)** | ||
| 1460 | |(s1)|(% style="width:812px" %)Converted single precision real number data or the device start number that stores the data|(% style="width:168px" %)0, 2^^ -126^^ ≤~|(s)~|< 2^^ 128^^|Single precision real number|ANYREAL_32 | ||
| 1461 | |(s2)|(% style="width:812px" %)Display the specified device start number that stores the converted value. The device specified in (s1) is used as the start, and (s2)+2 is used|(% style="width:168px" %)-|Signed BIN 16 bit|ANY16_ARRAY (number of elements: 3) | ||
| 1462 | |(d)|(% style="width:812px" %)Start number of the device storing the converted character string|(% style="width:168px" %)-|String|ANYSTRING_SINGLE | ||
| 1463 | |||
| 1464 | **Device used** | ||
| 1465 | |||
| 1466 | |(% rowspan="2" %)**Instruction**|(% rowspan="2" %)**Parameter**|(% colspan="12" %)**Devices**|**Offset modification**|((( | ||
| 1467 | **Pulse extension** | ||
| 1468 | ))) | ||
| 1469 | |**KnX**|**KnY**|**KnM**|**KnS**|**T**|**C**|**D**|**R**|**SD**|**LC**|**HSC**|**E**|**[D]**|**XXP** | ||
| 1470 | |(% rowspan="3" %)DESTR|Parameter 1| | | | |●|●|●|●|●|●|●|●|●|● | ||
| 1471 | |Parameter 2|●|●|●|●|●|●|●|●|●| | | |●|● | ||
| 1472 | |Parameter 3| |●|●|●|●|●|●|●|●| | | |●|● | ||
| 1473 | |||
| 1474 | **Features** | ||
| 1475 | |||
| 1476 | Convert the binary floating point data data stored in the device specified in (s1) into a character string according to the display specification stored after the device number specified in (s2), and store it in the device number specified in (d) after. You can also directly specify the real number to (s1). | ||
| 1477 | |||
| 1478 | • The converted data differs according to the display specification specified in (s2). | ||
| 1479 | |||
| 1480 | |**Unit**|**Features** | ||
| 1481 | |(s2)|0: Decimal point form 1: Exponential form | ||
| 1482 | |(s2)+1|All digits (total number of strings). Range: 2 to 24 | ||
| 1483 | |(s2)+2|The number of decimal digits. Range: 0 to 7 | ||
| 1484 | |||
| 1485 | The range in the above table will change the value range according to the conversion form and other information used | ||
| 1486 | |||
| 1487 | **Decimal form** | ||
| 1488 | |||
| 1489 | If 0 is specified in (s2), it will be in decimal form. | ||
| 1490 | |||
| 1491 | (% style="text-align:center" %) | ||
| 1492 | [[image:07-4 Basic instructions_html_eec337c1fd763035.png||height="337" width="800"]] | ||
| 1493 | |||
| 1494 | Corresponding digit range in decimal form: | ||
| 1495 | |||
| 1496 | |**Unit**|**Features** | ||
| 1497 | |(s2)|0: Decimal point form | ||
| 1498 | |(s2)+1|((( | ||
| 1499 | All digits (total number of strings). Range: 2 to 24. | ||
| 1500 | |||
| 1501 | When (s2)+2 is not 0: digits ≥ (number of decimal places + 3). | ||
| 1502 | ))) | ||
| 1503 | |(s2)+2|((( | ||
| 1504 | The number of decimal places. Range 0 to 7, | ||
| 1505 | |||
| 1506 | When (s2)+2 is not 0: digits ≥ (number of decimal places + 3). | ||
| 1507 | ))) | ||
| 1508 | |||
| 1509 | 1.Example: The total number of digits is 8, the number of decimal places is 3, and when -1.235 is specified, (d) will be stored in the following way. | ||
| 1510 | |||
| 1511 | When displaying character strings, display character strings in normal order from left to right for convenience. | ||
| 1512 | |||
| 1513 | (% style="text-align:center" %) | ||
| 1514 | [[image:07-4 Basic instructions_html_d6292112645e01e7.png]] | ||
| 1515 | |||
| 1516 | Converted string | ||
| 1517 | |||
| 1518 | (% style="text-align:center" %) | ||
| 1519 | [[image:07-4 Basic instructions_html_1ebeeaa49e685680.png]] | ||
| 1520 | |||
| 1521 | The corresponding ASCII code is: | ||
| 1522 | |||
| 1523 | (% style="text-align:center" %) | ||
| 1524 | [[image:07-4 Basic instructions_html_27188727e8fa4a8f.png]] | ||
| 1525 | |||
| 1526 | The first one is the sign bit. In the sign, when binary floating point data data is positive, 20H (blank) is stored, and when it is negative, 2DH(-) is stored. | ||
| 1527 | |||
| 1528 | If the actual number of digits is less than all digits during conversion, 20H (blank) will be added between the sign and the first number | ||
| 1529 | |||
| 1530 | If the decimal part of the binary floating point data data cannot be accommodated in the decimal part, the lower decimal part will be rounded off. | ||
| 1531 | |||
| 1532 | 2. Example: The total number of digits is 8, the number of decimal places is 2, and when -1.234 is specified, (d) will be stored in the following way. | ||
| 1533 | |||
| 1534 | (% style="text-align:center" %) | ||
| 1535 | [[image:07-4 Basic instructions_html_10eed9ffc391ff3d.png]] | ||
| 1536 | |||
| 1537 | The converted string: | ||
| 1538 | |||
| 1539 | (% style="text-align:center" %) | ||
| 1540 | [[image:07-4 Basic instructions_html_bf81afaca4c4c5dc.png]] | ||
| 1541 | |||
| 1542 | The corresponding ASCII code is: | ||
| 1543 | |||
| 1544 | (% style="text-align:center" %) | ||
| 1545 | [[image:07-4 Basic instructions_html_bc5a73de6522911b.png]] | ||
| 1546 | |||
| 1547 | In the above example: the low byte of D20 stores the negative sign 2DH(-). Then due to insufficient number of digits, the high byte of D20 and D21 are both 20H (blank). Finally, D22 to D23 store numeric characters 1.23 | ||
| 1548 | |||
| 1549 | **Exponential form** | ||
| 1550 | |||
| 1551 | When 1 is specified in (s2), it will be in exponential format. | ||
| 1552 | |||
| 1553 | (% style="text-align:center" %) | ||
| 1554 | [[image:07-4 Basic instructions_html_31b0c7486dcc6024.png||height="404" width="800"]] | ||
| 1555 | |||
| 1556 | The corresponding digit range in exponential form: | ||
| 1557 | |||
| 1558 | |**Unit**|**Features** | ||
| 1559 | |(s2)|1: Exponential form | ||
| 1560 | |(s2)+1|((( | ||
| 1561 | All digits (total number of strings). Range: 2 to 24. | ||
| 1562 | |||
| 1563 | (s2)+2 when non-zero: digits ≥ (number of decimal places + 7) | ||
| 1564 | ))) | ||
| 1565 | |(s2)+2|((( | ||
| 1566 | The number of decimal places. Range 0 to 7 | ||
| 1567 | |||
| 1568 | (s2)+2 when non-zero: digits ≥ (number of decimal places + 7) | ||
| 1569 | ))) | ||
| 1570 | |||
| 1571 | For example 3, all digits are 12, decimal place is 4, and 1234.5 is specified, (d) and later will be stored as follows. | ||
| 1572 | |||
| 1573 | (% style="text-align:center" %) | ||
| 1574 | [[image:07-4 Basic instructions_html_ddedd381e8273970.png]] | ||
| 1575 | |||
| 1576 | The converted string: | ||
| 1577 | |||
| 1578 | (% style="text-align:center" %) | ||
| 1579 | [[image:07-4 Basic instructions_html_2f46cec9d7f1efd6.png]] | ||
| 1580 | |||
| 1581 | The corresponding ASCII code is: | ||
| 1582 | |||
| 1583 | (% style="text-align:center" %) | ||
| 1584 | [[image:07-4 Basic instructions_html_75170a2a138983ff.png]] | ||
| 1585 | |||
| 1586 | In the sign of the integer part, when the binary floating point data data is positive, 20H (blank) is stored, and when it is negative, 2DH(-) is stored. | ||
| 1587 | |||
| 1588 | The integer part is fixed to 1 digit. 20H (blank) is stored between the integer part and the Sign. | ||
| 1589 | |||
| 1590 | If the decimal part of the binary floating point data data cannot be accommodated in the decimal part, the lower decimal part will be rounded off. | ||
| 1591 | |||
| 1592 | When the number of decimal places is set to other than 0, 2EH(.) is automatically stored in the number of specified decimal places+1 digit. When the decimal place is 0, 2EH(.) is not stored. | ||
| 1593 | |||
| 1594 | In the sign of the exponent, 2BH(+) is stored when the exponent is positive, and 2DH(-) is stored when it is negative. | ||
| 1595 | |||
| 1596 | The exponent is fixed to 2 digits. When the exponent part is a 1-digit number, 30H(0) is stored between the signs of the exponent part. | ||
| 1597 | |||
| 1598 | 00H is automatically stored at the end of the converted character string. | ||
| 1599 | |||
| 1600 | Example 4: All digits are 12, decimal places are 3, and -16346 is specified, (d) will be stored in the following way. | ||
| 1601 | |||
| 1602 | (% style="text-align:center" %) | ||
| 1603 | [[image:07-4 Basic instructions_html_6900aa794eddecff.png]] | ||
| 1604 | |||
| 1605 | The converted string: | ||
| 1606 | |||
| 1607 | (% style="text-align:center" %) | ||
| 1608 | [[image:07-4 Basic instructions_html_87654ae43d8a218b.png]] | ||
| 1609 | |||
| 1610 | The corresponding ASCII code is: | ||
| 1611 | |||
| 1612 | (% style="text-align:center" %) | ||
| 1613 | [[image:07-4 Basic instructions_html_cfd5b14b7db95402.png]] | ||
| 1614 | |||
| 1615 | As in the above example: | ||
| 1616 | |||
| 1617 | The low byte of D20 stores the negative sign 2DH(-). | ||
| 1618 | |||
| 1619 | Then due to insufficient number of digits, the high byte of D20 and the low bit of D21 are both 20H (blank). | ||
| 1620 | |||
| 1621 | 16346 becomes the string 1.635E+04, in which the last digit "6" of 16346 is rounded. | ||
| 1622 | |||
| 1623 | The exponent part is 34H(4) with only one bit, then add 30H(0) between the Signs 2DH(-) and 34H(4). | ||
| 1624 | |||
| 1625 | Finally D26 automatically stores 00H | ||
| 1626 | |||
| 1627 | Example 5: All digits are 12, and the number of decimal places is 0. If -16346 is specified, (d) will be stored as follows. | ||
| 1628 | |||
| 1629 | (% style="text-align:center" %) | ||
| 1630 | [[image:07-4 Basic instructions_html_453cd40ab652178d.png]] | ||
| 1631 | |||
| 1632 | The converted string: | ||
| 1633 | |||
| 1634 | [[image:07-4 Basic instructions_html_3344930f873d6b2f.png]] | ||
| 1635 | |||
| 1636 | The corresponding ASCII code is: | ||
| 1637 | |||
| 1638 | [[image:07-4 Basic instructions_html_d5db6ff342c45f05.png]] | ||
| 1639 | |||
| 1640 | This example mainly shows that if the decimal place is set to 0, the decimal point 2EH(.) will be automatically omitted. | ||
| 1641 | |||
| 1642 | (% class="box infomessage" %) | ||
| 1643 | ((( | ||
| 1644 | ✎**Note: **When the binary floating point data is converted, the more digits, the lower the accuracy of the digits, the worse the accuracy of the digits, and the conversion value may be inaccurate due to the progress. | ||
| 1645 | ))) | ||
| 1646 | |||
| 1647 | **Error code** | ||
| 1648 | |||
| 1649 | |**Error code**|**Content** | ||
| 1650 | |4085H|The read address of (s1) and (s2) exceeds the device range | ||
| 1651 | |4086H|The write address of (d) exceeds the device range | ||
| 1652 | |(% rowspan="6" %)4084H|When the content of the specified device (s1) and (s2) is an irregular number, a non-number, or ±∞ | ||
| 1653 | |When the format specified in (s2) is other than 0 or 1 | ||
| 1654 | |When all the digits specified in (s1) +1 exceeds the value of 24 | ||
| 1655 | |When the number of decimal places specified in (s2) +2 exceeds the range of 0 to 7 | ||
| 1656 | |In the decimal form, when (s2) is 0.((( | ||
| 1657 | 1. When the number of decimal places is 0: [(s2)+1]<2 | ||
| 1658 | 1. When the number of decimal places is other than 0: [(s2)+1]<(number of decimal places+3) | ||
| 1659 | ))) | ||
| 1660 | |In the exponential form, when (s2) is 0.((( | ||
| 1661 | 1. When the number of decimal places is 0: [(s2)+1]<6 | ||
| 1662 | 1. When the number of decimal places is other than 0: [(s2)+1]<(number of decimal places+7) | ||
| 1663 | ))) | ||
| 1664 | |||
| 1665 | == **DEVAL/String → single precision real number conversion** == | ||
| 1666 | |||
| 1667 | **DEVAL(P)** | ||
| 1668 | |||
| 1669 | The character string stored in the device number specified in (s) and later is converted to a binary floating point data, and then stored in the device specified in (d). | ||
| 1670 | |||
| 1671 | -[DEVAL (s) (d)] | ||
| 1672 | |||
| 1673 | **Content, range and data type** | ||
| 1674 | |||
| 1675 | |**Parameter**|**Content**|**Range**|**Data type**|**Data type (label)** | ||
| 1676 | |(s)|String data for single precision real number or the device start number that stores the string data|-|String|ANYSTRING_SINGLE | ||
| 1677 | |(d)|The device start number that stores the converted single precision real number|-|Single precision real number|ANYREAL_32 | ||
| 1678 | |||
| 1679 | **Device used** | ||
| 1680 | |||
| 1681 | |(% rowspan="2" %)**Instruction**|(% rowspan="2" %)**Parameter**|(% colspan="11" %)**Devices**|((( | ||
| 1682 | **Offset modification** | ||
| 1683 | )))|((( | ||
| 1684 | **Pulse extension** | ||
| 1685 | ))) | ||
| 1686 | |**KnX**|**KnY**|**KnM**|**KnS**|**T**|**C**|**D**|**R**|**SD**|**LC**|**HSC**|**[D]**|**XXP** | ||
| 1687 | |(% rowspan="2" %)DEVAL|Parameter 1|●|●|●|●|●|●|●|●|●| | |●|● | ||
| 1688 | |Parameter 2| | | | |●|●|●|●|●|●|●|●|● | ||
| 1689 | |||
| 1690 | **Features** | ||
| 1691 | |||
| 1692 | The character string stored in the device number specified in (s) and later is converted to a binary floating point data, and then stored in the device specified in (d). | ||
| 1693 | |||
| 1694 | Whether the specified string is in decimal form or exponential form, it can be converted to a binary floating point data. | ||
| 1695 | |||
| 1696 | Up to 24 characters can be set for the string. 20H (blank) and 30H (0) in the character string are also counted as 1 character. | ||
| 1697 | |||
| 1698 | (% style="text-align:center" %) | ||
| 1699 | [[image:07-4 Basic instructions_html_ee9b9b728e80a991.png||height="233" width="750"]] | ||
| 1700 | |||
| 1701 | **Decimal form** | ||
| 1702 | |||
| 1703 | When the character string specified in (s) is in decimal format, the following is the case. | ||
| 1704 | |||
| 1705 | ((( | ||
| 1706 | [[(1): single-precision real number>>image:image-20220809141843-1.jpeg]] | ||
| 1707 | ))) | ||
| 1708 | |||
| 1709 | In the character string specified in (s), for the character string to be converted to a binary floating point data, the 6 digits after the sign, decimal point, and exponent are valid, and the 7th digit and later will be discarded during conversion. | ||
| 1710 | |||
| 1711 | When the sign is specified as 2BH(+) or omitted in the decimal point format, it will be converted as a positive value. In addition, when the sign is specified as 2DH(-), it will be converted as a negative value. | ||
| 1712 | |||
| 1713 | ((( | ||
| 1714 | (% style="float:left" %) | ||
| 1715 | [[ (1): discarded | ||
| 1716 | (2): single-precision real number>>image:image-20220809142011-2.jpeg]] | ||
| 1717 | ))) | ||
| 1718 | |||
| 1719 | If there are 20H (blank) or 30H (0) in the character string specified in (s) other than the first 0, 20H and 30H will be ignored during conversion. | ||
| 1720 | |||
| 1721 | ((( | ||
| 1722 | [[(1): ignore | ||
| 1723 | |||
| 1724 | (2): single-precision real number>>image:image-20220809142123-3.jpeg]] | ||
| 1725 | ))) | ||
| 1726 | |||
| 1727 | **In the case of exponential form** | ||
| 1728 | |||
| 1729 | When the character string specified in (s) is in exponential form, it is executed as follows. | ||
| 1730 | |||
| 1731 | ((( | ||
| 1732 | [[(1): single-precision real number>>image:image-20220809142145-4.jpeg]] | ||
| 1733 | ))) | ||
| 1734 | |||
| 1735 | Among the character strings specified in (s), for the character string to be converted to a binary floating point data, the 6 digits after the sign, decimal point, and exponent are valid, and the 7th digit and later will be discarded during conversion. | ||
| 1736 | |||
| 1737 | If the sign of the exponent part is specified as 2BH(+) or omitted in the exponential form, it will be converted as a positive value. When the sign of the exponent is specified as 2DH(-), it will be converted as a negative value. | ||
| 1738 | |||
| 1739 | [[(1): discarded | ||
| 1740 | |||
| 1741 | (2): single-precision real number>>image:image-20220809142213-5.jpeg]] | ||
| 1742 | |||
| 1743 | If there is 20H (blank) or 30H (0) in the character string specified in (s) other than the first 0, 20H and 30H will be ignored during conversion. | ||
| 1744 | |||
| 1745 | In the exponential character string, if 30H (0) is stored between "E" and the value, 30H will be ignored during conversion. | ||
| 1746 | |||
| 1747 | ((( | ||
| 1748 | [[(1): Ignore. | ||
| 1749 | |||
| 1750 | (2): Single precision real number.>>image:image-20220809142256-6.jpeg]] | ||
| 1751 | ))) | ||
| 1752 | |||
| 1753 | The related devices are shown below. | ||
| 1754 | |||
| 1755 | |(% rowspan="2" %)**Devices**|(% rowspan="2" style="width:73px" %)**Name**|(% colspan="2" style="width:932px" %)**Content** | ||
| 1756 | |(% style="width:313px" %)**Condition**|(% style="width:619px" %)**Operating** | ||
| 1757 | |SM153|(% style="width:73px" %)Zero|(% style="width:313px" %)The operation result is zero|(% style="width:619px" %)The zero flag (SM153) turns ON. | ||
| 1758 | |SM152|(% style="width:73px" %)Borrow|(% style="width:313px" %)The absolute value of operation result <2^^-126^^|(% style="width:619px" %)The value of (d) becomes the minimum value of a 32-bit real number (2^^-126 ^^), and the borrow flag (SM152) turns on. | ||
| 1759 | |SM151|(% style="width:73px" %)Carry|(% style="width:313px" %)The absolute value of operation result> 2^^128^^|(% style="width:619px" %)The value of (d) becomes the maximum value of 32-bit real numbers (2^^128 ^^), and the carry flag (SM151) turns on. | ||
| 1760 | |||
| 1761 | **Error code** | ||
| 1762 | |||
| 1763 | |=(% scope="row" style="width: 134px;" %)**Error code**|=(% style="width: 941px;" %)**Content** | ||
| 1764 | |(% style="width:134px" %)4085H|(% style="width:941px" %)The read address of (s) exceeds the device range | ||
| 1765 | |(% style="width:134px" %)4086H|(% style="width:941px" %)The write address of (d) exceeds the device range | ||
| 1766 | |(% style="width:134px" %)408AH|(% style="width:941px" %)The string is not read by (s), or the string length exceeds 24 | ||
| 1767 | |(% style="width:134px" %)408BH|(% style="width:941px" %)When (s) reading a character string, the maximum range of the device is read, but 00H is not found and the end | ||
| 1768 | |(% rowspan="4" style="width:134px" %)4084H|(% style="width:941px" %)When there are characters other than 2BH (+), 2DH (-), 20H (space), 2EH (.), 45H (E), 65H(e), and 30 H(0) to 39H (9) in the string specified in (s) | ||
| 1769 | |(% style="width:941px" %)When there are two or more 2EH(.) characters in the character string specified in (s). | ||
| 1770 | |(% style="width:941px" %)When there are characters other than 45H(E), 2BH(+), 2DH(-), and 30 H(0) to 39H (9) in the exponent part specified in (s), or if there are multiple exponent parts, or exponent In some cases, 2BH(+) or 2DH(-) occurred twice or more. | ||
| 1771 | |(% style="width:941px" %)2BH(+) or 2DH(-) appears twice or more before the first digit of the string specified in (s). | ||
| 1772 | |||
| 1773 | **Example** | ||
| 1774 | |||
| 1775 | (% style="text-align:center" %) | ||
| 1776 | [[image:07-4 Basic instructions_html_67654da85337468b.png]] | ||
| 1777 | |||
| 1778 | (% style="text-align:center" %) | ||
| 1779 | [[image:07-4 Basic instructions_html_9f6bd5ea12b465b5.png]] | ||
| 1780 | |||
| 1781 | The stored character string of D0 is: 5.2467E+12 | ||
| 1782 | |||
| 1783 | The resulting floating point number is: 5.2467E+12 | ||
| 1784 | |||
| 1785 | (% style="text-align:center" %) | ||
| 1786 | [[image:07-4 Basic instructions_html_92978ecb5351fc41.png]] | ||
| 1787 | |||
| 1788 | == **DEXP/Single precision real number exponential operation** == | ||
| 1789 | |||
| 1790 | **DEXP(P)** | ||
| 1791 | |||
| 1792 | After performing the exponential calculation of the value specified in (s), the calculation result is stored in the device specified in (d). | ||
| 1793 | |||
| 1794 | -[DEXP (s) (d)] | ||
| 1795 | |||
| 1796 | **Content, range and data type** | ||
| 1797 | |||
| 1798 | |**Parameter**|**Content**|**Range**|**Data type**|**Data type (label)** | ||
| 1799 | |(s)|Data for exponential calculation or the device start number that stores the data|0, 2^^ -126^^ ≤~|(s)~|< 2^^ 128^^|Single precision real number|ANYREAL_32 | ||
| 1800 | |(d)|The device start number that stores the operation result|-|Single precision real number|ANYREAL_32 | ||
| 1801 | |||
| 1802 | **Device used** | ||
| 1803 | |||
| 1804 | |(% rowspan="2" %)**Instruction**|(% rowspan="2" %)**Parameter**|(% colspan="8" %)**Devices**|((( | ||
| 1805 | **Offset modification** | ||
| 1806 | )))|((( | ||
| 1807 | **Pulse extension** | ||
| 1808 | ))) | ||
| 1809 | |**T**|**C**|**D**|**R**|**SD**|**LC**|**HSC**|**E**|**[D]**|**XXP** | ||
| 1810 | |(% rowspan="2" %)DEXP|Parameter 1|●|●|●|●|●|●|●|●|●|● | ||
| 1811 | |Parameter 2|●|●|●|●|●|●|●| |●|● | ||
| 1812 | |||
| 1813 | **Features** | ||
| 1814 | |||
| 1815 | After performing the exponential calculation of the value specified in (s), the calculation result is stored in the device number specified in (d). | ||
| 1816 | |||
| 1817 | (% style="text-align:center" %) | ||
| 1818 | [[image:07-4 Basic instructions_html_58374bdfdc737cf2.png||height="147" width="750"]] | ||
| 1819 | |||
| 1820 | In exponential calculation, the base (e) is calculated as "2.71828". | ||
| 1821 | |||
| 1822 | The related devices are shown below. | ||
| 1823 | |||
| 1824 | |(% rowspan="2" %)**Devices**|(% rowspan="2" %)**Name**|(% colspan="2" %)**Content** | ||
| 1825 | |**Condition**|**Operating** | ||
| 1826 | |SM153|Zero|The operation result is zero|The zero flag (SM153) turns ON. | ||
| 1827 | |SM152|Borrow|The absolute value of operation result <2^^-126^^|The value of (d) becomes the minimum value of a 32-bit real number (2^^-126 ^^), and the borrow flag (SM152) turns on. | ||
| 1828 | |SM151|Carry|The absolute value of operation result> 2^^128^^|The value of (d) becomes the maximum value of 32-bit real numbers (2^^128 ^^), and the carry flag (SM151) turns on. | ||
| 1829 | |||
| 1830 | **Error code** | ||
| 1831 | |||
| 1832 | |**Error code**|**Content** | ||
| 1833 | |4085H|The write address in (s) exceeds the device range | ||
| 1834 | |4086H|The write address in (d) exceeds the device range | ||
| 1835 | |4084H|When the content of the device specified by (s) is an irregular number, a non-number and ±∞ | ||
| 1836 | |||
| 1837 | **Example** | ||
| 1838 | |||
| 1839 | (% style="text-align:center" %) | ||
| 1840 | [[image:07-4 Basic instructions_html_e61fb5cffd43b8f1.png]] | ||
| 1841 | |||
| 1842 | Calculate the result: | ||
| 1843 | |||
| 1844 | (% style="text-align:center" %) | ||
| 1845 | [[image:07-4 Basic instructions_html_95cc618375e8bd2c.png]] | ||
| 1846 | |||
| 1847 | == **INT/Single precision real number → signed BIN 16-bit data** == | ||
| 1848 | |||
| 1849 | **INT(P)** | ||
| 1850 | |||
| 1851 | Convert the specified single precision real number into signed BIN 16-bit data. | ||
| 1852 | |||
| 1853 | -[INT (s) (d)] | ||
| 1854 | |||
| 1855 | **Content, range and data type** | ||
| 1856 | |||
| 1857 | |**Parameter**|**Content**|**Range**|**Data type**|**Data type (label)** | ||
| 1858 | |(s)|Single precision real number or the start device storing single precision real number|-32768 to 32767|Single precision real number|ANYREAL_32 | ||
| 1859 | |(d)|Signed device for storing BIN data|-|BIN16 bit|ANY16_S | ||
| 1860 | |||
| 1861 | **Device used** | ||
| 1862 | |||
| 1863 | |(% rowspan="2" %)**Instruction**|(% rowspan="2" %)**Parameter**|(% colspan="7" %)**Devices**|((( | ||
| 1864 | **Offset modification** | ||
| 1865 | )))|((( | ||
| 1866 | **Pulse extension** | ||
| 1867 | ))) | ||
| 1868 | |**T**|**C**|**D**|**R**|**SD**|**LC**|**HSC**|**[D]**|**XXP** | ||
| 1869 | |(% rowspan="2" %)INT|Parameter 1|●|●|●|●|●|●|●|●|● | ||
| 1870 | |Parameter 2|●|●|●|●|●| | |●|● | ||
| 1871 | |||
| 1872 | **Features** | ||
| 1873 | |||
| 1874 | • Convert the single precision real number specified in (s) into signed BIN 16-bit data and store it in the device specified in (d). | ||
| 1875 | |||
| 1876 | • The converted data will be rounded to the first digit below the decimal point of the single precision real number specified in (s). | ||
| 1877 | |||
| 1878 | • When setting the input value with the engineering tool, rounding errors may occur. | ||
| 1879 | |||
| 1880 | • The related devices are as follows. | ||
| 1881 | |||
| 1882 | |(% rowspan="2" %)**Devices**|(% rowspan="2" %)**Name**|(% colspan="2" %)**Content** | ||
| 1883 | |**Condition**|**Operation** | ||
| 1884 | |SM153|Zero|The operation result is zero|The zero flag (SM153) turns ON. | ||
| 1885 | |SM152|Borrow|Decimal places are rounded off when converting|During conversion ((s) – (d))> (2^^ -126^^) ,borrow (SM152) turns ON | ||
| 1886 | |SM151|Carry|Conversion result is out of range|The value of (s) is out of the range -32768 to 32767 or the value of (s) is less than the minimum value of 32-bit real numbers (2^^ -126^^), and the carry flag (SM151) turns on. | ||
| 1887 | |||
| 1888 | **Error code** | ||
| 1889 | |||
| 1890 | |**Error code**|**Content** | ||
| 1891 | |4085H|The write address in (s) exceeds the device range | ||
| 1892 | |4086H|The write address in (d) exceeds the device range | ||
| 1893 | |4084H|When the content of the device specified by (s) is an irregular number, a non-number and ±∞ | ||
| 1894 | |||
| 1895 | (% style="text-align:center" %) | ||
| 1896 | [[image:07-4 Basic instructions_html_255459f5a8458ad1.png]] | ||
| 1897 | |||
| 1898 | Get the conversion result: | ||
| 1899 | |||
| 1900 | (% style="text-align:center" %) | ||
| 1901 | [[image:07-4 Basic instructions_html_729ac34e99a75efa.png]] | ||
| 1902 | |||
| 1903 | And the borrow means turn ON | ||
| 1904 | |||
| 1905 | (% style="text-align:center" %) | ||
| 1906 | [[image:07-4 Basic instructions_html_b7aea1e260bf313a.png]] | ||
| 1907 | |||
| 1908 | == **DINT/Single precision real number→ signed BIN 32-bit data** == | ||
| 1909 | |||
| 1910 | **DINT(P)** | ||
| 1911 | |||
| 1912 | Convert the specified single precision real number into signed BIN 32-bit data. | ||
| 1913 | |||
| 1914 | -[DINT (s) (d)] | ||
| 1915 | |||
| 1916 | **Content, range and data type** | ||
| 1917 | |||
| 1918 | |**Parameter**|**Content**|**Range**|**Data type**|**Data type (label)** | ||
| 1919 | |(s)|Single precision real number or the start device storing single precision real number|-2147483648 to 2147483647|Single precision real number|ANYREAL_32 | ||
| 1920 | |(d)|The start device storing BIN data|-|Signed BIN 32 bit|ANY32_S | ||
| 1921 | |||
| 1922 | **Device used** | ||
| 1923 | |||
| 1924 | |(% rowspan="2" %)**Instruction**|(% rowspan="2" %)**Parameter**|(% colspan="7" %)**Devices**|**Offset modification**|((( | ||
| 1925 | **Pulse extension** | ||
| 1926 | ))) | ||
| 1927 | |**T**|**C**|**D**|**R**|**SD**|**LC**|**HSC**|**[D]**|**XXP** | ||
| 1928 | |(% rowspan="2" %)DINT|Parameter 1|●|●|●|●|●|●|●|●|● | ||
| 1929 | |Parameter 2|●|●|●|●|●|●|●|●|● | ||
| 1930 | |||
| 1931 | **Features** | ||
| 1932 | |||
| 1933 | • Convert the binary floating point data specified in (s) into signed BIN 32-bit data and store it in the device specified in (d). | ||
| 1934 | |||
| 1935 | • The converted data will be rounded to the first digit below the decimal point of the binary floating point data specified in (s). | ||
| 1936 | |||
| 1937 | • When setting the input value with the engineering tool, rounding errors may occur. | ||
| 1938 | |||
| 1939 | • The related devices are as follows. | ||
| 1940 | |||
| 1941 | |(% rowspan="2" %)**Devices**|(% rowspan="2" %)**Name**|(% colspan="2" %)**Content** | ||
| 1942 | |**Condition**|**Operating** | ||
| 1943 | |SM153|Zero|The operation result is zero|The zero flag (SM153) turns ON. | ||
| 1944 | |SM152|Borrow|The absolute value of operation result <2^^-126^^|The value of (d) becomes the minimum value of a 32-bit real number (2^^-126 ^^), and the borrow flag (SM152) turns on. | ||
| 1945 | |SM151|Carry|The absolute value of operation result> 2^^128^^|The value of (d) becomes the maximum value of 32-bit real numbers (2^^128 ^^), and the carry flag (SM151) turns on. | ||
| 1946 | |||
| 1947 | **Error code** | ||
| 1948 | |||
| 1949 | |**Error code**|**Content** | ||
| 1950 | |4085H|The write address in (s) exceeds the device range | ||
| 1951 | |4086H|The write address in (d) exceeds the device range | ||
| 1952 | |4084H|When the content of the device specified by (s) is an irregular number, a non-number and ±∞ | ||
| 1953 | |||
| 1954 | **Example** | ||
| 1955 | |||
| 1956 | (% style="text-align:center" %) | ||
| 1957 | [[image:07-4 Basic instructions_html_1e627018c3993f6e.png]] | ||
| 1958 | |||
| 1959 | Get the conversion result: | ||
| 1960 | |||
| 1961 | (% style="text-align:center" %) | ||
| 1962 | [[image:07-4 Basic instructions_html_3c9ad8a9e15c92e0.png]] | ||
| 1963 | |||
| 1964 | And the borrow means turn ON | ||
| 1965 | |||
| 1966 | (% style="text-align:center" %) | ||
| 1967 | [[image:07-4 Basic instructions_html_b7aea1e260bf313a.png]] | ||
| 1968 | |||
| 1969 | == **DLOG10/Single precision real number common logarithmic operation** == | ||
| 1970 | |||
| 1971 | **DLOG10(P)** | ||
| 1972 | |||
| 1973 | Calculate the common logarithm (base 10 logarithm) of the value specified in (s), and store the result of the operation in the device specified in (d). | ||
| 1974 | |||
| 1975 | -[DLOG10 (s) (d)] | ||
| 1976 | |||
| 1977 | **Content, range and data type** | ||
| 1978 | |||
| 1979 | |**Parameter**|**Content**|**Range**|**Data type**|**Data type (label)** | ||
| 1980 | |(s)|Data for common logarithmic operations or the device start number storing the data|0, 2^^-126^^ ≤~|(s)~|< 2^^128^^|Single precision real number|ANYREAL_32 | ||
| 1981 | |(d)|The device start number storing operation result|-|Single precision real number|ANYREAL_32 | ||
| 1982 | |||
| 1983 | **Device used** | ||
| 1984 | |||
| 1985 | |(% rowspan="2" %)**Instruction**|(% rowspan="2" %)**Parameter**|(% colspan="8" %)**Devices**|**Offset modification**|((( | ||
| 1986 | **Pulse extension** | ||
| 1987 | ))) | ||
| 1988 | |**T**|**C**|**D**|**R**|**SD**|**LC**|**HSC**|**E**|**[D]**|**XXP** | ||
| 1989 | |(% rowspan="2" %)DLOG10|Parameter 1|●|●|●|●|●|●|●|●|●|● | ||
| 1990 | |Parameter 2|●|●|●|●|●|●|●| |●|● | ||
| 1991 | |||
| 1992 | **Features** | ||
| 1993 | |||
| 1994 | Calculate the common logarithm (base 10 logarithm) of the value specified in (s), and store the result of the calculation in the device number specified in (d). | ||
| 1995 | |||
| 1996 | (% style="text-align:center" %) | ||
| 1997 | [[image:07-4 Basic instructions_html_fd4be61e99151d97.png]] | ||
| 1998 | |||
| 1999 | The value specified in (s) can only be set to a positive number. (Cannot perform operations with negative numbers.) | ||
| 2000 | |||
| 2001 | • The related devices are as follows. | ||
| 2002 | |||
| 2003 | |(% rowspan="2" %)**Devices**|(% rowspan="2" %)**Name**|(% colspan="2" %)**Content** | ||
| 2004 | |**Condition**|**Operating** | ||
| 2005 | |SM153|Zero|The operation result is zero|The zero flag (SM153) turns ON. | ||
| 2006 | |SM152|Borrow|The absolute value of operation result <2^^-126^^|The value of (d) becomes the minimum value of a 32-bit real number (2^^-126 ^^), and the borrow flag (SM152) turns on. | ||
| 2007 | |SM151|Carry|The absolute value of operation result> 2^^128^^|The value of (d) becomes the maximum value of 32-bit real numbers (2^^128 ^^), and the carry flag (SM151) turns on. | ||
| 2008 | |||
| 2009 | **Error code** | ||
| 2010 | |||
| 2011 | |**Error code**|**Content** | ||
| 2012 | |4085H|The write address in (s) exceeds the device range | ||
| 2013 | |4086H|The write address in (d) exceeds the device range | ||
| 2014 | |4084H|When the content of the device specified by (s) is an irregular number, a non-number and ±∞ | ||
| 2015 | |||
| 2016 | **Example** | ||
| 2017 | |||
| 2018 | (% style="text-align:center" %) | ||
| 2019 | [[image:07-4 Basic instructions_html_148f52d5ac7c2f03.png]] | ||
| 2020 | |||
| 2021 | Get calculation results | ||
| 2022 | |||
| 2023 | (% style="text-align:center" %) | ||
| 2024 | [[image:07-4 Basic instructions_html_7a50e800575a7cff.png]] | ||
| 2025 | |||
| 2026 | == **DLOGE/Single precision real number natural logarithm operation** == | ||
| 2027 | |||
| 2028 | **DLOGE(P)** | ||
| 2029 | |||
| 2030 | After calculating the logarithm when the natural logarithm e of the value specified in (s) is the base, store the calculation result in the device specified in (d). | ||
| 2031 | |||
| 2032 | -[DLOGE (s) (d)] | ||
| 2033 | |||
| 2034 | **Content, range and data type** | ||
| 2035 | |||
| 2036 | |**Parameter**|**Content**|**Range**|**Data type**|**Data type (label)** | ||
| 2037 | |(s)|Data for logarithm operation or the device start number storing the data|0, 2^^-126^^ ≤~|(s)~|< 2^^128^^|Single precision real number|ANYREAL_32 | ||
| 2038 | |(d)|the device start number storing operation result|-|Single precision real number|ANYREAL_32 | ||
| 2039 | |||
| 2040 | **Device used** | ||
| 2041 | |||
| 2042 | |(% rowspan="2" %)**Instruction**|(% rowspan="2" %)**Parameter**|(% colspan="8" %)**Devices**|((( | ||
| 2043 | **Offset modification** | ||
| 2044 | )))|((( | ||
| 2045 | **Pulse extension** | ||
| 2046 | ))) | ||
| 2047 | |**T**|**C**|**D**|**R**|**SD**|**LC**|**HSC**|**E**|**[D]**|**XXP** | ||
| 2048 | |(% rowspan="2" %)DLOGE|Parameter 1|●|●|●|●|●|●|●|●|●|● | ||
| 2049 | |Parameter 2|●|●|●|●|●|●|●| |●|● | ||
| 2050 | |||
| 2051 | **Features** | ||
| 2052 | |||
| 2053 | • After calculating the logarithm when the natural logarithm e of the value specified in (s) is the base, store the result of the calculation in the device number specified in (d). | ||
| 2054 | |||
| 2055 | (% style="text-align:center" %) | ||
| 2056 | [[image:07-4 Basic instructions_html_188351d07e584b18.png||height="147" width="750"]] | ||
| 2057 | |||
| 2058 | • The value specified in (s) can only be set to a positive number. (Cannot perform operations with negative numbers.) | ||
| 2059 | |||
| 2060 | • The related devices are as follows. | ||
| 2061 | |||
| 2062 | |(% rowspan="2" %)**Devices**|(% rowspan="2" %)**Name**|(% colspan="2" %)**Content** | ||
| 2063 | |**Condition**|**Operating** | ||
| 2064 | |SM153|Zero|The operation result is zero|The zero flag (SM153) turns ON. | ||
| 2065 | |SM152|Borrow|The absolute value of operation result <2^^-126^^|The value of (d) becomes the minimum value of a 32-bit real number (2^^-126 ^^), and the borrow flag (SM152) turns on. | ||
| 2066 | |SM151|Carry|The absolute value of operation result> 2^^128^^|The value of (d) becomes the maximum value of 32-bit real numbers (2^^128 ^^), and the carry flag (SM151) turns on. | ||
| 2067 | |||
| 2068 | **Error code** | ||
| 2069 | |||
| 2070 | |**Error code**|**Content** | ||
| 2071 | |4085H|The write address in (s) exceeds the device range | ||
| 2072 | |4086H|The write address in (d) exceeds the device range | ||
| 2073 | |4084H|When the content of the device specified by (s) is an irregular number, a non-number and ±∞ | ||
| 2074 | |||
| 2075 | **Example** | ||
| 2076 | |||
| 2077 | (% style="text-align:center" %) | ||
| 2078 | [[image:07-4 Basic instructions_html_d50ae8bddd1c3270.png]] | ||
| 2079 | |||
| 2080 | The result is as below: | ||
| 2081 | |||
| 2082 | (% style="text-align:center" %) | ||
| 2083 | [[image:07-4 Basic instructions_html_ab07e08d5e1c5b31.png]] |