st-one-io / node-red-contrib-s7

A Node-RED node to interact with Siemens S7 PLCs
GNU General Public License v3.0
108 stars 55 forks source link

Change address from NodeRed property #112

Closed gamesmusic454 closed 11 months ago

gamesmusic454 commented 1 year ago

It would be pretty nice if we could change the IP address of the nodes sending the IP in msg.address for example, I've tried to modify the code but I did't have luck getting my own approach into NodeRed as I've never made a Node package, the code that I've modified it's in the S7.js and my approach is the following: connOpts = { host: msg.address, port: Number(config.port), rack: Number(config.rack), slot: Number(config.slot), s7ConnOpts: s7ConnOpts } I hope that changing the host: value to msg.address gives you the possibility to make it. If there is anything required to make it work I could help with that.

fernandoamorim1703 commented 11 months ago

Hello @gamesmusic454 ,

Unfortunately, this change is not feasible, as the "config.host" parameter is used to retrieve information set in the endpoint (in the part that registers all the PLC information).

fernandoamorim1703 commented 11 months ago

We will be closing this issue, if there is a need to revisit the subject, please open a new one. Thank you very much.