Bit (FPScript)
Extracts a bit trace from a data set with digital data.
Syntax
Bit(DataSet, N)
The syntax of the Bit function consists of the following parts:
Part |
Description |
---|---|
DataSet |
The data set from which a bit is to be extracted. All data structures are allowed. All real data types are permitted. The unit of the argument is ignored. For complex data types the absolute value is formed. If the argument is a list, then the function is executed for each element of the list and the result is also a list. |
N |
Specifies the number of bits to be extracted. The bits in the digital data are numbered beginning with zero. Permitted data structures are scalar value. All integral data types are permitted. The value must be greater or equal to 0 and less or equal to 63. If the argument is a list, then the first element in the list is taken. If this is also a list, then the process is repeated. |
Remarks
The result has the same structure as the argument DataSet.
A conversion is made into integers before the bit is extracted. For signals, only the Y component is considered.
The following illustration shows a data set with linear increasing values from 0 to 255 and the breakdown into individual bits:
Available in
FlexPro View, Basic, Professional, Developer Suite
Examples
Bit(0x10, 4) |
Results in 1. |
Bit(0x10, 3) |
Results in 0. |
Bit(16, 4) |
Results in 1. |