LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Datasocket connectivity issue

Hi all,

 

I have got two applications, a Server (that is connected to Embedded Device sensoring Temperature and Humidity), and a Client that recieves this information. Now the way which I have these applications working is that BOTH have the ability to Read or Write. The Server needs to Write Temp and Humid information, and the Client needs to Read these values. But also the Client needs to Write Control information (such as Turn on fan, turn on heater, turn on humidifier etc) and the Server needs to Read these values (and process, then pass them down to the Embedded device).

 

In order to do this I have set up two DataSocket connections on each application, one for Read and other for Write. They worked fine with a 'localhost' connection, but I am now testing it with two different computers over my home network.

 

The problem is the Server is to be running and Connected (waiting for the Client to connect), when I connect the server the client recieves information fine, but when I try to send control information via clicking a button, the Servers error message displays (using the DS_GetLibraryErrorString I think) "Error: Not Connected: Connection timed out.".

When I then Disconnect and Re-connect the Server everything works fine. But obviously I want to be able to prevent this situation, any ideas??

 

I can post code if need be.

 

Much appreciated

 

Rhys

0 Kudos
Message 1 of 6
(3,481 Views)

Hi Rhys,

 

If you could attach your code (or a stripped down version of it that achieves the behaviour) along with the version of LabVIEW you're using that'd help hugely.

 

Thanks,

Applications Engineer
0 Kudos
Message 2 of 6
(3,454 Views)

Thanks,

 

I have attatched code as suggested, and my LabWindows CVI is version 9.0

 

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

Hi Rhys,

 

That's a damn good name you've got there by the way, Rhys.

 

I've tinkered about with your project and managed to get it to connect first time on my PC. I've done this by including some files from the CVI folder into your project, then re building.

 

But once your code was running I wasn't able to get much functionality out of it except for the boolean buttons. Was this an issue just on my side?

 

I've attached the editted project in a zip file, and also a picture showing where I found the .fp and .h datasocket files I included.

 

I hope this works your side too! Have a great weekend now.

Rhys
Applications Engineer
National Instruments
Download All
0 Kudos
Message 4 of 6
(3,381 Views)

Hi again! not sure if you've managed to get the fix working?

 

I'll stay subscribed and keep a look out for a response. Otherwise I hope the application goes well!

Rhys
Applications Engineer
National Instruments
0 Kudos
Message 5 of 6
(3,332 Views)

Hi Rhys,

 

Your right, such a brilliant name!!

 

Much appreciated for your help, I have just come back from hols, and straight into Project write up work so at this time I have yet to test it out, but should do by tomorrow and I will let you know.

 

Thanks again

 

Rhys

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