LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Datasocket - OPC Problem

Solved!
Go to solution

Hello

 

I have a problem with Datasocket, when I try to read from the "NI OPC Servers", I can't. But, if I execute the program with the option "Highlight Execution", there are not problems. I've already tried to put a "Wait" between readings, but the problem doesn't disappear.

 

Thanks for your comments

0 Kudos
Message 1 of 6
(4,459 Views)

Hi joan,

 

Please attach the VI you're using here so that we may have a look at it...

 

Regards,

 

Nitin

0 Kudos
Message 2 of 6
(4,457 Views)

Also, being more specific with the kind of problem you are having helps.

 

Thanks!  🙂

 

Bill

 

Edited to correct failure to grasp basic English.

Message Edited by billko on 09-21-2009 02:03 PM
Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 3 of 6
(4,429 Views)
Solution
Accepted by joan_c

Thanks NitinD and billko for your answers.

 

I've already solve the problem, i'll try to explain it (excuse my English please).

 

Before, I put "DataSocket Open", "DataSocket Read" and "DataSocket Close" in the same loop iteration, without time between open the connection and read from the OPC Server. This made than the result of the reading was '0' all the time. Here we can see a screenshot:

 

mal.JPG

 

To solve this, I've separated the "DataSocket Open", the "DataSocket Read" and the "DataSocket Close" in three diferents loops, and I've added a wait in the first loop:

 

bien.JPG

No problems now, I think there wasn't enough time between open the connection and read from the OPC Server. 

 

Regards

 

 

 

 

Message 4 of 6
(4,408 Views)

Sometimes you have to brute-force it like that.  I know I had to put brutal wait statements in the communications VI we used for the OPC server, too.  Good to know you could handle it yourself.  Way to go!

 

Bill

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 5 of 6
(4,386 Views)

Hopefully someone reads this...

 

i was looking at the solution and i am doing something similar but different...

 

i have three variables to read from Var1, Var2 and Var3... i only open Var1 for reading, and then read from Var1, Var2 and Var3 and write to Var1.1 Var2.2 and Var3.3 with no problems, and then when done, i just close the reference to Var1...

 

So far i haven't had any problems with this... is there a reason why to open the three variables for Reading and then close the three variables?

0 Kudos
Message 6 of 6
(3,912 Views)