Not always getting value updates from modbus slave
Posted: Tue Apr 06, 2021 7:52 am
I noticed that by default when I use global variables (Globals.Tags.x.Value) in scripts, they are not always updated. They only appear to get updated when the current screen has a control that has an association with the tag.
Especially with the modbus server this behavior is strange, the modbus server confirms to the client that the writing of the variable was accepted, but (unless the current screen contains a component that has an association with the variable) the global variable is never updated.
Even though the the global variable is not updated, the variable is buffered internally, because when, in the future the operator navigates to another screen, that has a component with an association to the tag, then the global variable still gets the update it had received via modbus some time ago.
Especially with the modbus server this behavior is strange, the modbus server confirms to the client that the writing of the variable was accepted, but (unless the current screen contains a component that has an association with the variable) the global variable is never updated.
Even though the the global variable is not updated, the variable is buffered internally, because when, in the future the operator navigates to another screen, that has a component with an association to the tag, then the global variable still gets the update it had received via modbus some time ago.