bcmd -- Build CRaTER CCDSD Telecommand Packets
bcmd [a] [-b] [-h] [-m target] [-p ###] [-v] [-z foo@bar]
-a sets ASCII output mode: STOL mnemonics to STDOUT
-b sets Batch mode; echo command and guarantees >1sec command separation
-h displays full help message
-m selects a target machine for UDP packets
-p selects a port for UDP packets
-v specifies verbose operation
-z email ASCII (STOL) output to foo@bar
bias on | off
cal low | high on | off
calamp 8-bit-number
calrate low | high
disc thin | thick 8-bit-number
mask c1 c2 c3 ... | all | none
\mask c1 c2 c3 ...
litmask 32-bit-number(high bytes) 32-bit-number(low bytes)
process d1 | d2 | d3 | d4 | d5 | d6 on | off
echo 16-bit-number
time - | seconds:subseconds
test
clear
reset
1553 A | B
clock on | off
wait number-of-seconds
? | h # display the valid mnemonics
exit # exits program
The program accepts ASCII commands from STDIN and by default generates CCSDS telecommand packets on a UDP socket. Each input line generates a separate packet except that lines beginning with # are treated as comments and no packet is generated. The valid mnemonics are above. Numeric arguments may be given in decimal, octal, or hex format. The ``time'' command, if given a ``-'' argument, puts current system time into the packet. For further description of the commands see the Data ICD, 32-02001.
If the -a flag is given, the telecommand UDP packets are suppressed and the output is newline-separated STOL commands on STDOUT. If the -z foo@bar flag is given, each input will result in an email being sent to foo@bar whose contents is a single line containing the STOL-equivalent command (UDP packets are again suppressed).
The wait, clock, and 1553 commands are supervisory and not sent to the instrument. wait commands this program to insert a delay before processing the next instrument command. clock instructs the GSE to turn the (external to the instrument) 1Hz tick on or off. 1553 instructs the GSE to send all future instrument commands on the selected 1553 bus.
The ``mask'' command ORs a series of detector coincidence selections: e.g: to select a concidence of D!D2D3D4 and D3D4D5D6 the command is mask 1234 3456 To accept all possible combinations except single detector hits the command is mask all /1 /2 /3 /4 /5 /6 or, alternatively /mask 1 2 3 4 5 6
Choosing the -b flag runs the program in batch mode, intended to read commands from a file. In this case the individual commands are guaranteed to be separated by at least 1 second, and are echoed to STDOUT.
The name of the CRaTER GSE host can be specified on the command line, through use of the -m flag; the UDP port on that machine defaults to 11402 if not overridden with the -p flag. If neither of these are invoked, the program will look for the environment variable CRATER_GSE_CMD. If none of these succeed, the program will write to localhost.
CCmd
command.tcl
Bob Goeke
$Id: bcmd,v 3.2 2008/02/27 15:30:46 goeke Exp goeke $