Professional Documents
Culture Documents
FAX: 818-785-4415
Email: scandata@aol.com
Web Site: www.scan-data.com
APP-1129
06-01-00
Application Note APP-1129
What is a protocol?
The CAP SCADA Protocol.
A protocol is simply the language the RTUs,
computers and other devices use when they
communicate with each other.
Why is the CAP protocol so widely
Protocols have proliferated and today there are
used? hundreds of them. Many are proprietary (not
public) and are designed to lock the end user into
Many protocols are proprietary (not open to the public). a specific manufacturer's product.
Others are obsolete and are no longer supported by The worlds first protocol was the Morse code, a
the manufacturer. Other protocols, such as MODBUS, series of dots and dashes. It travelled along
have become virtual standards for communicating with railroad lines on iron wires and reached ships at
PLCs by virtue of their wide use. Every manufacturer sea over radios and flashing lights. Remember the
most famous Morse code message of them all,
tries to make a forceful case for using his own
SOS, Save Our Souls?
particular protocol. Which one to use?
The Morse code is a bit protocol, difficult to read.
The protocol requirements of PLCs (Programmable You have to interpret each set of bits.
Logic Controllers) and RTUs (Remote Telemetry Bit protocols are still used, especially in
proprietary systems and in large and complex
Units) differ in a number of aspects: SCADA systems for electric power distribution.
PLCs, most often used in factory floor and other local PLC protocols are often bit oriented as they are
control systems, need rapid access to read and designed to read and command single specific
inputs or outputs. "Turn coil #214 on" is a typical
change single individual points PLC command. These bit protocols are difficult to
handle by humans and by computers.
RTUs, used in SCADA systems, need rapid access to
all their information for quick central station screen Two protocols now dominate the world. The first,
obviously, is plain speech (English, Chinese,
updates. It is impractical to repeatedly ask for point
Norwegian, whatever). It dominates. Just listen to
after point in these systems. your TV or radio or mother in law. Even RTUs use
this plain speech protocol. Check the ScanData
This application note describes the CAP protocol in VBX-7 Voice Box Supervisor RTU.
detail.
The second dominating protocol is ASCII,
American Standard Code for Information
Interchange. It has been accepted by the whole
Why is the CAP protocol preferred for all world. Virtually all computers and printers and
modern SCADA systems? modems and what have you now communicate in
ASCII. It is an excellent RTU protocol, easily
generated and read by all computers.
1. CAP uses ASCII (American Standard Code For
Information Interchange) format:
5. CAP uses a message security checksum For instance, a Mode-C leak detect system was
character. delivered many years ago to the then Getty Oil in
central California, working over very noisy VHF
splinter frequency radios. Four ScanData RTUs at
There may be errors during a transmission due to crude oil custody transfer stations deliver CAP
noisy lines or to radio static. The software must have a protocol leak detect and metering pulse counts to a
way of finding out if this has happened so that it can central ScanData RTU. No erroneous counts have
ever been reported with this system.
disregard the message and ask the RTU to transmit
another one (see sidebar).
APP-1129, Page 2
garbage characters. Some RTUs have only a few analog and digital inputs
and outputs, others have lots of them. How many
The message delineators are usually a pair of '{ }' (so inputs and outputs does this RTU have? And what kind
dear to Pascal programmers). The CAP message now are they? The software needs to know an the RTU
looks like this: configuration field has the information.
(LF){ RTU message }(CS)(CR) The configuration field contains five pairs of numbers.
Certain protocols use five groups of three numbers.
The software now knows exactly where the message These five numbers follows the message type
starts and where it ends. This is essential for the identifier. The first number tells you how many analog
checksum calculation. If there is any flaw in any of the inputs the RTU has, the second pair how many pulse
characters in the message (inside these delineators) or counter inputs it has, the third pair how many digital
if the checksum does not match, the message is inputs it has, the fourth how many digital outputs (relay
discarded and another one asked for. drivers) it has and finally the fifth pair tells you how
many analog outputs the RTU has.
7. CAP uses a protocol version identifier: For example, an RTU with 8 analog inputs, 2 pulse
counter inputs, 8 digital inputs, 8 digital outputs and 1
There are different versions of the CAP protocol suit analog output (a version of the ScanData LMX RTU)
different applications. Some transmit analog has the following configuration field:
information in compressed form, others transmit it in
ASCII digits, etc. The receiving software needs to know (LF){ BXYZ!0802080801RTU message }(CS)(CR)
which version is in use.
Which particular CAP protocol version is the RTU 11. CAP uses separate data fields.
using? The protocol identifier character tells you. It
follows the space after the message start delineator. The RTU reports its analog, pulse counter and digital
For instance, where a 'B' version protocol is used, the input readings in three data fields. It reports the
message looks like this: contents of its analog and digital output buffers in two
more data fields. Five data fields in total. The RTU
(LF){ BRTU message }(CS)(CR) automatically dimensions its report data field size by
the information in its configuration field. No RTU
reporting space is wasted.
8. CAP uses a station identifier (address).
Each RTU has its own three character identifying 12. Example of a complete CAP RTU report.
code. For example, receiving a message from an
RTU in 'B' protocol with the identifier XYZ reads: For example, a complete report from an LMR RTU
with the identifier 513, with a D version protocol and
(LF){ BXYZRTU message }(CS)(CR) with 2 analog inputs, 1 counter input, 2 digital inputs, 2
digital outputs and 1 analog output, reads as follows:
APP-1129, Page 3
many data groups there are of each kind. (CR) is the end of transmission character.
EG is the compressed analog output register report XYZ is the station identifier.
field, corresponding to the RTU analog output #1.
Same compression as with the analog inputs. %% is the command message identifier. It tells the
RTU that a command follows.
} is the end of message character.
R05 identifies relay driver (status output) #5.
(CS) is the checksum character.
1 tells the RTU to turn this relay driver 'ON'. 0 would
APP-1129, Page 4
have told the RTU to turn this relay driver 'OFF'.
Summary:
The public domain CAP protocol is in use in systems
all over the world. It is fast, flexible virtually error free
and adapts easily to different RTU configurations and
functions. Complete CAP protocol manuals are
delivered with each ScanData RTU.
APP-1129, Page 5