LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

using TCP in reentrant VIs

Solved!
Go to solution

I am trying to transfer data between my PXI system to my PC over ethernet.  My PXI hard disk contains gigbytes of data in multiple files for 9 buses.  I am opening a TCP port for each bus and transfering all the files from that bus via its own TCP port.  The TCP ports are opened at the beginning of the application and closed at the end of the end of the application.  The enclosed VIs can be called anytime the application is running. 

 

TgtDownload.vi takes the unique information of each bus and initiates simultaneous calls, in parallel to TgtReadFiles.vi.  TgtReadFiles.vi is a reentrant VI.  On the host side; HostDownload.vi takes unique information of each bus and initites simultaneous calls, in parallel to HostFileWrite.vi, which is also a reentrant VI.  The VIs work except for bus 5.  TgtReadFiles never finishes, however, HostFileWrite does.  This happens only for bus 5.  All the other buses work perfectly. 

 

The TCP port selected are:  6000, 6100, 6200, 6300, 6400, 6500, 6600, 6700, and 6800.  The TCP chunk size is 38400 bytes.  I've changed the TCP port for bus 5 from 6500 to 6550, with no success.  The TCP Read function seems to think the port is closed (error 66).  However, that does not happen until the application is quit.

 

I've read the KB http://zone.ni.com/devzone/cda/pub/p/id/1020.  Is this a better way of creating my parallel loops?  Is there a better way of transfering data in parallel over TCP?  Suggestions on how to debug a reentrant VI.

0 Kudos
Message 1 of 2
(2,168 Views)
Solution
Accepted by topic author faustina

Are you sure your array of files sizes are correct and match in both the download VI's?

 

You have a timeout of -1 on the TCP/IP functions in both the hostwrite and targetread VI's.    If one of those values don't match, then the TCP/IP read could be waiting forever for one more byte that never gets sent.  It would explain why you would only have a problem with one bus and not the others.  The mismatch in sizes between the host 2-D array and the target 2-D array would only be in row 5.

 

0 Kudos
Message 2 of 2
(2,164 Views)