LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Data Limit on Com Port Read?

I am reading potentially large strings from the com port, and no matter how large the string is, there seems to be a maximum number of characters which can be read from the com port through labview at one time(4K) is there a way to change this, I am calling the "Serail Port Read.vi" with the specified com port, and the number returned from the "Bytes at Serial Port.vi", though in my experience this doesn't matter, because it still reads the same whether this number is 0 or 2mb. In short am I stuck reading only 4K characters at one time, or is there a way to fix this. Also I have a sequence frame before this one which has a delayed loop, and will compare the byte count from the current iteration of the loop with the byte count from
the previous iteration in order to make sure that bytes are not still arriving at the port. But apparently this seems to stop at 4K as well. Can someone please help?
Thanks.
0 Kudos
Message 1 of 5
(2,451 Views)
I had a similar problem with the limitations in the Serial Port Read.vi. I ended up writing my own DLL in Visual C++ and calling it from LabView. It wasn't as hard as it sounds. I used example code from Microsoft and modified it.

Does this sound like a viable solution for you?
-Matt Bradley

************ kudos always appreciated, but only when deserved **************************




Message 2 of 5
(2,451 Views)
I accomplished it using a second string buffer and reading the 4K each time, and then concatonating it onto the main string. It was a pain, but oh well.
0 Kudos
Message 3 of 5
(2,451 Views)
There is a potential problem you should be aware of. You may lose some bytes if the buffer is full and you don't read it. Might not be a problem, but I thought you should know.
-Matt Bradley

************ kudos always appreciated, but only when deserved **************************




0 Kudos
Message 4 of 5
(2,451 Views)
Take a look at some very well written serial port VIs contributed by Dave Thomson.

http://www.originalcode.com/occdl.html

These should help you get on the right track for serial port programming.
Serial programming is not as trivial as one would expect....

Alan



"Marshall GaTech" wrote in message
news:506500000008000000F5470000-1019262487000@exchange.ni.com...
> I am reading potentially large strings from the com port, and no
> matter how large the string is, there seems to be a maximum number of
> characters which can be read from the com port through labview at one
> time(4K) is there a way to change this, I am calling the "Serail Port
> Read.vi" with the specified com port, and the number returned from the
> "Bytes at Serial Port.vi", though in my
experience this doesn't
> matter, because it still reads the same whether this number is 0 or
> 2mb. In short am I stuck reading only 4K characters at one time, or
> is there a way to fix this. Also I have a sequence frame before this
> one which has a delayed loop, and will compare the byte count from the
> current iteration of the loop with the byte count from the previous
> iteration in order to make sure that bytes are not still arriving at
> the port. But apparently this seems to stop at 4K as well. Can
> someone please help?
> Thanks.
0 Kudos
Message 5 of 5
(2,451 Views)