“Variable description by index” function
IndexGroup: IdxGrp = 0x122300 + Channel ID
Index offset: IdxOffs = 0x45
Variable description | This function supplies the associated variable description for specified index and variable type. The total number of existing variable entries can be queried by the “Variable element number” function. |
Transfer parameter (here with stream offset specified):
0 | 4 |
Variable index | Identifier for variable type with zero termination |
where
Contents | Type | Size |
Variable index | UNS32 | fixed, 4 bytes |
Variable type identifier | STRING | variable, max. 256 bytes |
=> stream length max. 260 bytes
Return value (here with stream offset specified):
0 | 4 | 8 | 12 | 16 | (20) | (24) | ... | 20 + 4 *m |
Handle on the variable | Variable type | Access | Size | Number of array dimensions m | Number of elements in dimension 1 | Number of elements in dimension 2 | ... | Variable name |
where
Contents | Variable type | Size |
Handle on the variable | UNS32 | fixed, 4 bytes |
Variable type | Enumeration (UNS32) (*) | fixed, 4 bytes |
Access | Enumeration (UNS32) 1 = READ_ONLY 2 = READ_WRITE | fixed, 4 bytes |
Size | UNS32 | fixed, 4 bytes |
Number of array dimensions m | UNS32 (= 0, elementary variable) | fixed, 4 bytes |
Number of elements | UNS32 | variable, 4 bytes * m |
Variable name | String | variable, max. 256 bytes |
=> stream length 276 bytes + number of array dimensions n * 4 bytes, max. 2048 bytes
(*) Enumeration for variable type:
1 = BOOLEAN | 4 = SGN16 | 7 = UNS32 |
2 = SGN08 | 5 = UNS16 | 8 = REAL64 |
3 = UNS08 | 6 = SGN32 | 9 = STRING |
Notice
The variable type identifier, e.g. V.E, may not be followed by a dot.
Example
Application examples
The example below reads the description of the V.E variable with index 2.
IndexGrp: 0x122301 for the first channel
IndexOffs: 0x45
Transfer parameters:
2 | V.E | 0 |
2 for the variable with index entry 2
V.E identifier of variable type: V.E
0 zero termination
Return values:
0x2000002 | 1 | 1 | 2 | 1 | 2 | V.E.Variable_3 |
0x2000002 Handle
1 type of variable: Boolean
1 access rights: Read-Only
2 total size in bytes
1 array dimension
2 number of array elements
V.E.Variable_3 Variable name