Skip to content
Jiri Hnidek edited this page Nov 15, 2014 · 8 revisions

Tag Commands

This page contains session methods that can create, destroy or set tag.

def send_tag_create(self, prio, node_id, taggroup_id, data_type, count, custom_type)

The method send_tag_create() has to be called, when client wants to create tag. Note that this method does not contain own value of tag. The value of tag can be sent to Verse server, when client receive tag_create command and following callback method is called.

def cb_receive_tag_create(self, node_id, taggroup_id, tag_id, data_type, count, custom_type)

The callback method _receive_tag_create() is called, when Verse server created new tag in tag group.

def send_tag_destroy(self, prio, node_id, taggroup_id, tag_id)

The method send_tag_destroy() has to be called, when client want to destroy existing tag (it's ID has to be known as well ID of tag group and node).

def cb_receive_tag_destroy(self, node_id, taggroup_id, tag_id)

The callback method _receive_tag_destroy() is called, when Verse server destroyed existing tag.

def send_tag_set_values(self, prio, node_id, taggroup_id, tag_id, data_type, values)

When client wants to set new value of tag, then it has to call send_tag_set_value() method. It may seems that parameter data_type is useless, but keep in mind that Python can distinguish between char, short, int, long int. Similar problem raises with float and double. The parameter has to be there to set data precision. The parameter values has to be tuple. The maximal length of tuple could be four. If you want to set single with previous value, then you have to use following notation: (10,). Finally, when you use string tag, then there could be only one value (not two, three or four).

def cb_receive_tag_set_values(self, node_id, taggroup_id, tag_id, values)

The method cb_receive_tag_set_value() is called, when Verse server set new value of the tag.

Clone this wiki locally