Skip to content

Specification of Tag Commands

Jiri Hnidek edited this page Sep 19, 2014 · 7 revisions

Tag Commands

Verse server uses tags for storing simple scalar and vector values. Maximal length of vector stored in tag is 4.

Tag Create

This command is sent by Verse server to client, when client subscribed to tag group. This command can be also sent from client to Verse server, when client wants to create new tag. The command has following structure:

  0   1   2   3   4   5   6   7   8   9   10  11  12  13  14
+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
| O | L | S |    Node ID    | Tg ID | TagID | D | C |   CT  |
+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+

More detail description of structure:

 0                   1         1         2     2             3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 
+---------------+
|   OpCode=68   |
+---------------+
|    Length     |
+---------------+
|  Share=0/4/6  |
+---------------+---------------+---------------+---------------+
|                           Node ID                             |*
+---------------+---------------+---------------+---------------+
|          TagGroup ID          |*
+---------------+---------------+
|            Tag ID             |
+---------------+---------------+
|   Data Type   |
+---------------+
|     Count     |
+---------------+---------------+
|         Custom Type           |
+---------------+---------------+

Items of command have following purpose:

  • OpCode: identifier of this command.
  • Length: minimal length of this command.
  • Share: the length of address in bytes that is shared between commands with same OpCode.
  • Node ID: the ID of node, where client wants to create new tag
  • TagGroup ID: the ID of tag group, where client wants to create new tag.
  • Tag ID: the ID of new tag (it is unique inside of tag group). When client sends this command, then this value has to be -1 (0xFFFF).
  • Data Type: data type of new tag as it is described in Data Types.
  • Count: count of values shared in new tag. It could be: 1, 2, 3, 4.
  • Custom Type: user defined type of this tag group.

Note: any property of tag (ID, Data Type, Count of values or Custom Type) could not be changed. It is only possible to change value or values of tag. Value of tag can be sent in special command, when client knows ID id of tag.

Tag Destroy

This command can be sent by client, when client wants to destroy some tag and it has write asses to the node containing this tag. This command is also sent by server, when some tag is destroyed. The command has following structure:

  0   1   2   3   4   5   6   7   8   9   10
+---+---+---+---+---+---+---+---+---+---+---+
| O | L | S |    Node ID    | Tg ID | TagID |
+---+---+---+---+---+---+---+---+---+---+---+

More detail description of structure:

 0                   1         1         2     2             3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 
+---------------+
|   OpCode=69   |
+---------------+
|    Length     |
+---------------+
|  Share=0/4/6  |
+---------------+---------------+---------------+---------------+
|                           Node ID                             |*
+---------------+---------------+---------------+---------------+
|          TagGroup ID          |*
+---------------+---------------+
|            Tag ID             |
+---------------+---------------+
  • OpCode: identifier of this command.
  • Length: minimal length of this command.
  • Share: the length of address in bytes that is shared between commands with same OpCode.
  • Node ID: the ID of node, where client wants to destroy tag
  • TagGroup ID: the ID of tag group, where client wants to destroy tag.
  • Tag ID: the ID of the tag that will be destroyed.

Tag Set Value

There are several tag set value commands. Every command differs in data type and count of values.

Uint8

When client wants to set value of tag containing uint8 (in C it is uint8_t), then there are four variant of this command. These variants differs in count of values. A number of values could be: 1, 2, 3, 4. In other words you can set: scalar, 2D vector, 3D vector or 4D vector (quaternion). Command have following structures:

  0   1   2   3   4   5   6   7   8   9   10  11 
+---+---+---+---+---+---+---+---+---+---+---+---+
| O | L | S |    Node ID    | Tg ID | TagID | V |
+---+---+---+---+---+---+---+---+---+---+---+---+

  0   1   2   3   4   5   6   7   8   9   10  11  12
+---+---+---+---+---+---+---+---+---+---+---+---+---+
| O | L | S |    Node ID    | Tg ID | TagID | V | V |
+---+---+---+---+---+---+---+---+---+---+---+---+---+

  0   1   2   3   4   5   6   7   8   9   10  11  12  13
+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
| O | L | S |    Node ID    | Tg ID | TagID | V | V | V |
+---+---+---+---+---+---+---+---+---+---+---+---+---+---+

  0   1   2   3   4   5   6   7   8   9   10  11  12  13  14
+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
| O | L | S |    Node ID    | Tg ID | TagID | V | V | V | V |
+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+

More detail description of structures:

 0                   1         1         2     2             3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 
+---------------+
|   OpCode=70   | (71,72,73)
+---------------+
|    Length     |
+---------------+
| Share=0/4/6/8 |
+---------------+---------------+---------------+---------------+
|                           Node ID                             |*
+---------------+---------------+---------------+---------------+
|          TagGroup ID          |*
+---------------+---------------+
|            Tag ID             |*
+---------------+---------------+
| Value (uint8) | (70,71,72,73)
+---------------+
| Value (uint8) | (71,72,73)
+---------------+
| Value (uint8) | (72,73)
+---------------+
| Value (uint8) | (73)
+---------------+
  • OpCode: identifier of this command.
  • Length: minimal length of this command.
  • Share: the length of address in bytes that is shared between commands with same OpCode.
  • Node ID: the ID of node, where client/server wants to set value of tag.
  • TagGroup ID: the ID of tag group, where client/server wants to set value of tag.
  • Tag ID: the ID of the tag, where will be set/changed value.
  • Value: value(s) of tag. Command with OpCode equal to 70 has only one value. Command with OpCode equal to 71 has two values, etc.

Note: Commands for setting other data types are analogous. Thus there is only detail description of commands structures for following commands.

Uint16

 0                   1         1         2     2             3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 
+---------------+
|   OpCode=74   | (75,76,77)
+---------------+
|    Length     |
+---------------+
| Share=0/4/6/8 |
+---------------+---------------+---------------+---------------+
|                           Node ID                             |*
+---------------+---------------+---------------+---------------+
|          TagGroup ID          |*
+---------------+---------------+
|            Tag ID             |*
+---------------+---------------+
|          Value (uint16)       | (74,75,76,77)
+---------------+---------------+
|          Value (uint16)       | (75,76,77)
+---------------+---------------+
|          Value (uint16)       | (76,77)
+---------------+---------------+
|          Value (uint16)       | (77)
+---------------+---------------+

Uint32

 0                   1         1         2     2             3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 
+---------------+
|   OpCode=78   | (79,80,81)
+---------------+
|    Length     |
+---------------+
| Share=0/4/6/8 |
+---------------+---------------+---------------+---------------+
|                           Node ID                             |*
+---------------+---------------+---------------+---------------+
|          TagGroup ID          |*
+---------------+---------------+
|            Tag ID             |*
+---------------+---------------+---------------+---------------+
|                          Value (uint32)                       | (78,79,80,81)
+---------------+---------------+---------------+---------------+
|                          Value (uint32)                       | (79,80,81)
+---------------+---------------+---------------+---------------+
|                          Value (uint32)                       | (80,81)
+---------------+---------------+---------------+---------------+
|                          Value (uint32)                       | (81)
+---------------+---------------+---------------+---------------+

Uint64

 0                   1         1         2     2             3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 
+---------------+
|   OpCode=82   | (83,84,85)
+---------------+
|    Length     |
+---------------+
| Share=0/4/6/8 |
+---------------+---------------+---------------+---------------+
|                           Node ID                             |*
+---------------+---------------+---------------+---------------+
|          TagGroup ID          |*
+---------------+---------------+
|            Tag ID             |*
+---------------+---------------+---------------+---------------+
|                          Value (uint64)                       | (82,83,84,85)
+---------------+---------------+---------------+---------------+
|                                                               |
+---------------+---------------+---------------+---------------+
|                          Value (uint64)                       | (83,84,85)
+---------------+---------------+---------------+---------------+
|                                                               |
+---------------+---------------+---------------+---------------+
|                          Value (uint64)                       | (84,85)
+---------------+---------------+---------------+---------------+
|                                                               |
+---------------+---------------+---------------+---------------+
|                          Value (uint64)                       | (85)
+---------------+---------------+---------------+---------------+
|                                                               |
+---------------+---------------+---------------+---------------+

Real16

 0                   1         1         2     2             3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 
+---------------+
|   OpCode=86   | (87,88,89)
+---------------+
|    Length     |
+---------------+
| Share=0/4/6/8 |
+---------------+---------------+---------------+---------------+
|                           Node ID                             |*
+---------------+---------------+---------------+---------------+
|          TagGroup ID          |*
+---------------+---------------+
|            Tag ID             |*
+---------------+---------------+
|          Value (real16)       | (86,87,88,89)
+---------------+---------------+
|          Value (real16)       | (87,88,89)
+---------------+---------------+
|          Value (real16)       | (88,89)
+---------------+---------------+
|          Value (real16)       | (89)
+---------------+---------------+

Real32

 0                   1         1         2     2             3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 
+---------------+
|   OpCode=90   | (91,92,93)
+---------------+
|    Length     |
+---------------+
| Share=0/4/6/8 |
+---------------+---------------+---------------+---------------+
|                           Node ID                             |*
+---------------+---------------+---------------+---------------+
|          TagGroup ID          |*
+---------------+---------------+
|            Tag ID             |*
+---------------+---------------+---------------+---------------+
|                          Value (real32)                       | (90,91,92,93)
+---------------+---------------+---------------+---------------+
|                          Value (real32)                       | (91,92,93)
+---------------+---------------+---------------+---------------+
|                          Value (real32)                       | (92,93)
+---------------+---------------+---------------+---------------+
|                          Value (real32)                       | (93)
+---------------+---------------+---------------+---------------+

Real64

 0                   1         1         2     2             3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 
+---------------+
|   OpCode=94   | (95,96,97)
+---------------+
|    Length     |
+---------------+
| Share=0/4/6/8 |
+---------------+---------------+---------------+---------------+
|                           Node ID                             |*
+---------------+---------------+---------------+---------------+
|          TagGroup ID          |*
+---------------+---------------+
|            Tag ID             |*
+---------------+---------------+---------------+---------------+
|                          Value (real64)                       | (94,95,96,97)
+---------------+---------------+---------------+---------------+
|                                                               |
+---------------+---------------+---------------+---------------+
|                          Value (real64)                       | (95,96,97)
+---------------+---------------+---------------+---------------+
|                                                               |
+---------------+---------------+---------------+---------------+
|                          Value (real64)                       | (96,97)
+---------------+---------------+---------------+---------------+
|                                                               |
+---------------+---------------+---------------+---------------+
|                          Value (real64)                       | (97)
+---------------+---------------+---------------+---------------+
|                                                               |
+---------------+---------------+---------------+---------------+

String8

 0                   1         1         2     2             3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 
+---------------+
|   OpCode=98   |
+---------------+
|    Length     |
+---------------+
| Share=0/4/6/8 |
+---------------+---------------+---------------+---------------+
|                           Node ID                             |*
+---------------+---------------+---------------+---------------+
|          TagGroup ID          |*
+---------------+---------------+
|            Tag ID             |*
+---------------+---------------+---------------+---------------+
| String Length |                     String                    |
+---------------+---------------+---------------+---------------+
Clone this wiki locally