
15
11 May, 2006 DMC-A2 Series (ALD-00029)
Macro Sensors Tel. (856) 662-8000
www.macrosensors.com
Serial Communications
1elbaT snoitnevnoCleveLegatloVecafretnI
TXD, RXD: -3 to -15 V
0)evitca(eca
p
Mark (idle)1
S
TXD, RXD: +3 to +15 V
Logic
Interface State
RS-232
Communication Formats
ASCII Mode
The ASCII mode is a simple, isolated ASCII communication
protocol using the standard ASCII character set. This mode
provides external communication between the meter and a PC
allowing remote programming to be carried out.
DMC-A2 Series meters use a serial communication channel to
transfer data from the meter to another device. With serial
communications, data is sent one bit at a time over a single
communications line. The voltage is switched between a high
and a low level at a predetermined transmission speed (baud
rate) using ASCII encoding. Each ASCII character is transmitted
individually as a byte of information (eight bits) with a variable
idle period between characters. The idle period is the time
between the receiving device receiving the stop bit of the last
byte sent and the start bit of the next byte. The receiving device
(for example a PC) reads the voltage levels at the same interval
and then translates the switched levels back to an ASCII
character. The voltage levels depend on the interface standard
being used.
Table 1 lists the voltage level conventions used for RS-232. The
voltage levels listed are at the receiver.
See Table 2 for a list of the most commonly accessed ASCII
mode registers.
Each ASCII character is 'framed' with:
• A start bit.
• An optional error detection parity bit.
• And one or more ending stop bits.
For communication to take place, the data format and baud rate
(transmission speed) must match that of the other equipment in
the communication circuit. Figure 5 shows the character frame
formats used by the meter.
Idle
0b
0
b
1
b
2
b
3
b
4
b
5
b
6
Idle
8 data, no parity, 1 stop
Idle
0b
0
b
1
b
2
b
3
b
4
b
5
b
6
P
Idle
1
8 data, parity, 1 stop
Note: b
0
to b
7
is ASCII data.
Start
Bit
Stop
Bit
1
Receiving Device (PC)
Sending Device (Meter)
Data Bits
b
7
b
7
Stop
Bit
Parity
Bit
Figure 5 – Character Frame Formats
2elbaT )sretsigeRtib-23(sretsigeRIICSAnommoC
Function
.geRsubdoM
1 sutatSmralA 00004
2 retsigeRyalpsiD 31504
3 tluseRataDdess
ecorP 51504
4 1lennahC–ataDdessecorP 71504
5 2lennahC–ataDdessecorP 91504
93 3lennahC–ataDdessecorP 12504
04 4len
nahC–ataDdessecorP 32504
6 1tniopteS 53504
7 2tniopteS 73504
8 3tniopteS 93504
9 4tniopteS 14504
01 5tniopteS 34504
11
6tniopteS 54504
21 kaeP 52504
31 yellaV 72504
41 eraT 33504
51 esUetamxeTrofdevreseR –
61 1latoT 92504
71 2latoT 1350
4
ASCII Reg. #
#
Character Frame Formats
Start Bit and Data Bits
Data transmission always begins with the start bit. The start bit
signals the receiving device to prepare to receive data. One bit
period later, the least significant bit of the ASCII encoded
character is transmitted, followed by the remaining data bits.
The receiving device then reads each bit position as they are
transmitted and, since the sending and receiving devices
operate at the same transmission speed (baud rate), the data
is read without timing errors.
Parity Bit
To prevent errors in communication, the sum of data bits in
each character (byte) must be the same: either an odd amount
or an even amount. The parity bit is used to maintain this
similarity for all characters throughout the transmission.
It is necessary for the parity protocol of the sending and
receiving devices to be set before transmission.There are three
options for the parity bit, it can be set to either:
• None – which means there is no parity.
• Odd – which means the sum of bits in each byte is odd.
• Even – which means the sum of bits in each byte is even.
After the start and data bits of the byte have been sent, the
parity bit is sent. The transmitter sets the parity bit to 1 or 0
making the sum of the bits of the first character odd or even,
depending on the parity protocol set for the sending and
receiving devices.
As each subsequent character in the transmission is sent, the
transmitter sets the parity bit to a 1 or a 0 so that the protocol of
each character is the same as the first character: odd or even.
The parity bit is used by the receiver to detect errors that may
occur to an odd number of bits in the transmission. However, a
single parity bit cannot detect errors that may occur to an even
number of bits. Given this limitation, the parity bit is often
Comentarios a estos manuales