GetBit

GetBit('Expression','Bitnumber')

Description

This function returns the Boolean value of the 'Bitnumber' bit of 'Expression' after rounding to the nearest integer value. The rounding limit is in each case the next 0.5 increment. (2.48 --> 2; 2.50 -->3). Valid bit number sequence: 0 (LSB) to 15 (MSB).

Example

In the table below, the least significant byte of an integer value with the bits 0…7 is shown as an example. In order to represent the values 0…8, the individual bits are highlighted as with "X" (X = TRUE). The left column shows the initial values, which represented by the summed powers of 2 (header), e.g., 1 = 2^0; 2 = 2^1; 3 = 2^0 + 2^1.

GetBitMask

GetBitMask('Expression','Bitnumber')

Description

This function interprets 'Expression' as a bit mask of a float value and returns the value of the bit 'Bitnumber'. Valid range: 0 (LSB) to 31 (MSB)

This function was specifically developed for working with data from SimadynD in one particular case where up to 32 digital values are recorded in packed format as a float variable. The GetBitMask function only evaluates the valence of the specified bit 'Bitnumber' irrespective of whether it is part of the mantissa or of the exponent. In contrast to the GetBit function, there is no rounding to the next integer.