# Communication via Modbus to bus coupler (Beckhoff)

**URL:** <https://discourse.nodered.org/t/communication-via-modbus-to-bus-coupler-beckhoff/48218>\
**Category:** Industrial\
**Created:** [9 July 2021 17:41 UTC](https://discourse.nodered.org/t/communication-via-modbus-to-bus-coupler-beckhoff/48218 "2021-07-09T17:41:29Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Crashy77](https://avatars.discourse-cdn.com/v4/letter/c/bcef8e/32.png) [@Crashy77](https://discourse.nodered.org/u/Crashy77)\
**Post date:** [9 July 2021 17:41 UTC](https://discourse.nodered.org/t/communication-via-modbus-to-bus-coupler-beckhoff/48218/1 "2021-07-09T17:41:29Z")

</div>

Hi guys.

I´m trying to communicate with a Beckhoff bus coupler BK9000.  
It´s a ethernet based coupler and reading inputs works.  
But I´m not able to write an output.  
Does anybody got this working ?  
Thanks.

Thanks in advanced,  
Thorsten

---

<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:** [11 July 2021 13:53 UTC](https://discourse.nodered.org/t/communication-via-modbus-to-bus-coupler-beckhoff/48218/2 "2021-07-11T13:53:35Z")

</div>

According to [this page](https://www.beckhoff.com/en-gb/products/i-o/bus-terminals/bkxxxx-bus-coupler/bk9000.html), the BK9000 supports modbus-tcp.

> In addition to ADS the Bus Coupler supports Open Modbus (Modbus TCP), a simple, widespread master/slave protocol based on TCP/IP.

So install modbus nodes and communicate to it.

---

<div class="post-metadata">

**Author:** ![Crashy77](https://avatars.discourse-cdn.com/v4/letter/c/bcef8e/32.png) [@Crashy77](https://discourse.nodered.org/u/Crashy77)\
**Post date:** [11 July 2021 14:25 UTC](https://discourse.nodered.org/t/communication-via-modbus-to-bus-coupler-beckhoff/48218/3 "2021-07-11T14:25:25Z")

</div>

As already said, reading is possible, but not writing.

---

<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:** [11 July 2021 14:28 UTC](https://discourse.nodered.org/t/communication-via-modbus-to-bus-coupler-beckhoff/48218/4 "2021-07-11T14:28:08Z")

</div>

Are you formatting the write data correctly?  
How many registers are you trying to write in one go?  
Are you writing to _writable_ registers?  
What node (node-red-contrib-xxxxx) are you using?  
Do you have a demo (non-working) flow you can post?

---

<div class="post-metadata">

**Author:** ![Crashy77](https://avatars.discourse-cdn.com/v4/letter/c/bcef8e/32.png) [@Crashy77](https://discourse.nodered.org/u/Crashy77)\
**Post date:** [11 July 2021 15:21 UTC](https://discourse.nodered.org/t/communication-via-modbus-to-bus-coupler-beckhoff/48218/5 "2021-07-11T15:21:18Z")

</div>

node-red-contrib-modbus  
I´m getting this fault: "Modbus exception 4: Slave device failure (device reports internal error)"

I´m having a BK9000, 1 digital input module and 1 digital output module.  
For the output module I´m using:  
Unit-ID: 1  
FC6  
address: 2048  
There´s no difference if I´m using boolean oder numbers to set the output.

---

<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:** [11 July 2021 15:29 UTC](https://discourse.nodered.org/t/communication-via-modbus-to-bus-coupler-beckhoff/48218/6 "2021-07-11T15:29:48Z")

</div>

When you read 2048 and 2049, do the bits reflect the inputs and output cards status correctly?

As 2048 == 0x800 - is this not trying to write to the input card?

Have you tried writing a number between 0 & 65535 to address 2049 (hex 0x801)?

---

<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:** [11 July 2021 15:32 UTC](https://discourse.nodered.org/t/communication-via-modbus-to-bus-coupler-beckhoff/48218/7 "2021-07-11T15:32:35Z")

</div>

Actually, looking at manual, you might need to use FC 5 and bits

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/8/9/8920795c7e93c018e7baa05ee6dd51feafde825a.png)

Try FC5 and a value of 1 (or true) to address 2048

---

<div class="post-metadata">

**Author:** ![UnborN](https://avatars.discourse-cdn.com/v4/letter/u/4491bb/32.png) [@UnborN](https://discourse.nodered.org/u/UnborN)\
**Post date:** [11 July 2021 15:33 UTC](https://discourse.nodered.org/t/communication-via-modbus-to-bus-coupler-beckhoff/48218/8 "2021-07-11T15:33:06Z")

</div>

> [@Crashy77](#):
>
> For the output module I´m using:  
> Unit-ID: 1  
> FC6

FC6 for a digital out device ? shouldn't that be FC5 or FC15 ?

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/0/0/00d0aab4bd332e25b2a5c3c1ddf633788ab8065e.png)

---

<div class="post-metadata">

**Author:** ![Crashy77](https://avatars.discourse-cdn.com/v4/letter/c/bcef8e/32.png) [@Crashy77](https://discourse.nodered.org/u/Crashy77)\
**Post date:** [11 July 2021 15:33 UTC](https://discourse.nodered.org/t/communication-via-modbus-to-bus-coupler-beckhoff/48218/9 "2021-07-11T15:33:51Z")

</div>

Input addresses are between 0 ans 255.  
Output addresses are between 2048 and 2303.  
First input module is address 0, input feedback signals are 1, 2, 4 and 8.  
If input 1 and 3 are true, the feedback is 5.

---

<div class="post-metadata">

**Author:** ![Crashy77](https://avatars.discourse-cdn.com/v4/letter/c/bcef8e/32.png) [@Crashy77](https://discourse.nodered.org/u/Crashy77)\
**Post date:** [11 July 2021 15:35 UTC](https://discourse.nodered.org/t/communication-via-modbus-to-bus-coupler-beckhoff/48218/10 "2021-07-11T15:35:39Z")

</div>

Doesn´t matter if I´m using FC5, 6, 15 or 16.  
I´m always getting the fault message.

---

<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:** [11 July 2021 15:37 UTC](https://discourse.nodered.org/t/communication-via-modbus-to-bus-coupler-beckhoff/48218/11 "2021-07-11T15:37:35Z")

</div>

As the manual is not 100% clear, I would contact the support guys & ask for exact info. Explain what IO you have (and their arrangement) - ask what FC and what values to write to set / reset a DO.

---

<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:** [9 September 2021 15:38 UTC](https://discourse.nodered.org/t/communication-via-modbus-to-bus-coupler-beckhoff/48218/12 "2021-09-09T15:38:35Z")

</div>

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