LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

When does an array end? for TCP

Hello,

I have a numeric control which is an array.

I have noticed that I can stretch this with the pointer, and there are
more elements to the array.

However, that array is written to a labview TCP socket.

I know that when I code in 'C' and use sockets, that I MUST inform the
WRITER how
many bytes are being sent into the socket to be received, on the other
end, by the server.

However, with labview, the WRITE does NOT have a #-of-bytes-to-write
input wire.

This is now a problem because my server is NOT reading the data properly
from labview.

I fear it is because the digital controlling array does not have a size
limit?

So...

When I wire an array into a TCP socket, to write to it, HOW does it know
how many
of those seemingly endl
ess array elements to write?

Does an array have an end?

tom
0 Kudos
Message 1 of 2
(2,293 Views)
Certainly the array has an end. Since LabVIEW knows the number of elements in the array, it will send them all. If you want to limit the number, you must take the subset of the array before sending it into the TCP socket. If you need the receiver to know how many are coming, you must take the array size yourself and write it to the socket, before the data. This is very similar to raw file IO. the only things sent are what you send it.
Stu
Stu
0 Kudos
Message 2 of 2
(2,293 Views)