11-29-2010 04:41 AM
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.
11-30-2010 10:17 AM
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.
12-01-2010 07:39 AM
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.
12-01-2010 11:07 AM - edited 12-01-2010 11:08 AM
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.
12-08-2010 09:55 AM
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.
12-08-2010 09:55 AM
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.
12-08-2010 01:02 PM
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.
12-08-2010 01:21 PM
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
12-09-2010 05:22 AM
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.
12-09-2010 05:55 AM
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ö