UART Communication and Buffer Handling
How the controller manages measurement data during interrupted UART communication
What Is a UART?
A UART (Universal Asynchronous Receiver-Transmitter) is a serial communication interface used to exchange data between electronic devices. In Gantner Instruments DAQ systems, UART communication is used internally between the controller and the connected measurement modules.
Causes of UART Communication Errors
UART communication can be disrupted by electrical noise or electromagnetic interference, for example from inverters, relays, motors, or high-current switching. Communication errors can also occur when signals pass through moving connections such as slip rings, where intermittent contact or signal degradation may temporarily interrupt communication.
Configuring UART Error Handling
Buffer Pre-init Type
The controller can be configured to determine how the measurement buffer handles data during a UART communication error. In Controller Settings, go to Settings > Buffer Pre-init Type and select one of the following options:
-
Deactivated: During a communication error, the buffer continues to use the last valid measured value.
-
Fast Fill: As soon as a communication error occurs, the buffer is filled with the predefined fill pattern. The default fill pattern is typically
NaN, making missing or invalid measurement data clearly identifiable. -
Slow Fill: During short communication interruptions, the last valid measured value is retained. If the communication error continues for more than 2 seconds, the buffer is filled with the predefined fill pattern. This prevents brief communication interruptions from producing
NaNvalues while still making longer communication failures identifiable.
Fill Patern
The Fill Pattern defines the byte value (0–255) written to the measurement buffer when a UART communication error occurs and the configured Buffer Pre-init Type requires the fill pattern to be used. The value represents an 8-bit pattern; for example, 255 = 1111 1111.
By default, the Fill Pattern is set to 255. When applied to floating-point measurement data, this fill pattern is used to produce Not a Number (NaN) values, clearly identifying invalid or unavailable measurement data.
A fill pattern of 255 produces NaN values only for variables configured with a 32-bit floating-point data format. For other data formats, a different fill pattern may be required and can be selected according to the application requirements and preferred representation of invalid data.