44
Appendix E:
Data server programming
When directly accessing the data server using custom client software, several precautions and
considerations must be taken. A TCP/IP link is not as robust as a dedicated serial cable,
especially when the TCP/IP connection is made over the internet. This document provides
several guidelines to follow when programming a client application that uses the data server.
Making an connection
A connection to the data server is simply made by opening an TCP/IP socket to <RX-C4 IP
address>:1180. Up to 4 clients can make a connection to the data server simultaneously.
Data format
The data format sent over the TCP/IP connection is exactly the same as the data format sent
over the serial port.
Like the serial port communication format, the data server communication format is strictly one-
way. In other words, the data-server only sends data to the connected client, any incoming data
is completely ignored. This does not mean however, that the data server can just be “swamped”
with random data. The RX-C4 has only a limited amount of processing power available. If it has
to handle too much incoming data, the RX-C4 main functions will be impaired. Best is to send
no data at all to the data server.
Keeping the connection alive
As a LAN (or the internet) can be a very busy medium it is likely that the incoming data stream
is often interrupted for several seconds. The data server anticipates this by queuing the data
vectors for up to 10 seconds. This means that if (for some reason) the connection is interrupted
or delayed for several seconds, no data will be lost because the data server will buffer the data in
its queue and retransmit the data as soon as the connection is available again. However, if the
connection is interrupted or lost for more than 10 seconds, the queue will overflow and there
will be gaps in the data stream.
To check for this condition, it is advisable to monitor the vector count number. The vector count
number should count cyclically from 0x00 to 0xFF. By monitoring the vector count, missing
vectors are easily identified so that they can be replaced by “dummy” vectors by the client
software.
If no data is coming in over the TCP/IP connection for several minutes, it is safe to assume that
the connection is permanently lost. The TCP/IP socket must be closed (or aborted) and a new
connection attempt must be made. This method (checking if data is still coming in) is the only
reliable method for detecting a lost connection. It is not sufficient to rely on the TCP/IP stack to
detect a lost connection. Because of the way the TCP/IP protocol works, it is impossible for the
TCP/IP stack to detect any lost or aborted connections when the client is not actively sending
data.
Logging
For debugging purposes, it is advisable to log any “missing vector”, “lost connection” or
“reconnect” events in a log file.
Содержание RX-C4
Страница 4: ...4 ...
Страница 6: ...6 ...
Страница 8: ...8 ...
Страница 14: ...14 ...
Страница 26: ...26 ...
Страница 28: ...28 ...
Страница 40: ...40 Appendix D Receiving antennas Standard groundplane antenna Figure D1 Standard groundplane antenna ...
Страница 42: ...42 Figure D3 Directional quarter wave antenna ...