errori più dettagliati
parent
817246e77b
commit
fd2427a365
|
|
@ -87,7 +87,10 @@ function s7node_from_plc(plc) {
|
|||
rack: plc.rack,
|
||||
slot: plc.slot
|
||||
};
|
||||
let nuovo = new NodeS7();
|
||||
let nuovo = new NodeS7({
|
||||
silent: false,
|
||||
debug: true
|
||||
});
|
||||
let prom = new Promise(
|
||||
(resolve, reject) => {
|
||||
setTimeout(() => {
|
||||
|
|
@ -159,10 +162,10 @@ function s7_read_write_loop(ip, obj) {
|
|||
obj.addItems(item.variable);
|
||||
obj.readAllItems((anyBadQualities, dataObject) => {
|
||||
if (anyBadQualities) {
|
||||
console.error("bad qual", anyBadQualities)
|
||||
console.error("Can't read variables (" + ip + "): bad qualities", anyBadQualities)
|
||||
item.reject(anyBadQualities);
|
||||
} else {
|
||||
console.log("letti", dataObject);
|
||||
// console.log("letti", dataObject);
|
||||
item.resolve(dataObject[item.variable]);
|
||||
}
|
||||
s7write_lock[ip] = false;
|
||||
|
|
@ -194,7 +197,7 @@ module.exports = function (RED) {
|
|||
}).catch(err => {
|
||||
msg.result = "err";
|
||||
node.send(msg);
|
||||
node.error("Impossibile scrivere il valore: " + err);
|
||||
node.error("(" + msg.plc.ip + ") Impossibile scrivere il valore: " + err);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
|
@ -222,7 +225,7 @@ module.exports = function (RED) {
|
|||
}).catch(err => {
|
||||
msg.result = "err";
|
||||
node.send(msg);
|
||||
node.error("Impossibile scrivere il valore: " + err);
|
||||
node.error("(" + msg.plc.ip + ") Impossibile leggere il valore: " + err);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue