Automotive and Embedded Networks

cancel
Showing results for 
Search instead for 
Did you mean: 

XNET CAN: Send Error Frames

Hi,

 

is there a way to send error frames on a CAN-Bus using XNET?

I am able to receive error frames but I haven't found a way to send them.

 

Thanks

Dirk

0 Kudos
Message 1 of 5
(5,290 Views)

So I've actually never needed to do this, but isn't this just the Type input in the XNet CAN Frame?  By default it is an enum with the value CAN Data, change this to CAN Bus Error and write it and I think it sends the error frame.

0 Kudos
Message 2 of 5
(5,270 Views)

Yes, that was my expectation as well. I don't use Labview, but if I do the equivalent thing in the C API (set nxFrameType_CAN_BusError Flag), nxWriteFrame doesn't seem to do anything (I don't see error frames nor regular frames using an external bus monitor).

 

Also this page only talks about receiving error frames, not sending them.

 

Regards
Dirk

0 Kudos
Message 3 of 5
(5,264 Views)

XNET does not provide a reliable way to inject faults/errors on the bus.

If you only need a general fault you can try setting up an interface to transmit a frame with the wrong baud rate and it should result in a bus error. The exact bus error will depend on a number of factors but CRC, Stuff, and Form errors can all be generated with a mismatched baud rate.

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

Thanks for your answer Jeff. Unfortunately, changing the baud rate is not not feasible in my situation because the same interface is used by different XNET-Sessions and different DLLs. If I change the baudrate for one session I would somehow have to synchronize with the other sessions / DLLs and tell them not to transmit while the baudrate is wrong. Otherwise I would get multiple error frames instead of just one. It might be possible but I can't invest that much effort at this point in time.

0 Kudos
Message 5 of 5
(5,248 Views)