State VariablesAdding application specific variablesconst Run variables

Run variables

Run variables are Tcl variables that are registered with Readout to be periodically logged to the event stream in run variable documentation buffers. Run variables can be changed at any time, either by a script or by the C/C++ code. They are intended to document the change in value of experimental paramters that might drift in the course of a run. The CRunVariable class that implements run variables is derived from CTCLVariable.

To create a Run variable, you can either:

To programmatically create a runvar you need to:

The example below shows how to create a run variable. This code fragment should be put in the SetupRunVariables function.

            ...
            CRunVariableCommand* pRunvarCommand = 
                  rCore.getRunVariables();
            CRunVariable* pTemp = 
                  pRunvarCommand.Create(string("temperature"),
                                                     getTemperature());
            if(!pTemp) {
               cerr << "Attempted to double create runvar "temperature"
                     << endl;
            }
            ...
         

In the example above, getTemperature() is assumed to be a function that returns a string value for the current temperature being monitored.

Once created, you can choose any of the mechanisms described in Ordinary Tcl variables to provide access to it.

If you want to update the variable periodically, you have several choices:


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

State VariablesAdding application specific variablesconst Run variables