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

Polling mechanism instead of PubSub in OPCPublisher #605

Closed
saurabhsadhu opened this issue Jul 7, 2020 · 8 comments
Closed

Polling mechanism instead of PubSub in OPCPublisher #605

saurabhsadhu opened this issue Jul 7, 2020 · 8 comments
Assignees
Labels
feature request New feature or request

Comments

@saurabhsadhu
Copy link

saurabhsadhu commented Jul 7, 2020

Problem
I am trying to organize data coming through OPCpublisher according to timestamp. OPCPublisher works on PubSub model and hence it doesn't bring the data of nodes whose value have not been updated. For example if I have configured 100 nodes for OPCPublisher and all of them are sampled at 800ms interval. Now all nodes except 2 have changed their values at the next sampling interval. OPCPublisher doesn't get the data of those 2 nodes who haven't changed the values, because event wasn't detected. But I want to get the values even if they haven't changed.

I think polling mechanism instead of PubSub will resolve the issue. Is there any way to achieve this in OPCPublisher?

Thanks

@cristipogacean
Copy link
Contributor

Polling is not possible with the publisher. you can configure the heartbeat interval for the 2 static nodes.

@cristipogacean cristipogacean added the feature request New feature or request label Jul 7, 2020
@cristipogacean cristipogacean self-assigned this Jul 7, 2020
@cristipogacean
Copy link
Contributor

I think that for your use-case the best option would be the using the key frame mechanism from the OPC UA PubSub. This feature is on roadmap.

@FMauroy
Copy link

FMauroy commented Jul 24, 2020

Hi all,

we also had the same problem, and ended up modifying the code of publisher 2.5.3 as a temporary measure. Maybe not that temporary as the newer version of publisher doesn't support message shaping anymore, and this is something we rely heavily on...

So, what I changed is in OpcSession.cs, after the creation of a new OpcUaMonitoredItem, I add a filter of type DataChangeFilter, with a trigger value of "StatusValueTimestamp". This way, publisher is also notified when the timestamp changes, and we have the events we expect. With error checks, it's just 5 lines to add. So far so good, data volume is expectedly more important, but we have other components that rely on a complete stream of events, and a heartbeat of 1 sec was not sufficient.

Team, do you see any side-effect of using this approach? Appart from the extra events that are generated of course.

HTH
fred

@markusstuhler
Copy link
Contributor

Hi @FMauroy, did you try to configure the heartbeat interval like @cristipogacean proposed in his first response? That should give you values from the static nodes even when their value didn't change.

I will close this issue for now. Please reopen if the issue cannot be solved with that approach.

Thanks!

@FMauroy
Copy link

FMauroy commented Sep 22, 2020

Of course not, the heartbeat is unreliable. In many cases, we had values in the future, that's why we had to implement it this way.

@markusstuhler
Copy link
Contributor

Could you please provide the code you wrote so that we can have a look at it to answer your question concerning side effects?

Thanks!
Markus

@FMauroy
Copy link

FMauroy commented Oct 19, 2020

Hi, here is the code snippet I added (sorry, didn't see your reply sooner):

`
if (UseDataChangeTrigger)

    try

    {

       var filter = monitoredItem.MonitoredItem.Filter as DataChangeFilter ?? new DataChangeFilter();

        filter.Trigger = DataChangeTrigger.StatusValueTimestamp;

        monitoredItem.MonitoredItem.Filter = filter;

    }

    catch (Exception ex)

    {

        Logger.Warning(ex, "*** Filter hack error");

    }

`

@Sdelausnay
Copy link

Is this still on the radar of implementing this in the OPC UA publisher?

We have a client with wants to poll all of the values at fixed intervals.

Heartbeat is not really providing good results as it seems it is not updating the source timestamp of messages.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request
Projects
None yet
Development

No branches or pull requests

7 participants