Automotive and Embedded Networks

cancel
Showing results for 
Search instead for 
Did you mean: 

Creating XNet database Multiplexed CAN signals

I'm trying to create a database to send and receive a signals. My understanding from the specification is that the signal will have to be multiplexed in order to communicate with the device. 

The CAN interface utilizes 11bit identifiers and can be configured to operate at a baud rate of 125kbps or 250kbps. The  controller is assigned CAN ID 0x10A(266) and responds with CAN ID 0x10B (267)

I've attached the spec of the signals to be multiplexed and some of my database screenshots.  When I try to communicate with my device using the attached configuration, it doesn't work and I'm not sure if I set up my database correctly.

 

Thanks

Download All
0 Kudos
Message 1 of 8
(5,366 Views)

From what I can tell it looks like the database is setup according to the spec document. Have you tried using the XNET bus monitor in subordinate mode to monitor what is actually being sent to your ECU? Knowing what is actually being sent on the bus will help us to target our troubleshooting efforts. You can attach a log file or screenshot to the post.

Jeff L
National Instruments
0 Kudos
Message 2 of 8
(5,362 Views)

I have tried running bus monitor but I don't see any communication. How do you set up bus monitor in subordinate mode?  Also, I'm using the single port NI 9862 c-eries CAN module.

0 Kudos
Message 3 of 8
(5,359 Views)

For a cDAQ chassis we will open the bus monitor (BM) and select the local interface. Next we will cick on settings -> Interface and Database Settings. There is a drop down text box called Rum Mode that we will want to set to "Subordinate" and we will want a check mark in "Log Transmitted Frames".

 

Subordinate mode will piggy back the BM on top of your application and use the baud rate, termination, etc properties that your application sets.

 

 

If the BM is not an option, you can also configure the XNET echo transmit property, setup a frame stream input session, and include BM functionality in your own appliaction. The Frame Stream Input example is a good starting point for this approach.

 

 

Jeff L
National Instruments
0 Kudos
Message 4 of 8
(5,357 Views)

Hi Jeff,

 

I was able to set up BM as you described and I have attached the screenshot of the communication data. I don't see the multiplexed frames in it. As matter of fact, there don't seem to be any data transfer occurring which leads me to believe that the CAN database might have been set up incorrectly.  Can you look at the Request command in the data base screenshot?  I'm not quite sure if it is correct.  Anyways, take a look at BM and let me know what you think.  

 

Thanks

0 Kudos
Message 5 of 8
(5,353 Views)

It appears as though frame ID 0x10A is being sent out first as we would expect. The problem is that the first byte contains 0x00 instead of the 0x40 we are expecting. Since the database organizes the structure of the data but does not control the actual data being sent on the bus, we will need to take a closer look at how you are writing to the CAN bus.

 

I don't know how you are writing your data (frame or signal API) so you will have to check and make sure that you are providing data (0x40 for byte 0) in the call to XNET Write.

Jeff L
National Instruments
0 Kudos
Message 6 of 8
(5,343 Views)

Hi Jeff,

 

I'm using a CAN example VI that shipped with LabVIEW. I've attached a screenshot of the VI with my input and output frames included. I write to the CAN bus by clicking on the write button with 40 as the payload at byte 0.

The VI is CAN Frame Input Output Same port Single point.  Can be found under HW input and output-->CAN--->XNET---->Intro to Sessions-----> Multiple sessions

 

See attachment.

 

Thanks

0 Kudos
Message 7 of 8
(5,341 Views)

Very strange. I would expect the bus monitor to show the first byte being sent as a non-zero value. I created a little ECU simulator and tested your database and example against it without any issues. Your database appears to be setup properly and multiplexors have no impact on the frame API.

 

One thing we can try is to use a different example(s). If you send out the 0x10A frame via the CAN Frame Output Stream.vi while the CAN Frame Input Stream.vi is running on the same interface what do you see?

Jeff L
National Instruments
0 Kudos
Message 8 of 8
(5,286 Views)