Description
With the "Resolve several symbols" instruction, you resolve multiple symbolic tag names. As a result, you receive references to the tags. References are typed pointers that give you read or write access to the tags.
At the parameter "nameList", specify an Array of WSTRING . Here, the tag names that are to be resolved are transferred during runtime. The array can be in an optimized or non-optimized memory area.
At the parameter "referenceList", specify an Array of ResolvedSymbol (SDT) in which the references are to be saved. The array must be in an optimized memory area. The two Arrays must have the same limits.
The symbolic tag names are transferred in the format WSTRING and must not exceed a length of 254 UTF-16 characters. Enter the fully qualified name including the namespace. The qualifier # for local tags is not supported. Elements in arrays are supported but they must specify a fixed index for access to an element. Accesses with variable index, e.g., myArray[myIndexTag], are not supported.
Example of a fully-qualified name:
myNamespace.mySubnamespace.myDataBlock.myArray[7,12,1]
Using the "firstIndex" and "lastIndex" parameters, you can also only resolve some of the symbols from the list. If you wish to resolve the entire list of symbols, the "firstIndex" parameter can specify the low limit and the "lastIndex" parameter can specify the high limit.
The instruction is executed asynchronously. The execution starts with a rising signal edge at the "execute" parameter. You cannot make any changes at the "nameList" and "referenceList" parameters while the instruction is running (Busy = 1).
Before the symbols are resolved, the values are reset in the Array at the "referenceList" parameter within the specified Array limits ("firstIndex" and "lastIndex").
After the instruction is complete, the "done" parameter has the value = 1 for one cycle. The array at the "referenceList" parameter is filled with the references to the tags.
After a falling signal edge at the "execute" parameter, the instance of "ResolveSymbol" is no longer considered active.
|
Note Configuration limits A maximum of 10 "ResolveSymbols" instructions can be active at the same time. In total, all active instances of the instruction can resolve a maximum of 2,000 symbols. |
Parameters
The following table shows the parameters of the "Resolve several symbols" instruction:
|
Parameter |
Declaration |
Data type |
Memory area |
Description |
|---|---|---|---|---|
|
execute |
Input |
BOOL |
I, Q, M, D, L |
With a rising signal edge, execution of the instruction is started. |
|
firstIndex |
Input |
DINT |
I, Q, M, D, L, C |
Index of the first tag name to be resolved. |
|
lastIndex |
Input |
DINT |
I, Q, M, D, L, C |
Index of the last tag name to be resolved. |
|
done |
Output |
BOOL |
I, Q, M, D, L |
Done = 1 Execution of the instruction is complete. |
|
busy |
Output |
BOOL |
I, Q, M, D, L |
Busy = 1 The instruction is currently being executed. |
|
error |
Output |
BOOL |
I, Q, M, D, L |
ERROR = 1 Error occurred during processing. The error message is output at the STATUS parameter. |
|
status |
Output |
INT |
I, Q, M, D, L |
Block status / error number (see "STATUS parameter") |
|
nameList |
InOut |
Array of WSTRING |
D |
List of tag names to be resolved. |
|
referenceList |
InOut |
Array of ResolvedSymbol |
D |
List of references |
You can find additional information on SDT here: System data type ResolvedSymbol
STATUS parameter
The following table shows the meaning of the values of the "STATUS" parameter:
|
Error code (W#16#...) |
Description |
|---|---|
|
0000 |
No error occurred. |
|
7000 |
No job processing active. |
|
7001 |
Start of asynchronous job processing. Parameter BUSY = 1, DONE = 0 |
|
7002 |
Intermediate call: Instruction already active; BUSY = 1. |
|
80B3 |
The value at the "firstIndex" parameter is greater than the value at the "lastIndex" parameter. |
|
80B4 |
The ARRAY limits of "referenceList" and "nameList" have different limits. |
|
80C3 |
The maximum possible number of simultaneously active "ResolveSymbols" instructions has already been reached, or the maximum possible number of 2000 simultaneously resolvable symbols has been reached. |
|
8282 |
The value at the "firstIndex" parameter is outside the limits of the ARRAY. |
|
8382 |
The value at the "lastIndex" parameter is outside the limits of the ARRAY. |
|
8820 |
A name in the list of tags that you specified at the "nameList" parameter is invalid. |
|
8831 |
The ARRAY of WSTRING that you specified as the actual parameter for "nameList" does not exist. |
|
8833 |
The ARRAY of WSTRING that you specified as the actual parameter for "nameList" is only in the load memory and cannot be addressed by the instruction. |
|
8854 |
The actual parameter for "nameList" is not of the data type "ARRAY of WSTRING". |
|
8931 |
The ARRAY of ResolvedSymbol that you specified as the actual parameter for "referenceList" does not exist. |
|
8933 |
The ARRAY of ResolvedSymbol that you specified as the actual parameter for "referenceList" is only in the load memory and cannot be addressed by the instruction. |
|
8934 |
The ARRAY of ResolvedSymbol that you specified as the actual parameter for "referenceList" is write-protected. |
|
8936 |
The ARRAY of ResolvedSymbol that you specified as the actual parameter for "referenceList" is not in an optimized global data block. |
|
8954 |
The actual parameter for "referenceList" is not of the data type "ARRAY of WSTRING". |
Example
The following example shows how the instruction works:
The following table shows how the instruction works using specific operand values:
|
Parameter |
Operand |
Value/Data type |
|---|---|---|
|
nameList |
InOut_Symbols |
Array[0..99] of WSTRING |
|
referenceList |
InOut_ResolvedSymbols |
Array[0..99] of ResolvedSymbol |
|
firstIndex |
- |
0 |
|
lastIndex |
- |
9 |
|
execute |
Input_Execute |
BOOL |
|
busy |
Output_Busy |
BOOL |
|
done |
Output_Done |
BOOL |
If the operand #Input_Execute changes to signal state "1", execution of the instruction has begun. The tag names at the parameter "nameList" are resolved and the references to the tags are written in the operand "#InOut_ResolvedSymbols" at the parameter "referenceList". After the instruction is complete, the "done" parameter has the value = 1 for one cycle.