Specifications
Basic Concepts for Programming an S7-200 CPU
4-17
S7-200 Programmable Controller System Manual
C79000-G7076-C233-01
Table 4-10 Conversion Instructions
Conversion Instruction
Strong Data Type Checking
Allowed Operands
Data Type Checking
Allowed Operands
BYTE to INT IN: BYTE
OUT: INT
IN: BYTE
OUT: WORD, INT
INT to BYTE IN: INT
OUT: BYTE
IN: WORD, INT
OUT: BYTE
INT to DINT IN: DINT
OUT DINT
IN: WORD, INT
OUT: DWORD, DINT
DINT to INT IN: DINT
OUT: INT
IN: DWORD, DINT
OUT: WORD, INT
DINT to REAL IN: DINT
OUT: REAL
IN: DWORD, DINT
OUT: REAL
REAL to DINT (ROUND) IN: REAL
OUT: DINT
IN: REAL
OUT: DWORD, DINT
Under the IEC 1131-3 editing mode you can use the overloaded Move instruction
to convert between INT and WORD, and DINT and DWORD. The Move instruction
allows data types of the same size to be moved without the compiler generating
errors. See Table 4-11.
Table 4-11 Using Overloaded MOVE Instruction.
IEC 1131-3 Overloaded Move
IN OUT
MOVE (INT to WORD) INT WORD
MOVE (WORD to INT) WORD INT
MOVE (DINT to DWORD) DINT DWORD
MOVE (DWORD to DINT) DWORD DINT