Knowledge Base

ReadInputs – 2, SlaveAddr, InAddr16, ItemCount, SPAddr16

A ModBus Master script command

When processed this command will result in the SPLat master sending out a ModBus function 2 query (Read inputs), then wait for and process the response.

Parameters are:

ItemBit LengthDescription
SlaveAddr8The slave address
InAddr1616The 16-bit, 0-based address of an input (1xxxx reference) in the slave. This will be the starting point for the read.
ItemCount8An 8-bit count of how many coils are to be read. The minimum is 1. The maximum is determined by available communications buffer size (documented elsewhere). ItemCount contiguous items will be read.
SPAddr1616A 16-bit semaphore address within the SPLat master’s RAM, counting from RAM byte 0, bit 0. For example, RAM byte 34, bit 5 would be 34×8 + 5 = 277. The ItemCount single bit items read from the slave will be stored in these semaphores.