-
Notifications
You must be signed in to change notification settings - Fork 366
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Received DataChangeNotification without Value has changed #1686
Comments
you are using "subscribe_data_change" to add a MonitoredItem to the Subscription means a lot of defaults involved The default for DataChangeFilter.Trigger should be 1 ("STATUS_VALUE") -> "Report a notification if either the StatusCode or the value change" So from OPC UA Client side it should be only Notifications triggered by Value or StatusCode change in the Queue! The Client just empty's the Queue of Notifications... he can control which trigger to use... but in your case its already "STATUS_VALUE" which is the one you want... Reference: @oroulet our default is wrong should be 1 ("STATUS_VALUE") and not 0 ("STATUS") but in _subscribe we don't provide it anyways so its fine and not the reason for this issue! |
however have you Traced the Boolean Tag in TIA-Portal does it really did not change? not even a PLC cycle? the reason why i ask is because the SamplingInterval can hide these fast changes some times... especially with Queuesize=1 and DiscardOldest (UaExpert defaults) according to "sampling_interval=10" i doubt the plc can do that... but its just the requested interval it will get revised from the OPC UA Server: the interesting part is that actually the Timestamp appears to have changed:
looks like the PLC treated the missing DataChangeFilter as "STATUS_VALUE_TIMESTAMP" !? |
Thank you for your quick answer! I will run the tracing in the TIA portal next Monday and will report the results. |
@Scheibengraber could you be so kind and enable the debug logger in you python client and post the output here in a textfile? i like to check the requests/responses of the creation of Subscription and MonitoredItems!
|
@AndreasHeine I have attached the output with log level DEBUG for the asyncua logger in this comment. You can also see that there are multiple data change notifications where the value of the bool node is always False. Thank you for having a deep look! |
So the filter is empty -> which should force the server to use default-filter (STATUS_VALUE) ... i am currently checking how a empty ExtensionObject is getting serialized... |
Source: https://reference.opcfoundation.org/Core/Part4/v104/docs/5.12.2.2#_Ref104715274 looks ok so far... |
After upgrading of the Siemens PLC to Firmware V3.1.3 the issue still exists. |
hm thats bad... the client logic is kind of dumb tbh... can you try to set it manually i updated an example how to set the filter manually: |
|
the default is 0.0 in: opcua-asyncio/asyncua/common/subscription.py Line 255 in 1fe61df
which would be "0: Eventbased (as fast as possible)" -1: Inherit from PublishInterval thats weird... the sampling interval has not much to do with the datachange trigger... but ok! Reference:
@oroulet maybe 0.0 is not a good default value ^^ |
Describe the bug
We receive data change notificications from a Siemens S7 1517 (Firmware 2.9.4) OPC UA server with asyncua version 1.1.5.
Console output:
To Reproduce
You can use the following script to reproduce the issue. Please exchange the variables host, port and node id "ns=5;i=6010" with your node id in your OPCUA server.
Expected behavior
We would expect if there is no Value change that the datachange_notification callback isn't called. We subscribed the node with the FreeOpcUa client (python lib opcua-client 0.8.4), which has the same issue. The tool Unified Automation UaExpert (version 1.4.21 324) doesn't show a data change notification when we subscribe there the same node in these cases. So we can simply exclude that it is a issue on PLC side. We also assume that the FreeOpcUa client uses the library asyncua, because it has the same issue as our script.
Version
Python-Version: 3.8, 3.12
opcua-asyncio Version (e.g. master branch, 1.1.5):
The text was updated successfully, but these errors were encountered: