LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

RS232; can't set input queue size

I'm having difficulties setting the queue size of the serial port. I used a property node to look at the 'default size' and I got 50. In my port initialization, at the beginning of my program, I put a property node specifying a larger queue, like 1000. The other property node in the program reads the 'queue size' of the port, but always report 50.

What is interrresting, is if I change my port from COM1 to COM2 in the 'Visa Configura Serial Port' vi and run my vi, the property node will show my new buffer size (1000). If I stop the program, change the buffer size to something else and restart, the property node will still show 1000, not the new value.
If I put back COM1, then, the new value will show correctly. It seems to accept a new value only when a new port is specified.

Why can't I change the size of the input queue length using a property node??

I'm using WinXP.

Thanks.
0 Kudos
Message 1 of 5
(3,687 Views)
How are you setting up your serial communication? Are you wiring the "Bytes at port" value into your "byte count" on a "VISA read" tool?

Can you show a sample of your program? I don't have a lot of LabView experience personally, so I can't promise much, but the program I've been working on does a lot of serial communication, so hopefully whatever you're stuck on is something I've made it through somehow!
********************************************
Amateur programmer for over 10 years!
********************************************
0 Kudos
Message 2 of 5
(3,669 Views)
What exactly are you trying to do? The queue length and buffer size are two completely different things. The queue length deals with the number of VISA events that may be queued. To set the size of the serial port input buffer, you use VISA Set I/O Buffer Size. To determine how many bytes are in the serial port buffer, you use VISA Bytes at Serial Port.
0 Kudos
Message 3 of 5
(3,662 Views)
Bingo!
This is the function I was looking for. The vi called: 'VISA Set I/O Buffer Size'.
What I want to do is increase the input buffer size just in case there is a big steam of data coming in, and my program can't keep up with it. I had some lost characters once in a while. I'm not sure it's related to the buffer size, but I want to try it first to rule that option out.

I don't know why I didn't see that vi, I probably was too convinced that this could be done with a Visa property node.

Thank you all for the answers.

Michel.
0 Kudos
Message 4 of 5
(3,650 Views)
Hope that VI's the answer!

If that doesn't work, if your data always has the same terminating character you can write your code to look for that character instead of monitoring how many bits of data are arriving.
********************************************
Amateur programmer for over 10 years!
********************************************
0 Kudos
Message 5 of 5
(3,639 Views)