Example 1: with a B&R PLC array
There is a global variable on the B&R PLC
long _GLOBAL arVariableLong[200];
see the illustration below for the definition on the control system side.
Attention: the value in the input field 'Indices:' must be entered manually !
You can also place an array variable in the control system over a B&R PLC structure. This means that an unformatted binary dump of the structure will be read and written.
An array variable is created via the variable dialog in the control system. Enter the size of the structure in the input field "Indices" (dimension).
If it is an "i/u8Bit" array, you have to enter the size of the structure in Bytes in the input field "Indices".
If it is an "i/u16Bit" array, you have to enter the size of the structure in Bytes/2 in the input field "Indices".
If it is an "i/u32Bit" array, you have to enter the size of the structure in Bytes/4 in the input field "Indices".
If it is a "float" array, you have to enter the size of the structure in Bytes/4 in the input field "Indices".
Example: if you want to read out a structure that has a size of 20 Bytes in the PLC with a double word array in the control system, you have to enter the value '5' in the "Indices" field.
!The number of Bytes contained in a structure or an array can be found out in the PVI browser in the driver configuration (Column: Count).
Example2: with a B&R PLC structure
There is a global variable on the B&R PLC
struct strukt1 _GLOBAL struktTest;
its size is 156 Bytes. See the illustration below for the definition on the control system side.
ATTENTION: you have to manually enter the value in the input field 'Indices'!
Using the datatype CPU status
The datatype "CPU status" determines the last valid CPU status and returns it as a value.
Possible CPU status values:
Status name |
Status value |
---|---|
WarmStart |
0: Status of B&R: OK |
ColdStart |
1: Status of B&R: OK |
Reset |
=2: Status of B&R: Error |
Reconfiguration |
3: Status of B&R: Error |
NMI |
=4: Status of B&R: Error |
Diagnostics |
5: Status of B&R: Error |
Error |
=6: Status of B&R: Error |
ConnectionError |
7: Status of COPALP: Error |
Unknown Status |
65535: Status of COPALP: Error |
Info: for each CPU only one status variable can be created.