# Using Node-RED and (Step7) PLCSIM

**URL:** https://discourse.nodered.org/t/using-node-red-and-step7-plcsim/39791
**Category:** Industrial
**Created:** [26 January 2021 15:50 UTC](https://discourse.nodered.org/t/using-node-red-and-step7-plcsim/39791 "2021-01-26T15:50:55Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![e-Duardo](https://avatars.discourse-cdn.com/v4/letter/e/96bed5/32.png) [@e-Duardo](https://discourse.nodered.org/u/e-Duardo)
#### Post date: [26 January 2021 15:50 UTC](https://discourse.nodered.org/t/using-node-red-and-step7-plcsim/39791/1 "2021-01-26T15:50:55Z")

</div>

Hi,

I am learning to program PLCs, specifically Siemens Step7 with TIA Portal, and in the meanwhile I am following some tutorials to use Node-RED to create HMI (just to write/read some data). Specifically I am using the "S7" nodes

I am using PLCSIM to do the first trials, but I am not being able to communicate the virtual PLC and Node-RED. I am using NetToPLCsim to create a virtual connection (I introduced the IP assigned to the PLC and the address of the ethernet adapter).

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/1/2/12400a1dd5458762c0ccca1de27e525a27dc75ab.png)

NetToPLCsim appears to work well. I made a "ping" to the IP address of the simulated PLC and I got response (108ms average).  
The PUT/GET access is allowed.

Here you can see the set up of the S7 Node.

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/5/f/5fe83dd8865ee073ed693171bb07687a8d9e12ce.png)

The debug shows the message : _Error: connect ECONNREFUSED 192.168.0.105:102_

Any idea of where is the mistake?

Thanks and best regards

---

<div class="post-metadata">

### Author: ![e-Duardo](https://avatars.discourse-cdn.com/v4/letter/e/96bed5/32.png) [@e-Duardo](https://discourse.nodered.org/u/e-Duardo)
#### Post date: [29 January 2021 09:47 UTC](https://discourse.nodered.org/t/using-node-red-and-step7-plcsim/39791/2 "2021-01-29T09:47:12Z")

</div>

Hi!  
Finally I found the error.  
In the S7 Node I didn't have to write the IP Address assigned to the PLC, but the IP Address of the "network" that is "virtually" connected to PLCSIM in NetToPLCSIM.  
At first I introduced the IP Address of the Ethernet adapter as the "Network Address" in NetToPLCSIM, and it didn't work. Then I wrote a different IP, such as 127.0.0.1, which was virtually connected to the PLC (simulated), and the S7 node in Node-RED was connected to this new address, and finally the connection between the S7 Node and PLCSIM was successful.

Best regards

---

<div class="post-metadata">

### Author: ![PhilipV](https://avatars.discourse-cdn.com/v4/letter/p/ecccb3/32.png) [@PhilipV](https://discourse.nodered.org/u/PhilipV)
#### Post date: [29 January 2021 12:10 UTC](https://discourse.nodered.org/t/using-node-red-and-step7-plcsim/39791/3 "2021-01-29T12:10:22Z")

</div>

Hi e-Duardo,  
Looks interesting your project. Enables you to link and test connections/data exchange between S7-PLC and node-red without having the real hardware. Was planning to do the same setup, my idea is to use node-red ( and some python code) to simulate the behavior of real time processes and interact with control loop software in the S7-plc( PLCSIM in this case). It would be most helpful to me if you could send me some more details about the settings in NetToPLCsim. For the node-red part i prefer to use the "S7comm" nodes, had some issues with the ones you are using.  
Best regards.

---

<div class="post-metadata">

### Author: ![e-Duardo](https://avatars.discourse-cdn.com/v4/letter/e/96bed5/32.png) [@e-Duardo](https://discourse.nodered.org/u/e-Duardo)
#### Post date: [29 January 2021 14:31 UTC](https://discourse.nodered.org/t/using-node-red-and-step7-plcsim/39791/4 "2021-01-29T14:31:05Z")

</div>

Hi Philip,  
I can not be very precise in my explanation because I am newbie in both Step 7 (TIA Portal) and in Node-RED and anything related to network settings.  
The settings in NetToPLCSIM are quite simple:

- Start the program as administrator (it asks you to stop one service)
- Add a new station
- Introduce Network IP Address. At first I selected the IP address of the ethernet adaptor (if you click on the "..." button, you will have a list with the available network interface adresses), but it didn't work. It worked when I introduced a new IP address (127.0.0.1).
- Introduce the IP Address assigned to the PLC. If PLCSIM is running, the address will be shown when you click in the "..." button next to the IP field.
- Select the Rack and Slot of the PLC.
- Start the Server...

In Node-RED, use the address of the network (127.0.0.1 according to the example) instead of the PLC IP address. I suppose that this address is now the access point to the simulated PLC.  
I would like to try if it is possible to run Node-RED in a different computer (or even a Raspberry Pi) than TIA Portal and NetToPLCSIM. I suppose that, in that case, I should select the ethernet adapter IP address in NetToPLCSIM.

Best regards

---

<div class="post-metadata">

### Author: ![PhilipV](https://avatars.discourse-cdn.com/v4/letter/p/ecccb3/32.png) [@PhilipV](https://discourse.nodered.org/u/PhilipV)
#### Post date: [29 January 2021 15:35 UTC](https://discourse.nodered.org/t/using-node-red-and-step7-plcsim/39791/5 "2021-01-29T15:35:45Z")

</div>

Hi there ,  
Been using Step7 ( and even predecessor step5) for more then 30y ( oops ,...getting old), any question/problems, give me a ring. Just figuring out your setup. Are you running PLCSIM ( + net2plcsim) and the node-red server on the same machine? I think you can configure PLCSIM to be projected on a physical IP adres, so you could even run the node-red server on a separate platform. Install a remote tunnel to expose the localhost IPadres and you could connect remotely with the node-red client. Quiet some possibilities here...and lots of fun!

Regards

---

<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: [30 March 2021 15:36 UTC](https://discourse.nodered.org/t/using-node-red-and-step7-plcsim/39791/6 "2021-03-30T15:36:36Z")

</div>

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