LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

change Can Bus Baud rate after run the program (after initialize)

Solved!
Go to solution

Hello,

I using Labview 2012 and Can Bus.

After the program has been initialized, how I can be able to change the host CAN baud rate and maintain host communication.

 

 

 

0 Kudos
Message 1 of 21
(4,364 Views)

Hi Salmaiss,

 

have you tried to search the forum?

You would find topics like this

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 21
(4,344 Views)

Hello,

could you please send me the file with the version labview 2012

 

Regards;

 

0 Kudos
Message 3 of 21
(4,350 Views)

Hi salmaiss,

 

this is the core routine:

check.png

All you need is the ConfigCANnet function (found in old NI-CAN Frame API)!

(I hope you are using NI CAN hardware…)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 21
(4,346 Views)

yes I did that but still, when I change the baud rate after running the application I miss the connection

 

0 Kudos
Message 5 of 21
(4,338 Views)

Hi salmaiss,

 

I joined your questions to keep things in one place…

 

when I change the baud rate after running the application I miss the connection

Well, both ends all devices on the CAN bus have to use the very same baudrate. And usually you don't change the baudrate after starting a communication…

So what is your real problem? Can you explain with more details?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 21
(4,331 Views)

Hi,

when I change the baud rate I send a message to the all  devices to change the baud rate also,

so my question to be able to change the baud rate on all devices using CAN message after running the app.

 

0 Kudos
Message 7 of 21
(4,328 Views)

Hi salmaiss,

 

when I change the baud rate I send a message to the all  devices to change the baud rate also

It's quite hard to read your block diagram because you don't use AutoCleanup as often as needed…

Which "devices" are you talking to?

Do those devices understand the CAN message your are sending?

Are they receiving that message?

Do they answer with an OK or ERROR status?

 

my question to be able to change the baud rate on all devices using CAN message after running the app.

You need to read the manual of your devices to learn how to change their CAN interface baudrate!

 

Usually I have to power off/on devices before they start to use a different baudrate. And usually you don't change the CAN baudrate after a communication has been established…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 8 of 21
(4,324 Views)

Generally, the baud rate is setup up on opening the database.  The connection cannot occur if the connection parameters are not set properly.  Likewise, Connection parameters should normally be changed after closing the current connection and before the next.

 

In your attached PNG file, their is no apparent flow control on where your sub-vi (5) occurs in the process.

Help the Community (and future reviewers) by marking posts as follows:
If it helped - KUDOS
If it answers the issue - SOLUTION
0 Kudos
Message 9 of 21
(4,307 Views)

Hello,

 

thank you for the prompt reply,

the project which I'm working is:

there are a host and ECU connected by CAN.

I want to know if there is any way to change the baud rate between the ECU and the HOST after initialized the app.

0 Kudos
Message 10 of 21
(4,289 Views)