The ASCII protocol is a query-response or a question and answer communication protocol in which a host PC uses ASCII characters to send commands to a device and then receives responses back from that device. The ASCII command set is used to configure devices, send data to devices and to read data and status information back from devices.

# AA 00 (Data) [CS] (CR)
Delimiter Address Command Data* Checksum** Carriage Return

* Only applicable for commands setting digital outputs.

** Optional parameter for the command.

Every ASCII command sequence is a series of ASCII characters starting with a prefix delimiter and terminating with a carriage return character. All of the ASCII characters used are easily entered from a PC keyboard and every ASCII command is terminated with a Carriage Return character; hex 0D, denoted by (CR) All commands being sent to the device must be in uppercase characters.

Prefix or Delimiter: Each ASCII command starts with a single character command prefix or delimiter. The prefix will be one of the following five characters:-

# the hash our pound sign, ASCII value hex 0x23
% the percentage sign, ASCII value hex 0x25
$ the dollar sign, ASCII value hex 0x24
@ the at sign, ASCII value hex 0x40
~ the tilde or approx sign, ASCII value hex 0x7E

These prefix signs cannot be used interchangeably but are particular to the command string which follows.

Address: The ASCII protocol was first introduced in the 1980s by Analog Devices with its RS485 Half Duplex connected 6B Series modules and digital I/O boards and has been adopted and adapted by many other companies since. It is the de-facto communication protocol on the widely used RS485 Half Duplex connected ADAM/NuDam/eDAM modules. A very wide range of PC based data acquisition packages have support for this command protocol communicating over PC COM port. The Brainboxes ED-xxx range of devices are completely backwards compatible with these devices.

Since it was initially developed for an RS485 bus system containing many devices, each ASCII command must include the address of the particular device the command is directed to. The address is a two character field giving the hexadecimal address of the device (00-FF). The default address is 01. The address field is written as AA in the examples that follow.

A few commands do not have an address as these are broadcast commands that go to all the devices. Here the address field AA is replaced by the wildcard two star signs **. Two such examples are #** and ~**.

Command: The command field contains the command that you want to send to the device. The next section (Command List) gives a detailed description of how to use each command and what the commands do.

Data: The data being sent to the device which is required in the command. Depending on the command this data is in different formats.

Checksum: An optional two character checksum denoted [CS] can be included immediately before the terminating (CR). The purpose of the checksum is to help the PC and devices detect the communication errors that have corrupted the command strings. When the checksum is enabled all commands from the PC to the devices and all responses from the devices must contain a valid checksum otherwise the data is discarded. When the checksum is enabled, commands sent without a valid checksum will be ignored by the devices and the device will not respond to the host PC. By default the checksum is turned off. To turn checksum on, you must configure the device via its webpage using a browser.

In the following sections of this chapter, those parts of the command string in bold and underlined are parameters that the user must enter. Those parts of the command string in normal text are to be used literally in the command without replacement by the user.

Additionally, any parts of the command string that are in square brackets are optional. The checksum is an example of this as it is only required when the checksum is enabled in the firmware of the device.

Example Commands: Assuming that the checksum has not been turned on by the user, the simplest command is:

@AA(CR)

This command reads the status of the digital input port. Assuming the ED devices address is 01, that is AA=01, then the command the user would issue would be:

@01(CR)

A typical response from the device would be:

>01FA(CR)

Response Format

The response received from the device will depend on the ASCII command that has been sent. The response for each command is detailed in the Command List Section.

! AA (Data) [CS] (CR)
Delimiter Address Data* Checksum** Carriage Return

* Only applicable for certain commands that return data.

** Optional parameter for the command.

Prefix or Delimiter: Each ASCII response starts with a single character prefix or delimiter. The prefix will be one of the following three characters:-

> Greater than sign, ASCII value hex 0x3E
! Exclamation sign, ASCII value hex 0x21
? Question mark sign, ASCII 0x3F

Address: The address is a two character field giving the hexadecimal address of the device (00-FF). The default address is 01. The address field is written as AA in the examples that follow.

Data: The data being sent from the device in response to the command sent.

Checksum: Optional 2 character checksum.

Command List

Command Response Description Supported Devices
%AANNTTCCFF !AA Set Device Configuration All Devices
#** No Response Synchronized Sampling All Devices
#AA00DD > Set Digital Output ED-588, ED-527, ED-504, ED-008, ED-004, ED-204
#AA0ADD > Set Digital Output ED-588, ED-527, ED-504, ED-008, ED-004, ED-204
#AA0BDD > Set Digital Output ED-588, ED-527, ED-504, ED-008, ED-004, ED-204
#AA1cDD > Set Digital Output ED-588, ED-527, ED-504, ED-008, ED-004, ED-204
#AAAcDD > Set Digital Output ED-588, ED-527, ED-504, ED-008, ED-004, ED-204
#AABcDD > Set Digital Output ED-527
#AAN !AA(Data) Read Digital Input Counter ED-588, ED-516, ED-538, ED-504, ED-038, ED-004, ED-008, ED-204
$AA2 !AANNTTCCFF Read Device Configuration All Devices
$AA4 !S(Data) Read Synchronized Data All Devices
$AA5 !AAS Read Reset Status All Devices
$AA6 !(Data) Read Digital I/O Status All Devices
$AAC !AA Clear Latched Digital Output ED-588, ED-516, ED-504, ED-008, ED-004, ED-204
$AACN !AA Clear Digital Input Counter ED-588, ED-516, ED-504, ED-008, ED-004, ED-204
$AAF !AA(Data) Read Firmware Version All Devices
$AALS !(Data) Read Latched Digital Input ED-588, ED-516, ED-504, ED-008, ED-004, ED-204
$AAM !AA(Data) Read Device Name All Devices
@AA >(Data) Read Digital I/O Status All Devices
@AA(Data) > Set Digital Output ED-588, ED-527, ED-504, ED-008, ED-004, ED-204
~AAO(Name) !AA Set Device Name All Devices
~** No Response Host OK All Devices
~AA0 !AASS Read Watchdog Timeout Status All Devices
~AA1 !AA Reset Watchdog Timeout Status All Devices
~AA2 !AAVV Read Watchdog Timeout Settings All Devices
~AA3EVV !AA Set Watchdog Timeout Value All Devices
~AA4V !AA(Data) Read Power On/Safe Value ED-588, ED-527, ED-504, ED-008, ED-004, ED-204, ED-560
~AA5V !AA Set Power On/Safe Value ED-588, ED-527, ED-504, ED-008, ED-004, ED-204, ED-560
#AA >(Data) Reads analogue input of all channels ED-549
#AAN >(Data) Read the analogue input of the specified channel ED-549
$AA0Ci !AA Performs span calibration on the specified channel ED-549
$AA1Ci !AA Performs zero calibration on the specified channel ED-549
$AA5VV !AA Enables/disables the channel ED-549
$AA6 !AAVV Reads the enable/disable status ED-549
$AA7CiRrr !AA Sets the single channel range configuration ED-549
$AA8Ci !AACiRrr Reads the single channel range configuration ED-549
$AAA >(Data) Reads the analogue inputs of all the channels ED-549
$AAB !AANN Reads the channel diagnostic status ED-549
$AAM0 !AA(Data) Reads the device model ED-549
$AAM1 !AA(Data) Read device location ED-549
$AARS No response Reset the device ED-549, ED-560
$AAS0 !AA Internal calibration ED-549
$AAS1 !AA Reloads the default calibration settings ED-549
~AAEV !AA Enables/disables calibration ED-549
~AAL(Location) !AA Set device location ED-549
#AAn(Data) No response Set the output value for channel n ED-560
$AA4n !AA Set power on valure of channel n ED-560
$AA5 !AAs Reads the reset status ED-560
$AA6n !AA(Data) Read the output value for channel n ED-560
$AA7n !AA Read power on value of channel n ED-560
$AA9n !AA Read the output type and slew rate control for channel n ED-560
$AA9nts !AA Set the output type (t) and slew rate control (s) for channel n ED-560
$AA9nttss !AA Set the output type (tt) and slew rate control (ss) for channel n ED-560


This FAQ Applies to the following Brainboxes Product Ranges: