LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Change Baud Rate

Hi!Could anyone tell me the way of changing the baud rate of the serial port from 6500 to 9600 with LabVIEW?thanks!
0 Kudos
Message 1 of 5
(5,032 Views)
Use VISA Configure Serial Port.vi located in Instruments I/O >> Serial .You can also specify other parameters like parity,stop bit etc.
Message 2 of 5
(5,027 Views)
Hi jinyih,
 
I realize that you are asking about the baud rate, however, here is more info on how to setup & use the serial port:
 

For your reading pleasure

http://forums.ni.com/ni/board/message?board.id=170&message.id=111793&query.id=0#M111793

Or, if you're using LV7 and VISA.. :  (It may be too much details, but have a look at the bottom to "VISA Bytes At Serial Port" & "VISA Read")

 

Initializing the serial Port in LV7:

1. Go to the block diagram.

2. In the Functions Palette, select => Instrument IO => VISA => VISA Advanced and place the VISA Open vi on the block diagram.

3. Wire a "VISA resource name" control to the VISA Open vi. Also wire the Error-IN / OUT clusters appropriately.

4. Select the COMM port that you wish to use to connect to your instrument. (ex: COM1).

5. In the Functions Palette, select => Instrument IO => Serial; this is where you will find most of the useful VISA vi's relating to the serial communication.

6. Place the VISA Configure Serial Port.vi on the block diagram. You can wire the settings to this vi. You can use the Context Help for details (it is useful to show the connectors on the vi).

You can start with the following vi's:

a) "VISA Bytes At Serial Port" which indicates how many bytes are available top be read at the serial port buffer.

b) "VISA Write" Wire the string that you want to transmit to this vi. This vi also provides a return count for the number of bytes at the serial port (echoed data for instance).

c) "VISA Read" Reads the serial buffer as an output string. This is where you will want to wire the byte count (as an input) from the two vi's above.

d) "VISA Close" A very important vi, because it closes the communication session to the COMM port. Very useful if you switch back and forth with a software like HyperTerminal.

I think that this should get you going with the serial port communication. You may want to implement some sort of a loop (while for instance) in order to read the data from the serial port buffer until it is empty. Depending on the speed of the communication, you may also want to place a delay within the loop.

JLV

Message 3 of 5
(5,011 Views)
Hi!Thank you guys for the useful tips!have a great day!
0 Kudos
Message 4 of 5
(4,976 Views)

You're welcomed

😄

Message 5 of 5
(4,966 Views)