Maintaining Same CPU Usage When Exporting LabVIEW Code as .NET Interop Assembly

Updated Nov 21, 2023

Reported In

Software

  • LabVIEW

Programming Language

  • C# .NET

Issue Details

After exporting LabVIEW code as a .NET Interop Assembly file, and importing into C#, I observe low CPU usage, about 20-25%, compared to the original LabVIEW code, which was 95%. How to maintain 95% CPU usage in C# as well?

Solution

The same code running in LabVIEW and C# will cause different CPU usage, because of the difference of architecture in this programming languages.

To force the exported executable run the same way it ran in LabVIEW you should change the execution system. To do that go to File>>VI Properties>>Execution and change the Preferred Execution System from same as caller to standard.

Execution.png

After choosing this setting, you will get full performance when running the executable. Meaning, when you export a LabVIEW code to C# for example, you will observe the same CPU usage that was observed when running the code in LabVIEW.