100BBasic instructions
7.7 Convert
S7-1200 Programmable controller
202
System Manual, 11/2011, A5E02486680-05
7.7.2
Conversion instructions for SCL
Conversion instructions for SCL
Table 7- 76 Conversion from a Byte, Word, or DWord
Data type
Instruction
Result
BYTE_TO_WORD, BYTE_TO_DWORD
The value is transferred to the low byte of the target data
type.
BYTE_TO_SINT, BYTE_TO_USINT
The value is transferred to the target data type.
Byte
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_TO_BYTE
The low byte of the source value is transferred to the
target data type.
WORD _TO_DWORD
The value is transferred to the low byte of the target data
type.
WORD _TO_SINT, WORD _TO_USINT
The low byte of the source value is transferred to the
target data type.
WORD _TO_INT, WORD _TO_UINT
The value is transferred to the target data type.
Word
WORD _TO_DINT, WORD _TO_UDINT
The value is transferred to the low byte of the target data
type.
DWORD_TO_BYTE, DWORD_TO_WORD,
DWORD_TO_SINT, DWORD_TO_USINT,
DWORD_TO_INT, DWORD_TO_UINT
The low byte of the source value is transferred to the
target data type.
DWord
DWORD_TO_DINT, DWORD_TO_UDINT,
DWORD_TO_REAL
The value is transferred to the target data type.
Table 7- 77 Conversion from a short integer (SInt or USInt)
Data type
Instruction
Result
SINT_TO_BYTE
The value is transferred to the target data type.
SINT_TO_WORD, SINT_TO_DWORD,
SINT_TO_INT, SINT_TO_DINT
The value is transferred to the low byte of the target data
type.
SInt
SINT_TO_USINT, SINT_TO_UINT,
SINT_TO_UDINT, SINT_TO_REAL,
SINT_TO_LREAL, SINT_TO_CHAR,
SINT_TO_STRING
The value is converted.
USINT_TO_BYTE
The value is transferred to the target data type.
USINT_TO_WORD, USINT_TO_DWORD,
USINT_TO_INT, USINT_TO_UINT,
USINT_TO_DINT, USINT_TO_UDINT
The value is transferred to the low byte of the target data
type.
USInt
USINT_TO_SINT, USINT_TO_REAL,
USINT_TO_LREAL, USINT_TO_CHAR,
USINT_TO_STRING
The value is converted.