Basic instructions
7.7 Conversion operations
S7-1200 Programmable controller
System Manual, 03/2014, A5E02486680-AG
245
Table 7- 74 Data types for the parameters
IN Bit string
1
, SInt, USInt, Int, UInt, DInt, UDInt, Real, LReal,
Input value
OUT Bit string
1
, SInt, USInt, Int, UInt, DInt, UDInt, Real, LReal,
Input value converted to a new data type
The instruction does not allow you to select Bit strings (Byte, Word, DWord). To enter an operand of data type Byte,
Word, or DWord for a parameter of the instruction, select an unsigned integer with the same bit length. For example,
select USInt for a Byte, UInt for a Word, or UDInt for a DWord.
After you select the (convert from) data type, a list of possible conversions is shown in the
(convert to) dropdown list. Conversions from and to BCD16 are restricted to the Int data
type. Conversions from and to BCD32 are restricted to the DInt data type.
Table 7- 75 ENO status
Result exceeds valid range for OUT data type
OUT is set to the IN value
Conversion instructions for SCL
Conversion instructions for SCL
Table 7- 76 Conversion from a Bool, Byte, Word, or DWord
Bool
BOOL_TO_BYTE, BOOL_TO_WORD,
BOOL_TO_DWORD, BOOL_TO_INT,
The value is transferred to the least significant bit of the
target data type.
Byte
The least significant bit is transferred into the destination
BYTE_TO_WORD, BYTE_TO_DWORD
The value is transferred to the least significant byte of the
target data type.
BYTE_TO_SINT, BYTE_TO_USINT
The value is transferred to the target data type.
BYTE_TO_INT, BYTE_TO_UINT,
BYTE_TO_DINT, BYTE_TO_UDINT
The value is transferred to the least significant byte of the
target data type.
Word
The least significant bit is transferred into the destination
The least significant byte of the source value is
transferred to the target data type
The value is transferred to the least significant word of