Modbus RTU FC15, words or bytes?

I'm a little confused about the payload length for FC15. The Modbus Application Protocol Specification V1.1b states that the byte count = "Quantity of Outputs / 8, if the remainder is different of 0 ⇒ N = N+1" i.e. one byte for every 8 bits plus one additional byte for any remaining bits. This seems perfectly reasonable i.e. the minimum number of bytes that will hold the number of coils being written, which may be an odd or even number of bytes.

However I am working with a Modbus master implementation (in C) that appears to only send in multiples of 2 bytes i.e. any amount of coils to be written between 1-16 will have a two byte payload. I assumed this was a bug, so did a bit of searching and found a post by David_2 on this forum which aligns with the behaviour I am seeing:

Function Code 15, "write multiple coils", writes, in one transaction, a bit packed 16 bit word where each bit is a coil in a contiguous sequence of numbered coils and the function can write multiple 16 bit words in one transaction.
So which is it? Always a multiple of 2 bytes, or just the number of bytes that will hold the number of coils being written? Unfortunately every example showing an FC15 frame that I have found copies the one in the protocol spec, which shows 10 coils being written. I've not yet found a definitive example writing 8 coils or fewer.

Thanks for any clarification!
 
As a follow up, writing to 8 coils in an ICP-CON 7055 with two data bytes in the frame (but the frame otherwise correctly formed) causes it to respond with an exception, it only works with a single data byte in the frame. A company as established as ICP DAS interpreting the spec the same way I do is good enough for me.
 
Just to add further confirmation, Function Code 15 packets should only include the minimum number of bytes that hold the coils being written. If the master implementation you're using does not follow this, then it does not follow the spec and this therefore is a bug.
 
Top