Basic instructions
8.7 Conversion operations
S7-1200 Programmable controller
290 System Manual, V4.2, 09/2016, A5E02486680-AK
Conversion operations
8.7.1
Table 8- 102 Convert (CONV) instruction
out := <data type in>_TO_<data type out>(in);
Converts a data element from one
data type to another data type.
For LAD and FBD: Click the "???" and select the data types from the drop-down menu.
For SCL: Construct the conversion instruction by identifying the data type for the input parameter (in) and output pa-
rameter (out). For example, DWORD_TO_REAL converts a DWord value to a Real value.
Table 8- 103 Data types for the parameters
IN Bit string
1
, SInt, USInt, Int, UInt, DInt, UDInt, Real, LReal,
BCD16, BCD32, Char, WChar
Input value
OUT Bit string
1
, SInt, USInt, Int, UInt, DInt, UDInt, Real, LReal,
BCD16, BCD32, Char, WChar
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, se-
lect 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 8- 104 ENO status
Result exceeds valid range for OUT data type
OUT is set to the IN value