IEC 870 5 101 Protocol Users Guide
IEC 870 5 101 Protocol Users Guide
101
Protocol
Users Guide
Monaghan Engineering, Inc.
862 Las Colinas Drive
Dripping Springs, Texas 78620
Phone: 1-512-858-4271
Fax: 1-512-858-1355
e-mail: [email protected]
Monaghan Engineering IEC 870.5.101 Protocol
TABLE OF CONTENTS
i Rev. 1
Monaghan Engineering IEC 870.5.101 Protocol
The IEC 870.5.101 protocol converter is designed to convert a 19,200 baud asynchronous
communications channel to a slower asynchronous communications channel. The protocol converter also
provides time tagging of IEC 870 messages to 1 mS resolution.
The micro-controller that performs the protocol conversion is programmed to communicate with the host
computer in asynchronous format with one start bit, eight data bits, no parity and one stop bit. The
communications rate is 19,200 baud.
Communications between the micro-controller and the host computer will utilize a byte stuffing protocol.
The command byte used in the byte stuffing protocol is 80 Hex. When either the micro-controller or the
host computer encounters an 80 Hex character in the data stream it must examine the next character to
determine what action to perform. If the next character is another 80 Hex character, then the first 80 Hex
character is discarded and the second 80 Hex character is accepted as data. If the second character is
anything other than an 80 Hex character, it is interpreted as a command character, and processed
accordingly. The command characters for the IEC 870.5.101 protocol are defined as follows:
The configuration message is used to set the communications parameters of the converter. If a
configuration message is not sent to the micro-controller, the following default values will be used:
1 Rev. 1
Monaghan Engineering IEC 870.5.101 Protocol
Baud – 1200
Data Bits – 8
Parity – Even
Stop Bits - 1
The Start of Configuration is a two byte sequence consisting of an 80 hex character followed by a 03 hex
character.
The Baud Rate is a single character that defines the baud rate with which the micro-controller
communicates with the RTU. The available baud rates are as follows:
The Number of Data Bits is a single character that defines the number of data bits in each asynchronous
character.
The Number of Stop Bits is a single character that defines the number of stop bits in each asynchronous
character.
The Parity is a single character that defines if a parity bit is appended to the asynchronous character and
if that parity is even or odd.
2 Rev. 1
Monaghan Engineering IEC 870.5.101 Protocol
00 Hex – No Parity
01 Hex – Even Parity
02 Hex – Odd Parity
The EOM Delay is a single character that defines the number of character times to wait between
characters before sending the EOM command. The valid range is from 1 to 255.
Protocol is a single character that defines which protocol is to be used to communicate with the RTU.
Multiple protocols in a single chip are not currently supported. The Configuration Response message
gives the current protocol.
Version is a single character that gives the version of the protocol converter firmware. This value is not
downloadable. The Configuration Response message gives the current version number.
The End of Configuration is a two byte sequence consisting of an 80 hex character followed by a 04 hex
character.
The configuration message response is an echo of the configuration message. The configuration response
message is defined as follows:
The Query message is used to retrieve the current configuration of the protocol converter.
The Query Response message returns the communications parameters of the converter. The message is
defined as follows:
3 Rev. 1
Monaghan Engineering IEC 870.5.101 Protocol
The Start of Query is a two byte sequence consisting of an 80 hex character followed by a 07 hex
character.
The Baud Rate is a single character that defines the baud rate with which the micro-controller
communicates with the RTU. The available baud rates are as follows:
The Number of Data Bits is a single character that defines the number of data bits in each asynchronous
character.
The Number of Stop Bits is a single character that defines the number of stop bits in each asynchronous
character.
The Parity is a single character that defines if a parity bit is appended to the asynchronous character and
if that parity is even or odd.
00 Hex – No Parity
01 Hex – Even Parity
02 Hex – Odd Parity
The EOM Delay is a single character that defines the number of character times to wait between
characters before sending the EOM command. The valid range is from 1 to 255.
Protocol is a single character that defines which protocol is to be used to communicate with the RTU.
Multiple protocols in a single chip are not currently supported. The Configuration Response message
gives the current protocol.
4 Rev. 1
Monaghan Engineering IEC 870.5.101 Protocol
Version is a single character that gives the version of the protocol converter firmware.
The End of Query is a two byte sequence consisting of an 80 hex character followed by a 08 hex
character.
The Command and Data messages are used to send data to an RTU or retrieve data from an RTU.
The Start of Message is a two byte sequence consisting of an 80 hex character followed by a 01 hex
character.
The data bytes consist of address, control and data to be sent to the RTU. The data message can be of any
length.
The End of Message is a two byte sequence consisting of an 80 hex character followed by a 02 hex
character.
The micro-controller will start transmitting asynchronous characters as soon as the first data character
arrives. It is up to the host computer to send the following data bytes fast enough to keep up with the
micro-controller.
The protocol converter contains a 64 byte input buffer. As the buffer approaches its maximum capacity
the protocol converter will signal the computer to stop sending data by setting CTS inactive. After the
protocol converter has cleared enough of the buffer to accept more characters, it will set CTS active to
allow the computer to send more data.
The IEC 870.5.101 protocol utilizes a variable length message for data responses. The protocol converter
will send each character to the computer as it is received. The EOM command will be sent when either
the Carrier Detect input goes inactive indicating loss of carrier or when the time between characters
exceeds the EOM Delay setting.
5 Rev. 1
Monaghan Engineering IEC 870.5.101 Protocol
If parity is enabled, the protocol converter will check each character that it receives for the proper parity.
If a parity error is detected, the protocol converter will discard that character and send the End of
Message with Parity Error command.
The protocol converter will check each character that it receives for the proper framing. If a framing error
is detected, the protocol converter will discard that character and send the End of Message with Framing
Error command.
The Command and Data messages are used to send data to an RTU or retrieve data from an RTU. The
command can be set as either a normal message expecting a response, or a broadcast message. The
protocol converter will return a time tag with 1 mS resolution when the start bit of the transmit message
is sent and the start bit of the receive message is received.
The Start of Message is a two byte sequence consisting of an 80 hex character followed by a 10 hex
character.
The data bytes consist of address, control and data to be sent to the RTU. The data message can be of any
length.
The End of Message is a two byte sequence consisting of an 80 hex character followed by a 11 hex
character.
When the first data character is received, the micro-controller will start looking for a valid time message
from the IRIG-B interface. After a time message is received the micro-controller will record the time and
6 Rev. 1
Monaghan Engineering IEC 870.5.101 Protocol
start transmitting the first character. It is up to the host computer to send the following data bytes fast
enough to keep up with the micro-controller.
The IEC 870.5.101 protocol utilizes a variable length message for data responses. The protocol converter
will monitor the time messages being sent by the IRIG-B interface. When the start bit of the first
character sent by the RTU is received, the micro-controller will record the time and then send each
character to the computer as it is received. The STT command will be sent when either the Carrier Detect
input goes inactive indicating loss of carrier or when the time between characters exceeds the EOM
Delay setting. This will be followed by the time tag of the transmit messages and the time tag of the
receive message. The message will be ended with an EOMTT command.
The IEC 870.5.101 protocol utilizes command type 103 for clock synchronization. The Time
Synchronization command can be sent as a normal scan message or a broadcast message. The clock
synchronization message is identified by the Start of Time Sync (STS) header for a normal scan or a Start
of Broadcast Time Sync (SBTS) header for a broadcast message. Following the header is a 24 bit offset
that will be added to the IRIG-B time before it is sent to the RTU. The next two bytes are the current day
of year. The next two bytes will be the End of Time Sync Header, 80 Hex, 12 Hex. The next bytes will be
the IEC 870.5.101 time sync message with the most accurate time possible from the computer.
When the protocol converter receives a time sync message it will compare the Day of Year with the day
of year from the IRIG-B clock. If the day of year does not match, the message will be rejected. If the two
values for the day of year match, the protocol converter will then add the 24 bit offset to the time
received from the IGIG-B clock. If this causes a day rollover, the message will be rejected. If there was
not a day rollover, the protocol converter will then update the milliseconds, minutes and hours of the time
sync message with the proper time, calculate the checksum and transmit the message.
7 Rev. 1
Monaghan Engineering IEC 870.5.101 Protocol
The protocol converter will monitor the time messages being sent by the IRIG-B interface. When the start
bit of the first character sent by the RTU is received, the micro-controller will record the time and then
send each character to the computer as it is received. The STT command will be sent when either the
Carrier Detect input goes inactive indicating loss of carrier or when the time between characters exceeds
the EOM Delay setting. This will be followed by the time tag of the transmit messages and the time tag
of the receive message. The message will be ended with an ETS command.
8 Rev. 1
Monaghan Engineering IEC 870.5.101 Protocol
The protocol converter will respond with an acknowledgement message after the time sync message has
been sent. The TX time tag will contain the time when the command was sent. The RX time tag data will
not be valid.
The IEC 870.5.101 protocol utilizes command type 103 for clock delay bias. The Clock Delay command
can be sent as a normal scan message or a broadcast message. The clock delay message is identified by
the Start of Clock Delay (SCD) header for a normal scan or a Start of Broadcast Clock Delay (SBCD)
header for a broadcast message. Following the header will be the IEC 870.5.101 Clock Delay message
with the most accurate time possible from the computer.
9 Rev. 1
Monaghan Engineering IEC 870.5.101 Protocol
The protocol converter will update the milliseconds and minutes of the Clock Delay message with the
proper time, calculate the checksum and transmit the message.
The protocol converter will monitor the time messages being sent by the IRIG-B interface. When the start
bit of the first character sent by the RTU is received, the micro-controller will record the time and then
send each character to the computer as it is received. The STT command will be sent when either the
Carrier Detect input goes inactive indicating loss of carrier or when the time between characters exceeds
the EOM Delay setting. This will be followed by the time tag of the transmit messages and the time tag
of the receive message. The message will be ended with an ETS command.
10 Rev. 1
Monaghan Engineering IEC 870.5.101 Protocol
DBn-1 – Checksum
DBn – End 16 Hex
ECD – End of Time Sync (80 25)
The protocol converter will respond with an acknowledgement message after the time sync message has
been sent. The TX time tag will contain the time when the command was sent.
11 Rev. 1