11-28-2011 03:57 AM
Hi all!
I try to control stm32 usart by using labview to send USART parameters for example the baudrate. so to make things clear i'll give an example :
initially the stm32 and labview has both 9600 of baudrate,the user chooses 115200 (on labview interface) in order to communicate with this baudrate for the next operation. the problem is that i can't change the baudrate of visa to 115200 because stm32 still configurated on 9600 .
so i got an idea:
- i send the information 115200 without changing the visa baudrate (still at 9600)
-stm32 receive the information 115200 but don't change the configuration of usart (still 9600)because he need to tell labview that he will configurate its USART
-stm32 send (with 9600 baudrate)to labview that he will configurate its USART
-labview already changes its baudrate to 115200 (while stm32 changed its USART to 115200)
==> now the both of them are configurated at 115200 baud
my problems are:
-is this solution the right one?
-if yes how to make labview change the baudrate and make him choose between the old baudrate (9600)and the new one(115200)?
i'll be greatfull if someone helpe me and get me some advices?!
Best regards
Solved! Go to Solution.
11-28-2011 08:45 AM
What you are basically describing is a simple confirmation exchange method. LabVIEW tells the micro to change its baud rate. The micro responds by saying "OK, I'm going to change". Your LabVIEW app then assumes that the micro changed its baud rate, so it goes ahead and changes its baud rate to match. Presumably you have a simple "are you there command" that can be sent to the micro to verify the baud rate change. If not, it's probably worth considering.
As for your question regarding the baud rate change in LabVIEW, one simple solution is close the existing VISA session, and call the VISA Configure Serial Port VI with the new baud rate.