I am using the node s7 to read some data from a PLC, https://www.npmjs.com/package/node-red-contrib-s7
I am reading and getting the data correctly.
In the node configuration exist a checkbox to get data only if a value has changed, that is, if one value changed, I get an actualization of the complete list of variables I am reading.
Data I am getting from PLC:
The thing is that I would like to write on mysql only the data that has changed.... I dont have idea how to do it being efficiently...
I have made a test making a function for each variable and works ok... But is the right way??? I could do it, but what will happen if I am reading 400 variables? 400 functions? hahah...
Test I did for some variables...(for each PLC Variable...)
Let me know your opinions, please!!!