Conventions, Port numbers, Results – Thinklogical Router - ASCII-API User Manual

Page 5

Advertising
background image

Conventions

Port numbers

All port numbers are four places long, start counting at 1 and have leading zeros. For example, port 15 is encoded
as 0015.

A port number of 4 zeros is used in response to a status command to signify that no port is in use. A zero port
number is not valid in a command string.

A port number of four 9s (9999) in used to signify ALL ports. It is not valid in a response.
For example, if you wanted to encode all output ports, you would use: O9999

In the following sections, xxxx is used as a generic input port place holder; yyyy is used as the output port place
holder. Do not use xxxx or yyyy in a command, but replace each with the appropriate input or output port number.

Results

Results from commands are ASCII strings terminated with a newline (linefeed). The first character is an 'R', followed by
a 4 digit, zero-filled length. The length includes the trailing newline. Following the length will be either 'OK', or
'ERnnnn'. OK signifies the command was successful, while ERnnnn is an error code. After the OK or ERnnnn, a
comment may appear giving more detailed information.

In the case of a status command, the OK is followed by the status response.

You must wait for a result response before sending another command.

There are several options to control the output from the API. These options are described in detail in the document

Configuring-the-ASCII-Interface.pdf

. Two of the options are:

1. [--CR] Include a carriage return on each line output. (Useful for Windows)

2. [--verbose] Append a comment to each response with more information about an error code, or repeat the

successful command. Comments will start with the '#' character.

Examples of verbose output

Command:

CI0004O0007

normal:

R0003OK

verbose:

R0015OK#CI0004O0007

Command:

CI0004O0087

normal:

R0007ER0007

verbose:

R0072ER0007#Output port number 87 is out of range (1 thru 80):

'CI0004O0087'

Jun 12, 2014

Router ASCII API: V4.5-1

4/33

Advertising