writeItem

master
Pietro Brenna 2021-12-03 16:21:21 +01:00
parent cd6cbf116b
commit e5bed926b5
1 changed files with 2 additions and 2 deletions

View File

@ -147,7 +147,7 @@ function s7_read_write_loop(ip, obj) {
s7write_lock[ip] = true; s7write_lock[ip] = true;
let item = q.shift(); let item = q.shift();
if (item.action == "write") { if (item.action == "write") {
obj.writeItems(item.variable, [item.value], (e) => { obj.writeItems(item.variable, item.value, (e) => {
if (e) { if (e) {
// questa scrittura è fallita // questa scrittura è fallita
item.reject(e); item.reject(e);
@ -190,7 +190,7 @@ module.exports = function (RED) {
return; return;
}*/ }*/
s7node_from_plc(msg.plc).then(s7conn => { s7node_from_plc(msg.plc).then(s7conn => {
return s7_write(msg.plc, s7conn, msg.payload.variable, [msg.payload.value]); return s7_write(msg.plc, s7conn, msg.payload.variable, msg.payload.value);
}).then(() => { }).then(() => {
msg.result = "ok"; msg.result = "ok";
node.send(msg); node.send(msg);