Support Home


Knowledge Base


Documentation


Contact Support


Unofficial Forum

One DS and several sources for data

Question: I want one DS to get data from several different sources. Can I do this?

Answer: This is possible, but has some limitations. Read on to find out.

An example of such an installation is a temperature monitoring system in which several temperature measurement nodes constantly send their information to a single destination.

Again, this is only possible with UDP/IP transport protocol. if you use TCP/IP then the destination DS100/EM100 will only accept a single connection at a time so several devices will not be able to talk to this DS100/EM100 simultaneously. With UDP/IP this is possible and you don't even need to use the broadcast mode (because each source sends the data to only one destination).

There is one important aspect of this system that you must consider very carefully: you have to make sure that each meaningful “message” from the source is sent in a single UDP datagram (packet)! What constitutes this “message” is different from system to system but it generally means a complete piece of data (for example, a certain command).

Now, why is it important that the whole command fits in a single UDP datagram? Imagine for a second that your “message” is transmitted across the network in two UDP datagrams: the first one carries the beginning of the message and the second datagram carries the rest of it. When there is only one sender your destination DS100/EM100 will generally receive the datagrams in their order of transmission so the data will come out of the serial port in a correct way. But what if several senders transmit their messages at the same time? Pieces of messages can get mixed up. On the receiving end you may get message1_part1 first, then message2_part1, then message1_part2, followed by message2_part2. As a result the data coming out of the destination serial port will be incorrect!

To make sure that each message is sent as a single UDP datagram use the encapsulation options of the DS100/EM100. These options include several Settings that define how the incoming serial data is combined into the Ethernet packets. Typically, your messages have a certain structure: there is a start character to mark the beginning of the message (for example, STX), and an end character (for example, CR). Program the Settings of each sending DS100/EM100 as follows (see our Technical Manuals for details on these Settings and a general description of serial data encapsulation):

  1. Set the Start On Any Character (SA) Setting to 0 (disabled)
  2. Set the Use Start Character, Enable/Disable (F1) Setting to 1 (enabled)
  3. Set the Use Start Character, code (S1) Setting to 02 (for STX)
  4. Set the Use Stop Character, Enable/Disable (U1) Setting to 1 (enabled)
  5. Set the Use Stop Character, code (E1) Setting to 13 (for CR)
  6. Set the Number of post-characters (P1) Setting to 0 (no post-characters)
  7. Set the Maximum Length (ML) Setting to 255 (this will allow UDP packets of up to 255 bytes)
  8. Set the Maximum Delay (MD) Setting to 0 (this will disable this feature)

Now you have made sure that your messages start with STX and end with CR. As long a single message is 255 bytes or less, it is guaranteed to cross the network in a single UDP datagram.

Potential Pitfalls

The weak points of this system are:

  • The delivery of UDP messages is not reliable.
  • Message size cannot exceed 255 bytes.

© Tibbo Technology Inc. 2001-2009   Contact Us | Account