# Modbus communication with HEX codes

**URL:** https://discourse.nodered.org/t/modbus-communication-with-hex-codes/95024
**Category:** General
**Tags:** modbus
**Created:** [31 January 2025 08:15 UTC](https://discourse.nodered.org/t/modbus-communication-with-hex-codes/95024 "2025-01-31T08:15:09Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![jacekelgda](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/jacekelgda/32/98478_2.png) [@jacekelgda](https://discourse.nodered.org/u/jacekelgda)
#### Post date: [31 January 2025 08:15 UTC](https://discourse.nodered.org/t/modbus-communication-with-hex-codes/95024/1 "2025-01-31T08:15:09Z")

</div>

I am trying to setup a simple flow where I would like to send a HEX code to a device attached to a TCP modbus gate. I have a function that creates a message and payload which connects to a flex modbus getter using configured server. What I can see on the modbus serial is that always the gate recieves the 12 bytes code and when I interact manually with the device I am sending 8 bytes codes.  
Sending codes to this device: [https://www.waveshare.com/wiki/Modbus\_RTU\_IO\_8CH#Read\_Input\_Channel\_Status](https://www.waveshare.com/wiki/Modbus_RTU_IO_8CH#Read_Input_Channel_Status)

Code example: "01 02 00 00 00 08 79 CC"

I tried creating buffer, using plain json as in docs and some other internet examples. Please let me know what I am doing wrong, maybe I should not be using modbus plugin ?

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [31 January 2025 10:11 UTC](https://discourse.nodered.org/t/modbus-communication-with-hex-codes/95024/2 "2025-01-31T10:11:26Z")

</div>

> [@jacekelgda](#):
>
> I tried creating buffer, using plain json as in docs

Show us what you tried and what the result was (that is, what it looked like in a debug node).

---

<div class="post-metadata">

### Author: ![gregorius](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gregorius/32/73816_2.png) [@gregorius](https://discourse.nodered.org/u/gregorius)
#### Post date: [31 January 2025 13:02 UTC](https://discourse.nodered.org/t/modbus-communication-with-hex-codes/95024/3 "2025-01-31T13:02:46Z")

</div>

> [@Colin](#):
>
> Show us what you tried

Ideally please share you [flow code](https://discourse.nodered.org/t/how-to-share-code-or-flow-json/506) here and then we can better understand what you're doing.

It's hard to pinpoint your errors by just reading summaries of tasks!

---

<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: [1 May 2025 13:03 UTC](https://discourse.nodered.org/t/modbus-communication-with-hex-codes/95024/4 "2025-05-01T13:03:14Z")

</div>

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