Converting NaN in VeriStand

Updated Jul 6, 2026

Reported In

Software

  • VeriStand
  • VeriStand Custom Devices

Issue Details

I’m using VeriStand to pass measurements to a model, but sometimes the measurements can become NaN. Since the model can’t handle NaN values, I’m trying to convert them, how can I accomplish this?

Solution

To convert NaN values to another value (for example, 0) in VeriStand, one approach is to create a custom device for the conversion.

 

Custom devices can be created in LabVIEW. By using the Not a Number/Path/Refnum? function available in LabVIEW, you can determine whether an input value is NaN.

Using this Boolean result along with a Select function, you can define an alternative value to use when the input is NaN. By outputting this value from the custom device and mapping it to the model input, you can avoid passing NaN values into the model.

 

The figure below shows an example of how this can be implemented in an Inline HW Model custom device. Depending on your setup, you may also consider implementing this using other custom device architectures.

Additional Information

The version of LabVIEW used to develop the custom device must match the version of VeriStand. For example, if you are using VeriStand 2024, the custom device must also be developed using LabVIEW 2024.

Additionally, please note that for VeriStand 2021 and later, custom devices must be created using the 64-bit version of LabVIEW.