Hello there! I am using node-red-contrib-s7 v.3.1 and node-red-node-mysql v.1.0.3 to read data from a PLC and perform a INSERT on a MARIADB Database. Right now I can both read from the PLC and perform INSERT on the DB using separately but when I try put those two together I struggle with the syntax.
FYI the datatype or the variable is REAL and I have a 'S7 Input' Node feeding a 'Function' node
var LeftSide_Dist = msg.payload; LeftSide_Dist = LeftSide_Dist.toString(); var topic = "INSERT INTO myDB.stack (LeftSide_Dist, RightSide_Dist, LeftSide_Shift, RightSide_Shift, Top_Angle, Bottom_Angle, Code, `timestamp`) VALUES("+"LeftSide_Dist"+", 2, 3, 4, 5, 6, 7, current_timestamp())"; msg.topic = topic; return msg;
Can someone help me out?