Fixed-Point to Integer Cast Function

Owning Palette: Fixed-Point Functions

Requires: Base Development System

Scales the fixed-point input to produce an integer output. This function is the equivalent of an arithmetic shift of the input, constrained so that the least significant bit of the input becomes the least significant bit of the output.

Details  Example

 Add to the block diagram  Find on the palette
fixed-point is the data you want to scale. fixed-point can be any fixed-point data type.
integer is the input data scaled to the smallest compatible integer type that prevents overflow. This output discards the overflow status.

Fixed-Point to Integer Cast Details

If fixed-point is a signed number, LabVIEW sign-extends the input data as necessary to ensure that the input and output data are always the same sign.

Note  The Fixed-Point to Integer Cast function combines elements of the Scale by Power of 2 function and the Type Cast function. The Fixed-Point to Integer Cast function performs an operation that reinterprets the bits, like a cast, but also implements an arithmetic shift with sign extension, similar to the Scale by Power of 2.

Example

Refer to the Fixed-Point Cast VI in the labview\examples\Numerics directory for an example of using the Fixed-Point to Integer Cast function.

 Open example  Find related examples