Hi there, I've go through different posts here, but wasn't able to find a proper solution.
It's my first go with Node-Red and my objective is the following:
I have sensors variables from S7 PLC from which I have to get value to populate a Mysql db.
I've mounted the Mysql db node with no problems and start testing the first "Insert into" queries.
Actually I'm stuck in this situation:
I have a PLC S7 In node that is creating a msg.payload named "metri" that is a number (as I can see from the debug console).
I've created a function node with the following:
var metri=msg.payload.metri;
msg.topic = "INSERT INTO test_iot (metri) VALUE ('" + metri + "')";
return msg;
From the debug console, I see this message:
INSERT INTO test_iot (metri) VALUE ('undefined').
What I'm missing?
Thanks in advance for your help
Michele