Main Page | Data Structures | File List | Data Fields | Globals | Related Pages

commands.h

Go to the documentation of this file.
00001 #ifndef COMMANDS_H 00002 #define COMMANDS_H 00003 00017 // Common interactive client commands 00018 00019 int cmd_quit (char *, MsgType, char *); // quit the application 00020 int cmd_ping (char *, MsgType, char *); // ping (comm handshake request) 00021 int cmd_pong (char *, MsgType, char *); // pong (comm handshake acknowledge) 00022 int cmd_info (char *, MsgType, char *); // return client application info 00023 int cmd_version(char *, MsgType, char *); // return version info 00024 int cmd_verbose(char *, MsgType, char *); // toggle verbose mode 00025 int cmd_debug (char *, MsgType, char *); // toggle debug (superverbose) mode 00026 int cmd_help (char *, MsgType, char *); // show command help 00027 int cmd_history(char *, MsgType, char *); // cli history utility 00028 00029 // Microstep drive commands 00030 00031 int cmd_status (char *, MsgType, char *); // report drive status (inputs and drive params) 00032 int cmd_mstatus (char *, MsgType, char *); // query/print detailed microstep drive status 00033 int cmd_ports (char *, MsgType, char *); // show current mechanism comm ports 00034 int cmd_rdpos (char *, MsgType, char *); // read position encoders 00035 int cmd_setcur (char *, MsgType, char *); // set motor drive current (amps) 00036 int cmd_seticur (char *, MsgType, char *); // set motor idle current (amps) 00037 int cmd_setsp (char *, MsgType, char *); // set move speed (rev/s) 00038 int cmd_setacc (char *, MsgType, char *); // set move acceleration (rev/s/s) 00039 int cmd_setdec (char *, MsgType, char *); // set move deceleration (rev/s/s) 00040 int cmd_setdist (char *, MsgType, char *); // set move distance (steps) 00041 int cmd_setto (char *, MsgType, char *); // set/query timeout interval (sec) 00042 int cmd_setpt (char *, MsgType, char *); // set/query controller polling interval (msec) 00043 int cmd_settopo (char *, MsgType, char *); // set/query mechanism topology 00044 int cmd_idle (char *, MsgType, char *); // disable motor (idle to 0 amps) 00045 int cmd_reset (char *, MsgType, char *); // reset runtime & controller params 00046 int cmd_init (char *, MsgType, char *); // initialize the microstep drive 00047 int cmd_abort (char *, MsgType, char *); // abort/stop microstep drive 00048 int cmd_sclcmds (char *, MsgType, char *); // show list of SCL commands 00049 int cmd_ismask (char *, MsgType, char *); // set/query the input status bitmask 00050 int cmd_ndata (char *, MsgType, char *); // set/query the number of data bits 00051 int cmd_inpos (char *, MsgType, char *); // set/query the in-position bit address (0 disables) 00052 int cmd_homeaddr(char *, MsgType, char *); // set/query the home sensor address (0 disables) 00053 int cmd_limits (char *, MsgType, char *); // set/query the limit switches (OFF|OPEN|CLOSED) 00054 int cmd_moveit (char *, MsgType, char *); // execute a move with verbose feedback 00055 int cmd_moveabs (char *, MsgType, char *); // move to an absolute step-count position 00056 int cmd_moverel (char *, MsgType, char *); // execute a relative step-count move 00057 int cmd_moveto (char *, MsgType, char *); // move to an indexed position 00058 int cmd_findpos (char *, MsgType, char *); // seek a valid position 00059 00060 // Application command/action structure 00061 00066 struct Commands { 00067 char *cmd; 00068 00095 int(* action)(char *args, MsgType msgtype, char *reply); 00096 00097 char *usage; 00098 char *description; 00099 } 00100 cmdtab[] = { 00101 {"quit" ,cmd_quit ,"quit","Terminate the client session"}, 00102 {"status" ,cmd_status ,"status","Report the device status"}, 00103 {"mstatus" ,cmd_mstatus ,"mstatus","Query and report detailed microstep drive status"}, 00104 {"rdpos" ,cmd_rdpos ,"rdpos","Read the microstep drive position status"}, 00105 {"move" ,cmd_moveit ,"move <Fx>","Execute a raw SCL Fx move command with verbose output"}, 00106 {"moveto" ,cmd_moveto ,"moveto <I>","Move to indexed position I, range: 1..Npos"}, 00107 {"moveabs" ,cmd_moveabs ,"moveabs <X>","Move to absolute step-count position X, range: +/-16000000"}, 00108 {"moverel" ,cmd_moverel ,"moverel <dX>","Move dX steps from current position, range: +/-16000000"}, 00109 {"abort" ,cmd_abort ,"abort","Abort all motions and clear the drive command buffer"}, 00110 {"cmds" ,cmd_sclcmds ,"cmds","Print a list of all low-level SCL commands"}, 00111 {"findpos" ,cmd_findpos ,"findpos","Seek the nearest valid position in an indexed mechanims"}, 00112 {"current" ,cmd_setcur ,"current <Amps>","Set/query the drive current in Amps, range: 0-Imax"}, 00113 {"accel" ,cmd_setacc ,"accel <rev/s/s>","Set/query the drive acceleration in rev/s/s, range: 1-3000"}, 00114 {"speed" ,cmd_setsp ,"speed <rev/s>","Set/query the drive speed in rev/s, range: 0.025-50"}, 00115 {"dist" ,cmd_setdist ,"dist <steps>","Set/query the move distance in steps, range: +/-16000000"}, 00116 {"decel" ,cmd_setdec ,"decel <rev/s/s>","Set/query the drive deceleration in rev/s/s, range: 1-3000"}, 00117 {"idlecur" ,cmd_seticur ,"idlecur <Amps>","Set/query the drive idle current in Amps, range: 0-Imax"}, 00118 {"idle" ,cmd_idle ,"idle <on|off>","Enable/Dsiable drive idle after moves"}, 00119 {"timeout" ,cmd_setto ,"timeout <sec>","Set/query the drive communications timeout in seconds"}, 00120 {"polltime",cmd_setpt ,"polltime <msec>","Set/query the drive polling time in milliseconds"}, 00121 {"topology",cmd_settopo ,"topology <rotary|linear>","Set/query the mechanism topology, rotary or linear"}, 00122 {"ndata" ,cmd_ndata ,"ndata <n>","Set/query the number of position data bits (0..8, 0=unused)"}, 00123 {"inposaddr",cmd_inpos ,"inposaddr <n>","Set/query the in-position sensor address (0..8, 0=unused)"}, 00124 {"homeaddr",cmd_homeaddr,"homeaddr <n>","Set/query the home sensor address (0..8, 0=unused)"}, 00125 {"ismask" ,cmd_ismask ,"ismask <10101010>","Set/query the Input Status bit mask (8-bits)"}, 00126 {"limits" ,cmd_limits ,"limits <off|open|closed>","Set/query limit switches"}, 00127 {"init" ,cmd_init ,"init","(re)Initialize the microstep drive motion profile parameters"}, 00128 {"reset" ,cmd_reset ,"reset","Reload the runtime config file and re-initialize the drive"}, 00129 {"verbose" ,cmd_verbose ,"verbose","Toggle verbose output mode on/off"}, 00130 {"debug" ,cmd_debug ,"debug","Toggle super-verbose debugging output mode on/off"}, 00131 {"history" ,cmd_history ,"history","Show the command history"}, 00132 {"info" ,cmd_info ,"info","Report application runtime info"}, 00133 {"version" ,cmd_version ,"version","Report the application version and compilation time"}, 00134 {"ports" ,cmd_ports ,"ports","List information about the active drive comm ports"}, 00135 {"help" ,cmd_help ,"help <cmd>","Help command (alias: ? <cmd>)"}, 00136 {"?" ,cmd_help ,"",""}, // "" excludes from help 00137 {"ping" ,cmd_ping ,"",""}, 00138 {"pong" ,cmd_pong ,"",""} 00139 }; 00140 00141 // Number of commands defined (so we don't have to count correctly) 00142 00143 int NumCommands = sizeof(cmdtab)/sizeof(struct Commands); 00144 00145 // command function return codes 00146 00147 #define CMD_OK 0 00148 #define CMD_ERR -1 00149 #define CMD_NOOP 1 00150 00151 #endif // COMMANDS_H

Generated on Thu Jul 22 20:02:06 2004 for SiTool Si Microstepping Motor Controller Agent by doxygen 1.3.7