
How the Ockam Bus Works
Ockam data
Ockam data is organized into
frames. Each frame consists of ASCII characters with odd parity, and
one stop bit, organized as null, <tag>, and a variable
length string carrying the actual value, and ending with the null that
begins the next frame. The <tag> is a unique character
associated with a particular value (e.g. 'B' identifies boatspeed). An
example of a part of the output might look like this;
<0>T16:45<0>H-21<0>B7.31<0>D-24<0>A12.6<0>...
indicating time (T)
of 16:45, heel of 21 degrees to starboard, boatspeed 7.31 knots,
apparent wind angle of 24 degrees to port and apparent wind speed of
12.6 knots. You can receive this data as follows.
- Open the comm
port (default is 9600,N,7,1)
- Read a block of data, and cut off the beginning up to
and
including the first null. This synchronizes with the frames.
- Find the first null. If found, go to step 5.
- Append another block of data, and return to step 3.
- Extract from the first character to the null into
Frame.
Delete the null from the block. If Frame is zero length, return to step
3.
- From the first character of Frame, use or store the
value
represented by the rest of the Frame. Return to step 3.
This procedure is possible in
most languages, but not (as far as I know) in something like a
spreadsheet. It is also a killer in terms of having to return to
process characters before the comm buffer overflows. A far better way
to access Ockam data is to use a driver because it eliminates the need
for the application to manage the data stream. The OckamSoft 4 driver
handles the details and provides an API for access.
Ockam Etherserver
driver
Windows can have multiple
applications requiring data input from (and possibly multiple output
to) the instrument system. OckamSoft 4 addresses this need with the OckamSoft
4 Driver, a 32-bit server DLL that provides the
following services:
- Pigeonhole
service which returns the latest value for a specified Ockam tag.
- Time history of specified tags at specified rate and
depth.
Stored value can be snapshot or boxcar average.
- Position fix history functions which include Lat,
Lon, time
and bounding box of the latest 3000 position fixes.
- Ship's position and current calculation via DR
between
fixes.
- General purpose output to the Ockam system.
- Data logging functions.
- A database which maps tag->name and provides
other
information about Ockam variables. This function also allows temporary
redefinition of tags (e.g. temporary redefinition of User 1 to Polar
Speed when a program is outputting a User function like U1=polar_speed).
- A simulator, including the ability to sense other
application’s control output.
- Instrument error code database, including
description,
which are current, and which have ever occurred.
- NMEA-0183 FIFO and pigeonhole service. Use of this
function
requires a combined Ockam and NMEA-0183 data stream (see Ockam NMEA distribution).
- The latest (approximately) 40 NMEA sentences are
maintained in a FIFO accessed by GetNextNMEAsen().
- The latest specific NMEA sentence is available
with
GetNMEAsen().
- EnumNMEAsen() returns the saved time and sentence
ID
for the ith pigeonholed NMEA
sentence.
- Launches Ockam and NMEA data onto the network. This
enables
wireless applications to receive instrument data and send commands to
the system.
- Event notification via the Windows Message function.
This
function currently provides 7 messages:
- Change in Variable definition
- Time tick (1/4 sec rate)
- New NMEA sentence
- New position
- Specified tag changed
- Tack/gibe happened (Sign change of apparent wind
angle)
- Stopwatch status change (start/stop) and went to
zero.
- Magnetic variation change.
The driver is included with
the OS4 package
and does not require an unlock code.
The package also includes sample code and header files for Visual Basic
6 and Excel. Goodies #2 is source
code for a speech application.
Return
to Home Page |