Extended instructions
9.2 String and character
S7-1200 Programmable controller
System Manual, V4.2, 09/2016, A5E02486680-AK
381
6 '"IDB_...'
• First character of WSTRING:'
• The first five characters of the name and identifier that
the name was truncated: "IDB_...
• Last character of WSTRING:'
0 '"IDB_LEVEL_1".Level_2_
Instance.Level_3_Instance'
• First character of WSTRING:'
• All characters of the name:
"IDB_LEVEL_1".Level_2_Instance.Level_3_Instance
• Last character of WSTRING:'
Note
Use of GetInstancePath in function blocks with single instance
If the function block in which you call GetInstancePath saves data in
its own instance data
block, GetInstancePath outputs the name of the single instance as the global name. The
result at parameter OUT corresponds in this case to the
GetInstanceName (Page 376)
GetBlockName (Read out name of the block)
Table 9- 74 GetBlockName instruction
size:=_dint_in_);
You use the GetBlockName instruction to read
the name of the block in which the instruction
is called.
The following table shows the parameters of the GetBlockName instruction:
SIZE Input UINT I, Q, M, D, L or
constant
Limits the number of characters output at the
RET_VAL parameter.
• SIZE > 0: GetBlockName returns the first SIZE
characters of the name.
• SIZE = 0: GetBlockName returns the entire name.
• SIZE < 0: GetBlockName returns the last SIZE
characters of the name.
Read name of the instance data block
You can find additional information on valid data types under "Data types (Page 125)".