writeItem
parent
cd6cbf116b
commit
e5bed926b5
|
|
@ -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);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue