ASCII Protocol and Commands

FAQs

Contents
ED Command List
BB-400 Command List

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.

Click on the command below to see more information.

Command List

Command Response Description Supported Devices
%AANNTTCCFF !AA Set Device Configuration All ‘ED’ Digital Devices
%AANNTTCCFF !AA Set Device Configuration All ‘ED’ Analog Devices
#** No Response Synchronized Sampling All ‘ED’ Devices
#AA00DD > Set Digital Output ED-588, ED-538, ED-527, ED-504, ED-008, ED-004, ED-204, ED-038
#AA0ADD > Set Digital Output ED-588, ED-538, ED-527, ED-504, ED-008, ED-004, ED-204, ED-038
#AA0BDD > Set Digital Output ED-588, ED-538, ED-527, ED-504, ED-008, ED-004, ED-204, ED-038
#AA1cDD > Set Digital Output ED-588, ED-538, ED-527, ED-504, ED-008, ED-004, ED-204, ED-038
#AAAcDD > Set Digital Output ED-588, ED-538, ED-527, ED-504, ED-008, ED-004, ED-204, ED-038
#AABcDD > Set Digital Output ED-527
#AAN !AA(Data) Read Digital Input Counter ED-588, ED-538, ED-516, ED-504, ED-008, ED-004, ED-204, ED-038
$AA2 !AANNTTCCFF Read Device Configuration All ‘ED’ Devices
$AA4 !S(Data) Read Synchronized Data All ‘ED’ Digital Devices
$AA4 !S(Data) Read Synchronized Data All ‘ED’ Analog Devices
$AA5 !AAS Read Reset Status All ‘ED’ Devices
$AA6 !(Data) Read Digital I/O Status All ‘ED’ Devices
$AAC !AA Clear Latched Digital Input ED-588, ED-538, ED-516, ED-504, ED-008, ED-004, ED-204, ED-038
$AACN !AA Clear Digital Input Counter ED-588, ED-538, ED-516, ED-504, ED-008, ED-004, ED-204, ED-038
$AAF !AA(Data) Read Firmware Version All ‘ED’ Devices
$AALS !(Data) Read Latched Digital Input ED-588, ED-538, ED-516, ED-504, ED-008, ED-004, ED-204, ED-038
$AAM !AA(Data) Read Device Name All ‘ED’ Devices
@AA >(Data) Read Digital I/O Status All ‘ED’ Devices
@AA(Data) > Set Digital Output ED-588, ED-538, ED-527, ED-504, ED-008, ED-004, ED-204, ED-038
~AAO(Name) !AA Set Device Name All ‘ED’ Devices
~** No Response Host OK All ‘ED’ Devices
~AA0 !AASS Read Watchdog Timeout Status All ‘ED’ Devices
~AA1 !AA Reset Watchdog Timeout Status All ‘ED’ Devices
~AA2 !AAVV Read Watchdog Timeout Settings All ‘ED’ Devices
~AA3EVV !AA Set Watchdog Timeout Value All ‘ED’ Devices
~AA4V !AA(Data) Read Power On/Safe Value ED-588, ED-538, ED-527, ED-504, ED-008, ED-004, ED-204, ED-038, ED-560
~AA5V !AA Set Power On/Safe Value ED-588, ED-538, ED-527, ED-504, ED-008, ED-004, ED-204, ED-038, ED-560
~AAXCn !AATTTT Get Debounce Time Value of a Channel ED-588, ED-538, ED-516, ED-504, ED-008, ED-004, ED-204, ED-038
~AAXCnTTTT !AA Set Debounce Time Value of a Channel ED-588, ED-538, ED-516, ED-504, ED-008, ED-004, ED-204, ED-038
#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 value of channel n 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

BB-400 Response Format

As explained above, 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.

The only difference between ED devices and the BB-400, is that the BB-400 has a static address of “01”:

! 01 (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). For the BB-400, this is
defaulted to ’01’ and cannot be changed.

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

Checksum: Optional 2 character checksum.

Click on the command below to see more information.

BB-400 Command List

Command Response Description
#011cDD > Set Digital Output
#01AcDD > Set Digital Output
#01N !01(Data) Read Digital Input Counter
$012 !01NNTTCCFF Read Device Configuration
$016 !(Data) Read Digital I/O Status
$01C !01 Clear Latched Digital Output
$01CN !01 Clear Digital Input Counter
$01F !01(Data) Read Firmware Version
$01LS !(Data) Read Latched Digital Input
$01M !01(Data) Read Device Name
$01M0 !01(Data) Reads the device model
$01RS No response Reset the device
$01S1 !01 Reloads the default calibration settings
@01 >(Data) Read Digital I/O Status
@01(Data) > Set Digital Output
~01O(Name) !01 Set Device Name
~01XCn !01TTTT Get Debounce Time Value of a Channel
~01XCnTTTT !01 Set Debounce Time Value of a Channel
%01NNTTCCFF !01 Set Device Configuration

 

Related FAQs

Related Products

Related Range

FAQs