Rank: Member
Joined: 4/15/2015(UTC) Posts: 12 Location: Florianópolis
Was thanked: 5 time(s) in 5 post(s)
|
Dear colleagues,
I try to implement subscription and monitored items codes of Lesson 6 (UA_SDK Documentation)
I customize the SampleUaCOnsole example in the UA_SDK.
I was create a customized version of overload UaCLient::Connect method with url for calling a new use method (my code) callled void Create_Subscription(std::shared_ptr<Mtk::Ua::ClientSDK::IUaClientSession> m_spUaSession); The body of this method is the first code in the Lesson 6. This method create a subscription of a previous session with my server (I am a customer of Embedded SDK Server). After de subscrition method invocation, in the UaCLient::Browse customised for me I invoque a new method called UaCLient::CreateMonitorItens. This method receive the session id, node Ids of the monitored itens and create a node monitoring in my server. The body of this method is the second code in the Lesson 6.
The next step I will be create a new class inherit of the IUaSubscriptionCallbackHandler, like the third code in Lesson 6: class MyUAClient: public IUaSubscriptionCallbackHandler
This class have a method MyUAClient::OnDataChanged that detect the changes in the value of nodes and capture this values "on data changed event".
I use two classes in my code becouse MyUAClient inherit characteristics of IUaSubscriptionCallbackHandler. The class operate in call back mode.
My principal question: where I invoque the MyUAClient::OnDataChanged method? In the main function of my program? I need improve modifications in my server code? The Embedded SDK server say that subscription and monitored itens "was transparent by library".
Do you have a complete example code of subscription and monitored itens (i.e Lesson 6 implementation)????
|
 1 user thanked Roberto Dias for this useful post.
|
|
|
Rank: Advanced Member
Joined: 11/28/2014(UTC) Posts: 37
Was thanked: 13 time(s) in 11 post(s)
|
Hi Roberto,
I'll see what I can do to get some sample code posted, but it might take a day or two.
Once you have everything wired together, the OnDataChanged() method will be called by the library for you to report changes to the data on the server. Note that it will be called in the context of a different thread (one created by the library) from the main thread of your application.
HTH Patrick
|
 1 user thanked Patrick Griffiths for this useful post.
|
|
|
Rank: Member
Joined: 4/15/2015(UTC) Posts: 12 Location: Florianópolis
Was thanked: 5 time(s) in 5 post(s)
|
Hello Patrick,
Very thanks for your quick reply! I was a little confused with the callback methods! I don´t see how library call "OnDataChanged()" intrinsically.
I wait your example for major clarification.
Thanks a lot!
|
 1 user thanked Roberto Dias for this useful post.
|
|
|
Rank: Newbie
Joined: 5/28/2015(UTC) Posts: 2
Was thanked: 2 time(s) in 2 post(s)
|
Hi Roberto,
Can you give me your email? Then I can send the demo code to you.
Hongtao
|
 1 user thanked Gary for this useful post.
|
|
|
Rank: Member
Joined: 4/15/2015(UTC) Posts: 12 Location: Florianópolis
Was thanked: 5 time(s) in 5 post(s)
|
Dear Gary My personal email roberto.ifsc@gmail.com
|
 1 user thanked Roberto Dias for this useful post.
|
|
|
Rank: Newbie
Joined: 5/28/2015(UTC) Posts: 2
Was thanked: 2 time(s) in 2 post(s)
|
Roberto,
I have sent demo code to you in email.
If you have further questions about it, please let me know.
|
 1 user thanked Gary for this useful post.
|
|
|
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.