Extended instructions
9.2 String and character
S7-1200 Programmable controller
System Manual, V4.2, 09/2016, A5E02486680-AK
377
Example: Meaning of SIZE parameter
To limit the length of the read instance name, use the SIZE parameter. If the instruction has
truncated the name, it indicates the truncation by the character "..." (Unicode character
16#2026) at the end of the name. Note that this character has the length 1.
The following example illustrates the meaning of the SIZE parameter. GetInstanceName has
read out the following instance name from the block interface: "Level1_DB" (The double
quotes at the start and end belong to the name.)
1 '...'
• First character of WSTRING:'
• Identifier that the name was truncated: ...
• Last character of WSTRING:'
2 '"...'
• First character of WSTRING:'
• The first character of the name and identifier that the
name was truncated:"...
• Last character of WSTRING:'
3 '"L...'
• First character of WSTRING:'
• The first two characters of the name and identifier that
the name was truncated:"... "L...
• Last character of WSTRING:'
6 '"Leve...'
• First character of WSTRING:'
• The first five characters of the name and identifier that
the name was truncated: "Leve...
• Last character of WSTRING:'
0 '"Level1_DB"'
• First character of WSTRING:'
• All characters of the name: "Level1_DB"
• Last character of WSTRING:'
GetInstanceName writes out the name of the instance data block to the OUT parameter. The
instruction truncates the name if the name of the instance data block is longer than the
maximum length of WSTRING.