XRF Sample Handler Controller Commands
for Ver 1.7, 22 Feb 2000
file: shndlcmd.html
Commands:
- all commands preceded by # and terminated with CR (ENTER)
- Note: for power controlling commands, 0 = ON and 1 = OFF
AD[0-6] - Get A/D from channel 0 - 6
- i.e. AD2 requests reading from third A/D channel
APWR[0-1][=0,1] - request current status or power ON/OFF for A/D channel 0 or 1 device
- eg: APWR1 requests status of power for A/D channel 1 device
- eg: APWR0=1 turns OFF power for channel 0 device
- Note: A/D channels 0 and 1 are used for Flow Meters
CAD[0-6] - request continuous A/D readings from channel 0 to 6
- updates at about 1 Hz rate
- ESC to exit
CAL[0-6] - request cal constants set for channel 0 - 6
CPOS - request continuous position readings from turntable encoder
- ESC to exit
- returns position from 0 to 359.9 degrees
- a reading of 360.0 indicates a problem and is invalid
- NOTE: ESC also kills Motor 1 power (turntable motor)
GOCWp,ss - move sample #ss clockwise to position #p, as follows:
- Sample numbers are 0 to 23
- Position numbers are:
- 0 - home position (at access plates)
- 1 - intake position
- 2 - XRF analysis position
- Position digit must be followed by comma, then 1 or 2 digit sample number.
- Note 1: Main motor power must be enabled (MPWR command).
- Note 2: Motor2 and Motor3 must be in open (CCW) position (i.e.
MLIM1 = 1 and MLIM3 = 1) or command will abort with error.
- Note 3: Motor1 must NOT be running from another command.
H - request HELP menu
ITK[=0,1] - request or control motor 2 (intake position)
- 0 = CLOSE and 1 = OPEN
- Reports 255 if position unknown.
- Aborts after 30 seconds.
- Note 1: Main motor power must be enabled (MPWR command).
- Note 2: Motor1 must NOT be running from another command.
L - request INFO (serial number, cal constants, etc)
MDIR[1-3][=0,1] - request or set motor 1 - 3 direction
- 0 = CW and 1 = CCW
- NOTE: CW closes motor 2 and 3
- eg: MDIR1=0 sets motor 1 to turn CW
MEN[1-3][=0,1] - request current status or power ON/OFF motors 1 - 3
- eg: MEN3=0 starts motor 3 (the XRF analysis position motor)
- Motor 1 = sample turntable motor
- NOTE: Motor 1 CANNOT be enabled (MEN1=0) unless limit
switches 1 and 3 are activated (MLIM1 and MLIM3 indicate 1) -
i.e. unless Motors 2 and 3 have cranked their respective mechanisms fully OPEN
- Motor 2 = intake position motor
- Motor 3 = XRF analysis position motor
- NOTE: Only one motor may be enabled at any given time
MLIM[0-3] - request limit switch status
- 1 = switch activated and 0 = switch NOT activated
- Switch 0 = Motor 2, CW limit (position closed)
- Switch 1 = Motor 2, CCW limit (position open)
- Switch 2 = Motor 3, CW limit (position closed)
- Switch 3 = Motor 3, CCW limit (position open)
- eg: MLIM2 requests status of Motor 3 CW limit switch
MPWR[=0,1] - request current status or power ON/OFF for main motor power
- NOTE: this applies power to all of the motor control circuits;
the MEN[1-3] command powers ON/OFF the individual motors
POS - request position reading from turntable encoder
- returns position from 0 to 359.9 degrees
- a reading of 360.0 indicates a problem and is invalid
PUMP[=0,1] - request current status or power ON/OFF for air pumps
PV[=0,1] - request current status or power ON/OFF for purge valve
ROCWnnnn - rotate turntable clockwise to absolute position of encoder
- Position is degrees * 10 for .1 degree resolution.
- Positions may be from 1 degree to 359 degrees (10 - 3590).
- Note 1: Main motor power must be enabled (MPWR command).
- Note 2: Motor2 and Motor3 must be in open (CCW) position (i.e.
MLIM1 = 1 and MLIM3 = 1) or command will abort with error.
- Note 3: Motor1 must NOT be running from another command.
STAT - request current status in computer-readable format
- responds with 4 space-separated values;
- decimal position number (from last GOCW) [0-2]; 255 = uninitialized
- decimal sample number (from last GOCW) [0-23]; 255 = uninitialized
- decimal encoder position in degrees * 10; -1 = encoder failed to respond
- hex status word (16 bits)
- power bits: LOW = ON
- limit sw: HI at limit
- DIR bits: LOW = CW
- bit 0 - purge valve (p1.1)
- bit 1 - APWR0 (p0.5)
- bit 2 - APWR1 (p0.6)
- bit 3 - encoder (p0.7)
- bit 4 - M2_CW (p3.2)
- bit 5 - M2_CCW (p3.3)
- bit 6 - M3_CW (p3.4)
- bit 7 - M3_CCW (p3.5)
- bit 8 - M1_DIR (p2.0)
- bit 9 - M1_EN (p2.1)
- bit 10 - M2_DIR (p2.2)
- bit 11 - M2_EN (p2.3)
- bit 12 - M3_DIR (p2.4)
- bit 13 - M3_EN (p2.5)
- bit 14 - PUMP (p2.6)
- bit 15 - MPOWER (p2.7)
- status word is FFF7 immediately after power up (only encoder
is ON)
- Example 1: typical power up return: 255 255 1901 FFF7
- Example 2: after GOCW1,12 command: 1 12 647 7EF7
- terminated with CRLF
T[0-23] move sample # 0 - 23 to home position (for servicing)
- moves the requested sample number to the access (home) position
for installation/removal of filter holders
- actually uses GOCW0,ss where ss is sample number from 0-23
UOK - handle EEPROM; check or update values
- Q - quit without update
- WOK - write new values to EEPROM then quit
- A[=addr] - request or set address (currently unused)
- C[0-6][A-D][=fpnum] - request or set cal constant sets 0-6 parameters A-D
- sets 0-6 correspond to A/D channels 0-6
- parameters A-D are used in polynomial as follows:
A + Bx + Cx^2 + Dx^3
- D[=text] - request or set manufacturing date
- M[=text] - request or set model info
- O[=nnn] - request or set encoder offset in degrees * 10
- Values may range +/- 3 degrees; i.e. -30 to 30
- operational hint: if position after GOCW is overshooting, ADD offset here
- S[=text] - request or set serial number
- SFL[=nnn] - request or set speed factor low (Motor1 ON time in 10ms slices)
- SFH[=nnn] - request or set speed factor high (Motor1 OFF time in 10ms slices)
- Good default values are SFL = 1 and SFH = 2.
- New values do not take effect until system restart.
XRF[=0,1] - request or control motor 3 (xrf position)
- 0 = CLOSE and 1 = OPEN
- Reports 255 if position unknown.
- Aborts after 30 seconds.
- Note 1: Main motor power must be enabled (MPWR command).
- Note 2: Motor1 must NOT be running from another command.
ERROR CODES
4001 - range error; the value entered is out of range.
4002 - running error; the motor is already running.
4003 - no motor power error; main power to the motors is not enabled.
4004 - no response error; the position encoder is not responding;
4005 - sample range error; the sample number is not 0 to 23. (GOCW command)
4006 - position range error; the position number is not 0 to 2. (GOCW command)
4101 - motor 1 error; motor 1 cannot start because motor 2 and 3 "open" limit switches are not active.
- MLIM1 and MLIM3 must both indicate 1 (open) or motor 1 will not run.