LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Trouble with sending huge arrays via DataSockets.

Hi,
I am having trouble sending huge arrays via Data Sockets from my main vi on the server PC to the vi on the client PC.
To further elaborate, in my main vi program I have created 3 arrays called Array1, Array2 and Array3 on my front Panel. By right clicking the mouse on each set of array and from the pop-up menu I selected Data Operations-> DataSocket Connection and I entered dstp://localhost/Array1 and clicked on Publish to broadcast the data from Array1. Similarly, I did the same for Array2 and Array3.

Now, in my client vi program I have created three arrays on my front Panel to read (Subscribe) the data from the three arrays broadcasted via DataSockets from the server’s main vi program. To subsc
ribe the data I did the similar process above and clicked on Subscribe to read the data (of course the IP address of the client PC will be different then the server PC so enter the hosts IP address). Once the data is received in the client arrays, I am using LV2 globals so that I can use these arrays on other sub-vi’s locally (instead of having each sub-vi get data from the server directly).

I succeeded in doing this with two arrays, however when I added the third array the DataSockets would not work consistently. For example the refresh rate would get slower at times and sometimes 2 out of the 3 arrays would update. I don’t know if I have exceeded the limit on how much data DataSockets can broadcast, but I need to have some mechanism to broadcast 6 arrays (approx. 10000 elements for each array) of double digits precision.

Has anyone come across this issue? Is there another way of broadcasting data more efficiently then DataSockets?

I would appreciate any
help that I can get.

I have attached the files for this program in the zip file.

First run the Server main program, testServeMainVI.vi, and then the client program, testClientMainVI.vi.

Thanks
Nish
0 Kudos
Message 1 of 5
(2,428 Views)
Hi Nish,

Maybe you can try the "flattern to string" VI and send the string instead of arrays.

The VI is under Advanced/Data Manipulation. On the client side, use "unflattern from string" VI.

Hope this helps.

Dan
0 Kudos
Message 2 of 5
(2,428 Views)
DataSocket can be a lossy communication. I like the advice to flatten the data to a string, but another option would be to buffer the communcation. The problem might be that the data is being overwritten on the server faster than it is being read. There is an example of buffered datasocket on NI web page: http://venus.ni.com/stage/we/niepd_web_display.DISPLAY_EPD4?p_guid=BA3F9DFED17F62C3E034080020E74861&p_node=DZ52000_US&p_submitted=N&p_rank=&p_answer=&p_source=Internal

Also, I have played with the new built in buffered datasocket in LabVIEW 7.0. It is pretty slick. If buffers the data both on the server and the client side.
0 Kudos
Message 3 of 5
(2,428 Views)
That’s not good news. We are planning to get labVIEW 7.0 and use datasockets. I finally managed to get the datasockets working on labVIEW 6.1. I was able to send 5 arrays with the size of each array 30000 elements (total of 150,000) every second to several clients with no problems. I hope that labVIEW 7.0 can handle this. You would think that the newer version would improve on the performance (speed) of datasockets.
Do you know if datasockets uses any kind of compression technique or smart algorithm to broadcast the data?

Thanks for your response.

Nish
0 Kudos
Message 4 of 5
(2,428 Views)
Sorry I misread your slick as sick. In that case it is good news.
0 Kudos
Message 5 of 5
(2,428 Views)