LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

RS232 XON/XOFF

Hi, NG!

I'm very new to labview... I try to communicate with a microcontroller by using the RS232
interface. All this happens on a windows box. Therefore I tried to use the serial init
and serial read vi. I'm not able to get it to work without XON/XOFF...

I suppose windows doesn't allow me a direct communication without
software handshake? Am I wrong?

Thanks Radek
0 Kudos
Message 1 of 4
(5,434 Views)
The serial handshaking requirements will depend on how your microcontroller is set up. If the microcontroller requires XON/XOFF, then you'll need to use XON/XOFF (same for RTS/CTS). However, I haven't seen too many (if any?) microcontrollers that use XON/XOFF, so I'm curious as to what is going on.

As far as Windows goes, it doesn't care what the handshaking settings are. You just have to be sure that you are using the appropriate handshaking for your device (microcontroller).

Are you using the traditional serial vi's or are you using VISA?
0 Kudos
Message 2 of 4
(5,434 Views)
> The serial handshaking requirements will depend on how your
> microcontroller is set up. If the microcontroller requires XON/XOFF,
> then you'll need to use XON/XOFF (same for RTS/CTS). However, I haven't
> seen too many (if any?) microcontrollers that use XON/XOFF, so I'm
> curious as to what is going on.

On the controller I wrote two routines. The first uses XON/XOFF to
communicate with the PC and works fine, the
second doesn't use any handshake method and doesn't work. I suppose that
labview uses the windows low-level driver whitch seems to use XON/XOF by
default with no possibility to switch it off...
The XON/XOFF switch in the (traditional) serial init vi In the
traditional serial read vi has no effect on the communication.

> As far as Windows go
es, it doesn't care what the handshaking settings
> are. You just have to be sure that you are using the appropriate
> handshaking for your device (microcontroller).
>
> Are you using the traditional serial vi's or are you using VISA?

By the way, where is the difference between traditional serial vi's and
VISA? (Newbie question)

Thanks

Radek
0 Kudos
Message 3 of 4
(5,434 Views)
The Windows driver (serial.sys for example) and the NI-Serial driver should be obtaining the default port configuration from the port settings in the device manager. Thus if XON/XOFF is selected as the default state in the device manager, then XON/XOFF will be turned on whenever a port opens.

As far as flow control with the traditional serial vi, I do know that there are some problems with those vi's and flow control (as in, it doesn't work). There are quite a few shortcomings/bugs with these vi's, and thus National Instruments' recommendation that all serial communication use NI-VISA. The VISA communication vi's are much more powerful than the old traditional vi's and offer a much wider range of configuration and monitoring/status option
s. If you switch over to NI-VISA calls instead of the traditional calls you should get full control over the flow control settings. You'll also be able to use NI-Spy to debug your communication problems.

Speaking of communication problem, by "not working" do you mean no data is seen, data is corrupted, or something else? XON/XOFF simply is a method of telling the sender to start/stop transmitting when certain characters are sent. Perhaps the XON is never seen? Is it possible to use RTS/CTS handshaking instead?
0 Kudos
Message 4 of 4
(5,434 Views)