Code: |
AS + 400 |
Symbolic: |
bccMonCreate |
This command will try to create a new variable monitor on the connected device. Request parameters are the following:
Offset |
Type |
Label |
Description |
---|---|---|---|
0 |
U32 |
OWNER |
Owner identification ID |
4 |
U8 |
N |
Number of variables (1-25) |
5 |
VAR0 |
Variable def 0 |
|
... |
VAR1 |
Variable def 1 |
|
... |
... |
.... |
.... |
... |
VAR{N-1} |
Variable def N-1 |
Notes:
•maximum value for N depend on maximum data size (no more than 251 bytes) with a limit of 25 variables.
On success, a bccAck is received with the following data:
Offset |
Type |
Label |
Description |
---|---|---|---|
0 |
U32 |
ID |
Monitor identification ID |
4 |
U8 |
SIZE |
Total data size, calculated by device (must match your request resulting data size). |
On failure, a bccNack is received. Specific errors:
NACK code |
Description |
Extra data |
---|---|---|
nackOutOfResource |
No more resource to create a new monitor, |
|
nackDataOverflow |
Data for monitor is exceeding the maximum limit (for BCC3 is 255 bytes) |
|
nackIllegalArgs |
Illegal arguments |
U16 What illegal 1=(unused) 2=Number of variable 10+N=Bad variable {N} U16 Variable error code 1=Unkown type 2=Bad index 3=Bad address 4=Bad repeat counter 5=Variable data too long |
Notes:
•Don't make any assumption about monitor ID assignment: they are strictly depending to a specific implementation of the BCC3 protocol and can be both in sequential or random order.
•Don't make any assumption of monitor definition persistence: if monitor structures - on a device - run out of space, the specific implementation of the BCC3 protocol can act in different way:
1.Reply with a nackOutOfResouce error.
2.Reuse monitor entries not yet started (older or in an arbitrary order).
•Monitor can use not initialized variables in reading, but they always have conventional 0 value.