BY MICHAEL SIMPSON
Adaptive website at www.adaptivedisplays.com.
The signs use a protocol called Alpha Sign
Communications Protocol. You can find a complete
description of the protocol at www.amsi.com/Pages/
97088061.htm
The protocol can be a bit complicated as it supports
networking devices. What I’m going to do in this article is
exploit a feature of the protocol to create a very simple
interface.
Programming Protocol
I have been doing PC and Pocket PC development for
some time now and, a while back, I decided to create a
simple development platform that would make interfacing
to devices and robotics much quicker and easier. With the
help of other engineers, we came up with a development
platform called Zeus. Zeus has both desktop and Pocket PC
versions available.
I have created a version of Zeus just for Nuts & Volts
readers. ZeusNV will let you debug, compile, and test
the code in this article. You can even create a stand-alone
executable that you can distribute to others.
ZeusNV has one requirement. You must have the .Net
Framework installed on your Windows machine.
The code we used is quite simple and can be adapted
to just about any programming language that supports
RS232 communications.
The Alpha Protocol
The Alpha protocol has some pretty advanced features
such as networking and message labeling. It also supports
uploading graphic images call DOTS. In order to make the
explanation and examples as simple as possible, we will
drastically simplify the interface by using certain simple
aspects of the protocol.
Before we send a single byte to the sign, we need to
open up a comport with the correct settings. The protocol
supports the following baud rates: 1200, 2400, 4800, and
9600 with the following settings: 7 Bits, 1 Start, 2 Stop, and
Even Parity. We use the Zeus ComOpen command to open
the com port.
Const Ch1 1
ComOpen(Ch1,baud=9600,port=1,parity=2,bits= 7,stop=2)
Zeus can control five Async connections at once.
These are called channels; hence, the Ch1 constant. You
will need to change the port=1 setting if you are using
anything else. For instance, if you are using Bluetooth on
an IPAQ Pocket PC to connect to a Bluetooth RS232
connector, you will use port= 8.
Once the port is open, we have to tell the sign we are
■ FIGURE 2
ready to communicate with it. I call this the ready header.
ComOutput Ch1,chr(0)+chr(0)+chr(0)+chr(0)+chr(0)
ComOutput Ch1,chr(1)
ComOutput Ch1,”Z00”
We start with five null characters (Value 0). This sets the
sign’s baud rate to the rate you are transmitting. (Note that
if you are dealing with a language that can’t send Null characters, you may also send five 1s.) We then send an SOH
(Start Of Header, Value = 1) character. After this, we can do
many things but, in our case, we are going to send “Z00.”
This tells the sign that we are addressing all signs on the bus.
The Alpha protocol supports sending checksums.
However, to make the interface simpler, we are not going
to utilize this feature.
With the header sent, we can now send a command.
The Alpha protocol supports several command types, but we
will only be using a couple of them. In this case, we are going
to send a Priority
Text Message. What ■ FIGURE 3
is neat about this
message is that it
bypasses the internal
file system so it’s
simple and fast. The
down side is that you
can only send 125
bytes, but since we
are going to be sending real time messages, this is perfect.
To send a Priority
Text Message, you
start by sending an
STX (Start Text, Value
= 2) character.
We then send a
command code of
September 2006 41