LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Labview freezes while opening datasocket

I have an OPC server that takes more than 1 minute to start.
So when i try to open a connection to this OPC , this delays more  than 1 minute and during this time the entire code stops. This happens even to code in parallel loops, even to others Vi's and even to the Labview program itself. I Need to do some other things during this period, this is a long period to wait, for a user, it was never acceptable.
In the attached Vi, i try to update the time in the screen, and you can seen that this only happens after the connection established or reached the timeout, even if you try to abort the Vi, you can't.
What you suggest? There is other option?
0 Kudos
Message 1 of 10
(4,810 Views)
Why do you have the Datasocket Open VI in a while loop? This only needs to be called once to open the datasocket. Then if you need to read continuously, put the Read inside the while loop, and the Close on the outside. The way it is written now, it will try to open the same datasocket multiple times. Check your error output. You're more than likely getting an error there.
0 Kudos
Message 2 of 10
(4,795 Views)

Hello,

I suggest you to see the example called "NI DAQ OPC Client.vi" in LabVIEW in order to have an example of DataSocket connexion. You can find more examples in LabVIEW.

Here is a tutorial about the dataSocket :http://zone.ni.com/devzone/cda/tut/p/id/3224

Regards.

0 Kudos
Message 3 of 10
(4,784 Views)

Sima,

Please concentrate in the problem, do not invent other problems!

I know very well what I’m doing, and how I should do it, I don’t need any tutorial or examples of how to do it, the problem is in the time taken (and blocked all rest) by the open function and not in the architecture. As you can suppose this VI is only for demonstrate the problem, and you can test and reach the problem. And as I know I can open the connection how many times I want and no error is given (is open the same thing), I know "is not necessary", but even probably it is because is the open that launches the OPC server and to guarantee that the OPC server is Up, probably I need to launch it some times in a loop (of course with some more logic and test, but this is not the problem for here).

So, can anybody give some answer about the Datasocket open connection and the Labview total freeze during the execution of this function??

 

0 Kudos
Message 4 of 10
(4,766 Views)
Well IDILIO, that was uncalled for. Maybe someone else will be willing to help you with that attitude.
0 Kudos
Message 5 of 10
(4,756 Views)

Sima,

 

Sorry for the answer type, but I didn't intend to offend anybody, I was just trying to explain which was the problem, because the first it seems that nobody understood which was the problem and were to suggest other types of problems...

0 Kudos
Message 6 of 10
(4,753 Views)
Hello,

are there any news to this topic ?   Since i have exactly the same problem i would like to know if there are any changes.

I attached a VI wich shows the behaviour. Best you can see it if you choose a PC within you network as target address and than disconnect this PC.
If you run the VI in this situation LabVIEW freezes on my PC for about 45 seconds, even if the timeout is the default of 10 seconds. In the network where the applicatin is runnig it takes also longer.
As result i get failures in other parts of the program, that get locked for that time too.






Message Edited by ChristianH on 03-17-2008 01:11 PM
0 Kudos
Message 7 of 10
(4,578 Views)
As far as i know there is no solution yet for this problem, and NI doesn't reconigze the problem.... 😞
0 Kudos
Message 8 of 10
(4,553 Views)

that´s aren´t good news, since i don´t know another LabVIEW solution for reading OPC Items which meets the requirement to add and remove connections programmaticly.
Under perfect conditions the Datasocket VIs work well for that, but if something goes wrong, our whole application runs into trouble.
It looks like the DS Vis run in the User Interface Thread because all fronpanel Updates stop for some time.
The same happens also if you connect a Frontpanel Control with a OPC Item on a OPC Server on a remote PC. Whole LabVIEW freezes for some time if the connection gets broken or the OpenVI can´t find the remote PC. (At least everything visible stops working, some VIs in the background (like a PID controller and some communication VIs are still working.)
If the Remote host is reachable and only the Item is missing, the Open DS VI returns faster with an error and LabVIEW won´t freeze so long.

Has anyone an idea for an alternative OPC communication that don´t needs a manually setup ?





0 Kudos
Message 9 of 10
(4,530 Views)

Same problem here and it is driving me crazy.

 

I just want to open a DS-connection to a remote OPC-server (which me be running or not) and want the connection to timeout properly if the server is down.

However LV makes it impossible to do any error handling in code since it freezes up completely.

 

0 Kudos
Message 10 of 10
(4,094 Views)