Polling/Subscription Wrapper
Kinda new to the Git-world so lemme know if this is the wrong place to post this. Wondering if anyone has done a polling/subscription oriented wrapper for this. Something that works more like an OPC subscription where polling is handled in the wrapper and notifies on data changes. Looking at writing one but don't want to re-invent the wheel.
I have sort-of, kind-of.
I've done it internally for work and also in another open source project.
What's your end goal? I might be able to add some example code to the repo or refer you to my other project.
End goal is to be able to avoid use of drivers like Kepware. Currently using OPC with a subscription model. What I am thinking is to emulate OPC behaviors. In OPC there are methods for read, write, subscribe. A subscription has an update/polling interval.
So, if I subscribe a group of tags with a 1000ms interval, the driver would execute reads every 1000ms but also compare the new value to the last value and notify with a callback of any value changes.
Any example code you could share would be appreciated. I will share out my finished product with any enhancements. I think having a polling model will be a good addition.
Marc Bertrand Sage Clarity +1 636-226-7427
From: jkoplo @.> Sent: Tuesday, August 9, 2022 4:13 PM To: libplctag/libplctag.NET @.> Cc: Marc Bertrand @.>; Author @.> Subject: Re: [libplctag/libplctag.NET] Polling/Subscription Wrapper (Issue #263)
I have sort-of, kind-of.
I've done it internally for work and also in another open source project.
What's your end goal? I might be able to add some example code to the repo or the you to my other project.
— Reply to this email directly, view it on GitHubhttps://github.com/libplctag/libplctag.NET/issues/263#issuecomment-1209901708, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AKFX2XLZRGGYFK5APPPDK6LVYLCVLANCNFSM56BXRRGA. You are receiving this because you authored the thread.Message ID: @.@.>>
Sorry for the email reply, I am on vacation with limited Internet access.
The core library can support a subscription model but you need to do a little work. You need to create a tag handle with the automatic read attribute and with a callback.
A wrapper like the .Net one could probably make this look a lot nicer.
There was a user who mentioned creating a version of an open source OPC server that used libplctag for CIP. I don't think the work was ever released publicly.
Best, Kyle
On Wed, Aug 10, 2022, 5:43 AM Marc Bertrand @.***> wrote:
End goal is to be able to avoid use of drivers like Kepware. Currently using OPC with a subscription model. What I am thinking is to emulate OPC behaviors. In OPC there are methods for read, write, subscribe. A subscription has an update/polling interval.
So, if I subscribe a group of tags with a 1000ms interval, the driver would execute reads every 1000ms but also compare the new value to the last value and notify with a callback of any value changes.
Any example code you could share would be appreciated. I will share out my finished product with any enhancements. I think having a polling model will be a good addition.
Marc Bertrand Sage Clarity +1 636-226-7427
From: jkoplo @.> Sent: Tuesday, August 9, 2022 4:13 PM To: libplctag/libplctag.NET @.> Cc: Marc Bertrand @.>; Author @.> Subject: Re: [libplctag/libplctag.NET] Polling/Subscription Wrapper (Issue #263)
I have sort-of, kind-of.
I've done it internally for work and also in another open source project.
What's your end goal? I might be able to add some example code to the repo or the you to my other project.
— Reply to this email directly, view it on GitHub< https://github.com/libplctag/libplctag.NET/issues/263#issuecomment-1209901708>, or unsubscribe< https://github.com/notifications/unsubscribe-auth/AKFX2XLZRGGYFK5APPPDK6LVYLCVLANCNFSM56BXRRGA>.
You are receiving this because you authored the thread.Message ID: @.@.>>
— Reply to this email directly, view it on GitHub https://github.com/libplctag/libplctag.NET/issues/263#issuecomment-1210622163, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAN4LC6OL2TW22CYXCJWTSDVYOPYXANCNFSM56BXRRGA . You are receiving this because you are subscribed to this thread.Message ID: @.***>
Hey Kyle,
You seem to know this library pretty well. Any chance you or someone you know from the OSS project might be interested in picking up some side work?
My DevOps team is not well suited for something like this. I come from a PLC integration background so I could probably figure it out but I have time constraints. I’ve engaged specialized development from places like Upwork before and have budget for this kind of thing.
I’d love to get this embedded in our stack. Trying to figure out the best way to get going.
Thanks,
Marc
Marc Bertrand Sage Clarity +1 636-226-7427
From: Kyle Hayes @.> Sent: Thursday, August 11, 2022 11:54 AM To: libplctag/libplctag.NET @.> Cc: Marc Bertrand @.>; Author @.> Subject: Re: [libplctag/libplctag.NET] Polling/Subscription Wrapper (Issue #263)
Sorry for the email reply, I am on vacation with limited Internet access.
The core library can support a subscription model but you need to do a little work. You need to create a tag handle with the automatic read attribute and with a callback.
A wrapper like the .Net one could probably make this look a lot nicer.
There was a user who mentioned creating a version of an open source OPC server that used libplctag for CIP. I don't think the work was ever released publicly.
Best, Kyle
On Wed, Aug 10, 2022, 5:43 AM Marc Bertrand @.***mailto:***@***.***> wrote:
End goal is to be able to avoid use of drivers like Kepware. Currently using OPC with a subscription model. What I am thinking is to emulate OPC behaviors. In OPC there are methods for read, write, subscribe. A subscription has an update/polling interval.
So, if I subscribe a group of tags with a 1000ms interval, the driver would execute reads every 1000ms but also compare the new value to the last value and notify with a callback of any value changes.
Any example code you could share would be appreciated. I will share out my finished product with any enhancements. I think having a polling model will be a good addition.
Marc Bertrand Sage Clarity +1 636-226-7427
From: jkoplo @.mailto:***@***.***> Sent: Tuesday, August 9, 2022 4:13 PM To: libplctag/libplctag.NET @.mailto:***@***.***> Cc: Marc Bertrand @.mailto:***@***.***>; Author @.mailto:***@***.***> Subject: Re: [libplctag/libplctag.NET] Polling/Subscription Wrapper (Issue #263)
I have sort-of, kind-of.
I've done it internally for work and also in another open source project.
What's your end goal? I might be able to add some example code to the repo or the you to my other project.
— Reply to this email directly, view it on GitHub< https://github.com/libplctag/libplctag.NET/issues/263#issuecomment-1209901708>, or unsubscribe< https://github.com/notifications/unsubscribe-auth/AKFX2XLZRGGYFK5APPPDK6LVYLCVLANCNFSM56BXRRGA>.
You are receiving this because you authored the thread.Message ID: @.@.mailto:***@***.******@***.***>>
— Reply to this email directly, view it on GitHub https://github.com/libplctag/libplctag.NET/issues/263#issuecomment-1210622163, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAN4LC6OL2TW22CYXCJWTSDVYOPYXANCNFSM56BXRRGA . You are receiving this because you are subscribed to this thread.Message ID: @.***mailto:***@***.***>
— Reply to this email directly, view it on GitHubhttps://github.com/libplctag/libplctag.NET/issues/263#issuecomment-1212241418, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AKFX2XJ5P2HN4XV6IVFSFSTVYUVY3ANCNFSM56BXRRGA. You are receiving this because you authored the thread.Message ID: @.@.>>
@MarcBertrand - What sort of 'callback' are you looking for? Just a simple event from a library in C# or some sort of webhook? Or are you running an OPC-UA client on your end and looking for a special OPC-UA message back?
The OPC-UA library for .NET (OPC UA .NET) is basically the reference implementation and we use it professionally to host OPC-UA servers within our code. Tying it together with libplctag.NET isn't terribly hard, but as far as I know no one has published that in an open source version. That would basically just be an open source OPC-UA server that could target AB PLCs (and a few others).
I've considered slapping the two together myself and publishing it, but I haven't gotten into the depths of OPC-UA yet. I'm working on another project (CrudeObservatory) that was originally a configurable router between PLCs and storage formats/endpoints, but is starting to look more and more like an open source Historian server.
It sounds like you are just looking to replace Kepware with something that doesn't have a license fee?
@MarcBertrand I can't do any contract work due to my contract with my employer. That's how I keep libplctag independent. I think the C# OPC/UA implementation that Jody mentions would be a good starting place if you really need OPC. If that is not what you need, then asking on the forum might yield some results.
Hi @MarcBertrand - I believe this issue can be closed?
Yes, thank you!
Marc Bertrand Sage Clarity +1 636-226-7427
From: timyhac @.> Sent: Wednesday, September 14, 2022 5:32 AM To: libplctag/libplctag.NET @.> Cc: Marc Bertrand @.>; Mention @.> Subject: Re: [libplctag/libplctag.NET] Polling/Subscription Wrapper (Issue #263)
Hi @MarcBertrandhttps://github.com/MarcBertrand - I believe this issue can be closed?
— Reply to this email directly, view it on GitHubhttps://github.com/libplctag/libplctag.NET/issues/263#issuecomment-1246568313, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AKFX2XK6L4PRNKIATRZOPDTV6GSTTANCNFSM56BXRRGA. You are receiving this because you were mentioned.Message ID: @.@.>>