logo

Notification

Icon
Error

Options
Go to last post Go to first unread
Offline Roberto Dias  
#1 Posted : Thursday, May 28, 2015 5:04:13 AM(UTC)
Roberto Dias

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)????
thanks 1 user thanked Roberto Dias for this useful post.
Offline Patrick Griffiths  
#2 Posted : Thursday, May 28, 2015 7:58:32 AM(UTC)
Patrick Griffiths

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
thanks 1 user thanked Patrick Griffiths for this useful post.
Offline Roberto Dias  
#3 Posted : Thursday, May 28, 2015 3:10:13 PM(UTC)
Roberto Dias

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!
thanks 1 user thanked Roberto Dias for this useful post.
Offline Gary  
#4 Posted : Tuesday, June 2, 2015 1:52:19 PM(UTC)
Gary

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
thanks 1 user thanked Gary for this useful post.
Offline Roberto Dias  
#5 Posted : Tuesday, June 2, 2015 2:46:51 PM(UTC)
Roberto Dias

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
thanks 1 user thanked Roberto Dias for this useful post.
Offline Gary  
#6 Posted : Wednesday, June 3, 2015 10:57:53 AM(UTC)
Gary

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.
thanks 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.

Matrikon Subscribe  |   Matrikon Unsubscribe  |   Global Unsubscribe  |   Privacy Statement  |   Do Not Sell My Personal Information   |   Cookie Notice