Description
You use the "Move value" instruction to transfer the content of the operand at the IN input to the operand at the OUT1 output. The transfer is always made in the direction of ascending address.
Enable output ENO returns the signal state "0" if one of the following conditions applies:
-
Enable input EN has the signal state "0".
-
The data type at the IN parameter does not correspond to the specified data type at the OUT1 parameter.
The following table lists the possible transfers for the S7-1200 CPU series:
|
Source (IN) |
Destination (OUT1) |
|
|---|---|---|
|
With IEC check |
Without IEC check |
|
|
BYTE |
BYTE, WORD, DWORD |
BYTE, WORD, DWORD, SINT, USINT, INT, UINT, DINT, UDINT, TIME, DATE ,TOD, CHAR |
|
WORD |
WORD, DWORD |
BYTE, WORD, DWORD, SINT, USINT, INT, UINT, DINT, UDINT, TIME, DATE, TOD, CHAR |
|
DWORD |
DWORD |
BYTE, WORD, DWORD, SINT, USINT, INT, UINT, DINT, UDINT, REAL, TIME, DATE, TOD, CHAR |
|
SINT |
SINT |
BYTE, WORD, DWORD, SINT, USINT, INT, UINT, DINT, UDINT, TIME, DATE, TOD |
|
USINT |
USINT, UINT, UDINT |
BYTE, WORD, DWORD, SINT, USINT, INT, UINT, DINT, UDINT, TIME, DATE, TOD |
|
INT |
INT |
BYTE, WORD, DWORD, SINT, USINT, INT, UINT, DINT, UDINT, TIME, DATE, TOD |
|
UINT |
UINT, UDINT |
BYTE, WORD, DWORD, SINT, USINT, INT, UINT, DINT, UDINT, TIME, DATE, TOD |
|
DINT |
DINT |
BYTE, WORD, DWORD, SINT, USINT, INT, UINT, DINT, UDINT, TIME, DATE, TOD |
|
UDINT |
UDINT |
BYTE, WORD, DWORD, SINT, USINT, INT, UINT, DINT, UDINT, TIME, DATE, TOD |
|
REAL |
REAL |
DWORD, REAL |
|
LREAL |
LREAL |
LREAL |
|
TIME |
TIME |
BYTE, WORD, DWORD, SINT, USINT, INT, UINT, DINT, UDINT, TIME |
|
DATE |
DATE |
BYTE, WORD, DWORD, SINT, USINT, INT, UINT, DINT, UDINT, DATE |
|
TOD |
TOD |
BYTE, WORD, DWORD, SINT, USINT, INT, UINT, DINT, UDINT, TOD |
|
DTL |
DTL |
DTL |
|
CHAR |
CHAR |
BYTE, WORD, DWORD, CHAR, Character of a string1) |
|
WCHAR |
WCHAR |
BYTE, WORD, DWORD, CHAR, WCHAR, character of a character string1) |
|
Character of a string1) |
Character of a string |
CHAR, WCHAR, character of a string |
|
ARRAY2) |
ARRAY |
ARRAY |
|
STRUCT |
STRUCT |
STRUCT |
|
PLC data type (UDT) |
PLC data type (UDT) |
PLC data type (UDT) |
|
IEC_TIMER |
IEC_TIMER |
IEC_TIMER |
|
IEC_SCOUNTER |
IEC_SCOUNTER |
IEC_SCOUNTER |
|
IEC_USCOUNTER |
IEC_USCOUNTER |
IEC_USCOUNTER |
|
IEC_COUNTER |
IEC_COUNTER |
IEC_COUNTER |
|
IEC_UCOUNTER |
IEC_UCOUNTER |
IEC_UCOUNTER |
|
IEC_DCOUNTER |
IEC_DCOUNTER |
IEC_DCOUNTER |
|
IEC_UDCOUNTER |
IEC_UDCOUNTER |
IEC_UDCOUNTER |
The following table lists the possible transfers for the S7-1500 CPU series:
|
Source (IN) |
Destination (OUT1) |
|
|---|---|---|
|
With IEC check |
Without IEC check |
|
|
BYTE |
BYTE, WORD, DWORD, LWORD |
BYTE, WORD, DWORD, LWORD, SINT, USINT, INT, UINT, DINT, UDINT, LINT, ULINT, TIME, LTIME, LDT, DATE ,TOD, LTOD, CHAR |
|
WORD |
WORD, DWORD, LWORD |
BYTE, WORD, DWORD, LWORD, SINT, USINT, INT, UINT, DINT, UDINT, LINT, ULINT, S5TIME, TIME, LTIME, LDT, DATE, TOD, LTOD, CHAR |
|
DWORD |
DWORD, LWORD |
BYTE, WORD, DWORD, LWORD, SINT, USINT, INT, UINT, DINT, UDINT, LINT, ULINT, REAL, TIME, LTIME, LDT, DATE, TOD, LTOD, CHAR |
|
LWORD |
LWORD |
BYTE, WORD, DWORD, LWORD, SINT, USINT, INT, UINT, DINT, UDINT, LINT, ULINT, LREAL, TIME, LTIME, LDT, DATE, TOD, LTOD, CHAR |
|
SINT |
SINT |
BYTE, WORD, DWORD, LWORD, SINT, USINT, INT, UINT, DINT, UDINT, LINT, ULINT, TIME, LTIME, LDT, DATE, TOD, LTOD |
|
USINT |
USINT, UINT, UDINT, ULINT |
BYTE, WORD, DWORD, LWORD, SINT, USINT, INT, UINT, DINT, UDINT, LINT, ULINT, TIME, LTIME, LDT, DATE, TOD, LTOD |
|
INT |
INT |
BYTE, WORD, DWORD, LWORD, SINT, USINT, INT, UINT, DINT, UDINT, LINT, ULINT, TIME, LTIME, LDT, DATE, TOD, LTOD |
|
UINT |
UINT, UDINT, ULINT |
BYTE, WORD, DWORD, LWORD, SINT, USINT, INT, UINT, DINT, UDINT, LINT, ULINT, TIME, LTIME, LDT, DATE, TOD. LTOD |
|
DINT |
DINT |
BYTE, WORD, DWORD, LWORD, SINT, USINT, INT, UINT, DINT, UDINT, LINT, ULINT, TIME, LTIME, LDT, DATE, TOD, LTOD |
|
UDINT |
UDINT, ULINT |
BYTE, WORD, DWORD, LWORD, SINT, USINT, INT, UINT, DINT, UDINT, LINT, ULINT, TIME, LTIME, LDT, DATE, TOD, LTOD |
|
LINT |
LINT |
BYTE, WORD, DWORD, LWORD, SINT, USINT, INT, UINT, DINT, UDINT, LINT, ULINT, TIME, LTIME, LDT, DATE, TOD, LTOD |
|
ULINT |
ULINT |
BYTE, WORD, DWORD, LWORD, SINT, USINT, INT, UINT, DINT, UDINT, LINT, ULINT, TIME, LTIME, LDT, DATE, TOD, LTOD |
|
REAL |
REAL |
DWORD, REAL |
|
LREAL |
LREAL |
LWORD, LREAL |
|
S5TIME |
S5TIME |
WORD, S5TIME |
|
TIME |
TIME |
BYTE, WORD, DWORD, LWORD, SINT, USINT, INT, UINT, DINT, UDINT, LINT, ULINT, TIME |
|
LTIME |
LTIME |
BYTE, WORD, DWORD, LWORD, SINT, USINT, INT, UINT, DINT, UDINT, LINT, ULINT, LTIME |
|
DATE |
DATE |
BYTE, WORD, DWORD, LWORD, SINT, USINT, INT, UINT, DINT, UDINT, LINT, ULINT, DATE |
|
DT |
DT |
DT |
|
LDT |
LDT |
BYTE, WORD, DWORD, LWORD, SINT, USINT, INT, UINT, DINT, UDINT, LINT, ULINT, LDT |
|
TOD |
TOD |
BYTE, WORD, DWORD, LWORD, SINT, USINT, INT, UINT, DINT, UDINT, LINT, ULINT, TOD |
|
LTOD |
LTOD |
BYTE, WORD, DWORD, LWORD, SINT, USINT, INT, UINT, DINT, UDINT, LINT, ULINT, LTOD |
|
DTL |
DTL |
DTL |
|
CHAR |
CHAR |
BYTE, WORD, DWORD, LWORD, CHAR, Character of a string1) |
|
WCHAR |
WCHAR |
BYTE, WORD, DWORD, LWORD, CHAR, WCHAR, Character of a string1) |
|
Character of a string1) |
Character of a string |
CHAR, WCHAR, character of a string |
|
ARRAY2) |
ARRAY |
ARRAY |
|
STRUCT |
STRUCT |
STRUCT |
|
COUNTER |
COUNTER, WORD, INT |
WORD, DWORD, INT, UINT, DINT, UDINT |
|
TIMER |
TIMER, WORD, INT |
WORD, DWORD, INT, UINT, DINT, UDINT |
|
PLC data type (UDT) |
PLC data type (UDT) |
PLC data type (UDT) |
|
IEC_TIMER |
IEC_TIMER |
IEC_TIMER |
|
IEC_LTIMER |
IEC_LTIMER |
IEC_LTIMER |
|
IEC_SCOUNTER |
IEC_SCOUNTER |
IEC_SCOUNTER |
|
IEC_USCOUNTER |
IEC_USCOUNTER |
IEC_USCOUNTER |
|
IEC_COUNTER |
IEC_COUNTER |
IEC_COUNTER |
|
IEC_UCOUNTER |
IEC_UCOUNTER |
IEC_UCOUNTER |
|
IEC_DCOUNTER |
IEC_DCOUNTER |
IEC_DCOUNTER |
|
IEC_UDCOUNTER |
IEC_UDCOUNTER |
IEC_UDCOUNTER |
|
IEC_LCOUNTER |
IEC_LCOUNTER |
IEC_LCOUNTER |
|
IEC_ULCOUNTER |
IEC_ULCOUNTER |
IEC_ULCOUNTER |
|
REF() |
There is no data type conversion. The transferred tag must correspond exactly to the target data type. References to technology objects must point to a technology object of the same type or a derived type. |
|
1) You can also use the "Move value" instruction to transfer individual characters of a string to operands of the CHAR or WCHAR data type. The number of the character to be transferred is specified in square brackets next to the operand name. "MyString[2]", for example, transfers the second character of the "MyString" string. The transfer of the operand of the data type CHAR or WCHAR to the individual character of a string is also possible. You can also replace a specific character of a string with the character of another string.
2) Transferring entire arrays (ARRAY) is possible only when the array components of the operands at input IN and at output OUT1 are of the same data type.
If the bit length of the data type at input IN exceeds the bit length of the data type at output OUT1, the higher-order bits of the source value are lost. If the bit length of the data type at input IN is less than the bit length of the data type at output OUT1, the higher-order bits of the destination value will be overwritten with zeros.
In its initial state, the instruction box contains 1 output (OUT1). The number of outputs can be extended. The added outputs are numbered in ascending order on the box. During the execution of the instruction, the content of the operand at the input IN is transferred to all available outputs. The instruction box cannot be extended if structured data types (DTL, STRUCT, ARRAY) or characters of a string are transferred.
You can also use the "Move block" (MOVE_BLK) and "Move block uninterruptible" (UMOVE_BLK) instructions to move operands of the ARRAY data type. Operand of the data type STRING or WSTRING can be copied with the instruction "Move character string" (S_MOVE).
Parameters
The following table shows the parameters of the "Move value" instruction:
|
Parameters |
Declaration |
Data type |
Memory area |
Description |
||
|---|---|---|---|---|---|---|
|
S7-1200 |
S7-1500 |
S7-1200 |
S7-1500 |
|||
|
EN |
Input |
BOOL |
BOOL |
I, Q, M, D, L or constant |
I, Q, M, D, L, T, C or constant |
Enable input |
|
ENO |
Output |
BOOL |
BOOL |
I, Q, M, D, L |
I, Q, M, D, L |
Enable output |
|
IN |
Input |
Bit strings, integers, floating-point numbers, timers, date and time, CHAR, WCHAR, STRUCT, ARRAY, IEC data types, PLC data type (UDT) |
Bit strings, integers, floating-point numbers, timers, date and time, CHAR; WCHAR, STRUCT, ARRAY, TIMER, COUNTER, IEC data type, PLC data type (UDT) |
I, Q, M, D, L or constant |
I, Q, M, D, L or constant |
Element used to overwrite the destination address. |
|
OUT1 |
Output |
Bit strings, integers, floating-point numbers, timers, date and time, CHAR, WCHAR, STRUCT, ARRAY, IEC data types, PLC data type (UDT) |
Bit strings, integers, floating-point numbers, timers, date and time, CHAR; WCHAR, STRUCT, ARRAY, TIMER, COUNTER, IEC data type, PLC data type (UDT) |
I, Q, M, D, L |
I, Q, M, D, L |
Destination address |
You can find additional information on valid data types under "See also".
Example
The following example shows how the instruction works:
The following table shows how the instruction works using specific operand values:
|
Parameters |
Operand |
Value |
|---|---|---|
|
IN |
TagIn_Value |
0011 1111 1010 1111 |
|
OUT1 |
TagOut_Value |
0011 1111 1010 1111 |
If the "TagIn" operand returns signal state TRUE, the instruction is executed. The instruction moves the contents of the "TagIn_Value" operand to the "TagOut_Value" operand. If the instruction is executed without errors, the ENO and "TagOut" enable outputs are set to signal state TRUE.
|
Note You can find more information on the MOVE instruction in the following article in the Siemens Industry Online Support: In STEP 7 (TIA Portal) how do you copy memory areas and structured data from one data block to another? |
See also
Overview of the valid data types
Basics of the EN/ENO mechanism
Removing instruction inputs and outputs (S7-1200, S7-1500)
MOVE_BLK: Move block (S7-1200, S7-1500)
UMOVE_BLK: Move block uninterruptible (S7-1200, S7-1500)
S_MOVE: Move character string (S7-1200, S7-1500)
Inserting FBD elements
Editing FBD elements
Inserting operands in FBD instructions
Adding additional inputs and outputs to FBD elements (S7-1200, S7-1500)
System memory areas (S7-1200)