# Modbus write a FC 5 value other than True or False i.e. 0x5500

**URL:** <https://discourse.nodered.org/t/modbus-write-a-fc-5-value-other-than-true-or-false-i-e-0x5500/85784>\
**Category:** General\
**Tags:** modbus\
**Created:** [22 February 2024 19:55 UTC](https://discourse.nodered.org/t/modbus-write-a-fc-5-value-other-than-true-or-false-i-e-0x5500/85784 "2024-02-22T19:55:42Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![chrisdbrown3839](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/chrisdbrown3839/32/88547_2.png) [@chrisdbrown3839](https://discourse.nodered.org/u/chrisdbrown3839)\
**Post date:** [22 February 2024 19:55 UTC](https://discourse.nodered.org/t/modbus-write-a-fc-5-value-other-than-true-or-false-i-e-0x5500/85784/1 "2024-02-22T19:55:42Z")

</div>

Hi - On the Waveshare POE ethernet 8 channel relay you have the ability to toggle the state of a relay by sending 0x5500 using an FC5 message. I known this is a coil not a register but quoting the manual wiki here [Waveshare POE Relay](https://www.waveshare.com/wiki/Modbus_POE_ETH_Relay#Single_Relay_Control)

It appears that the modbus write and modes flex write node only allow true or false - values. If you send any positive values it changes it to 0xFF00. Any clues on how to send 0x5500 without it being changed!

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [22 February 2024 20:04 UTC](https://discourse.nodered.org/t/modbus-write-a-fc-5-value-other-than-true-or-false-i-e-0x5500/85784/2 "2024-02-22T20:04:43Z")

</div>

That is super odd.

It may be a typo - perhaps it should be FC6? I would give it a go.

* * *

Question, that manual states the device can be controlled via MQTT - is that not a better option?

---

<div class="post-metadata">

**Author:** ![chrisdbrown3839](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/chrisdbrown3839/32/88547_2.png) [@chrisdbrown3839](https://discourse.nodered.org/u/chrisdbrown3839)\
**Post date:** [22 February 2024 21:02 UTC](https://discourse.nodered.org/t/modbus-write-a-fc-5-value-other-than-true-or-false-i-e-0x5500/85784/3 "2024-02-22T21:02:32Z")

</div>

Hi - I had the same thought process - tried FC6 and get a timeout. I have also raised a case with Waveshare. They have similar none POE relay devices but they also use FC5.  
I did try MQTT - but the only refs I can find are linked to their cloud. Its not a massive deal as I can code my way around a toggle but would like to prevent someone else wasting a lot of time on the same thing.

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [22 February 2024 21:24 UTC](https://discourse.nodered.org/t/modbus-write-a-fc-5-value-other-than-true-or-false-i-e-0x5500/85784/4 "2024-02-22T21:24:56Z")

</div>

> [@chrisdbrown3839](#):
>
> I did try MQTT - but the only refs I can find are linked to their cloud

The manual shows a connection field. Have you tried setting that to your own broker?

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/6/6/6662dd4cc1bc9b4a5dd925c8ff471c8998deb797.png)

---

<div class="post-metadata">

**Author:** ![chrisdbrown3839](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/chrisdbrown3839/32/88547_2.png) [@chrisdbrown3839](https://discourse.nodered.org/u/chrisdbrown3839)\
**Post date:** [22 February 2024 21:49 UTC](https://discourse.nodered.org/t/modbus-write-a-fc-5-value-other-than-true-or-false-i-e-0x5500/85784/5 "2024-02-22T21:49:28Z")

</div>

Cheers - will do

---

<div class="post-metadata">

**Author:** ![Billy\_C](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/billy_c/32/74647_2.png) [@Billy\_C](https://discourse.nodered.org/u/Billy_C)\
**Post date:** [23 February 2024 04:52 UTC](https://discourse.nodered.org/t/modbus-write-a-fc-5-value-other-than-true-or-false-i-e-0x5500/85784/6 "2024-02-23T04:52:46Z")

</div>

Why bother fussing with their toggle control? Node red can handle toggling logic. I assume the coil on and off commands work even though that oddball flip command doesn’t. Is that correct?

Toggle logic in node red could read the coil and then command the opposite of the current state.

---

<div class="post-metadata">

**Author:** ![chrisdbrown3839](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/chrisdbrown3839/32/88547_2.png) [@chrisdbrown3839](https://discourse.nodered.org/u/chrisdbrown3839)\
**Post date:** [23 February 2024 06:59 UTC](https://discourse.nodered.org/t/modbus-write-a-fc-5-value-other-than-true-or-false-i-e-0x5500/85784/7 "2024-02-23T06:59:48Z")

</div>

Yep Agree - On and Off work fine so agree I can code around it. More checking I wasn't doing anything wrong as new to nodered and wasn't aware of the behaviour of the FC5 Modbus node to send any none zero value passed to it as True.

---

<div class="post-metadata">

**Author:** ![chrisdbrown3839](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/chrisdbrown3839/32/88547_2.png) [@chrisdbrown3839](https://discourse.nodered.org/u/chrisdbrown3839)\
**Post date:** [23 February 2024 07:03 UTC](https://discourse.nodered.org/t/modbus-write-a-fc-5-value-other-than-true-or-false-i-e-0x5500/85784/8 "2024-02-23T07:03:05Z")

</div>

I did try MQTT again but not convinced with the level of firmware support for it- Unable to get the broker values to stick and never saw it try to connect to it in the Mosquitto logs

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [23 May 2024 07:03 UTC](https://discourse.nodered.org/t/modbus-write-a-fc-5-value-other-than-true-or-false-i-e-0x5500/85784/9 "2024-05-23T07:03:05Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
