Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

how to change BAUD Rate dynamically using visa without stopping the program?

Solved!
Go to solution

hello all, i tried to change the baud rate dynamically, and have a weird problem, the code run fine when i execute the uC code with break=points, however, when i remove the breakpoints from uC, LV fails to understand the '@' character which marks the start of data stream and thus, doesn't save the data... what could be the issue? attached are same vi in lv10 and lv8 versions.

Now on LabVIEW 10.0 on Win7
Download All
0 Kudos
Message 11 of 14
(1,386 Views)
Solution
Accepted by topic author LV_Enthu

When something works in highlight mode but doesn't work in regular mode it means you have a timing issue. You are reading data right after configuring. How do you know data is there? Flush the serial port buffer before reconfiguring it. You may also need to flush it afterwards. Put a small delay after the configuration. Try things.

0 Kudos
Message 12 of 14
(1,377 Views)

i changed the vi, basically i introduced a while loop after the re-configuration of the baud rate and things seem to work well, however, another problem... Smiley Sad

i am transferring data from uC to  PC which will be like 1GB or so... when i have the counter in uC range from 0-1024, labview simply fails to detect the '@' value and thus, never saves the data... i have declared this counter variable as unsigned int in uC, so, the counter can go upto 2^16 ...

i am wondering what happens when i change the counter value from 1023 to 1024 and labview just hangs... 1024 = 2^10 ... anything wrong with labview?

also, this same code works great when i don't change the baud rate... i.e. if i have a constant baud rate, i could save 1GB of data...

what could be wrong?

Now on LabVIEW 10.0 on Win7
0 Kudos
Message 13 of 14
(1,369 Views)

figured the prob.. was in lv code..

 

Now on LabVIEW 10.0 on Win7
0 Kudos
Message 14 of 14
(1,362 Views)