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

Hi salmaiss,

 

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

Does your ECU support such baud rate changes in operation mode?

Read its programming manual and/or ask its manufacturer!

 

When the ECU support such changes then you need to implement an algorithm following the instructions of the ECU programming manual…

 

(You wrote you have multiple devices connected to the CAN bus: ALL of them need to change their baudrate!)

Best regards,
GerdW


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

Hi,

Does your ECU support such baud rate changes in operation mode?

Yes, it supports baud rate change.

when I send a message to change the baud rate the application stop working (closing) and I don't know how to reconnect again

0 Kudos
Message 12 of 21
(2,011 Views)

Many devices can connect at various connection speeds.  What you need to understand is that once the speed is established, generally, it cannot be changed.  A device configuration for 500KBaud that makes a connection from ECU to controller will lose its connection if the baudrate suddenly jumps to 1MBaud as both sides (ECU and Controller) are not changing together.  If the connection is closed, then a new configuration loaded, the connection at 1MBaud may be established.

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

Hi salmaiss,

 

when I send a message to change the baud rate the application stop working (closing)

Which application is stopping and closing? (Why is it closing?)

 

and I don't know how to reconnect again

Restart your LabVIEW VI and use the new baudrate…

 

Is there only one ECU/device on the CAN bus (beside your computer)?

If there are more than one: do all of them use the changed baudrate? (Did you verify that?)

Did you test the CAN bus using some additional CAN bus tester?

 

Best regards,
GerdW


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

Hello,

Is there only one ECU/device on the CAN bus (beside your computer)?

 

there is on ECU

 

If there are more than one: do all of them use the changed baudrate? (Did you verify that?)

NO

 

Did you test the CAN bus using some additional CAN bus tester?

 I use PCAN to check the bus.

 

now when I change the baud rate it's work but I have to change the baud rate in PCAN-View manually.

 

there is any to change the baud rate in pcan-view automatically using labeview?

I use NI USB (high speed can)

* sorry but it's my first project in labeview and I have no experience with it before.

  

0 Kudos
Message 15 of 21
(1,986 Views)
Solution
Accepted by topic author salmaiss

Hi salmaiss,

 

I use PCAN to check the bus.

That's a nice tool , I use it too…

 

now when I change the baud rate it's work but I have to change the baud rate in PCAN-View manually.

Yes.

 

there is any to change the baud rate in pcan-view automatically using labeview?

No.

As has been said several times before: when you change the baudrate you have to stop all running CAN communication and start it over with the new baudrate!

This applies to all devices on the CAN bus: NI-CAN, PCAN interface, ECU…

Best regards,
GerdW


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

Hi Sam,

 

please don't post LabVIEW-specific questions as personal message!

 

Hollo GerdW,

I hope you are fine. could you, please, help me to find a solution to my experiment.

I received a CAN rx message from a unite, that message contains five elements.
the message length 7 Bytes 
from 8 - 24 (bit) I use them  for an element  (1)
and from  24 - 32 (bit) I use them for another element (2)
(other bits using also but there)
now I want to use one bit from (1) and one bit from (2) as flags to color the BG of the elements or not.
could you, please, send me an example or any information that help me.

Use AND functions to mask the bit in those two "elements" (I call them signals) of your CAN message.Compare the result of both AND functions and decide which color to use…

Best regards,
GerdW


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

Hello,

thank you and I'm sorry to post LabVIEW-specific questions as a personal message!

could you please check the attach.

I hope will be more clear my question about using a bit as a flag in Labview.

 

Best Regards;

 

 

0 Kudos
Message 18 of 21
(1,960 Views)

Hi Sam,

 

when you have arrays as cluster elements then you cannot color single elements independently…

You can color the whole array - or you have to use single elements (or use some other tricks like transparent arrays over colorboxes).

 

To mask bits you use an AND operation!

Best regards,
GerdW


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

Hello,

many thanks for you answering.

I have changed the cluster by arrays. but the coloring doesn't work.

could you please check the attach.

 

Regards;

0 Kudos
Message 20 of 21
(1,942 Views)