C185 CAN Transmit Message Setup

D153, D175, C125, C127, C185 and C187 forum

Re: C185 CAN Transmit Message Setup

Postby SOReilly on Wed Aug 09, 2023 10:14 am

Sometimes it can be helpful to represent it in binary to get a better visual representation of the data.

As an example -1 represented in 16 bit signed is 1111 1111 1111 1111. The hex representation condenses this to FF FF.

Unmasked this would be transmitted as shown above but it can be masked which essentially overwrites the bit value to 0. 65 72 in binary is 0110 0101 0111 0010, so any bits which are 0 in the mask value will be overwritten as such and any bits which are 1 in the mask will be unmodified from the original value.

Basically this is just a clever way to transmit any value we like without needing to use an existing channel value.
SOReilly
MoTeC
 
Posts: 90
Joined: Wed May 04, 2022 12:28 pm
Location: Melbourne

Re: C185 CAN Transmit Message Setup

Postby MalcolmG on Fri Aug 11, 2023 8:33 am

Of course a simpler option is just to have the constant value of "1", and use the multiplier to set it to the value you desire. Not quite so clever, but much easier to understand for anyone who isn't familiar with 2's complement binary values and doesn't properly understand bitmasks (you will however have to convert your hex values to decimal to enter them into the multiplier field)
MalcolmG
Pro User
 
Posts: 77
Joined: Fri Dec 18, 2015 1:34 pm
Location: Auckland, NZ

Re: C185 CAN Transmit Message Setup

Postby SOReilly on Fri Aug 11, 2023 9:32 am

Or you could use a constant of 0 and use the adder of the decimal value you need to transmit. All methods will work it's just different ways of approaching it.
SOReilly
MoTeC
 
Posts: 90
Joined: Wed May 04, 2022 12:28 pm
Location: Melbourne

Previous

Return to Colour displays

Who is online

Users browsing this forum: No registered users and 27 guests