When the data received on my CAN message exceeds 327.67, it flips over to -327.68. Why is this happening?
The reason it is overflowing like that is because it is a 16bit signed number. All channels in the Dash are signed so for it to work correctly you have to force it to be a 32bit number. The way to do this will depend on where in the CAN message the channel is positioned. I have attached an image with some examples of how to set the Offset, Length, Mask and Divisor depending on where the 'Fuel Used' channel is positioned.
One thing to note, if the channel is positioned in byte 0, you will have to use advanced maths to get the correct divisor. In this case you need a divisor of 65536, but the divisor parameter in the CAN template has a maximum value of 32767.
The reason for the divisor is that the mask works as an 'AND' on the channel, not a bit shift.
The signed/unsigned tick box still needs to be selected correctly depending whether the channel being received is signed or not.
Comments
0 comments
Please sign in to leave a comment.