LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

close and reopen serial port with other baud rate

Hi LabVIEWers,
 
In my project I have to send a kind of kernel to a device, via RS232 with 19200 baud.
Then I have to start the kernel (sending an ´S´ to the device, still with 19200 baud.
After this point I have to change the baudrate to 115200, and with this baudrate continue the communication. After speed change I send a "P" character to the device (a kind of ping), and the device should respond with 0x55. Normally this vi doesn´t work. BUT....
...if I set a breakpoint before the speedchange -> start the vi and wait until it comes to the breakpoint -> click CONTINUE on toolbar, ans IT WORKS! When I remove the breakpoint, it doesn´t work. I have tested this 100 times, this is reproducable.
 
I already tried to insert a wait instead of the breakpoint, but it doesn´t help.
 
What should be the problem?
 
regards
MB
0 Kudos
Message 1 of 7
(3,391 Views)

Hi!

Please send your vi, so we can get clear idea (about sequence 0,1,2..).

Whay everytime you are configuring serial port before writing and reding charcters???

0 Kudos
Message 2 of 7
(3,386 Views)
Clearly, the device needs time to receive the S, react and reset its own baud rate. I can't see a reason why it should not work with a proper delay in the false case. How long did you wait?
Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
0 Kudos
Message 3 of 7
(3,374 Views)
interlinked
- Partha ( CLD until Oct 2027 🙂 )
0 Kudos
Message 4 of 7
(3,345 Views)
Sorry, this one here.
- Partha ( CLD until Oct 2027 🙂 )
0 Kudos
Message 5 of 7
(3,340 Views)
Hi Parthabe,
   seems that you interlinked too Smiley Very Happy

graziano
Message 6 of 7
(3,329 Views)
Hi!
   the title of your post let me think that you opened and closed properly VISA port.... now that I see the code (even if as image) I'd suggest to close and open VISA in place of the breakpoint.  With my VI it works.


graziano
0 Kudos
Message 7 of 7
(3,327 Views)