Using Conversion Instructions; Using Overloaded Move Instruction - Siemens SIMATIC S7-200 System Manual

Hide thumbs Also See for SIMATIC S7-200:
Table of Contents

Advertisement

Using Conversion Instructions

Conversion instructions permit the movement from one data type to another.
STEP 7-Micro/WIN 32 supports the conversion instructions shown in Table 4-10 for
moving values between the simple data types.
Table 4-10 Conversion Instructions
Conversion Instruction
BYTE to INT
INT to BYTE
INT to DINT
DINT to INT
DINT to REAL
REAL to DINT (ROUND)
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
MOVE (INT to WORD)
MOVE (WORD to INT)
MOVE (DINT to DWORD)
MOVE (DWORD to DINT)
S7-200 Programmable Controller System Manual
A5E00066097-02
Basic Concepts for Programming an S7-200 CPU
Strong Data Type Checking
Allowed Operands
IN:
BYTE
OUT:
INT
IN:
INT
OUT:
BYTE
IN:
DINT
OUT
DINT
IN:
DINT
OUT:
INT
IN:
DINT
OUT:
REAL
IN:
REAL
OUT:
DINT
INT
WORD
DINT
DWORD
Data Type Checking
Allowed Operands
IN:
BYTE
OUT:
WORD, INT
IN:
WORD, INT
OUT:
BYTE
IN:
WORD, INT
OUT:
DWORD, DINT
IN:
DWORD, DINT
OUT:
WORD, INT
IN:
DWORD, DINT
OUT:
REAL
IN:
REAL
OUT:
DWORD, DINT
IN
WORD
INT
DWORD
DINT
OUT
4-17

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents