From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

What can cause a hang in a datasocket write

I'm using LabView 2011 in an application that writes 70120 bytes to a Datasocket manager on the local machine twice per second. A remote machine reads those bytes whenever the data is available. Approximately five or six times a day the remote machine reports a timeout error but the local machine does not see any error. I traced the problem to the Datasocket write vi on the server, I put code either side of the vi to monitor the time and the error status and found that it spends 4 seconds in the vi  when the problem occurs but reports no error. I've changed the code to do buffered writes on the server and buffered reads on the client but it makes no difference.

The server runs Windows 2008 R2 and the client Windows 7. Both are 32bit applications.

0 Kudos
Message 1 of 4
(2,325 Views)

Hi Waldo UK,

 

I think I would test the system by running 2 example VI's on the server and client machines their are a few example to be found for the respective task's if you have context help on (ctrl + h) then hover the cursor over the Datasocket write VI then click detailed help.  If you scroll down there is a link to run a simple example VI if you try running this and see if you get the same error we will be able to tell if its your program or the system.  

 

Post back your findings and I will be happy to help further.

Matt Surridge

National Instruments
0 Kudos
Message 2 of 4
(2,300 Views)

Hi,

Sorry it's taken a week to get back, I've tried to be as thorough as possible getting some results. I've attached a picture of the sub vi block diagram that I use to write the data to the local datasocket manager. The sequences either side of the datasocket write are there to record the time before and after the write. To test the operation of the datasocket write alone I replaced the variant input to the writer with a "Hello World" constant, it ran for 24 hours without failing. I repeated this test and tried starting / stopping other services such as Oracle that use the network and found that was also ok. I ran the entire system again and the problem reoccured. I stopped each of the four data sources in turn and found after stopping a PXI controller the problem disappeared. Communication with this controller is by a TCP/IP link rather than datasocket.

I have tried changing port nos. etc. but the problem doesn't go away. This PXI controller looks after thermocouple and RTD type measurements and if a channel is not connected it produces NaN errors occasionally. I detect these and trap them but I wondered if it is the "quality" of the data conversion to variant that is causing the writer to hang.

0 Kudos
Message 3 of 4
(2,278 Views)

Just to test the theory that it might be something in the data that upsets the datasocket write I wrote the variant data to a binary file when the hang event occurs. I then read these files into the code that extracts the data from a datasocket read and test the data for NaN. I have searched the data for anything untoward but no luck.

Any suggestions?

0 Kudos
Message 4 of 4
(2,263 Views)