Go to the source code of this file.
Data Structures | |
struct | Commands |
Client command action function data structure. More... | |
Defines | |
#define | CMD_OK 0 |
Command executed OK, return completion status. | |
#define | CMD_ERR -1 |
Command execution resulted in an error. | |
#define | CMD_NOOP 1 |
Command execution requires no further action (no-op). | |
Functions | |
int | cmd_quit (char *, MsgType, char *) |
QUIT command - terminate the client session. | |
int | cmd_ping (char *, MsgType, char *) |
PING command - communication handshaking request. | |
int | cmd_pong (char *, MsgType, char *) |
PONG command - communication handshaking acknowledgment. | |
int | cmd_info (char *, MsgType, char *) |
INFO command - report client application runtime information. | |
int | cmd_version (char *, MsgType, char *) |
VERSION command - report application version and compilation info. | |
int | cmd_verbose (char *, MsgType, char *) |
VERBOSE command - toggle verbose console output on/off. | |
int | cmd_debug (char *, MsgType, char *) |
DEBUG command - toggle debugging (super-verbose) console output on/off. | |
int | cmd_help (char *, MsgType, char *) |
HELP command - print a list of commands on the client console. | |
int | cmd_history (char *, MsgType, char *) |
HISTORY command - show the application's interactive command history. | |
int | cmd_ports (char *, MsgType, char *) |
PORTS command - report info about open mechanism comm comm ports. | |
int | cmd_rdpos (char *, MsgType, char *) |
RDPOS command - read filter wheel position encoders. | |
int | cmd_setcur (char *, MsgType, char *) |
CURRENT command - set/query drive current in Amps. | |
int | cmd_setsp (char *, MsgType, char *) |
SPEED command - set/query drive speed in rev/sec. | |
int | cmd_setacc (char *, MsgType, char *) |
ACCEL command - set/query move acceleration in rev/sec/sec. | |
int | cmd_setdec (char *, MsgType, char *) |
DECEL command - set/query move deceleration in rev/sec/sec. | |
int | cmd_setstep (char *, MsgType, char *) |
STEPS command - set/query the steps/position in steps. | |
int | cmd_setto (char *, MsgType, char *) |
TIMEOUT command - set/query the communication timeout interval in seconds. | |
int | cmd_mstatus (char *, MsgType, char *) |
MSTATUS command - report detailed microstep drive status. | |
int | cmd_idle (char *, MsgType, char *) |
IDLE command - enable/disable the microstep drive idle current. | |
int | cmd_send (char *, MsgType, char *) |
SEND command - send a raw command to microstep drive. | |
int | cmd_query (char *, MsgType, char *) |
QUERY command - send a raw device query to the microstep drive. | |
int | cmd_reset (char *, MsgType, char *) |
RESET command - reload the runtime config paramters and re-initialize the microstep drive. | |
int | cmd_init (char *, MsgType, char *) |
INIT command - (re)initialize the microstep drive. | |
int | cmd_abort (char *, MsgType, char *) |
ABORT command - abort a move in progress. | |
int | cmd_fpars (char *, MsgType, char *) |
FPARS command - report detailed filter wheel parameters. | |
int | cmd_status (char *, MsgType, char *) |
STATUS command - report client status. | |
int | cmd_filter (char *, MsgType, char *) |
FILTER command - move filter n into the beam. | |
int | cmd_load (char *, MsgType, char *) |
LOAD command - move filter n into the filter wheel's load port. | |
int | cmd_findpos (char *, MsgType, char *) |
FINDPOS command - seek the nearest valid filter position. | |
Variables | |
Commands | cmdtab [] |
Client command action function data structure. | |
int | NumCommands = sizeof(cmdtab)/sizeof(struct Commands) |
number of commands defined |
To add a command, you need to
See commands.c for the full implementation details.
|
Command executed OK, return completion status.
|
|
Command execution resulted in an error.
|
|
Command execution requires no further action (no-op).
|
|
QUIT command - terminate the client session.
|
|
PING command - communication handshaking request.
PINGs are actually handled separately in the SocketCommand() handler (nothing is done by the KeyboardCommand() handler) because the PONG sent back acknowledging the comm handshaking request is, in effect, a pseudo-command (implicit REQ:), not a "DONE:" response to a command request. This exception to the general messaging syntax has to be handled carefully to prevent problems, especially to ensure backwards compatibility with older IMPv applications.
|
|
PONG command - communication handshaking acknowledgment.
cmd_pong doesn't do anything except return a CMD_NOOP (since this "command" must NOT result in a reply back to the sender). In more sophisticated apps, we might actually use receipt of a pong to do something useful (e.g., help build up a node table), so at the very least this module works as a placeholder for future expansion.
|
|
INFO command - report client application runtime information.
The format of cmd_info should be tailored specifically for the particular client application. If a client controls specific instrument or interface functions, the state of those functions should be reported in the info string, making it an omnibus "what is your status" command. |
|
VERSION command - report application version and compilation info.
|
|
VERBOSE command - toggle verbose console output on/off.
In general "Verbose" output refers only to client application level output (i.e., echoing socket message traffic, printing status update info, etc.). An more chatty DEBUG mode is provided that prints more engineering-level info for detailed low-level system debugging.
|
|
DEBUG command - toggle debugging (super-verbose) console output on/off.
DEBUG mode is a super-verbose mode that spews lots of I/O chatter onto the application console, useful during client debugging or for troubleshooting. For example, in client applications that control stepper motors, the full motor control chatter is echoed to the console during DEBUG mode to enable the user to follow the steps the system is (or is not) taking, watch encoder and limit switches assert (or not), etc. DEBUG is normally disabled during normal user operations.
|
|
HELP command - print a list of commands on the client console.
|
|
HISTORY command - show the application's interactive command history.
|
|
PORTS command - report info about open mechanism comm comm ports.
FWPort=/dev/ttyS0 PortStatus=Open |
|
RDPOS command - read filter wheel position encoders.
|
|
CURRENT command - set/query drive current in Amps.
NOTE: the maximum current is not specified a priori, so we need to find some way to set this in the header. At present, until we work this out, this could allow dangerously high currents to be set. |
|
SPEED command - set/query drive speed in rev/sec.
Speeds must be in the range #SI_MINVEL to #SI_MAXVEL (defined in siutils.h) |
|
ACCEL command - set/query move acceleration in rev/sec/sec.
Accelerations are in integer steps from #SI_MINVDOT to #SI_MAXVDOT (defined in siutils.h). |
|
DECEL command - set/query move deceleration in rev/sec/sec.
Decelerations are in integer steps from #SI_MINVDOT to #SI_MAXVDOT (defined in siutils.h), in units of rev/s/s. |
|
STEPS command - set/query the steps/position in steps.
Move distances are in integer units of steps, + or -, with value in the range #SI_MAXMOVE (see scutils.h) |
|
TIMEOUT command - set/query the communication timeout interval in seconds.
This is an internal variable, no microstep controller setting is required. |
|
MSTATUS command - report detailed microstep drive status. Queries the stepper motor controller and reports the current microstep drive paramters. The report is formatted as IMPv2-compliant message with the parameters given as keyword=value pairs. The keywords correspond to the names of the parameters in the SCL command set. This is low-level stuff, meaningful only to people who know the SCL command set, or have the manual at hand. If you have to look at mstatus, you have to be ready to get down to the nitty-gritty. It takes approximately 1 second to execute a complete controller status query, depending on the local communications details. For brief filter status, use the STATUS command (cmd_status()). For detailed filter wheel parameters, use the FPARS command (cmd_fpars()).
|
|
IDLE command - enable/disable the microstep drive idle current.
Sets the fw.Idle flag (1=enabled, 0=disabled), and uploads either the "MD" ("Motor Disable") or "ME" ("Motor Enable") commands to the Si controller. Note that a move can in fact be launched even if the drive is "disabled", as all that is disabled is the idle current (i.e., ME sets the idle current to 50% of the drive current and turns the drive on, while MD sets the idle current to 0 and turns the drive off. The next FL or other "move" command will start the drive at full current). If IDLE is given with no arguments, it reports the current idle setting (as it is known) |
|
SEND command - send a raw command to microstep drive.
The Si motor controllers require commands in all uppercase. As a precaution we force the arguments of this command to uppercase.
|
|
QUERY command - send a raw device query to the microstep drive.
To send a command that produces no reply from the controller, use the "send" command, cmd_send().
|
|
RESET command - reload the runtime config paramters and re-initialize the microstep drive.
This provides the client application with a warm restart facility. |
|
INIT command - (re)initialize the microstep drive.
|
|
ABORT command - abort a move in progress.
Sets the fw.Abort flag to report to upstream processes that an abort has been sent and services. It then queries the drive status after sending the abort to try to determine the drive status. |
|
FPARS command - report detailed filter wheel parameters. Prints a detailed listing of all of the filter wheel control parameters. The defaults are defined in the runtime configuration file (see loadconfig()), and may be overridden by various low-level motor control commands (e.g., SPEED, ACCEL, etc.). This reptors the current state of this parameter set. The report is formatted as IMPv2-compliant message with the parameters given as keyword=value pairs. For brief filter status, use the STATUS command (cmd_status()). For the current microstep drive internal parameters, use the MSTATUS command (cmd_mstatus()).
|
|
STATUS command - report client status.
FWState=Ready Filter=2 Load=5If the filter is out of position when queried, it will read something like FWState=Ready Filter=UNKNOWN Load=UNKNOWN |
|
FILTER command - move filter
If a move is requested, the filter is moved through N steps, where N is the least path to the target filter position.' See cmd_load() for the equivalent LOAD command to put a specific filter into the loading position |
|
LOAD command - move filter
If a move is requested, the filter is moved through N steps, where N is the least path to the target filter position. See cmd_filter() for the equivalent FILTER command to put a specific filter into the instrument beam. |
|
FINDPOS command - seek the nearest valid filter position.
|
|
Client command action function data structure.
|
|
number of commands defined
|