BitMask and BitString sensors

FAQs for all GEMS displays

Moderators:R!C0, JonMan, RickS

Locked
User avatar
RickS
GEMS Engineer
GEMS Engineer
Posts:547
Joined:Thu May 17, 2007 11:38 am
BitMask and BitString sensors

Post by RickS » Tue Jan 22, 2013 2:20 pm

Bitmask Sensor

The bitmask sensor is used to mask off bits from a raw (16 bit) input. This is useful when data is received from the ECU that contains information for two different outputs. For example, the lower 4 bits of a value may be used to determine gear position while the upper 4 bits determine diff mode. The bitmask is specified as the sum of all the bits being masked.


Bit String Sensor

When an input has bits that are set, dependent upon a mode in the ECU, it can be useful to convert this into a text string output. The bit string sensor takes the input and compares it with defined bitmasks. The bitmasks are compared in order of priority until the masked input is set, or no more bitmasks are defined. If a masked input is set, the corresponding output string is passed out of the sensor. If no bitmask matches the input an empty output string is passed.

To create a bit string sensor, add a name for the sensor in the Bit String tab and click on the (...) button to show the bit string editor. The priority determines the order in which the bitmasks are evaluated with low numbers being a higher priority. This ensures that if two bitmasks match, only the highest priority output string is returned from the sensor.

A slightly expanded document is attached
Attachments
BitMasks&Strings.doc
BitMask and BitString sensors
(94KiB)Downloaded 1071 times

Locked