Read different PLCs with Node-RED

Hi to everyone,

I'm trying to develop an application to read different type of data from many PLCs (S7-1500).

I developed yet different application between S7-1500 and Node-RED, but always with one PLC for time.

My goal now is to develop an application where, for example, from a scroll list or a text box I can insert the IP of the PLC that I'd like to connect, choose it, and read data from it.

So I think that there could be a type of message that I can send to the node (for example) "S7 control" where I dinamically set the IP(?).

Do anyone try it yet?

I hope that I've explained my problem more cleary possible.

Thanks in advance!

1 Like

One method would be to use existing libraries or bridging APIs like Python, to control the PLC, so you would just need to create a python (script) service, that say sends and receives MQTT messages, translating to PLC control language via the Python library (module). Scanning a few programming documents for PLCs I found a lot of discussion using 'canned' control language standards, but little on how to bridge these to more common programming environments. Since Python can talk to almost anything, that is where I started.

But then I found this!

The above is interesting reading... it is the actual training document Siemens published to do what I think is exactly what you want to do?

1 Like

HI!
Thanks for your reply!
Well, your idea is interesting, but I can control yet the PLC with the S7 node, and also th OPCUA communication that you have linked has the same problem, that I can't dinimically change the IP addresse of the PLC that I want to connect.

So the problem rest.
I hope in an update of the S7 node functions.

you can reverse engineer the S7-Node.

Hmmm...i get your idea but why ? you want to create like loop to communicate with multiple plc, one at a time ?

Or if there is an S7 module for Node... NOT Node Red, but just Node... you could leverage that with a bit more work in NR as well.

Also, since clearly the documentation if officially from the manufacturer, why not contact them and ask about or if they plan to update the documentation, addressing your issue?

No, in this moment for change the reading from a PLC to another I need to open the S7 flow and change manually the IP.
I want choose from my dashboard the IP without open the programming interface, also because I'll not be the only user of this future program, so maybe a person could damage the program trying to change the IP manually.

HI Nodi,
I have already contacted the manufacturer, but they didn't answered me....I think that the only solution is to attend

Is there a S7 user group or community that might have some information or ideas? I have no experience with PLCs. But I am sure there are those out on the net that has vast experience with them?

If you are talking about the official Siemens forum I have already asked. A user replied telling me that he tried in every way too but he never succeeded

if you switch the IP dynamically you are opening connection to the PLC, that its not good because u will increase the cycle time of the plc each you connect, even if you use a CP card from siemens.

Another problem if you communication handler have some kinda of "bug" the connection will stuck in the plc, the only way to some it's reboot the plc or cp card.

Really odd, I can't see a firm like Siemens doing anything half baked. Or not addresses a key issue, which I believe this is IMHO. As we say in German... Das ist stumpf.

I'm using the S7 node to read from many PLCs in our factory.

The workaround I am using at the moment is to create multiple S7 nodes, one for each PLC you may want to have in the flow, then add a few parameters to the payload stating the model of machine, and which modules are enabled on each machine.

Then I feed the messages to a massive subflow that handles all the S7 machines. Inside the subflow, I use the machine model and the enabled modules to filter the information that goes across the flow.

You could use a similar way to filter out which S7 node you want to read from:

  • change the message after S7 to add the filtering parameter
  • use the list to select a machine (by model, IP address string, or whatever parameter you added in the change node)
  • store the value you selected in a context variable
  • filter the messages as they come into your node depending on the filtering parameter.

I think it should work.

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