Search code examples
sqlnode-red

Insert into in different tables


enter image description here

I'm developing software in node red that should read tags from a PLC and register them on a db. experimenting I tried to group 3 nodes s7 with a join node and 2 others with another join node both groups should go to read from the same PLC but write in different tables, taken singly they work but putting it in the same flow the result is value = BAD0 or BAD48 (I think it is depending on the type of data) as below, does anyone know the reason?

this is the code in the both nodes "Inserisci" :

msg.topic = 'insert into S7_log (codice_evento,pezzi_da_fare,pezzi_fatti) values ("'+ msg.payload.value [0]+'"  ,"'+ msg.payload.value[1] +'"  ,"'+ msg.payload.value[2] +'" )'
return msg;

PS : the only difference between nodes "inserisci" are the names of tags

enter image description here


Solution

  • Problem solved , was a my mistake , the "quantity" of one tags was wrong.