LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Sending Multiple CAN Messages

Solved!
Go to solution

I have tried using the example listed in NI knowledge base but it appears I am missing something

 

The example is listed in this link https://decibel.ni.com/content/docs/DOC-3666

 

 

If you look at the block diagram the VI is capable of pushing multiple messages to CAN at different rates.

 

The part I am a little confused with is the "Write to Data to Bus." section in the block diagram.

 

If you look at the front panel there is an Array called DataBytes which is set to 56, 11.

 

I guess my confusion is I am usure why this is set to these values?  If another CAN message needs to be send what would the second set of values need to be set to?

 

I am able to successfully push one CAN message on to the network but when I add another message I do not see it being pushed on to the network.

 

Eventually I would like to push 20 - 40 messgaes to a CAN network all requiring different sample rates simulating a vehicle environment.

 

I am using a PXI 8464 2 Port CAN interface. 

 

I am pushing the signals out of CAN0

 

I am monitoring the CAN signals on CAN1 through MAX by connecting CAN0 and CAN1 with NI's 2 Meter Can Cable (PN 192017A-02 CAN CABLE 2 Meter 4304 12506)

 

 

Any help would be appriciated

Tim
0 Kudos
Message 1 of 6
(5,078 Views)

So far I have tried some of the existing examples from NI and I cannot send multiple signals over the same CAN BUS.

 

I thought it may have something to do with the CAN messages I imported into MAX so I installed NI's example messages of TransmissionFluids & InstrumentPanel.

 

I have tried to send these messages utilizing the example linked to the previous post but I have not had any success as of yet. Below is a view of my front panel.

 

 

 FrontPanel.jpg

 

 

When I run the VI the bus only recognizes one message being sent as opposed to the two messages I am trying to send.

 

CANBusMonitor.jpg

I have also attached a copy of my bus Port configurations.  I have tried modifying these configurations from low speed to high speed but I cannot read the second message.

 

PortProprties.jpg

Any help would be greatly appreciated.

Tim
0 Kudos
Message 2 of 6
(5,054 Views)

There is also a related article at  https://decibel.ni.com/content/docs/DOC-4663

0 Kudos
Message 3 of 6
(5,051 Views)

Yes I have tried that VI without success as well

 

I created different parameters for the message such as ID's 5 & 7 at a different period and when I push the messages onto CAN I am only able to read 1 Message.

 

I modified the parameters by changing ID 7 to 4 and dropping the period to 40 ms and again I am only able to read one message through MAX (However this time it is message ID 4 not ID 5)

 

I am at a loss why I cannot read multiple messages through MAX.  Is this an issue with MAX?  How else can I verify that multiple messages are being pushed onto the network?

 

ID5Bus.jpg

 

 

 

 

 

ID4Bus.jpg

Tim
0 Kudos
Message 4 of 6
(5,039 Views)
Solution
Accepted by topic author smoothdurban

I was able to push multiple message by making the following changes.

 

Setting the Baud rate to 500,000 kb.

 

Setting both CAN ports (CAN0 for writing and CAN1 for reading) to highspeed.

 

And finally adding an ECU to the network.  Not really sure why this worked other then the fact that it may have created the medium for the messages to be transmitted.

 

Thanks everyone for their help 😉

Tim
0 Kudos
Message 5 of 6
(5,021 Views)

How do you add ECU to network?

0 Kudos
Message 6 of 6
(3,141 Views)