Command tags, flags and command control

The tagging mechanism described in the beginning of this tutorial is actually more than just a message tagging facility. For example, you can stop any running command with the stop command, from any connection:

myloop << loop legRF2 = legLF2,
...
stop myloop;

You can also freeze a command with the freeze command and unfreeze it (it will restart where it was before freezing) with the unfreeze command. There is also a block/unblock pair of commands to block new commands with a given tag and prevent them to be executed. Note that tags can prefix a set of commands between brackets, like { ... }, and it can be associated to large portions of code, not only single commands.

Next to the tag, it is possible to use one or more flags. Flags are keywords prefixed by a + sign. The most useful flags are +begin and +end which send a system message when the command starts or stops, or +bg which puts the command in background. Here are a set of illustrating examples:

mytag+begin: loop legRF2 = legLF2,
[139464:mytag] *** begin
+begin+end: wait(1s);
[00564537] *** begin
[00565537] *** end

More flags are described in the URBI Language Specification.

Since URBI 1.0, you can use hierarchical tags like mytag.subtag. The advantage is that you can stop a whole hierarchy based only on the highest tag: the above tag can be stopped with a stop mytag.subtag and a stop mytag as well, and you can group commands more easily with this mechanism. Future version will also include multi-tagging to even increase the possibilities.