Closed MattCost closed 6 years ago
Hmmm, the master branch shows line 433 as what you are recommending already. Can you add your code so I can get a look at what you are doing?
https://github.com/cmseaton42/node-ethernet-ip/blob/master/src/controller/index.js That version doesn't have the await
const { Controller, Tag } = require("ethernet-ip");
const PLC = new Controller();
// Add some tags to group
PLC.subscribe(new Tag("TestRead")); // Controller Scope Tag
PLC.connect("10.115.45.52", 0).then(() => {
console.log("Connected to PLC!");
console.log(PLC.properties);
PLC.scan_rate = 1500;
// Begin Scanning
PLC.scan();
});
// Catch the Tag "Changed" and "Initialized" Events
PLC.forEach(tag => {
// Called on the First Successful Read from the Controller
tag.on("Initialized", tag => {
console.log("Initialized", tag.value);
});
// Called if Tag.controller_value changes
tag.on("Changed", (tag, oldValue) => {
console.log("Changed:", tag.value);
});
});
Ahhhh, good catch. Patching now.
@MattCost v1.1.2
should resolve the issue. Let me know if everything seems to be working when you upgrade.
Yup! Working as expected now.
Sweet, Thanks for the heads up!
Changing PLC Scan rate has no effect. Tags are scanned as fast as possible
Current Behavior
Tags are scanned as fast as possible
Expected Behavior
Tags should be scanned every X ms
Possible Solution (Optional)
ethernet-ip\src\controller\index.js line 433 - should be "await delay(this.state.scan_rate);"
Your Environment
npm list
- e.g. 1.0.6): ethernet-ip 1.1.1node --version
- e.g. 9.8.0):