Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

How to dynamically change RS232 baud rate

Dear All,
I have a two timed-loops running on RT target as standard structure everywhere on the NI.com. The fast loop read/write RS-232 data while the slow loop contact host computer to receive cmd.
The problem is the RS-232 baud rate need to be changed on the fly. If I close the port and reopen it in the slow loop, how should I transfer the reference into fast loop then?
Many thanks
 
Feilong
 
 
0 Kudos
Message 1 of 2
(3,791 Views)
Hi feilong,

You should be able to create a local variable to do this easily. You can create a local variable of the baud rate by right clicking on the control/indicator selecting Create > Local Variable. You can then choose to read or write to the local variable by choosing the option when right-clicking on the local variable (Change to Read/Write). You can then drop this local variable down in your other loop, change to read, and you can then access the new baud rate.

Let us know if this works for you!
Rasheel
0 Kudos
Message 2 of 2
(3,762 Views)