The Ascii Protocol - Mantracourt DSC User Manual

Strain gauge or load cell embedded digitiser module – 2nd generation
Hide thumbs Also See for DSC:
Table of Contents

Advertisement

E.G. could get 3.999974 instead of 4
eg. for a byte write 240, 240.1 and 239.66 are all the same value
Rounding
Although rounding is applied when writing to integral values, data read from a device is not rounded off.

The ASCII Protocol

The ASCII protocol uses only printable characters and carriage-return ('<CR>'), which allows a "dumb" terminal
device or a PC programme like Hyper-Terminal to interrogate the device. Host Command Message Format
The basic command request structure is shown in the following example, illustrating the message
"!001:SGAI=123.456<CR>", meaning write 123.456 to parameter SGAI on station 1:
Framing
Station
Character
Address
!
001
An Explanation of Each Field is as Follows:
• Framing Character A "!" character is used to signal the start of a new message. This character is only ever
transmitted by the host, for framing purposes
• Station Address A three-digit ASCII decimal number (0-999), determining which slave device(s) the command is
intended for. All three digits must be sent.
Address 000 is reserved for broadcast addressing.
• Separator always present. As no checksum or message verification technique is used, slaves use this as an extra
check on message validity
• Command Identifier. Up to 4 alpha-numeric characters, case insensitive, giving the name of the required
command.
• Access Code. Defines what sort of response is expected :–
'=' means write data is expected to follow
'?' means the host is expecting to receive read data back
<CR> (i.e. nothing more before end) means the command is an action type (execute)
• Data. An ASCII decimal-formatted number, can include 0..9, '+','–', '.' and spaces.
This field can have a maximum length of 15 characters
• End of frame. A <CR> is always present to indicate the end of the message
Summary
• A command message begins with '!', followed by a three-digit station address, then a ':', and finishes with a
<CR>.
• The '!' and <CR> only appear at the beginning and end of commands respectively
• From the ':' to the final <CR> is the command 'instruction' (of read, write or execute type)
• All instructions begin with an alphanumeric command identifier of up to 4 characters, and end with a non-
alphanumeric (which may be the final <CR>).
Slave Response Message Formats
Each slave monitors the bus for command messages. It responds to any message that is addressed to it by sending a
response message.
To be accepted by a slave device, a message must start with '!', the correct three-digit slave address and ':', and
end with <CR>, with no intervening extra '!'.
The slave will then always respond.
There are Three Possible Types of Response: acknowledge (ACK), acknowledge with data (for a read), and not-
acknowledge (NAK)
ACK is a single <CR> character. This confirms an execute or write command.
ACK-with-data is a decimal number, followed by <CR>. This confirms a read and returns the data value.
NAK is an '?' <CR> sequence. The device rejected the command.
There Are Several Possible Reasons For A NAK Response
Command identifier not recognised
Badly formatted command: Missing command identifier, unrecognised access-code character, or unexpected
character somewhere else
Access attempted not supported by this command.
Micron Meters DCell & DSC User Manual
Separator
Command
Identifier
:
SGAI
Access
Data
Code
=
-99.9999
End of
frame
<CR>
48

Advertisement

Table of Contents
loading

This manual is also suitable for:

Dcell

Table of Contents