04-25-2017 07:36 AM
If I setup the same through Bus Monitor send/receive communication works without any error. But when I try to do the same from the above sample program I get bus-off error. There is nothing else on the bus. Also the ECU continues to transmit even though there is a bus error state.
Either I am missing something in my code or some settings are off.
Attached is bus monitor log and following are screen captures for the same.
04-25-2017 04:36 PM
What version of XNET are you using? The UI for setting custom buad rates was introduced in 16.1 but resulting values will work with some older versions of the driver as well.
I did notice that the nxFrameType in your code is set to nxFrameType_CAN20_Data. We can try setting it to nxFrameType_CANFDBRS_Data, although, in my testing it didn't make a difference.
We can also try moving the set point of the arbitration phase to 72.5%, but again, if bus monitor is working I would expect the application code to perform the same way with the same settings.
04-26-2017 02:26 PM
Thanks again Jeff L. Changing the arbitration phase value to 72.5% for "nxPropSession_IntfBaudRate64" resolved this issue.
I am running the latest NI XNET software (16.1) and changing the frame type didn't help because I am writing a standard/classic CAN frame.
Also, this means that the standard baud rate wont work for me and converting it to custom by using these bit timing register values is my only option!