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);
}