Hi there,
i need to set the variables of the s7 endpoint node dynamically, i mean from out side the node
i have an idea to connect to oracle database to fetch the following Data:
PLC IP, Rack, Slot and also the variables
then send those values (via a function node or something else) to the s7 Endpoint node
i search a lot for any thing like that but i couldn't do it
any help will be highly highly appreciated
Many thanks, really your reply is very very helpful
do me a favor and send me how to write to PLC
sorry, don't have an example of writing, but it looks pretty straight forward from github example:
function connected(err) {
if (typeof(err) !== "undefined") {
// We have an error. Maybe the PLC is not reachable.
console.log(err);
process.exit();
}
conn.setTranslationCB(function(tag) { return variables[tag]; }); // This sets the "translation" to allow us to work with object names
conn.addItems(['TEST1', 'TEST4']);
conn.addItems('TEST6');
// conn.removeItems(['TEST2', 'TEST3']); // We could do this.
// conn.writeItems(['TEST5', 'TEST6'], [ 867.5309, 9 ], valuesWritten); // You can write an array of items as well.
// conn.writeItems('TEST7', [666, 777], valuesWritten); // You can write a single array item too.
conn.writeItems('TEST3', true, valuesWritten); // This writes a single boolean item (one bit) to true
conn.readAllItems(valuesReady);
}
your support is highly appreciated