equipman
SPring-8 Equipment Manager RPC interface
DESCRIPTION
Developers at SPring-8 (the 8-GeV Super Photon Ring in Hyogyo, Japan) are developing an remote procedure call (RPC) protocol for controlling motors, counters and other hardware. spec includes initial support for the motors and counters and (as of release 4.05.10) a built-in function for sending arbitrary commands.
THE em_io() FUNCTION
Arbitrary Equipment Manager commands can be sent using the em_io([host, ] voc) function. When invoked with two arguments, the first argument host is a string containing the host name, such as "bl35vme0", while the second argument is the voc part of the command (verb-object-command?). If called with just the voc argument, the same host name as the previous em_io() call is used. If the command is a "get" voc, the reply is returned as a string. Otherwise the return value is a zero. If there is an error, the return value is -1.
EQUIPMENT MANAGER MOTORS
Configuration of the Equipment Manager (EM) motors is complicated by the length of the string needed to identify each motor. In fact, two strings are needed to identify each motor. One is the host name (associated with an IP address) for each VME crate. The other string identifies the motor, for example as bl_35in_st1_motor_1. spec assumes that for a particular crate, the first components of the motor strings will all be the same. This assumption lets the strings be specified within the current constraints of spec's configuration editor.
To configure EM motors, on the Devices screen, select the type of motor controller as "SPring-8 Equipment Manager (RPC)". One controller entry is for an entire VME crate. For the DEVICE, enter a string in the form hostname:prefix. The field width for this string is about 64 bytes, so very long strings can be accommodated. An example for DEVICE would be bl35vme0:bl_35in_st1. For the NUM field, enter as many motors as will be used in the particular crate. It is alright for the value to be bigger than necessary.
By default, the unique part of the name will be motor_num where num is motor number. To configure an arbitrary string for the unique part of the name, use the optional motor-parameter screen of the configuration editor, accessed by typing m (twice) from the main motor screen. Enter the rest of the EM motor name (minus the intervening underscore _) as a string under "Generic Parameter 1". The field length there is only 18 bytes. (That constraint is why the rest of the prefix is entered with the crate host name.) In the above example, the string would be motor_1.
Note, the division between what is prefix and what is the unique part for each motor is arbitrary, but must be consistent for each motor crate, with the unique part of the name fitting in the 18-character field on the second optional motor screen.
With the Equipment Manager identification done, the spec motor names and mnemonics can be chosen as desired.
Note, spec sets the software motor limits in the RPC server for each motor to agree with the software limits in the spec settings file. That is to say, the current software motor limits that could be obtained from the RPC server are ignored.
EQUIPMENT MANAGER COUNTERS
To configure EM counters and counter/timers, first go to the Devices screen of spec's hardware configuration editor. In the scalers section, select the type of counter as either "SPring-8 EM Counters (RPC)" or "SPring-8 EM Counter/Timer (RPC)".
For the DEVICE, enter a string in the form hostname:prefix. For the ADDR, enter the module number of the counter in the crate. The counter name will be formed by appending _counter_A or _counter_A_C to the prefix (depending on whether the command is for the unit or an individual channel), where A is the value of the ADDR field and C is the channel number of the counter from the scalers screen.
