When processed this command will result in the SPLat master sending out a ModBus function 6 query (Force single holding register), then wait for the response.
Parameters are:
SlaveAddr |
An 8-bit slave address |
RegAddr16 |
The 16-bit, 0-based address of a holding register (4xxxx reference) in the slave. |
SPAddr16 |
A 16-bit RAM address within the SPLat master's RAM. |
SPMode |
Determines whether data to the slave is transferred from SPLat RAM in byte mode (SPMode=0) or word mode (SPMode=1). In byte mode one byte of SPLat RAM will copied to the least significant byte of the destination holding register and the most significant byte will be set to 0. In word mode the 16-bit slave register will be written from 2 bytes of SPLat RAM. In either mode "bigendian" byte ordering is used. That means the first byte transmitted on the ModBus is the most significant byte (the ModBus default behaviour), and the lowest SPLat RAM location contains the most significant byte.
In byte mode one byte of SPLat RAM will be sent as the second of two bytes on the ModBus, with the first byte set to 0. Thus the 16-bit register in the slave gets filled with one 8-bit value from the SPLat master. In word mode the 16-bit slave register will be written from 2 consecutive bytes of SPLat RAM. The lowest SPLat address of each pair gets sent first. In default ModBus behaviour this will become the most significant byte of the destination register (Bigendian ordering) |