12-07-2018 01:56 AM
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
12-07-2018 07:39 AM
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.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
12-07-2018 08:31 AM
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
12-07-2018 10:41 AM
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.
12-10-2018 03:02 AM
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.