VariantPut: Write VARIANT tag value (S7-1200, S7-1500) - STEP 7

FBD (S7-1200, S7-1500)

ft:publication_title
FBD (S7-1200, S7-1500)
Product
STEP 7
Version
V20
Publication date
11/2024
Language
en-US
VariantPut: Write VARIANT tag value

Description

You can use the "Write VARIANT tag value" instruction to write the value of the tag at the SRC parameter to the memory at the DST parameter to which the VARIANT points.

The DST parameter has the VARIANT data type. Any data type except for VARIANT can be specified at the SRC parameter.

The data type of the tag at the SRC parameter must match the data type to which the VARIANT points.

Note

To copy structures and ARRAYs, you can use the "MOVE_BLK_VARIANT instruction: Move block" instruction. For additional information, refer to "See also".

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 types do not correspond. (No value is transferred.)

Parameters

The following table shows the parameters of the instruction "Write VARIANT tag value":

Parameters

Declaration

Data type

Memory area

Description

S7-1200

S7-1500

EN

Input

BOOL

I, Q, M, D, L or constant

I, Q, M, D, L or constant

Enable input

ENO

Output

BOOL

I, Q, M, D, L

I, Q, M, D, L

Enable output

SRC

Input

Bit strings, integers, floating-point numbers, timers, date and time, character strings, ARRAY elements, PLC data types

I, Q, M, D, L

I, Q, M, D, L, P

Tag to be read

DST

Input

VARIANT

L (The declaration is possible in the "Input", "InOut" and "Temp" sections of the block interface.)

Result of the instruction

You can find additional information on valid data types under "See also".

Example

The following example shows how the instruction works:

If the "TagIn" operand returns signal state "1", the instruction is executed. The value of the "TagIn_Source" operand is written to the tag to which the VARIANT at the #TagIn_Dest operand points.