07-05-2011 04:10 PM
hello, is there a way i can change the baud rate of VISA Write/Read on the fly?
please let me know.
thanks
Solved! Go to Solution.
07-06-2011 04:59 AM - edited 07-06-2011 04:59 AM
Hi,
There is a property node for setting (and reading) the baudrate setting.
Kees
07-06-2011 08:40 AM
do you mean, i can change the baud rate during the current program is running? i don't want to stop the program, just press a button and a new baud-rate is set!! is that possible?
07-06-2011 08:54 AM
Yes. Though the exact method depends on your architecture. What does your architecture look like? Do you have an event structure? State machine? Polling loop? Have you looked at the shipping examples to see how to respond to events?
07-06-2011 08:57 AM - edited 07-06-2011 09:00 AM
You can change the baudrate on the fly.
I would never do that but it is possible.
An reinitialize of the COM port is a better solution I think.
Like Smercurio said tell us more about your program.
Kees
07-06-2011 09:06 AM
@smercurio_fc wrote:
Yes. Though the exact method depends on your architecture. What does your architecture look like? Do you have an event structure? State machine? Polling loop? Have you looked at the shipping examples to see how to respond to events?
smercurio_fc, I would like to create a program in which the basic initialization to a uC(like sending clock, data download path, and commands which are 1-time only) would be send from LV at a lower baud (say 115k), and later on when i
@want to download data from uC into my cmputer, that would be done @ higher baud, 900k, or so... i would like to make this program event based, but i find event based programming difficult in LV, hence will simply poll the user-input.
07-06-2011 09:07 AM - edited 07-06-2011 09:10 AM
@K C wrote:
You can change the baudrate on the fly.
I would never do that but it is possible.
WHY SO? DOES IT PRODUCE LOT OF ERRORS?
An reinitialize of the COM port is a better solution I think.
WHAT KIND OF RE-INITIALIZE? LIKE USING A VISA CLOSE.vi , AND THEN CALLING VISA CONFIGURE SERIAL PORT.vi?
Like Smercurio said tell us more about your program.
Kees
07-06-2011 09:11 AM - edited 07-06-2011 09:11 AM
I tested this with my USB Com port. But I do not know if it works with every COM port.
Also I think you should flush Rx and TX buffers when changing the baudrate.
And using the Initialize COM port for this is just neather.
Kees
07-06-2011 09:28 AM
@CrackJack wrote:
i would like to make this program event based, but i find event based programming difficult in LV, hence will simply poll the user-input.
What exactly do you find difficult about it? It's quite easy. Have you looked at the shipping examples?
07-06-2011 09:57 AM
in previous programs, i had observed that the program used to get stuck if there is no event occuring and I had timing issues, but it has been a while that I haven't really tried event based programming, i kind of left event based alone~~~... but i will definately give it a shot now...
i did look at the examples... will try to implementusing the concepts mentioend..
thanks