ComBuffer

The ComBuffer data structure is a data buffer that decouples the hardware-dependent communication blocks from the hardware-independent blocks (see Communication Principle). At the same time this decouples a fast communication task from the standard task. Data buffers of type ComBuffer are never directly written or read by the user, but are merely used as intermediate storage for the communication blocks.

TYPE ComBuffer
STRUCT
    Buffer: ARRAY[0..300] OF BYTE;
    RdIdx: INT;
    WrIdx: INT;
    Count: INT; (* Number of characters in the ring buffer *)
    FreeByte:INT; (* Number of free spaces in the ring buffer *)
    Error: INT; (* Interface error code *)
    blocked : BOOL;
END_STRUCT
END_TYPE