A.2 Description

A.2.3 ktl monitor varname ?script? ?-binary?


This option is only available in ktk.

Monitor the specified keyword, optionally executing a script whenever a monitor is triggered. The variable name is returned as the command value.

ktl link must already have been used to link the service and keyword. Usually, varname is the keyword name, but ktl link may have overridden this.

When a monitor is triggered, the varname global variable is updated with the new keyword value. By default this is the ASCII (external) representation of the value (usually this is what GUIs will want to use), but -binary will force use of the binary (internal) representation.

If a script is specified, it can be any set of Tcl commands and will be invoked after the global variable has been set.

The KTL_NOPRIME flag is always used when enabling monitors. This means that no explicit read of the keyword to obtain an initial value will take place. Some keyword libraries will handle this internally. Others will not.

Numeric values which do not begin with a sign will have a leading space inserted. This is to improve visual effect (a column of left-justified numbers, some of which have signs and some of which don't looks horrible!). This behavior cannot currently be controlled.

For example, using ASCII representation (degrees in this case):

ktk4.1% ktl link dcs2 az
az
ktk4.1% ktl monitor az {puts $az}
az
ktk4.1% 
 354.8103
 354.8116
 354.8130
 .
 .
...and using binary representation (radians in this case):

ktk4.1% ktl link dcs2 az   
az
ktk4.1% ktl monitor az {puts $az} -binary
az
ktk4.1% 
 6.22573
 6.22576
 6.22578

Tcl/Tk/KTL Interface - 13 NOV 1996

Generated with Harlequin WebMaker

Back to the Keck Home Page