VeriStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I extract model dll information (inports, outports etc) using VeriStando API?

You may not have installed the Model Framework support with NI VeriStand. It's an optional installation component. If you re-run the installer, you should see it for selection, and it should take only a moment to install.

Jarrod S.
National Instruments
0 Kudos
Message 11 of 19
(3,874 Views)

Hi Jarrod,

 

I have it installed.

 

We did not received our official DVD's. May I be working with a incomplete installation DVD?

 

Cheers.

CHCastro
0 Kudos
Message 12 of 19
(3,870 Views)

I misspoke earlier, it is called the Model Framework, not the Model Interface.

 

This path contains the source code and several example models. Sinewave, random, and delay.

C:\VeriStand\2010\ModelInterface\custom

 

You can look inside the codegen.c file to see all the DLL export function prototypes you will need to use to query the built model DLL.

 

To be honest, it will be a decent amount of work to do this. Your time might be better served just grabbing an eval copy of SIT and using the SIT Initalize Model.VI. If you want to keep using it, make a purchase, if not... it is open source. You could take out the part your need.

Stephen B
0 Kudos
Message 13 of 19
(3,860 Views)

Claudio,

 

The NI_VStand_Model_Framework_Guide.pdf explains how to use the model framework.  This framework includes code that defines all of the entry points for the DLL which you should be able to call in order to get information about the model.  You should be able to find function prototypes and definitions for all of the functions in:

C:\VeriStand\2010\ModelInterface\NIVERISTAND_API.h

C:\VeriStand\2010\ModelInterface\custom\codegen.c

 

Note that none of this is documented or "supported", so you're going to need to figure out how to do this yourself.  The functions should be pretty self-explanatory though, so hopefully you shouldn't have too much trouble figuring out what to call (ex. NIRT_GetParameterIndices, NIRT_GetParameterSpec, etc..).

 

For the System Definition API, there currently isn't documentation for it, but NI VeriStand 2010 ships with a few examples of how to use it:

<LabVIEW>\examples\NI VeriStand\API\System Definition API\

0 Kudos
Message 14 of 19
(3,857 Views)

Claudio,

Which VI are you running when you get the error?  If you are running your VI I would expect an error if the project is not running.  Your VI uses the Execution Host API.  If you are running Jarrod's VI you should not be getting an error.

 

What is the error you are getting?

 

There are many different options being presented in the thread: Execution Host API, System Definition API, DLL calls directly to the model.  All of them will get you the information, but based on my understanding of what you are looking for using the System Definition API should be the easiest.  Just to clarify you do not need the model framework installed to use the System Definition API.

 

We do not yet have documentation for the System Definition API, however there is a basic example that I pointed you to earlier.  Also the VI that Jarrod provided, gives a complete example of using the System Definition API to a model to a system definition and then querry to find the parameters and signals that were added.  When working with thethe System Definition API it is useful to think of it as doing programmatically what you would be doing in System Explorer.  So to add a model you need to navigate down the hierarchy to the model section.  Once you are at the models section you can add the model.

 

Carl L

National Instruments

0 Kudos
Message 15 of 19
(3,846 Views)

Hi Carl,

 

I apologize but might be more clear; I got error when the project is not running even with the code that Jarrod let disabled, enabled.

 

I mean, no matter I ran Jarrod VI with the project stop, I got a message error. With the project running the VI works fine.

 

By the way, can you guys take a look in posts at EMBRAER´s discussion forum?

 

I posted 2 questions there.

 

Cheers,

Cláudio H.

CHCastro
0 Kudos
Message 16 of 19
(3,838 Views)

Hi Devin,

 

I check the ".c" and ".h" files and manage to access the model dll using NIRT_GetModelSpec and NIRT_GetBuildInfo but these calls doesn't retrieve the information that I got about the model with System explorer model window.

 

When I click over a model the Simulation model info window show something like:

Model rate: 5000 Hz

Path: C:\WorkDir\Models\Bleed\xxx\bleed_real_time.dll
Modification date/time: 13:10:41,000 8/12/2010
File size (Byte): 598016
File version: 1.275
Product name: bleed_real_time
Internal name: Development version of xxx
Company name: xxxx
Legal copyright: xxx Property.
File description: Bleed model for xxx

 

Is there anyway to reach these information using Execution API or System Definition API?

 

We need to use this to be sure that we are using the correct version during the tests since the model will change during the development.

 

Cheers,

Cláudio H.

 

CHCastro
0 Kudos
Message 17 of 19
(3,837 Views)

In order to retrieve the information you could use the System assembly (System.dll).

Pls check out this link for more information: http://msdn.microsoft.com/en-us/library/system.diagnostics.fileversioninfo.aspx

or download the attached example VI.

 

Thanks,

Tom

0 Kudos
Message 18 of 19
(3,832 Views)

Hi ThSa,

 

Bull´s eye ... for now.

 

I will use this with Jarrod VI to have an interim solution.

 

Cheers,

Cláudio H.

CHCastro
0 Kudos
Message 19 of 19
(3,824 Views)