Extended instructions
9.2 String and character
S7-1200 Programmable controller
370 System Manual, V4.2, 09/2016, A5E02486680-AK
Runtime information
9.2.5.1
GetSymbolName (Read out a tag on the input parameter)
Table 9- 70 GetSymbolName instruction
variable:=_parameter_in_,
size:=_dint_in_);
The GetSymbolName instruction returns a
string corresponding to the name of a variable
from the block interface.
Your program can call the instruction multiple
times with different tags. The process value of
the tag is irrelevant.
The instruction returns the name read at the
The following table shows the parameters of the GetSymbolName instruction:
VARIABLE Input PARAMETER Parameter
sections Input,
Variable from the local block interface for which you
want a string value of the name returned
SIZE Input DINT I, Q, M, D, L Limits the number of characters output at the OUT
parameter:
•
SIZE > 0: GetSymbolName returns the first SIZE
characters of the name.
• SIZE = 0: GetSymbolName returns the entire
name.
•
SIZE < 0: GetSymbolName returns the last SIZE
characters of the name.
OUT Return WSTRING I, Q, M, D, L Output of the tag name supplied by the input pa-
You specify the input parameters of the block interface at the VARIABLE parameter. Use
only an interface parameter for this parameter and not a PLC or data block tag.
To limit the length of the read tag name, use the SIZE parameter. If the instruction truncates
the name, it indicates the truncation by the characters "..." (Unicode character 16#2026)
appears at the end of the name. Note that this character has the length 1.
You can find additional information on valid data types under "Data types (Page 125)".