08-23-2011 05:56 AM
I'm develloping RT application that communicate with CAN device with J1939 protocol and extended CAN frames through CRIO and 9853 CAN module.
I look at J1939 Protocol reference example to help me achieving my project.
All is working fine but i want to know why when i'm using the 9853 Module i need to use Bit mask (AND 0x1FFFFFFF for READ and OR 0x20000000 for WRITE)
As you could see on NI example ...(for WRITE)
Why we need to use this both mask to have the correct CAN Frame ID on the network ???
It doesn't blok me ... but i like to understand why i need to add this code ...
Hope someone will have the answer.
Romain
Solved! Go to Solution.
08-23-2011 07:34 AM
That is how you indicate to the CAN controller that the ID is an extended (29-bit) ID instead of a standard (11-bit) ID.
Standard ID 10 would be 0x0000000A
Extended ID 10 would be 0x2000000A
08-23-2011 07:48 AM
I was just suprised that FPGA Node "CAN Read" could give ID such as 0x38FF50D0 instead of 0x18FF50D0. 0x38..... contain more than 29 bits. Of course it need to be masked. I just though that ID will be automatically masked before receiving it as 32 bits number with FPGA Node.
But i had already understood that the mask used cover 29 bits of extended ID format 🙂
08-23-2011 07:58 AM
The read uses the 30th bit to indicate whether the ID is standard or extended. Otherwise, if you received ID 0x0000000A, you wouldn't know if it was std or extended. For higher numbers (> 11 bits) it is obvious, but the flag is set regardless so you don't need multiple branches.