Error 22: The VI was compiled for a different OS When Deploying LabVIEW Real-Time Application

Updated Aug 30, 2022

Reported In

Software

  • LabVIEW Real-Time Module

Operating System

  • LabVIEW Real-Time (NI Linux Real-Time)
  • Phar Lap
  • VxWorks

Issue Details

I have developed code for a Real-Time (RT) target, such as NI LinuxRT, Phar Lap or VxWorks. This successfully runs if deployed through the project in interactive mode. When deploying to the target as a startup application and rebooting, no code runs and no outputs on the target change. When viewing the NI MAX error logs, I see:
Error 22: The VI was compiled for a different OS.".
How do I get past this issue and deploy this program as a startup application?

Solution

This error is seen if the Real-Time target in the LabVIEW project is in a mutated state and is not fully set for the correct operating system. This can occur if a developer attempts to manually change the target properties to another Real-Time Operating System (RTOS) but does not fully change all the properties or linked file paths. 

You can resolve this issue by re-adding the target with the correct RTOS and copying the configuration across. This can be done by right-clicking the project title in the project tree, Selecting New >> Targets and Devices and browsing to the correct target type. You can then copy or drag the files directly across in the project view.