4 Noticeboard Extension

The Adam notice board system (SUN/77) stores arrays of bytes in shared memory. Each notice board item has associated with it a data type and dimensions but the notice board system itself does not attach any meaning to them; it is up to the applications accessing the noticeboard to agree on the interpretation of the type and dimension information. The types recognizes by the Tcl/Tk interface to the noticeboard system and the way it interprets the data value are:

_INTEGER
4 byte signed integers.
_REAL
4 byte floating point numbers.
_DOUBLE
8 byte floating point numbers.
_LOGICAL
4 byte logical values where zero is FALSE and any other value is TRUE.
_CHAR
A character string.

The notice board extension defines one new command nbs. The nbs command can be used to read nbs notice board items with:

  nbs get <nbs_name>

which returns the values stored in the specified nbs item. If the type of the item is one of _INTEGER, _REAL, _DOUBLE or _LOGICAL the values stored in noticeboard are formatted into a list of integer, float or logical values as appropriate. If the item is of any other type the entire item is simply returned as a string with no interpretation.

Notice board items can be written with:

  nbs put <nbs_name> <value>

where <nbs_name> is a fully qualified nbs item name and <values> is the values to be written. The format of <values> depends on the type of the nbs item; if it is _INTEGER, _REAL, _DOUBLE or _LOGICAL, it must be a list of values of that can be converted to the appropriate type by the usual rules and of exactly the correct length to fill the item. If the type is _CHAR it must by a string, no longer than the length of the item; the string will be padded with blanks to the correct length before being written to the noticeboard. If the item has any other type <value> must be a string of exactly the same length of the item.

The command:

  nbs info <nbs_name>

returns a list of information about the nbs item. The first element of the list which indicates whether the item is a primitive item (1) or a structure item (0). If it is a structure item the remaining elements of the list are the names of the children of the item. If it is a primitive item the remaining elements are:

(1)
The type.
(2)
The length.
(3)
A list of the dimensions.

Noticeboard items can also be “monitored”; at some specified time interval the value stored in the item is copied into a Tcl variable, again using the standard type conversions.

  nbs monitor <nbs_name> <variable>

adds <nbs_name> to the list of NBS items to be monitored and associates it with the global Tcl variable <variable>.

  nbs start <interval>

starts monitoring all the NBS items in the list with the interval between checks set to <interval> milliseconds.

  nbs stop

stops the monitoring process and

  nbs clear

empties the list of nbs items being monitored.

  nbs monitor

returns a list of all the noticeboard items currently being monitored. Each element of the list consists of a two element list giving the notice board item name and the name of the corresponding Tcl variable name.

Examples are given in appendix B.