
5.
Application Usage Scenarios
The UART parameter settings in EasySet can affect end
-to-
end data communications performance between the
SNAP Link adapters and your RS-
485/422/232 devices. This section provides several s
cenarios to illustrate
setting the UART parameters for optimal performance. Your application or device may require a few trial
-and-
error adjustments before performing as desired. These scenarios provide recommended rule
-of-
thumb starting
points to begin t
his trial-and-error process.
Refer to the UART discussion in the EasySet chapter for a description of the UART parameters, but in summary,
the three parameters are:
•
Buffering Timeout
–
the total length of time to wait before buffered data is transmitted. T
he unit of
measure is milliseconds and the default is 0. 0 effectively turns the buffering timer off.
•
Buffering Threshold
–
the minimum number of characters to enqueue before the buffer is transmitted.
SNAP Link contains a 123 byte buffer, but that must include a 12 byte header when in multipoint mode
and a 15 byte header when in point
-to-
point mode. The default value is 100. Values over 100 are not
recommended, especially at high baud rates, because the buffer could be overrun resulting in dropped
characters.
•
Inter-
character Timeout
–
the length of time to wait between the arrival of characters before the buffer
is transmitted. The unit of measure is in milliseconds and the default is 10.
Scenario 1: Card Scanner
In this example, a card scanner is sending s
mall but continuous packets of data. One of its requirements is fast
turnaround, hence a small buffer needs to be emptied frequently to reduce latency. Suggested parameters are:
•
Buffering Timeout
–
0 turns this timer off. In this case, we’ll let the
threshold and inter-
character timer
take care of flushing the buffer.
•
Buffering Threshold
–
This should be set to the size of the card scanner packets plus an additional 12 or
15 bytes of header. So if the packet size of the payload is 16 bytes, then this buffer could be set to 28 if
using multicast or 31 bytes if using unicast. SNAP Link adapters configured as masters in a multipoint
configuration always use multicast. Slaves and paired adapters always use unicast communications.
•
Inter-
character Timeout
–
This should be a low number, such as 3 to 10 milliseconds, to prevent data
from being buffered too long. Higher baud rates should use a lower value, and lower baud rates need a
higher value.
Scenario 2: File Transfer, Continuous Stream
In this example a l
arge continuous block of data is transmitted, such as what would take place during a file
transfer. In this case latency is not an issue, but maximizing the transfer rate is. Suggested parameters are:
•
Buffering Timeout
–
This should be set to a fairly large number to ensure the transmit buffer is filled
before being transmitted. At 19,200 baud, an appropriate number would be 50 to 60 milliseconds.
•
Buffering Threshold
–
This should be set to as large a number as possible. The maximum would be 108
bytes in po
int-to-
point mode and 111 bytes in multipoint mode, however as stated above, numbers
above 100 are not recommended.
•
Inter-
character Timeout
–
This should be set to 0 to turn this parameter off. We don’t want the buffer
transmitted if the serial device should hesitate for a few milliseconds. Instead, we want the buffer to be
filled to capacity, so we’ll let the other two parameters control when the buffer is transmitted.
SNAP Link
17
Содержание SNAP Link
Страница 4: ......