Automotive and Embedded Networks

cancel
Showing results for 
Search instead for 
Did you mean: 

Transmit Time in database for CAN Frame being ignored

Solved!
Go to solution

Hello,

In the help for XNET Create Session (Frame Output Queued).vi it states "For this mode, NI-XNET transmits each frame according to its properties in the database". I have a FIBEX database xml, with a single CAN cluster @1 MBaud.

 

For a particular Frame witihn the database that has Timing Type = 'Cyclic Data' and Transmit Time = '0.02 s' I am expecting that this would cause frames to be transmitted at 50Hz.

After a single XNET Write (Frame CAN).vi which is passed a single Frame with the correct Payload length (XNET Frame CAN.ctl type), this starts Frame transmission continuously, which can be seen being recieved using the NI-XNET Bus Monitor.

 

Bus Monitor Frame showing rate @ ~800 to 900 Hz rather than the expected 50Hz.

 

This is using CAN1 to CAN2 of an NI USB-8502

Running LabVIEW 2020 with 2020 XNET on Windows 10.

 

What could be missing from my setup please?

0 Kudos
Message 1 of 6
(2,340 Views)

Can you post the screenshots of the Database Editor on the frame you are transmitting and the Bus Monitor showing the frame received?

I suspect that the 800-900Hz frames are not the frames you transmitted through another port but the error frame. What is the ID of the received frames? Did you add or enable the termination resistor?

-------------------------------------------------------
Control Lead | Intelline Inc
0 Kudos
Message 2 of 6
(2,315 Views)

I also would like to see some code.  But I think you are using the wrong session type.  If you want it to continually send it at a specified rate with a single write, it sounds like you want a Single Point session type.  Here is a blog post where I go over some of them, from the read perspective.  CAN Blog Part 6. If you use the Queued or Stream you will need to keep writing multiple frames over and over, and one will be sent at a time at the specified rate.  

0 Kudos
Message 3 of 6
(2,308 Views)

Thank you for your post.

 

Bus Monitor.png

Above is actually showing 7000Hz for the Frame rate being recived. Termination at the Bus monitor end is On (using unterminated NI cable)

DB setup.png

  

Database setup above.

 

This is running on my LabVIEW 2023 Q1 machine. The Transmit side also sets Termination to On using session property node.

The IDs match ok as shown above, and the number of payload bytes received is as expected (as well as the default signal values).

 

I have also tried using Frame Out Single-point for the Session creation (passing array of Cyclic frames) instead but gives the same issue.

0 Kudos
Message 4 of 6
(2,302 Views)
Solution
Accepted by AndyJD

Okay is the bus monitor set to Listen Only?  The way the CAN bus works is a device will send a frame, and then wait to see if someone on the bus acknowledges it.  If no one does, then it sends it again as fast as it can until it gets a response.  If there are no devices on the bus, and the bus monitor is set to Listen Only, then it won't acknowledge a messages.  This can also be fixed by just having any other CAN device on the bus set to not Listen Only.  This can be set the configuration window of the bus monitor.

 

I mention some of this in Part 2 under the Automatic Re-transmit section.

Message 5 of 6
(2,297 Views)

Thank you so much. Yes, turning off 'Listen only' fixed this issue. Realise now that usually the Bus Monitor should just be there to observe/monitor, but if there are no real ECUs on the network then as you say there's no acknowledge. I am very new to CAN.

Have previsouly read your blogs and have been very useful.

0 Kudos
Message 6 of 6
(2,286 Views)