Floating Point Case Selector in a LabVIEW Case Structure

Updated May 2, 2018

Reported In

Software

  • LabVIEW

Issue Details

I want to use a floating point value to select a case in my LabVIEW case structure.

Solution

Floating point values cannot be directly used in a Case Structure's Case Selector. If you wire a floating point into a case structure, a coercion dot appears, meaning that the number is being turned into an integer and losing precision. However, you can multiply the floating point value by a power of ten, and then convert that value into a signed integer. Then, you can make cases and case ranges that are your desired floating point value multiplied by the same power of ten value.
 

Additional Information

Since you are converting a floating point value into an integer, you will lose precision on your floating point value to the number of significant digits your power of ten multiplier has. However, this loss of precision is not as severe as wiring the floating point value in directly.

WAS THIS ARTICLE HELPFUL?

Not Helpful