VeriStand

cancel
Showing results for 
Search instead for 
Did you mean: 

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

Hi,

 

I am working in a system that may run using the actual or modelled UUT. Besides this, it uses 3 heavy models running at 5 kHz.

 

I am looking for a way to inspect the model dll and extract its information as System Explorer does when the model is included.

 

Is it possible to do this using VeriStand API?

 

Cheers,

Cláudio H.

CHCastro
0 Kudos
Message 1 of 19
(7,350 Views)

What is the state of the system when you want to make this query of the model? Is the system up and running at the time? Has the model already been imported into a System Definition? Or do you just want to point to a random model DLL and retrieve information about it?

 

There are no functions in the VeriStand Execution API to directly inspect a model DLL to get the inports, outports, etc. However, there are many ways of inspecting a System Definition file through VeriStand API calls. The System Definition includes channels for model inputs, outputs as well as parameters and signals that have been imported. You can get a lot of information this way about the model.

Jarrod S.
National Instruments
0 Kudos
Message 2 of 19
(7,329 Views)

Hi Jarrod,

 

Yes, I want to do off-line as System Explorer does before loading the dll into the target.

 

I thought that it should exist an API call to do this since is possible to edit the in4 files, to add a model, off line.

 

in4 editing was possible in VS 2009 and I believe in 2010 using .NET API.

 

Cheers.

CHCastro
0 Kudos
Message 3 of 19
(7,315 Views)

You can use the System Definition API to extract information from a System Definition file. This includes a lot of information imported from the model DLL. Attached is an example that extracts model information from a specified model in a System Definition file using the System Definition API. Note I have not tested or debugged it much, but it seems to do a decent job.

Jarrod S.
National Instruments
0 Kudos
Message 4 of 19
(7,301 Views)

Hi Jarrod,

 

This VI does what I am doing now but in a cleanner way.

 

I made some changes to let it model independent.

 

The point is: it is necessary to run the project to retrieve the model information. My feeling is that System explorer does this without run the project and this is what we would like to do.

 

Other point: when we compile the model we fill the fields of information in "NI Information" which we want to retrieve. These information field are avaiable in system explorer during in4 creation.

 

Is this possible?

 

I am including the generic version of your VI that I changed.

 

Cheers.

Cláudio H.

CHCastro
0 Kudos
Message 5 of 19
(7,257 Views)

Hi Jarrod,

 

This VI does what I am doing now but in a cleanner way.

 

I made some changes to let it model independent.

 

The point is: it is necessary to run the project to retrieve the model information. My feeling is that System explorer does this without run the project and this is what we would like to do.

 

Other point: when we compile the model we fill the fields of information in "NI Information" which we want to retrieve. These information field are avaiable in system explorer during in4 creation.

 

Is this possible?

 

I am including the generic version of your VI that I changed.

 

Cheers.

Cláudio H.

CHCastro
Download All
0 Kudos
Message 6 of 19
(7,257 Views)

If you want to inspect the model dll file without interfacing with NI VeriStand at all, you can just call the dll's exported functions. They are documented in the NI VeriStand Model Interface documentation installed to C:\VeriStand

 

Since Simulation Interface Toolkit (SIT) uses the same model interface functions, instead of writing your own, you could just call the "SIT Initalize Model.VI" and that will tell you everything you probably want to know directly from querying the DLL.

 

 

Stephen B
0 Kudos
Message 7 of 19
(7,250 Views)

It looks like you are using the Execution Host API.  Jarrod is recommending the System Definition API.  The two are different all though you can accomplish task with both.  As you noted with the Execution Host API you need to run the project in order to perform the querry.  If you instead use the System Definition API, you do not need to run the project (or System Explorer).  So take an other look at Jarrod's VI.

 

Carl L

National Instruments

0 Kudos
Message 8 of 19
(7,242 Views)

Hi Stepen,

 

It's nice to chat with you again.

 

Yes, I want to interface the model directly without VS calls. I searched in C:\ and just found NI_VStand_Model_Framework_Guide.pdf but not Model Interface. Can you check where is NI VeriStand Model Interface?

 

I haven't SIT toolkit so, I need to create my own code.

 

Cheers,

Cláudio H.

CHCastro
0 Kudos
Message 9 of 19
(7,228 Views)

Hey Carl,

 

Where can I find information about System Definition API? I tried VeriStand help and search *Veristand*PDF files without matches.

 

I took an other look but I always got errors if the project is not running.

 

ajö

CHCastro
0 Kudos
Message 10 of 19
(7,227 Views)