NavigationTopMaking Epics variables into runvar'sCool advanced stuff

Cool advanced stuff

You can use the fact that the Readout program can run as a wish interpreter to visually monitor the control variables you are logging (you can do this in a separate TclServer too of course). This section presents a set of shell and Tcl scripts that show how to do this.

To start the readout program as wish based tcl server you must set the display environment variable in the runreadout script and specify the window switch to readout. A sample script that does this is shown below:

#!/bin/bash
cd ~/controlfix/testing
export DISPLAY=compgrp5:0.0
Readout --camac-trigger --port=2701  --window

The script below determines if the tk interpreter is active and loaded. If so, it presents a very simple display of all the epics data updated by the epicsarchiver.

foreach channel [array names EPICS_DATA] {
    runvar EPICS_DATA($channel)
    runvar EPICS_UNIT($channel)
}


if {[info var tk*] != "" } {
    if {$tkloaded} {
	foreach channel [array names EPICS_DATA] {
	    destroy .f$channel
	    frame .f$channel
	    label .f$channel.label -text $channel
	    label .f$channel.value -textvariable EPICS_DATA($channel)
	    label .f$channel.units -textvariable EPICS_UNIT($channel)
	    pack .f$channel.label .f$channel.value .f$channel.units -side left
	    pack .f$channel -side top
	}
    }
}

Note how this script checks for the existence of tk variables and the state of tkloaded before creating the gui. This script can be run either in window or nonwindowed modes of readout.


Report documentation errors to Ron Fox (fox@nscl.msu.edu)or NSCL's Bugzilla page

NavigationTopMaking Epics variables into runvar'sCool advanced stuff