We are getting the value in the SQL but POD tag shows undefine.
tag property define as One Item in the IOT device.
debug output:
9/25/2020, 11:12:51 PMnode: 3cdb5ae5.2dec26
msg.payload : string[275]
"INSERT INTO [2WE TVS_NFFPP].[dbo].[MQTTData] (DateTime, POD, Pos1_op, Pos1_ETA, Pos1_Weight, Pos1_rdy,Pos1_Length,Pos1_1_2_cut,Pos1_All_cut,Pos1_DD,Detex,Number_Ply) VALUES ('9/25/2020 23:12:51','undefined', '58.047','50','9.91138','OFF','7.745','OFF','OFF','OFF','2200','3')"
Function Node:
d = new Date,
dformat = [d.getMonth()+1,
d.getDate(),
d.getFullYear()].join('/')+' '+
[d.getHours(),
d.getMinutes(),
d.getSeconds()].join(':');
dtstmp = new Date().toString();
pld = "INSERT INTO [2WE TVS_NFFPP].[dbo].[MQTTData] "
pld = pld + "(DateTime, POD, Pos1_op, Pos1_ETA, Pos1_Weight, Pos1_rdy,Pos1_Length,Pos1_1_2_cut,Pos1_All_cut,Pos1_DD,Detex,Number_Ply) "
pld = pld + "VALUES ('"+ dformat+"','" + msg.payload.POD[0] + "', '" + msg.payload.Pos1_op + "','" + msg.payload.Pos1_ETA + "','" + msg.payload.Pos1_Weight + "','" + msg.payload.Pos1_rdy + "','" + msg.payload.Pos1_Length + "','" + msg.payload.Pos1_1_2_cut + "','" + msg.payload.Pos1_All_cut + "','" + msg.payload.Pos1_DD + "','" + msg.payload.Detex + "','" + msg.payload.Number_Ply + "')"
msg.topic = ''
msg.payload = pld
return msg;
this is the tags
In the CSV file, it shows POD-0 but we try with POD-0 also it shows 0 is not defined.