Program instructions
7.5 Convert
S7-200 SMART
236
System Manual, V2.3, 07/2017, A5E03822230-AF
7.5
Convert
7.5.1
Standard conversion instructions
These instructions convert an input value IN to the assigned format and store the output
value in the memory location assigned by OUT. For example, you can convert a double
integer value to a real number. You can also convert between integer and BCD formats.
Standard conversions
LAD / FBD
STL
Description
BTI IN, OUT
Byte to integer:
Convert the byte value IN to an integer value and place the result at the ad-
dress assigned to OUT. The byte is unsigned; therefore, there is no sign exten-
sion.
ITB IN, OUT
Integer to byte:
Convert the word value IN to a byte value and place the result at the address
assigned to OUT. Values 0 to 255 are converted. All other values result in over-
flow and the output is not affected.
Note: To change an integer to a real number, execute the Integer to Double
Integer instruction and then the Double Integer to Real instruction.
ITD IN, OUT
Integer to double integer:
Convert the integer value IN to a double integer value and place the result at
the address assigned to OUT. The sign is extended.
DTI IN, OUT
Double Integer to integer:
Convert the double integer value IN to an integer value and place the result at
the address assigned to OUT. If the value that you convert is too large to be
represented in the output, then the overflow bit is set and the output is not af-
fected.
DTR IN, OUT
Double integer to real:
Convert a 32-bit, signed integer IN into a 32-bit real number and place the result
at the address assigned to OUT.
BCDI OUT
IBCD OUT
BCD to Integer:
Convert the binary-coded decimal WORD data type value IN to an integer
WORD data type value and load the result in the address assigned to OUT. The
valid range for IN is 0 to 9999 BCD.
Integer to BCD:
Convert the input integer WORD data type value IN to a binary-coded decimal
WORD data type and load the result at the address assigned to OUT. The valid
range for IN is 0 to 9999 integer.
For STL, the IN and OUT parameters use the same address.
Содержание SIMATIC S7-200
Страница 30: ...Product overview 1 7 Programming software S7 200 SMART 30 System Manual V2 3 07 2017 A5E03822230 AF ...
Страница 267: ...Program instructions 7 6 Counters S7 200 SMART System Manual V2 3 07 2017 A5E03822230 AF 267 HSC modes 3 and 4 ...
Страница 394: ...Program instructions 7 18 Subroutine S7 200 SMART 394 System Manual V2 3 07 2017 A5E03822230 AF ...
Страница 425: ...Communication 8 5 PROFIBUS S7 200 SMART System Manual V2 3 07 2017 A5E03822230 AF 425 ...
Страница 786: ...Technical specifications A 11 S7 200 SMART cables S7 200 SMART 786 System Manual V2 3 07 2017 A5E03822230 AF ...
Страница 798: ...Error codes C 4 PLC fatal error codes S7 200 SMART 798 System Manual V2 3 07 2017 A5E03822230 AF ...
Страница 848: ...Ordering information F 6 Human Machine Interface devices S7 200 SMART 848 System Manual V2 3 07 2017 A5E03822230 AF ...