LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how do i continually monitor the RS232 port without polling?

When i continually poll the port, speed of data being sent out is significantly reduced.
0 Kudos
Message 1 of 5
(4,676 Views)
Hi Craig,
have you tried to 'poll' only the number of bytes at the port with 'VISA Bytes at Serial Port.vi' ?
BTW Look for the version of your VISA driver, updates might improve the performance, or do you use the serial compatibility vis?
Greetings from Germany
Henrik

LV since v3.1

“ground” is a convenient fantasy

'˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'


0 Kudos
Message 2 of 5
(4,676 Views)
How are you polling for data? What are you polling? Are you using the compatibility VIs or VISA?

Are you reading one byte at a time inside of a loop? You could then try reading more than one byte at a time, which should improve things greatly.

What do you want to monitor? The actualy data lines, or something else?

Thanks,
0 Kudos
Message 3 of 5
(4,676 Views)
Hi David,

I'm polling for data using a VISA read in a while loop.

I'm using Labview 7.0 to communicate with a motor controller through the RS232 port, sending commands to move the motor, then read back from the motor controller the position and/or any error codes.

The number of bytes at the port is not fixed, a termination character is used for separation.

Thanks
0 Kudos
Message 4 of 5
(4,676 Views)
When a character is sent to the COM port on your computer, the data is placed in a buffer for later retrieval. The VISA read funtion reads from this buffer, or waits for data if the buffer is empty. The process of filling this buffer is controlled by the OS (as far as I know it`s not hardware controlled).

The funtion mentioned previously "Bytes at serial Port" returns information on whether the buffer is empty or not (which can be assumed to indicate whether transmission has taken place). This function, however, does not wait for a transmission, thus freeing up the computer to do other things while waiting. By placing the "Bytes at serial port" in a while loop (with, say a 5ms loop period), you are freeing up the computer a lot, and
can still (Using a case structure to read bytes if there ARE bytes in the buffer) read any information which comes your way.

This is the recommended way to "poll" the serial port.

Hope this helps

Shane
Using LV 6.1 and 8.2.1 on W2k (SP4) and WXP (SP2)
0 Kudos
Message 5 of 5
(4,676 Views)