node-ethernet-ip
node-ethernet-ip copied to clipboard
Changed Event is missed for previously written tags
Changed Event is missed for previously written tags.
Current Behavior
When a tag is written to the PLC, in the following read cycles is no Changed Event produced.
Expected Behavior
A Changed Event is also produced for tags previously written to the PLC.
Possible Solution (Optional)
In file /src/tag/index.js remove line (574):
unstageWriteRequest() {
const { tag } = this.state;
tag.stage_write = false;
//tag.controllerValue = tag.value;
}
Context
If node-ethernet-ip is used in Node-RED and eth-ip in and eth-ip out nodes are connected to the same PLC tag, the value is properly written to the PLC but cannot be read back. The reasons for this behaviour are:
- In unstageWriteRequest the value of tag.controllerValue is already updated to the new value.
- In controller_value the comparison (line 239)
if (newValue !== this.state.tag.controllerValue)
does not see a difference and there no Changed Event has been emitted. - In Node-RED no message is generated at eth-ip in node.
Steps to Reproduce (for bugs only)
- In Node-Red, create a small flow consisting in: numeric to eth-ip in and eth-ip out to text. Both eth-ip nodes are linked to the same PLC DINT tag. Screenshot:
- Run it and change the value of numeric node (input) on the dashboard.
- Check if the value for the text node (output), it does not change.
Your Environment
- Package version (Use
npm list
- e.g. 1.0.6): 1.2.5 - Node Version (Use
node --version
- e.g. 9.8.0): 12.16.2 - Operating System and version: Linux raspberrypi 4.19.97-v7+
- Controller Type (eg 1756-L83E/B): 1769-L32E
- Controller Firmware (eg 30.11): 20.14