Skip to content
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

Possible filtered monitored item status change problem #2653

Open
1 of 7 tasks
jojastahl opened this issue Apr 16, 2019 · 0 comments
Open
1 of 7 tasks

Possible filtered monitored item status change problem #2653

jojastahl opened this issue Apr 16, 2019 · 0 comments

Comments

@jojastahl
Copy link
Contributor

Description

I probably discovered a problem with status change detection of monitored items, if a deadband filter is applied.

Background Information / Reproduction Steps

While I was looking for a problem where my monitored items of a subscription kept the initial Status UA_STATUSCODE_BADWAITINGFORINITIALDATA, I looked at the detectValueChangeWithFilter function in ua_subscription_datachange.c. I couldn't verify with a running test, whether my code analysis is correct, but maybe the code owner can quickly confirm or reject this issue:

I think that in case of a monitored item with deadband filter type UA_DEADBANDTYPE_ABSOLUTE, a status change of the data value will not be reported, if the value remains stable. Evidence: in case of UA_DEADBANDTYPE_PERCENT a call to updateNeededForStatusCode is used to check for this, but in case of UA_DEADBANDTYPE_ABSOLUTE this call is missing. See

if(!updateNeededForFilteredValue(&value->value, &mon->lastValue,
mon->filter.dataChangeFilter.deadbandValue))
return UA_STATUSCODE_GOOD;
compared to
if(!updateNeededForFilteredPercentValue(&value->value, &mon->lastValue,
mon->filter.dataChangeFilter.deadbandValue, euRange)) {
if(!updateNeededForStatusCode(value, mon)) //when same value, but different status code is written
return UA_STATUSCODE_GOOD;
}
.

The second observation targets the updateNeededForStatusCode function at

static UA_Boolean
updateNeededForStatusCode(const UA_DataValue *value, const UA_MonitoredItem *mon) {
if (UA_Variant_isScalar(&value->value)) {
if(value->status != mon->lastStatus)
return true;
}
return false;
}
. Is it correct, that a status change is only detected for scalar values? The updateNeededForFilteredValue and updateNeededForFilteredPercentValue are handling arrays aswell, so this one should probably do so, too?

Checklist

Please provide the following information:

  • open62541 Version (release number or git tag): master
  • Other OPC UA SDKs used (client or server):
  • Operating system:
  • Logs (with UA_LOGLEVEL set as low as necessary) attached
  • Wireshark network dump attached
  • Self-contained code example attached
  • Critical issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant