I have a strange problem to report about Datasockets. The following simple test works fine when both reader and writer are VIs... but refuse to work when one is compiled to an EXE. Here is the situation:
I have a simple Datasocket reader VI that sits in a loop. It reads a URL (with a 10s timeout) and then waits 10 seconds and then reads the URL again... over and over. The URL is on the localhost and the datatype is a simple integer.
I also have a simple Datasocket writer VI that writes an integer to this URL once and then stops.
If I run the Reader VI, it will sit in a loop and read the URL over and over. If I run the Writer VI, it updates the URL once and the Reader will correctly read the integer.
This works fine in LabVIEW... but if I compile any one of the VIs (or both) into an EXE and run it, then they refuse to communicate properly. I have attached example VIs and executables that can easily reproduce this problem. Here is are detailed instructions to reproduce the problem:
1. Open "DS Reader.vi" and run it inside LabVIEW. Note how it will continually timeout because nothing has been written to the URL.
2. Open "DS Writer.vi". Wait until the the DS Reader displays the "Waiting 10 seconds" text and then run "DS Writer.vi". It will write an integer to the URL.
3. Notice how the "DS Reader.vi" will then read this integer. This is fine.
4. Let "DS Reader.vi" continue to run. You will notice that subsequent iteration will timeout because the URL has not been updated.
5. Wait until the the DS Reader displays the "Waiting 5 seconds" text again and then double-click on "DS Write.exe". It will open and run and write an integer to the URL just as the VI did previously. However, you will now notice that the "DS Reader.vi" does NOT receive the update. In fact, it never receives any updates.
Am I misunderstanding the logic of how datasockets works? Or am I doing something totally wrong? Can someone out there confirm this behaviour?
http://www.medicollector.com