Command | Summary | Example | Details |
---|---|---|---|
En | Enable buffer on port n | E1 | @@ |
Xn | Disable buffer on port n | X1 | @@ |
Sn,d | Set port n to be input or output | S1,0 | @@ |
In | Read in (Input) data from port n | I1 | @@ |
in.b | Read bit b of port n | i1.0 | @@ |
On=xx | Write (Output) the value xx to port n | O1=d5 | @@ |
on.b=x | Write value x to bit b of port n | o3.5=1 | @@ |
A | Set Port 1 to be analog mode | A | @@ |
D | Set Port 1 to be digital mode | D | @@ |
a.n | Read analog value on channel n of Port 1 | a.0 | @@ |
Vn | Enable byte events on port n | V2 | @@ |
vn.b | Enable bit event on bit b of port n | v2.7 | @@ |
Cn | Disable all events on port n | C1 | @@ |
cn.b | Disable bit event on bit b of port n | c1.0 | @@ |
L | Toggle between CR and CRLF | L | @@ |
R | Reset the board configuration | R | @@ |
P | Ping the board (verify serial connection) | P | @@ |
E | Enable buffer |
---|---|
Syntax: | En |
Returns: | (nothing) |
Values: | n = {1,2,3} |
Description: | Enables the buffer that is connected to port n. Note that Port 1 does not have a buffer because it can be put into analog mode. The serial board does not return an error if port 1 is specified, but the command will have no effect on port 1. This command does not affect whether a port is configured as an input or output port. |
X | Disable buffer |
---|---|
Syntax: | Xn |
Returns: | (nothing) |
Values: | n = {1,2,3} |
Description: | Disables the buffer on Port n. Port 1 does not have a buffer, so the command X1 will have no effect. When a buffer is disabled, the port is put into a high-impedance mode by de-asserting the enable pin on the buffer chip. This command does not affect whether a port is configured as an input or output port. |
S | Set port direction |
---|---|
Syntax: | Sn,d |
Returns: | (nothing) |
Values: | n = {1,2,3} d = {0 ... FF} |
Description: | Configures port n as an input port or an output port. If d = 0, the port is configured as an input port, otherwise it is configured as an output port. |
I | Read a port value |
---|---|
Syntax: | In |
Returns: | Pn=xx (a 2-character hexadecimal number) |
Values: | n = {1,2,3} xx = {00 ... FF} |
Description: | Reads the current value (a byte) of port n. Regardless of what the value is, the the serial board returns the value (xx) as a 2-character hexadecimal number. The value is padded with zeroes if necessary to make it two characters. This command does not affect whether the port is configured as an input or output port. If this command is used when the port is in output mode, it will return the current value present on the port. |
i | Read a bit value |
---|---|
Syntax: | in.b |
Returns: | pn.b=x |
Values: | n = {1,2,3} b = {0 ... 7} x = {0,1} |
Description: | Reads the current value of bit b on port n. If the bit is on (high), the x in the return string will be 1, otherwise it will be 0. The same extra notes apply to this command as do to the I command. |
O | Write to a port |
---|---|
Syntax: | On=xx |
Returns: | (nothing) |
Values: | n = {1,2,3} xx = {0 ... FF} |
Description: | Outputs (writes) the hexidecimal value xx to port n. This command does not affect whether the port is configured as an input or output port. If this command is used when port n is in input mode, it will have no immediate effect, however if the port is later put into output mode, the value of the port will then become the value of xx. |
o | Write to a bit |
---|---|
Syntax: | on.b=x |
Returns: | (nothing) |
Values: | n = {1,2,3} b = {0 ... 7} x = {0,1} |
Description: | Outputs the value of x to bit b of port n. If x is 0, the bit is cleared (turned off), but if x is 1, the bit is set (turned on). This command does not affect whether the port is configured as an input port or an output port. |
A | Analog mode on port 1 |
---|---|
Syntax: | A |
Returns: | (nothing) |
Description: | Configures port 1 for analog mode. When in analog mode, each pin of port 1 becomes a separate analog input channel, numbered from 0 to 7 just as the digital bits are numbered. |
D | Digital mode on port 1 |
---|---|
Syntax: | D |
Returns: | (nothing) |
Description: | Configures port 1 for digital mode (default). |
a | Read an analog channel |
---|---|
Syntax: | a.n |
Returns: | a.n=xxx |
Values: | n = {0 ... 7} xxx = {000 ... 3FF} |
Description: | Reads an analog channel of port 1. This command does not affect whether port 1 is configured for analog mode or digital mode. Because each analog channel has a 10-bit precision, the board returns a value in from 0 to 3FF (1023 decimal). The value is returned in hexadecimal and, if necessary, is padded with zeroes to create a 3-character value. |
V | Enable a byte event |
---|---|
Syntax: | Vn |
Returns: | (nothing) |
Events: | Bn=xx |
Values: | n = {1,2,3} xx = {00 ... FF} |
Description: | Enables byte event monitoring and notification for port n. When a byte event is enabled, the I/O board monitors the port, and sends an Event (format shown above) to the PC whenever the value on that port changes. The value of xx is sent in hexadecimal, and is padded with zeroes to two characters if necessary. Events cannot be enabled on port 1 when it is in analog mode. |
v | Enable a bit event |
---|---|
Syntax: | vn.b |
Returns: | (nothing) |
Events: | bn.b=x |
Values: | n = {1,2,3} b = {0 ... 7} x = {0,1} |
Description: | Enables bit event monitoring and notification for bit b of port n. An event (format shown above) is sent whenever the value of the bit changes. Events cannot be enabled on port 1 when it is in analog mode. |
C | Disable a port's events |
---|---|
Syntax: | Cn |
Returns: | (nothing) |
Values: | n = {1,2,3} |
Description: | Disables (clears) all events (both byte and bit) on port n. This has the opposite effect as the V and v commands. When the events of a port are disabled, the I/O board quits checking for changing values on the port. |
c | Disable a bit event |
---|---|
Syntax: | cn.b |
Returns: | (nothing) |
Values: | n = {1,2,3} b = {0 ... 7} |
Description: | Disables event monitoring and notification on bit b of port n. This has the opposite effect of the v command. |
L | Toggle CR and CRLF |
---|---|
Syntax: | L |
Returns: | (nothing) |
Description: | Toggles whether the I/O board sends just a carriage return (CR) or both a carriage return and a linefeed (LF) when it responds to the PC. By default, the I/O board sends only a carriage return to terminate its responses. However, when using the board from a terminal program, it may be helpful to enable CR and LF so that all responses can be seen and will not be overwritten by the next response. |
R | Reset board configuration |
---|---|
Syntax: | R |
Returns: | (nothing) |
Description: | Resets the configuration of the I/O board to defaults. This command does NOT perform a hardware reset on the board, but it resets the configuration to its initial, default settings. This means that all buffers are enabled, all ports are configured as digital, and are configured as inputs. All events are also disabled. |
P | Ping the board |
---|---|
Syntax: | P |
Returns: | G |
Description: | This command simply "pings" the board in order to test the serial connection to the PC, and to verify that the board is powered up and operational. The board will send back a G to indicate the connection is Good. |
Back to Contents | Winford Engineering (2000) |