I using Labview 2016.
USB Can Bus NI-8473.
Also using the producer consumer loops in my program.
I have a test to perform were I need to change the Can Bus baud rate after the program has been initialise this becaus I need to test different products that need the Can Bus baud rate to be either 250000 or 500000. I would like to be able to this without re-starting the program.
Solved! Go to Solution.
How about not initializing the serial port until you know what unit you are testing? (Select the baud rate when selecting the unit, then init. Close after the unit is finished. Lather, rinse, repeat as necessary.)
Thanks for the insable info. I all ready try to initiliase the Can Bus in the comsumer loop but I coul not get the can bus to talk to any unit I plug into the system.
Post your code so we can offer some good advice.
I also have a USB-8473 so I have the needed CAN tool kit
You need to reset and close the CAN port, set the new baud rate, then re-open it. The code looks a bit like this (I use this particular code when I open an NI-CAN port because if you abort a VI without closing the port first, it will still be open on the next run, and generate an error when you try to re-open it, which this code handles - but it's the same idea for closing and reopening it deliberately in the middle of your program).
I got something similar.
The VI sample is a short version of my large VI. I did not included the Producer Loop
The only I am missing is the reset prior the closing the can. Hope this helps.
I will add the reset to my main vi and try it.