| COMMUNICATE |
| |
| port |
<port> <baudrate> <linedelay> <echo> <odd> <even> <stop2> |
| |
opens or re-opens <port> at specified <baudrate>. |
| |
any pending chars from <port> are discarded. |
| |
sets delay (in msec) to use before sending each message to <port>. |
| |
delays are inaccurate due to unavoidable computer design issues. |
| |
<baudrate> and <linedelay> are <values>. |
| |
optional arg "echo" tells CC that the comm hardware echos every |
| |
char sent to port, so CC should swallow the echos. optional args |
| |
"odd"/"even"/"stop2" activate those parameters for transmit only. |
| |
for receive, CC always accepts odd/even/none parity, 1/2 stop bits. |
| |
| send |
<port> <string> |
| sendc |
<calg> <port> <string> |
| |
send string to port, optionally applying a chksum algorithm. |
| |
<linedelay> applied (see PORT command). |
| |
| recv |
<port> <timeout> <string> |
| recvc |
<calg> <port> <timeout> <string> |
| |
receive string from port, optionally applying chksum algorithm. |
| |
string must arrive exactly, within <timeout> seconds, else FAIL. |
| |
once <string> arrives, proceed immediately. |
| |
no other chars may arrive before <string> arrives. |
| |
if chars arrive after <string>, leave them in input buffer. |
| |
| scan |
<port> <timeout> <string> |
| scanc |
<calg> <port> <timeout> <string> |
| |
scan all incoming chars from port for <string>, optionally |
| |
applying chksum algorithm. <string> must arrive exactly, |
| |
within <timeout> seconds, else FAIL. unlike the RECV cmds, |
| |
other chars may arrive before <string> arrives, and they will |
| |
be discarded until <string> arrives. once <string> arrives, |
| |
proceed immediately. if chars arrive after <string>, |
| |
leave them in input buffer. |
| |
| capt |
<port> <timeout> etx <etx> |
| capt |
<port> <timeout> len <len> |
| capt |
<port> <timeout> elen <pos> <multdiv> <xor> <add> <and> |
| capt |
<port> <timeout> sdn |
| captc |
<calg> <port> <timeout> etx <etx> |
| captc |
<calg> <port> <timeout> len <len> |
| captc |
<calg> <port> <timeout> elen <pos> <multdiv> <xor> <add> <and> |
| captc |
<calg> <port> <timeout> sdn |
| |
capture any message from <port>, optionally applying chksum algorithm. |
| |
holds message in capt buf until next CAPT/CAPTC command, allowing for |
| |
multiple PARSE commands to be applied to the same captured message. |
| |
if using CAPTC, the msg chksum is verified but not retained in capt buf. |
| |
all arguments except <port> and <calg> are <values>. |
| |
if ender is "etx" (end of transmission), then <etx> specifies the |
| |
ascii code of the etx character 0-255. if ender is "len" (length), |
| |
then <len> specifies the number of bytes to receive 0-1000. |
| |
if ender is "sdn" (Somfy Digital Network), then message length |
| |
is taken from the second byte in the message. |
| |
if ender is "elen" (embedded length), then <pos> specifies the position |
| |
in the message where the length is found (first byte in msg is pos==1). |
| |
<multdiv> is positive to multiply or negative to divide the embedded length. |
| |
after <multdiv> is applied, the result is then xored by <xor>, |
| |
then <add> is added, and the result is finally anded with <and>. |
| |
note the ender "sdn" is shorthand for elen 2 1 31 0 31 . |
| |
| chksum |
<name> <func> <start> <end> <xor> <add> <and> <fmt> <put> <where> <clen> |
| |
this cmd defines a custom checksum algorithm. see the section below. |
| |
| clear |
<port> |
| |
discard all pending chars from <port> input buffer. |
| |
| quiet |
<port> |
| |
the port must have NO chars in its input buffer, else FAIL. |
| |
| break |
<port> <tempbaud> <bytetosend> |
| |
Send break signal. Note this is a kluge, so read the break signals section below. |
| |
<tempbaud> is the temporary baudrate. <bytetosend> is the byte to send at that |
| |
baudrate to create the break. both are <values>. |
| |
| sendd |
<port> <string> |
| sendl |
<port> <string> |
| |
send string to port, optionally preceeded by a string length byte. |
| |
each byte from <string> is sent as ascii decimal (1-3 chars) preceeded |
| |
by a dot. one \r is sent after all chars are complete. |
| |
<linedelay> not applied. these 2 commands are for downloading tables. |
| |
| CONTROL |
| |
| delay |
<seconds> |
| delaym |
<milliseconds> |
| |
delay seconds or milliseconds. <seconds> or <milliseconds> are <values>. |
| |
arriving chars on all ports accumulate in their input buffers during the delay. |
| |
| align |
<seconds> |
| |
wait for time of day to be multiple of <seconds> past midnight. |
| |
will not match present second to prevent multiple matches in same second. |
| |
useful for logging data at even intervals (see SHOW ONLY and SHOW VARS commands). |
| |
arriving chars on all ports accumulate in their input buffers while waiting. |
| |
| pause |
allow |
| pause |
ignore |
| pause |
<timeout> <message> |
| |
display <message> and wait up to <timeout> seconds for Continue |
| |
button to be pressed. when <timeout> elapses, script processing |
| |
continues (it is not a FAIL). set <timeout> to 0 to wait forever. |
| |
<message> may be absent and may contain spaces. |
| |
use PAUSE ignore and PAUSE allow, surrounding critical script fragments, |
| |
to prevent pressing of the Pause button from causing a script timeout |
| |
and thus script FAIL. |
| |
| list |
<var> <value1> [ <value2> ] ... |
| listend |
<var> |
| |
executes the lines between LIST and LISTEND, with <var> set to |
| |
each <value> specified, in succession. up to 100 <values> allowed. |
| |
lists and loops may be nested interchangeably, up to 26 levels deep. |
| |
| loop |
<var> <first1> <last1> <step1> [ <first2> <last2> <step2> ] ... |
| loopend |
<var> |
| |
executes the lines between LOOP and LOOPEND, with <var> cycling |
| |
through each loop specified. <var> will be set to <first1>, |
| |
then <first1> + <step1>, and so on thru <last1>. after <var> |
| |
has stepped past <last1>, the next triplet on the line is executed, |
| |
and so on. up to 33 triplets can be specified in the LOOP command. |
| |
<firstX> <lastX> <stepX> are all <values>, and may also be negative. |
| |
lists and loops may be nested interchangeably, up to 26 levels deep. |
| |
| skip |
<value1> <cmp1> <value2> [ <andor> <value3> <cmp2> <value4> ] ... |
| skipn |
<n> <value1> <cmp1> <value2> [ <andor> <value3> <cmp2> <value4> ] ... |
| |
compare a <value> with another <value>. |
| |
<cmpX> can be one of: > >= < <= == != |
| |
if the comparison is true then skip the next 1 or <n> lines. |
| |
<n> is a <value> 0 or greater. optional <andor> can be && or || |
| |
to chain up to 20 comparisons together. |
| |
all && are evaluated before any || is evaluated. |
| |
SKIPN is also handy to reduce label clutter. |
| |
| label |
<lab> |
| goto |
<lab> |
| |
jump to label. |
| |
forward and backward references permitted. |
| |
very powerful when used after SKIP command. |
| |
| return |
|
| call |
<lab> |
| |
call label, and save return address. return to the |
| |
saved address when return command is executed. |
| |
forward and backward references permitted. |
| |
very powerful when used after SKIP command. |
| |
call/return can be nested up to 26 levels deep. |
| |
| exit |
<message> |
| |
exit the script. |
| |
message may be absent and may contain spaces. |
| |
very powerful when used after SKIP command. |
| |
| beep |
|
| |
makes an audible beep from your computer |
| |
| MISC |
| |
| vars |
26 |
| vars |
52 |
| |
causes variables after this command to be case insensitive (26) or case sensitive (52), |
| |
giving you 26 or 52 variables to work with. default when CC starts is 26, thus Q and q |
| |
are the same variable. using "vars 52" makes Q and q different variables. |
| |
| faultt |
off |
| faultt |
<var> |
| faultt |
clear <seconds> |
| |
causes RECV/RECVC/SCAN/SCANC/CAPT/CAPTC/PARSE/QUIET commands to be |
| |
fault tolerant. instead of terminating the script, CC increments <var>. |
| |
the fault tolerance applies to communication, not syntax and usage. |
| |
you may tally certain errors or all errors. you may tally all errors |
| |
to one var, or different errors to different vars. using "clear" causes |
| |
all future trapped faults, after incrementing, to delay <seconds> then |
| |
clear that port's input buffer. set <seconds> to 0 to stop clearing. |
| |
| parse |
<pstring> |
| |
parses the capt buf. see parse string section below. |
| |
| match |
<var> <ormask> <string> |
| |
compare <string> against keep buf. if they differ, proceed |
| |
without error. if they match then do: <var> |= <ormask>. |
| |
this is useful when a device may send several messages |
| |
in an unpredictable order. <ormask> is a <value>. |
| |
| math |
<oper> <oper> ... |
| |
performs math operations like an RPN stack machine. |
| |
all math is performed with long signed integers (-2B to +2B). |
| |
no error checking. stack is unchanged between MATH commands. |
| |
stack is 26 levels deep. operators are described later. |
| |
| set |
<var> <value> |
| set |
captbuf <string> |
| |
this command is for script development and debug. |
| |
setting <var> to <value> can be done in a math command, |
| |
but SET is more convenient. set capt buf to a <string> |
| |
to help you develop PARSE commands in your script. |
| |
| unset |
<var> |
| |
release var for reuse. needed if you break out of a list/loop, |
| |
so you can re-use the var in that or another list/loop. |
| |
unset also removes vars from the trace output (screen & file). |
| |
| comment |
<newchar> |
| |
change the comment char from this point forward in the script file. |
| |
<newchar> can be numeric 0-255 or any single character. CC default is semicolon. |
| |
| show |
only |
| show |
auxbuf |
| show |
binbuf |
| show |
captbuf |
| show |
keepbuf |
| show |
string <string> |
| show |
chksum <calg> |
| show |
vars <var> ... |
| |
these cmds are for script development, debug, and selected output. |
| |
show string - to help you develop var escape sequences (<string> expanded into binbuf) |
| |
show chksum - to help you develop custom chksums (chksum <calg> applied to binbuf) |
| |
show capt/keep bufs - to help you develop PARSE commands. |
| |
show aux/bin bufs - to inspect most-recent SEND/RECV command messages. |
| |
show only - to henceforth limit the output file to only show cmds. |
| |
show vars - to show the values of a list of vars, handy to produce data to |
| |
later import into excel, best used after "show only" and "align" commands. |