LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

tcp/ip client hanging up

Hello Everyone
 
I have this C++ server sending variable size data (64 bytes, 164 bytes, 228 bytes etc) every 100ms. I am connected fine with a labview client vi;  using the "read TCP from LV" the problem is I can only read exact amount of data (and I am missing some data). I will need to specify a number bytes on "Bytes to read" input.
I would like to use the "Immediate" input option on the "mode" input and hopefully the client will adjust itself and read all the data coming from the server however I get zero when I switch to "immediate" mode  and I heve to switch back to "standard" mode input on TCP read icon. 
 
Thank You Very Much
 
0 Kudos
Message 1 of 2
(2,619 Views)

Togos,

I found some very helpful suggestions in the LabVIEW help about TCP Read.  I think the best would be to prepend the number of bytes the data is going to be to the C++ server output.  Then in LabVIEW you can set up two TCP Read functions: one to read the number of bytes and the other to read the rest of the data.  This would only be a solution if you had access to the code for your server though.  If you don't have access you could have the maximum bytes to read as your Bytes to Read input and shorten the timeout value.  You can then clear the timeout error you get to prevent popups and hopefully get all of the data that you need.  I would recommend checking out the help file for more specifics. 

Hope this helps!

Andy F.

-----------------------------------------------------------------
National Instruments
0 Kudos
Message 2 of 2
(2,605 Views)