I created a flow that read PLC data with the s7 library.
I would like to read the chamber configuration (ip, port, timeout and reading cycle) from a file and then inject those values in the s7 In node, rather than put them with hard code. I have read on the forum that is kind of possible using control s7 node, but I didn't really understand how to do it.
Here is a flow example (without reading file but just with an injection node) :
I have taken your tips into considerations, thanks. I have created my own node in order to put dynamic variables in the configuration file, which initiates the connection with the PLC. It is also possible to list all the variables you want to read in the same file. The output of this node will deliver an object with all those information.
Hey @MystiiK - it looks like you have created a contrib for node-red.
Great stuff.
A few pointers if you dont mind:
The name of the node "nodes7-custom-node" is not really in line with Node-RED naming guidelines. The recommendation for naming node-RED contrib nodes is to publish it as @scopename/node-name. I feel something like @mystiik/node-red-s7-dynamic or similar may be better suited? (just my opinion)
Also, since the readme does not mention node-red, I actually had to look at the source to realise it was an installable contrib node for Node-RED.
It should also be tagged with node-red in the package.
Lastly, I note there is no repository link specified in your package. This is very useful for users to let you know if there is an issue.
Thank you for your recommendations. So I renamed the package and the node properly, but I needed to create another package for that : npm i node-red-contrib-nodes7-dynamic.
The link : https://www.npmjs.com/package/node-red-contrib-nodes7-dynamic
I've also put the keywords in the package, and I deleted the previous one.
To be honest, I didn't try the other packages for two reasons.
First, because I didn't find a good package for my use case (the one you showed was created just one week ago).
Secondly, as an apprentice, I wanted to take the opportunity to create a whole library by myself, for the exercise. It was very rewarding to do it and it helps to understand better how works NodeRED
you should consider adding an examples folder and adding 1 or 2 example flows
5. These become available to users in the import dialog (ctrl-i)
6. Not having this will mark your package down in the node-red flows catalog scoring
you should add your node to the flows catalog so that users can install it via "Manage Palette"