Conversion Instructions For Scl - Siemens S7-1200 System Manual

Hide thumbs Also See for S7-1200:
Table of Contents

Advertisement

Table 7- 74
Data types for the parameters
Parameter
Data type
IN
Bit string
BCD16, BCD32
OUT
Bit string
BCD16, BCD32
The instruction does not allow you to select Bit strings (Byte, Word, DWord). To enter an operand of data type Byte,
1
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
ENO
Description
1
No error
0
IN is +/- INF or +/- NaN
0
Result exceeds valid range for OUT data type
7.7.2

Conversion instructions for SCL

Conversion instructions for SCL
Table 7- 76
Conversion from a Bool, Byte, Word, or DWord
Data type
Instruction
BOOL_TO_BYTE, BOOL_TO_WORD,
Bool
BOOL_TO_DWORD, BOOL_TO_INT,
BOOL_TO_DINT
BYTE_TO_BOOL
Byte
BYTE_TO_WORD, BYTE_TO_DWORD
BYTE_TO_SINT, BYTE_TO_USINT
BYTE_TO_INT, BYTE_TO_UINT,
BYTE_TO_DINT, BYTE_TO_UDINT
WORD_TO_BOOL
Word
WORD_TO_BYTE
WORD_TO_DWORD
S7-1200 Programmable controller
System Manual, 03/2014, A5E02486680-AG
, SInt, USInt, Int, UInt, DInt, UDInt, Real, LReal,
1
, SInt, USInt, Int, UInt, DInt, UDInt, Real, LReal,
1
Description
Input value
Input value converted to a new data type
Result OUT
Valid result
+/- INF or +/- NaN
OUT is set to the IN value
Result
The value is transferred to the least significant bit of the
target data type.
The least significant bit is transferred into the destination
data type.
The value is transferred to the least significant byte of the
target data type.
The value is transferred to the target data type.
The value is transferred to the least significant byte of the
target data type.
The least significant bit is transferred into the destination
data type.
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
the target data type.
Basic instructions
7.7 Conversion operations
245

Advertisement

Table of Contents
loading

Table of Contents