Error -383200 When Running .lvmodel in Standalone Application Using Model Interface Toolkit

Updated Jun 20, 2023

Reported In

Software

  • LabVIEW Model Interface Toolkit

Issue Details

I have created a .lvmodel file from a VI using the VeriStand Model Framework and the Generate Model from VI tool in LabVIEW. I want to load and run my model using the LabVIEW Model Interface Toolkit. When I run the VI that is loading my model in the LabVIEW development environment, it loads and runs correctly. However, if I build that VI into a standalone application (EXE) and run it, the application throws the following error:

Error -383200 occurred at xxx. <Additional Message>  Model Interface Toolkit: Failed to load file model xxx.

Possible reason(s):
Model Interface Toolkit: Cannot load model. Ensure the Model Library Path is valid and the model conforms to the NI VeriStand Model Framework header file (ni_modelframework.h). If you are deploying to a VxWorks target, you must FTP your .out file to the ni-rt/ or ni-rt/system/ directory.

error mit.png

Solution

The Model Interface Toolkit functions that are used to load and run models rely on dependencies that are not included by default when a standalone application is built. Copy the following two files into the data directory of the recently built application.
  • C:\Program Files (x86)\National Instruments\[your LabVIEW version]\vi.lib\Model Interface Toolkit\Data\lvmodel
  • C:\Program Files (x86)\National Instruments\[your LabVIEW version]\vi.lib\Model Interface Toolkit\Data\NIVeriStand_LVModel.dll
The data directory of your standalone application should now look like this:
 
data directory.png
 
Please note that the NIVeriStand_MdlWrap.dll file should already be present in the data directory because the Application Builder automatically adds it as a dependency.

You should now be able to run your application and the model can be loaded without error.

Additional Information

You could also address this issue by adding the two files mentioned above to your project files as shown below:

mit project.png

You can then add these files in the Source Files section of the Build Specifications, as shown below, so that they are always included in the data folder of the application when it is built.

mit build specs.png


This behavior should only affect LabVIEW models built for Windows targets. Building Real-Time executables for deployment on PharLap or Linux RT systems should not have this problem