Procedure Message Format


In general messages involve 3 letter commands. Some commands are in the form

<procedure> <parameters> <CR>

The Ascii Command Interpreter is a Snap2Motion application and can be tailored. If the format or prompt at the end is not desired the project can be edited to produce an alternate response. Check with the factory for details.

There might be no parameters, one, or several depending on the function. Parameters are seperated by spaces. The space between the procedure and the first parameter is optional. Adding a space im- proves readability. The command is terminated with a carriage return (ASCII 13) character.

After receiving a command, the controller will transmit the following information:

<CRLF> <error number> <return value> <prompt>

The prompt is the "greater than" symbol. The error number indicates if the command was completed successfully. A "0" indicates a success. Other numbers represent errors. If the first number is not 0, the remaining information in the response is not present. After the error number is a space followed by the return value of the command as a floating point formatted value. All commands have return values. Most return values reflect controller state. Some return values confirm information that was sent when no specific return value is associated with the command. The response terminates with the "greater than" symbol as the default prompt.

Hooking up a terminal, or using a terminal program on the PC such as Telnet for TCP/IP communication permits exercising the board and viewing this transaction behavior. Telnet comes with Windows but usually involves an additional setup step. Google "install telnet" for additional details on installing Telnet. Telnet is started from the command line with the IP address as a parameter:

Typing just the "CR" key produces a null command which returns 0 (ordinal) for error and 0.000 (float) for return value:

The command RWD (Reset Watchdog) which has no parameters can be typed with the following example response:

The error is "0" indicating the command succeeded. The value number, in this particular case, reports the watchdog has tripped status that was found prior to the reset. If the EStop connector is removed and the command is performed this is the response:

Error 32 is reported, Watchdog Failed To Reset Escape Code. There is not a value number following because the command failed.

An example of a command which requires parameters would be the output command, SetOutputBit (SOB). The first parameter is the bit number and the second the desired output value.

Parameters are separated by spaces or commas.