next up previous
Next: Hints for linking to Up: The CEBAF Test Package: Previous: Variable Registration System

Subsections

RPC service

An application interface is currently being developed that allows access to the registered variables. Through these calls, one may get a list of registered variables or a list of a subset of the variables (e.g. by class). One may also read or set any of the registered variables. Through special hooks placed on a special class of variables, test and histogram definitions may also be changed through remote procedure calls.

Fortran RPC access routines

C RPC access routines

At present, the C interface to RPC is undocumented and may be subject to change.

As an example the call to retrieve a list of variables is

long daVarList(char *pattern, char ***listp, int *count);
This function will return a pointer to a list of all registered variables that begin with the string contained in pattern. The number of variables in the list will be returned in count. For example
status = daVarList("parm.", &list, &count);
will return a list of all variables in the parameter class.

Routines are also available to read or write any parameter. Since there is a networking overhead that limits RPC to several hundred calls a second, routines will also be provided that can set or read an arbitrary list of variables in one subroutine call. Since RPC calls are served in between the processing of events, the use of a single RPC call to read or write a list of variables insures that all variables returned or set correspond to a single event.

Class Parsing

When a string identifying a variable is passsed through an RPC call, the server follows a specific rule to interpret the variable name. If the string contains several periods in it, the server first searches for a registered variable of the name only up to the first period. If this is not found, the string up to the second period is searched for and so on. When a match is found, the server looks at the hook attributes for the registered variable. If the hook for the present function (read or write) is found, that function is called to handle the read or write request. If there are no hooks, then a default handler is called.

Attributes

From remote applications, one may add an attribute specifier to the end of a registered variable name. This is done by adding a period followed by the name of the attribute. The default attributes are value, title, type, size, flags, and name. If the variable or it's handler allows it, additional attributes may be specified. If no attribute is specified, then the value attribute is used.

Rebooking histograms and tests through RPC

When a block of tests or histograms is booked, a registered variable of the name block.class.blockname is created. (E.g., for the test block in section 2.2, the variable block.test.hms is created.) The value of this variable is the number of times that the block has been executed and the title is the entire string of characters from the input file between and including the begin and end lines.

In order to change the test definitions for this example test block, the remote application requests the value of block.test.hms.title. The remote application can then put this string in an editor widget where the user can edit the test definitions. The application then writes the new string to the variable block.test.hms.title. On the server, the variable block.test will have been defined with a special write hook. As well as resetting the title attribute of block.test.hms, the special handler will recompile the test code so that on the next event processed, the new tests will be in effect.


next up previous
Next: Hints for linking to Up: The CEBAF Test Package: Previous: Variable Registration System
Stephen A. Wood 2005-03-18