Matrikon OPC Automation Forum
»
Matrikon Developers Forum
»
UA SDK
»
UaClient.isConnected() return true even if UaClient is not ready to be used.
Rank: Member
Joined: 12/1/2014(UTC) Posts: 19
Thanks: 2 times Was thanked: 2 time(s) in 2 post(s)
|
UaClient.isConnected() return true even if UaClient (m_uaConnection) is not ready.
next code is based on your UaClient example and generate an error:
UaClient *client;
void doSomething() { // part 1; if (client==NULL) { client = new UaClient("xxx","yyy"); client.connect(); while (!client.isConnected()) { // waiting until client connects // relese resourses;
} } //part 2; if (client.isConnected()) client.ReadSomething(); //!!!!!!!!!!!!!! crush; } Where is two possible scenario. 1. If client was previously created. Then everything works fine. 2. if software need to create a new client. It crushes.
Am I doing this wrong?
Thank you.
|
|
|
|
Rank: Advanced Member
Joined: 11/28/2014(UTC) Posts: 37
Was thanked: 13 time(s) in 11 post(s)
|
Hi Vladimir,
In general, it's not enough to have a connection. You'll need to create a session before you can read.
Just to make sure we are talking about the same thing: are you trying to re-use the sample code? The sample is intended to be a quick and dirty demonstration of the required workflow, it's probably not a good idea to use it directly as the basis for your own code.
If you can post a more complete code snippet we can give you more specific advice.
Cheers, Patrick
|
|
|
|
Rank: Member
Joined: 12/1/2014(UTC) Posts: 19
Thanks: 2 times Was thanked: 2 time(s) in 2 post(s)
|
Patrick, You absolutely right. I need to wait until session will be created.
Thank you.
|
|
|
|
Matrikon OPC Automation Forum
»
Matrikon Developers Forum
»
UA SDK
»
UaClient.isConnected() return true even if UaClient is not ready to be used.
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.