Modbus TCP

25 views
Skip to first unread message

Toby Mills

unread,
Nov 10, 2025, 3:42:49 AM (3 days ago) Nov 10
to Loxone English
Has anyone got Modbus TCP to work with a relay board.
I'm finding Loxone is sending 16bit integers instead of a binary bit for the relay and I can't see where you change the type in Modbus TCP in  Loxone config.

Toby

Jonathan Dixon

unread,
Nov 10, 2025, 3:51:13 AM (3 days ago) Nov 10
to Toby Mills, Loxone English
Try using the "write coil" rather than write integer command 



--
You received this message because you are subscribed to the Google Groups "Loxone English" group.
To unsubscribe from this group and stop receiving emails from it, send an email to loxone-englis...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/loxone-english/437a54a0-7691-46ea-bc3c-0dc7d17c8945n%40googlegroups.com.

Toby Mills

unread,
Nov 10, 2025, 4:06:27 AM (3 days ago) Nov 10
to Loxone English
Thanks, yes loxone config only 4 options for Modbus TCP and I'm using write single coil..
Screenshot 2025-11-10 220127.jpg

But in the logs this is going out as an unsigned integer.
Screenshot 2025-11-10 220242.jpg

I just have it connected up to a switch for testing so I'm wondering if switches output integers or if I'm missing something stupid.
Have also tried an analog actuator and different addresses.
I can control the relays when I send raw hex from using a TCP sender. But if I even try and send that hex using the Modbus Test command, it sends it as an integer.
Screenshot 2025-11-10 220439.jpg

Toby

Jonathan Dixon

unread,
Nov 10, 2025, 8:30:50 AM (3 days ago) Nov 10
to Toby Mills, Loxone English
>But in the logs this is going out as an unsigned integer.

Yes this is correct - at the TCP layer everything is integers, and modbus TCP tends to encode things into 16 bit values.
See https://www.waveshare.com/wiki/Modbus_Protocol_Specification#0x05_Write_Single_Coil - Coil logic "on" is encoded as 0xFF00 which is 65280 decimal which is what you're seeing.

The relay board should be able to decode this, but depending on the relay board there can be an additional layer of shenanigans at play. For example, Waveshare ethernet relays default to modbus RTU over TCP, you need to use some proprietary software to reconfigure them to modbus TCP mode. See https://www.waveshare.com/wiki/Modbus_POE_ETH_Relay#Modbus_TCP_Protocol_Settings


Reply all
Reply to author
Forward
0 new messages