For all Modubus Client requests, the data always and only ever comprise one or more 16-bit words. A 16-bit word value of 0xFF00 translates to a single-bit value of 1 in the discrete output coil when using Modbus Protocol Function code [05 (0x05) Write
Single Coil].
TL;DR
Yes, a Modbus Client request using Modbus Function code
[05 (0x05) Write Single Coil], is writing a
single bit (coil) value on the Modbus Server
device, but to write the coil via the Modbus
protocol, it will
- EITHER send the 16-bit word value x0000 to assign a single-bit value of 0 to the coil (device discrete output i.e. BOOL),
- OR send the 16-bit word value 0xFF00 to assign a single-bit value of 1 to the coil.
So in the image supplied by @TheWaterboy in Post #23, that single 0xFF00* is a
16-bit word that is meant to be interpreted
in toto by the Modbus Server for
one coil (BOOL; bit)
only.
* = 0xFF00 = FF00h A-B hex = -256 decimal, as noted by @AustralIan)
N.B. this only applies to protocol requests using Function code [05 (0x05) Write
Single Coil]; for Function code [15 (0x0F) Write
Multiple Coils] the protocol still uses a 16-bit word (or multiple 16-bit words, for more than 16 coils), but the mapping is one coil per bit in the word(s).
Cf. image below from pp. 17,18 of [April 26, 2012
http://www.modbus.org MODBUS APPLICATION PROTOCOL SPECIFICATION V1.1b3] at
this link (scroll to bottom of that page).
Sidebar: I have a Micro820 Modbus TCP Client (MSG_MODBUS2 instruction) writing a single coil to an S7-1214C Modbus TCP server (MB_SERVER instruction, attached to a 120V relay and a lamp @OldChemEng's TV room), and writing 0xFF00 in the protocol does not flip the S7-1214C coil: it needs to be 0xFFFF (I forget if 0x0001 also works). I have to do some more testing to make sure I understand exactly what is going on, but this seems to imply that the Siemens MB_SERVER instruciton does not implement Modbus TCP protocol correctly, which seems odd to me, so maybe I am misinterpreting my setup. I would appreciate if anyone else could run the same test.