09-21-2009 07:47 AM
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
Solved! Go to Solution.
09-21-2009 07:56 AM
Hi joan,
Please attach the VI you're using here so that we may have a look at it...
Regards,
Nitin
09-21-2009 02:02 PM - edited 09-21-2009 02:03 PM
Also, being more specific with the kind of problem you are having helps.
Thanks! 🙂
Bill
Edited to correct failure to grasp basic English.
09-22-2009 01:22 PM
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:
 
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:
 
No problems now, I think there wasn't enough time between open the connection and read from the OPC Server.
Regards
09-23-2009 11:22 AM
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
03-11-2011 04:58 PM
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?