# Catching Modbus package from Siemens PLC

**URL:** <https://discourse.nodered.org/t/catching-modbus-package-from-siemens-plc/95455>\
**Category:** General\
**Created:** [17 February 2025 07:47 UTC](https://discourse.nodered.org/t/catching-modbus-package-from-siemens-plc/95455 "2025-02-17T07:47:17Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dan.L](https://avatars.discourse-cdn.com/v4/letter/d/a5b964/32.png) [@Dan.L](https://discourse.nodered.org/u/Dan.L)\
**Post date:** [17 February 2025 07:47 UTC](https://discourse.nodered.org/t/catching-modbus-package-from-siemens-plc/95455/1 "2025-02-17T07:47:17Z")

</div>

Hi all,  
I’m new to Node-Red, but have relatively simple task to accomplish.  
We have Siemens LOGO PLC (6ED1052-1MD08-0BA2) that we program using Logo!Soft. The one has Network Output block that should send Modbus package to Windows PC and Node-Red should catch it and trigger further commands (SMS – already works). Did anyone had experience with this?

 ![node](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/9/a/9a729692aead556862dd1ae4775b1112a3bf6259.png)

Logo!Soft Network Output block:  
Write value to: remote device  
IP: 192.168.3.170 (Windows PC IP address)  
Device type: Modbus-compatible device  
Port: 502  
Unit ID: 1  
ModBus Type: Coil (can’t be changed)  
ModBus address: 1

Node-Red on Windows PC side has Modbus Read block:  
Name: Read PLC  
Unit-Id: 1  
FC: FC 1: Read Coil Status  
Address: 502  
Quantity: 1  
Poll Rate: 10 seconds  
Server: modbus-tcp@192.168.3.171:502 (PLC IP address)

What I’m missing? See attached screenshot.  
Thank you in advance!

---

<div class="post-metadata">

**Author:** ![malmgrenola](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/malmgrenola/32/98886_2.png) [@malmgrenola](https://discourse.nodered.org/u/malmgrenola)\
**Post date:** [17 February 2025 09:03 UTC](https://discourse.nodered.org/t/catching-modbus-package-from-siemens-plc/95455/3 "2025-02-17T09:03:39Z")

</div>

Hello,  
The help file in **LOGO!Soft** contains a description of the **Modbus address space** for LOGO. See the attached screenshot.

 ![download](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/e/e/ee6aebb779acc688a8520f63d1f4bd92d44032ec.png)

To read the **Q1 output** , you need to set the address within the correct range and specify the number of outputs to read in the **quantity** field.

I've also noticed that the address space is likely **zero-indexed** , so the first **Coil (Q1)** can often be found at **address 8192**. However, I haven't fully dug into the offset issue, so you may need to experiment a bit.

### A couple of key points to check:

1. **Modbus Read Address:** The **address** in the Modbus Read node should not be the **port (502)** but rather an **address within the Modbus memory space**.
2. **Correct Function Code (FC):** Make sure you select the right **FC** based on the type of register you're trying to read.
3. **LOGO! IP Addresses:** The **Siemens LOGO! PLC** actually uses **two IP addresses** : the one you configured and **the next one (+1)**, so keep that in mind when troubleshooting.
4. **SMS thoughts:** You might need to create a function to bind the coil status values and only send an sms when the state goes from low to high or the opposite high to low, since the read output is a stream of data.

Hope this helps!

Happy PLCing!

---

<div class="post-metadata">

**Author:** ![Dan.L](https://avatars.discourse-cdn.com/v4/letter/d/a5b964/32.png) [@Dan.L](https://discourse.nodered.org/u/Dan.L)\
**Post date:** [18 February 2025 09:42 UTC](https://discourse.nodered.org/t/catching-modbus-package-from-siemens-plc/95455/4 "2025-02-18T09:42:21Z")

</div>

Thank you for advice! I will check address space. I've just realized that maybe I'm doing it wrong. PLC will be Modbus client and Node-Red will be Modbus server. The other way around PLC's port 502 was closed. Need to figure out how to configure that flow. Maybe something like:

 ![8874636](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/d/3/d34e6a2b6d08d9b0167be4fedbb80e9623044a39.png)

---

<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:** [19 May 2025 09:42 UTC](https://discourse.nodered.org/t/catching-modbus-package-from-siemens-plc/95455/5 "2025-05-19T09:42:56Z")

</div>

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