Code: |
AS + 314 |
Symbolic: |
bccEnumVar |
This command will enumerate variables definition: this is a standard download transfer sequence.
REQDATA structure is the following:
Offset |
Type |
Label |
Description |
---|---|---|---|
0 |
U32 |
FLAGS |
Operation settings: 0x00000001 Enumerate standard variables 0x00000002 Enumerate user task variables 0x00000004 Enumerate logical variables 0x00000008 Force enumeration (even is same ID) 0x00000010 Enumerate dynamic variables |
4 |
U32 |
VARSETID |
Current locale variable set identification: if different, enumeration will occurs. |
ACKDATA structure is the following:
Offset |
Type |
Label |
Description |
---|---|---|---|
0 |
U32 |
COUNT |
No. of item that will be received |
4 |
U32 |
VARSETID |
Real variable set identification |
On failure, a bccNack is received. Specific errors:
NACK code |
Description |
Extra data |
---|---|---|
nackSameData |
Remote variable set is the same of the local set. Enumeration is not needed. |
|
nackIllegalArgs |
Illegal parameter |
U16 What illegal: 1=Flags 2=Variable set ID |
ITEMDATA structure is the following:
Offset |
Type |
Label |
Description |
---|---|---|---|
0 |
U16 |
PID |
Process ID |
2 |
U16 |
VARID |
Variable ID |
4 |
U8 |
CATEG |
Variable category: 0=Not valid (illegal) 10=Ladder diagram alias 11=Memory variable (#1) 12=Standard variable 13=Logical structure 14=Logical variable 15=Dynamic structure/class 16=Dynamic variable |
5 |
U8[23] |
DATA |
Data according variable category |
28 |
STRZ |
NAME |
Variable name |
(#1) Memory variables are considered to be represented in little-endian format.
If filed PID has value of 0xFFFF (group definition), ITEMDATA structure is the following:
Offset |
Type |
Label |
Description |
---|---|---|---|
0 |
U16 |
PID |
Task ID (0xFFFF) |
2 |
U16 |
NSIZE |
Name size (excluded terminal 0) |
4 |
STRZ(NSIZE+1) |
NAME |
Group name |
4+NSIZE+1 |
STRZ |
TEXT |
Group description |
When a variable group definition is received (PID=0xFFFF), all subsequent received variables are relative to this group definition until a new group definition is received.
Notes:
•bccData (or bccEndData) messages will begin with pid = 0 and will be incremented by 1 at each message.
•bccEndData contain last item and after it the transfer is completed.
•The data transfer could be aborted at any time with a bccAbort command.
•The maximum repeat counter is calculated as the product array index size: if none of 3 index are defined, maximum repeat counter is assumed to have a default value of 1.
•Variable definition with childs (referenced by a PPID e PVARID) must be category 11 (Memory variable) and type 11 (Structure).
Specific DATA for category 10 (ladder diagram alias)
Offset |
Type |
Label |
Description |
---|---|---|---|
+0 |
U16 |
TYPE |
Alias type: 0=not valid (illegal) 1=logical input channel 2=logical input word 16bit 3=logical input word 16bit, bit access 4=logical input word 32bit 5=logical input word 32bit, bit access 6=logical output channel 7=logical output word 16bit 8=logical output word 16bit, bit access 9=logical output word 32bit 10=logical output word 32bit, bit access 11=integer volatile register 32bit 12=integer volatile register 32bit, bit access 13=integer non volatile register 32bit 14=integer non volatile register 32bit, bit access 15=real volatile register 64bit 16=real non volatile register 64bit 17=alarm mask 18=alarm mask, bit access |
+2 |
U16 |
IX |
Variable index |
+4 |
U16 |
BIX |
Bit index for bit access |
Specific DATA for category 11 (memory variable)
Offset |
Type |
Label |
Description |
---|---|---|---|
+0 |
U8 |
TYPE |
Memory x86 variable type: 0=not valid (illegal) 1=unsigned 8bit 2=signed 8bit 3=unsigned 16bit 4=signed 16bit 5=unsigned 32bit 6=signed 32bit 7=double (64bit) 8=float (32bit) 9=boolean (#1) 10=char array 11=structure definition 12=string (0 termined) (#3) 13=bit 14=timer (#2) 15=counter (#2) 16=(reserved) 17=unsigned 64bit 18=signed 64bit |
+1 |
U32 |
SIZE |
Variable base size. In case of string type (12), this field indicate the maximum string buffer size, 0 terminator included. |
+5 |
U16 |
DIM0 |
Array index 0 size |
+7 |
U16 |
DIM1 |
Array index 1 size |
+9 |
U16 |
DIM2 |
Array index 2 size |
+11 |
U32 |
FLAG |
Variable flags: 0x00000001 Has array 0 size 0x00000002 Has array 1 size 0x00000004 Has array 2 size 0x00000008 Has repeat counter 0x00000010 Has parent variable |
+15 |
U32 |
ADDR |
Base address or parent offset (if has parent flag) |
+19 |
U16 |
PPID |
Parent Process ID |
+21 |
U16 |
PVARID |
Parent Variable ID |
(#1) Boolean type (9) is considered having an unsigned 8bit storage.
(#2) Timer type (14) and counter type (15) have their own predefined structure.
(#3) RDE3 does not currently support this data type.
Notes:
•Flag 'Has array 2 size' implies flag 'Has array 1 size' and this implies flag 'Has index 0'.
Specific DATA for category 12 (standard variable)
Offset |
Type |
Label |
Description |
---|---|---|---|
+0 |
U16 |
TYPE |
Variable type: 0=not valid (illegal) 1=logical input channel 2=logical input word 16bit 3=logical input word 32bit 4=logical output channel 5=logical output word 16bit 6=logical output word 32bit 7=integer volatile register 32bit 8=integer non volatile register 32bit 9=real volatile register 64bit 10=real non volatile register 64bit 11=alarm mask 32bit 12=string volatile register (#1) 13=string non volatile register (#1) 14=integer parameter register 16bit 15=integer parameter register 32bit 16=real parameter register 64bit 17=float parameter register 32bit 18=integer axis parameter 16bit 19=integer axis parameter 32bit 20=real axis parameter 64bit 21=float axis parameter 32bit 22=alarm code in alarm stack 23=alarm text in alarm stack (#1) 24=integer volatile register 64bit 25=integer non volatile register 64bit 26=integer parameter register 64bit 27=integer axis parameter 64bit |
+2 |
U16 |
BASE |
Base index |
+4 |
U16 |
DIM |
Array size |
+6 |
I16 |
OFFSET |
Array offset |
+8 |
U16 |
AXIS |
Axis count |
+10 |
U32 |
FLAGS |
Variable flags: 0x00000001 Has array size 0x00000002 Has axis count 0x00000004 Has array offset |
+14 |
U16 |
SSIZE |
String size (#1) |
(#1) Use SSIZE field to text string size
Notes:
•Usually these variables should be relative to a group named SYS (aka system variables).
•General fields PID and VARID are not used by this category.
Specific DATA for category 13 (logical structure)
Offset |
Type |
Label |
Description |
---|---|---|---|
+0 |
U32 |
TYPEID |
Structure type ID: 0x00000000-0x0000FFFF predefined 0x00010000-0xFFFFFFFF user defined
Predefined types ID are: 0x00000000=not valid (illegal) 0x00000001=signed 8bit 0x00000002=unsigned 8bit 0x00000003=signed 16bit 0x00000004=unsigned 16bit 0x00000005=signed 32bit 0x00000006=unsigned 32bit 0x00000007=signed 64bit 0x00000008=unsigned 64bit 0x00000009=string (#1) 0x0000000A=float (32bit) 0x0000000B=double (64bit) 0x0000000C=boolean 0x0000000D=timer 0x0000000E=counter 0x0000000F=alias (ladder) 0x00000010=edge (ladder) 0x00000011=(reserved, ex power set) 0x00000012=(reserved, ex axes group) 0x00000013=(reserved, ex path) 0x00000014=(reserved, ex point_l) |
+4 |
U16 |
DIM0 |
Array 0 size (0=none) or string size (#1) |
+6 |
U16 |
DIM1 |
Array 1 size (0=none) |
+8 |
U16 |
DIM2 |
Array 2 size (0=none) |
+10 |
U16 |
OFF0 |
Array 0 index offset |
+12 |
U16 |
OFF1 |
Array 1 index offset |
+14 |
U16 |
OFF2 |
Array 2 index offset |
+16 |
U32 |
FLAGS |
Flags: 0x00000001 Begin of user defined structure 0x00000002 End of user defined structure 0x00000004 Disable bit access |
(#1) DIM0 value 0 assume meaning of default string size
Notes:
•A used defined structure declaration must begin with the "begin of user defined structure" flag and must end with the "end of user defined structure" flag: a void structure declaration (both flags specified) is allowed, but is useless.
•General fields PID and VARID are not used by this category.
•Fields DIM0, DIM1 and DIM2 (and related field OFFx and flags "Has index N") are not used with the "Begin of user defined structure" flag.
•User defined structure are relative to the current group only: when it change, structure are cleared.
•User defined structure cannot have nested declaration, but can have item with TYPEID related to another user defined structure.
•DIM2 > 0 implies DIM1 > 0 and DIM1 > 0 implies DIM0 > 0.
•Type 0x00000009 (string) has DIM0 as string size (0=default 128 character string): string array indexes are from DIM1 field.
•The disable bit access flag is intended for those TYPEID that normally provides the data bit access (like integer values).
Specific DATA for category 14 (logical variable)
Offset |
Type |
Label |
Description |
---|---|---|---|
+0 |
U32 |
TYPEID |
Structure type ID: 0x00000000-0x0000FFFF predefined 0x00010000-0xFFFFFFFF user defined
Predefined types ID are: 0x00000000=not valid (illegal) 0x00000001=signed 8bit 0x00000002=unsigned 8bit 0x00000003=signed 16bit 0x00000004=unsigned 16bit 0x00000005=signed 32bit 0x00000006=unsigned 32bit 0x00000007=signed 64bit 0x00000008=unsigned 64bit 0x00000009=string (#1) 0x0000000A=float (32bit) 0x0000000B=double (64bit) 0x0000000C=boolean 0x0000000D=timer 0x0000000E=counter 0x0000000F=alias (ladder) 0x00000010=edge (ladder) 0x00000011=(reserved, ex power set) 0x00000012=(reserved, ex axes group) 0x00000013=(reserved, ex path) 0x00000014=(reserved, ex point_l) |
+4 |
U16 |
DIM0 |
Array 0 size (0=none) or string size (#1) |
+6 |
U16 |
DIM1 |
Array 1 size (0=none) |
+8 |
U16 |
DIM2 |
Array 2 size (0=none) |
+10 |
U16 |
OFF0 |
Array 0 index offset |
+12 |
U16 |
OFF1 |
Array 1 index offset |
+14 |
U16 |
OFF2 |
Array 2 index offset |
+16 |
U32 |
FLAGS |
Variable flags: 0x00000001 Disable bit access |
(#1) DIM0 value 0 assume meaning of default string size
Notes:
•User structure type ID are defined with category 13 (logical structure) that have to be defined before the category 14 (logical variable).
•General fields PID and VARID are not used by this category.
•DIM1 > 0 implies DIM0 > 0, and DIM2 > 0 implies DIM1 > 0 and DIM0 > 0.
•Type 0x00000009 (string) has DIM0 as string size (0=default 128 character string): string array indexes are from DIM1 field.
•The disable bit access flag is intended for those TYPEID that normally provides the data bit access (like integer values).
Specific DATA for category 15 (dynamic structure)
Offset |
Type |
Label |
Description |
---|---|---|---|
+0 |
U32 |
TYPEID |
Structure type ID: 0x00000000-0x00000FFF predefined 0x00001000-0xFFFFFFFF user defined
Predefined types ID are: 0=not valid (illegal) 1=signed 8bit 2=signed 16bit 3=signed 32bit 4=signed 64bit 5=unsigned 8bit 6=unsigned 16bit 7=unsigned 32bit 8=unsigned 64bit 9=float (32bit) 10=real (64bit) 11=bool 12=string |
+4 |
U16 |
DIM0 |
Array 0 size (0=none) or string size (#1) |
+6 |
U16 |
DIM1 |
Array 1 size (0=none) |
+8 |
U16 |
DIM2 |
Array 2 size (0=none) |
+10 |
U32 |
FLAGS |
Flags: 0x00000001 Structured begin 0x00000002 Structure end 0x00000004 Disable bit access 0x00000008 Static structure item 0x00000010 Static-instance structure item 0xF0000000 Structure type (mask): 0x0 = structure 0x1 = class 0x2 = namespace 0x3 = interface |
+14 |
U32 |
PTYPEID |
Parent structure ID (0=none) |
(#1) DIM0 value 0 assume meaning of default string size
Notes:
•A used defined structure/class declaration must begin with the 0x1 flag (structure begin) and must end with the 0x2 flag (structure end): a void structure declaration (both flags specified) is allowed, but is useless.
•General fields PID and VARID are not used by this category.
•Field TYPEID, if flags 0x1 (structure begin) is set, contains the source type-id of the structure itself: in all other cases, the field refer to the item target type-id.
•Field PTYPEID is used only when the flag 0x1 (structure begin) is set
•Fields DIM0, DIM1 and DIM2 (and related field OFFx and flags "Has index N") are not used when the flag 0x1 (structure begin) is set
•User defined structure are relative to the current group only: when it change, structure are cleared.
•User defined structure cannot have nested declaration, but can have item with TYPEID related to another user defined structure.
•DIM2 > 0 implies DIM1 > 0 and DIM1 > 0 implies DIM0 > 0.
•Type 13 (string) has DIM0 as string size (0=default 128 character string): string array indexes are from DIM1 field.
•The disable bit access flag is intended for those TYPEID that normally provides the data bit access (like integer values).
•The static structure item flag is valid only if the flags 0x1 (structure begin) is not set.
•The structure type value is valid only if the flags 0x1 (structure begin) is set.
Specific DATA for category 16 (dynamic variable)
Offset |
Type |
Label |
Description |
---|---|---|---|
+0 |
U32 |
TYPEID |
Variable type ID: 0x00000000-0x00000FFF predefined 0x00001000-0xFFFFFFFF user defined
Predefined types ID are: 0=not valid (illegal) 1=signed 8bit 2=signed 16bit 3=signed 32bit 4=signed 64bit 5=unsigned 8bit 6=unsigned 16bit 7=unsigned 32bit 8=unsigned 64bit 9=float (32bit) 10=real (64bit) 11=bool 12=string |
+4 |
U16 |
DIM0 |
Array 0 size (0=none) or string size (#1) |
+6 |
U16 |
DIM1 |
Array 1 size (0=none) |
+8 |
U16 |
DIM2 |
Array 2 size (0=none) |
+10 |
U32 |
FLAGS |
Flags: 0x00000001 (reserved) 0x00000002 (reserved) 0x00000004 Disable bit access 0x00000008 Static variable 0x00000010 Static-instance variable |
(#1) DIM0 value 0 assume meaning of default string size
Notes:
•User dynamic structure typeid's are defined with category 15 (dynamic structure): the dynamic variable can be defined before its declaration.
•General fields PID and VARID are not used by this category.
•DIM1 > 0 implies DIM0 > 0, and DIM2 > 0 implies DIM1 > 0 and DIM0 > 0.
•Type 13 (string) has DIM0 as string size (0=default 128 character string): string array indexes are from DIM1 field.
•The disable bit access flag is intended for those TYPEID that normally provides the data bit access (like integer values).