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:

#AA00(Data)[CS](CR)
DelimiterAddressCommandData*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)
DelimiterAddressData*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

CommandResponseDescriptionSupported Devices
%AANNTTCCFF!AASet Device ConfigurationAll ‘ED’ Digital Devices
%AANNTTCCFF!AASet Device ConfigurationAll ‘ED’ Analog Devices
#**No ResponseSynchronized SamplingAll ‘ED’ Devices
#AA00DD>Set Digital OutputED-588, ED-527, ED-504, ED-008, ED-004, ED-204
#AA0ADD>Set Digital OutputED-588, ED-527, ED-504, ED-008, ED-004, ED-204
#AA0BDD>Set Digital OutputED-588, ED-527, ED-504, ED-008, ED-004, ED-204
#AA1cDD>Set Digital OutputED-588, ED-527, ED-504, ED-008, ED-004, ED-204
#AAAcDD>Set Digital OutputED-588, ED-527, ED-504, ED-008, ED-004, ED-204
#AABcDD>Set Digital OutputED-527
#AAN!AA(Data)Read Digital Input CounterED-588, ED-516, ED-538, ED-504, ED-038, ED-004, ED-008, ED-204
$AA2!AANNTTCCFFRead Device ConfigurationAll ‘ED’ Devices
$AA4!S(Data)Read Synchronized DataAll ‘ED’ Digital Devices
$AA4!S(Data)Read Synchronized DataAll ‘ED’ Analog Devices
$AA5!AASRead Reset StatusAll ‘ED’ Devices
$AA6!(Data)Read Digital I/O StatusAll ‘ED’ Devices
$AAC!AAClear Latched Digital OutputED-588, ED-516, ED-504, ED-008, ED-004, ED-204
$AACN!AAClear Digital Input CounterED-588, ED-516, ED-504, ED-008, ED-004, ED-204
$AAF!AA(Data)Read Firmware VersionAll ‘ED’ Devices
$AALS!(Data)Read Latched Digital InputED-588, ED-516, ED-504, ED-008, ED-004, ED-204
$AAM!AA(Data)Read Device NameAll ‘ED’ Devices
@AA>(Data)Read Digital I/O StatusAll ‘ED’ Devices
@AA(Data)>Set Digital OutputED-588, ED-527, ED-504, ED-008, ED-004, ED-204
~AAO(Name)!AASet Device NameAll ‘ED’ Devices
~**No ResponseHost OKAll ‘ED’ Devices
~AA0!AASSRead Watchdog Timeout StatusAll ‘ED’ Devices
~AA1!AAReset Watchdog Timeout StatusAll ‘ED’ Devices
~AA2!AAVVRead Watchdog Timeout SettingsAll ‘ED’ Devices
~AA3EVV!AASet Watchdog Timeout ValueAll ‘ED’ Devices
~AA4V!AA(Data)Read Power On/Safe ValueED-588, ED-527, ED-504, ED-008, ED-004, ED-204, ED-560
~AA5V!AASet Power On/Safe ValueED-588, ED-527, ED-504, ED-008, ED-004, ED-204, ED-560
~AAXCn!AATTTTGet Debounce Time Value of a ChannelED-588, ED-516, ED-504, ED-008, ED-004, ED-204
~AAXCnTTTT!AASet Debounce Time Value of a ChannelED-588, ED-516, ED-504, ED-008, ED-004, ED-204
#AA>(Data)Reads analogue input of all channelsED-549
#AAN>(Data)Read the analogue input of the specified channelED-549
$AA0Ci!AAPerforms span calibration on the specified channelED-549
$AA1Ci!AAPerforms zero calibration on the specified channelED-549
$AA5VV!AAEnables/disables the channelED-549
$AA6!AAVVReads the enable/disable statusED-549
$AA7CiRrr!AASets the single channel range configurationED-549
$AA8Ci!AACiRrrReads the single channel range configurationED-549
$AAA>(Data)Reads the analogue inputs of all the channelsED-549
$AAB!AANNReads the channel diagnostic statusED-549
$AAM0!AA(Data)Reads the device modelED-549
$AAM1!AA(Data)Read device locationED-549
$AARSNo responseReset the deviceED-549, ED-560
$AAS0!AAInternal calibrationED-549
$AAS1!AAReloads the default calibration settingsED-549
~AAEV!AAEnables/disables calibrationED-549
~AAL(Location)!AASet device locationED-549
#AAn(Data)No responseSet the output value for channel nED-560
$AA4n!AASet power on value of channel nED-560
$AA6n!AA(Data)Read the output value for channel nED-560
$AA7n!AARead power on value of channel nED-560
$AA9n!AARead the output type and slew rate control for channel nED-560
$AA9nts!AASet the output type (t) and slew rate control (s) for channel nED-560
$AA9nttss!AASet the output type (tt) and slew rate control (ss) for channel nED-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)
DelimiterAddressData*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

CommandResponseDescription
#011cDD>Set Digital Output
#01AcDD>Set Digital Output
#01N!01(Data)Read Digital Input Counter
$012!01NNTTCCFFRead Device Configuration
$016!(Data)Read Digital I/O Status
$01C!01Clear Latched Digital Output
$01CN!01Clear 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
$01RSNo responseReset the device
$01S1!01Reloads the default calibration settings
@01>(Data)Read Digital I/O Status
@01(Data)>Set Digital Output
~01O(Name)!01Set Device Name
~01XCn!01TTTTGet Debounce Time Value of a Channel
~01XCnTTTT!01Set Debounce Time Value of a Channel
%01NNTTCCFF!01Set Device Configuration

 

    Related FAQs

    Related Products

    Related Range

    FAQs