OpenCurves  0.9
Real Time Connection File Format

Real time data connections used an XML file to specify the connection type and messaging formats. These files are loaded by the RealTimePlot class. The XML file identifies the following attributes:

  • The connection port and communications protocol
  • The outgoing and incoming message formats.

The serial example below uses the string data format, while the network section shows the a binary format example. Either is valid in either block. The <headings> element is optional.

<connection>
<serial port="portname" baud="9600">
<buffer size="xxx"/>
<time column="1" scale="1.0"/>
<comms format="utf-8">
<onconnect>abcdefg</onconnect>
<headings>
<heading name="name1"/>
<heading name="name2"/>
<heading name="name3"/>
</headings>
</comms>
</serial>
<network ip="ipv4" port="1234" protocol="udp|tcp">
<buffer size="xxx"/>
<time field="timestamp" scale="1.0e-6"/>
<comms format="binary">
<onconnect>
<!-- Data structure sent when connection is made -->
<!-- Endian specification is optional, defaulting to the current platform -->
<struct endian="little|big|network">
<field type="uint16" name="type">6</field>
<field type="uint16" name="subtype">1</field>
<field type="uint16" name="size">16</field>
<field type="uint16" name="flags">2</field>
<field type="uint32" name="sequenceNumber">0</field>
</struct>
</onconnect>
<ondisconnect>
<!-- Data structure sent when disconnecting -->
<struct endian="little|big|network">
<field type="uint16" name="type">6</field>
<field type="uint16" name="subtype">2</field>
<field type="uint16" name="size">16</field>
<field type="uint16" name="flags">2</field>
<field type="uint32" name="sequenceNumber">0</field>
</struct>
</ondisconnect>
<receive>
<!-- Expected incoming data structure -->
<!-- Only fields with 'heading'='yes' are displayed. Additionally, the time element above may specify any field to derive a time value from. -->
<struct endian="little|big|network">
<field type="uint16" name="type" />
<field type="uint16" name="subtype" />
<field type="uint16" name="size" />
<field type="uint16" name="flags" />
<field type="uint32" name="sequenceNumber" />
<field type="uint64" name="timestamp" />
<field type="double" name="pitch" heading="yes" />
<field type="double" name="roll" heading="yes" />
<field type="double" name="yaw" heading="yes" />
<field type="uint8" name="mode" />
<!-- Pad out the read to the size field -->
<padby field="size" />
<!-- Pad out the read by another 2 bytes -->
<pad size="2" />
</struct>
</receive>
</comms>
</network>
</connection>

!