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).
Note |
|
|---|---|
|
The function does not apply to integers with 64 bits because these data types are not supported by ibaPDA and thus cannot be included in a data file. |
|
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.
Tip |
|
|---|---|
|
If you want to reduce one or more 8-, 16- or 32-bit integers to single bits, open the context menu of the desired signal in the signal tree and select Show bits in the context menu. All bits are then shown as individual digital signals, without programming the GetBit function. The internal method of this function is the same as for GetBit. |
|
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.
Tip |
|
|---|---|
|
If you want to reduce one or more 32 bit floating values to single bits, open the context menu of the desired signal in the signal tree and select Show bits in the context menu. All bits are then shown as individual digital signals. The internal method of this function is the same as for GetBitMask. |
|

