Skip to main content

Module fifo_queue

Module fifo_queue 

Source
Expand description

§Modbus FIFO Queue Service

This module implements the client-side logic for Function Code 24 (0x18): Read FIFO Queue.

The Read FIFO Queue function allows the client to read the contents of a First-In-First-Out (FIFO) queue of 16-bit registers in a remote device. The function returns a count of the registers in the queue, followed by the queue data.

§Module Structure

  • apis: High-level public API for triggering FIFO queue reads via ClientServices.
  • request: Handles the construction and serialization of the Read FIFO Queue request PDU.
  • response: Handles parsing, validation of byte counts, and register extraction from response PDUs.
  • service: Internal orchestration logic for building ADUs and handling de-encapsulation.

§Constraints

  • Max Capacity: The Modbus specification limits the FIFO queue to a maximum of 31 registers.
  • Read-Only: This function code is specifically for reading; writing to FIFOs is typically handled via standard register write functions (FC 06 or 16) depending on the server implementation.
  • no_std: Fully compatible with embedded environments using fixed-size buffers.

Modules§

request
Modbus FIFO Queue Service Module
response
Modbus FIFO Queue Response Handling

Structs§

FifoQueue
A collection of register values retrieved from a Modbus FIFO queue.

Constants§

MAX_FIFO_QUEUE_COUNT_PER_PDU
The maximum number of 16-bit registers that can be returned in a single Read FIFO Queue (FC 24) response.