LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

CAN Channel Configuration

Hi,
 
My Test requires that a CAN Signal (i'm transmitting this signal by configuring it MAX in .ncd file) with no.of bits as 56 needs to be configured.i'm able to configure this setting in MAX(it doesn't show an invalid configuration).But when i use this channel(signal) from LABVIEW for transmission, it prompts an error "Maximum no.of bits that can be configured is only 52 for integer channel".(Error code:-1074388547)
 
Here i'm more curious why the limit is 52?(How this limit is fixed?).Since it's showing limit for integer channel,even i can't change data type to IEEE float(as it takes all 64 bits & i have 2 signals for configuration)
 
I can reduce no.of bits from 56 to 52.but that will just clear error,but my data also may be truncated.
 
My signal properties are this:
Signal 1
Channel Name:MSG
Start & length of bits:0 & 2
Data type:unsigned
Signal format: Motorola
 
Signal 2
Channel Name:DATA
Start & length of bits:56 & 56
Data type:unsigned
Signal format: Motorola
 
Kindly clarify on the above.
 
Thanks & Regards
-Murali.
0 Kudos
Message 1 of 3
(2,641 Views)
Not sure if this is related to your problem, but if you only have 7 data bytes (7*8 = 56 bits)  then surely your bits will run from 0..55 (i.e. bit 55 is the 56th bit)

0 Kudos
Message 2 of 3
(2,637 Views)
Hi Murali,

Internally NI-CAN uses a 64-bit double to store Channel values regardless of the type. As a 64-bit double has a mantissa of 52 bit (one bit is the sign, the remaining 11 bit is the exponent), one would get incorrect (truncated) data if more than 52 bit are allowed.

It causes additional programming work, but you could split up the 56-bit channel into two separate channels and add their individual values to get the correct value (this requires some additional math to have your program merge the two 'half channels' into a correctly scaled one).

-B2k
0 Kudos
Message 3 of 3
(2,616 Views)