LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I extract the Simulation End Time from the compiled .dll using SIT?

I am looking for a way to extract the original simulation end time that was set when I compiled the .dll with RTW.  I know I can override this value in the Driver.vi and can tell SIT to use this original value by setting this control to -1, but I see no block downstream that then outputs the Simulation End Time that will actually be used.

 

Obviously if I override it I know what it is, but I would like to inherit the end time from different compiled versions of the model, save it as a Network Shared Variable and send it back to my Host to show as an indicator and be used for graphing.  I would like to think that in the giant cluster labeled Simulation Details that outputs from many of the SIT .vis this kind of model information is embedded, but there is no signal clearly labeled to be the end time.

 

Thanks!

-Greg

0 Kudos
Message 1 of 4
(3,291 Views)
What is the "Simulation End Time".  Is that some kind of Simulink parameter?  Does it show up in a lgo file or some kind of report of the simulation.  If it is not a port or exported parameter, then LabVIEW cannot import it directly from the Simulink dll.
Chris Bakker
SET Americas
CEO

0 Kudos
Message 2 of 4
(3,265 Views)

The simulation end time is set in Simulink in the Configuration Parameters dialog box (the same box that configures RTW which .tlc file to use and what kind of optimization to use when compiling the .dll) so I guess it is a special type of parameter.  The way SIT works now is the top level autogenerated Driver.vi has a control for this end time that is used before the .dll is initialized that by default is set to -1 which means inherit the end time from the model.  You can override the time manually with a real time as well.  Anyway, I put a Network Shared Variable here to read the end time, but it always reports -1 and I would like to be able to report what the inherited time actually is.

 

So if I compiled two different .dlls with two different end times I would expect this variable to update appropriately when I run each of them.  I can find ways around it - I thought I could probably use one of the many SIT .vis that might have the end time embedded somewhere as an output because this information is needed at some low level to know when to stop the Base Rate Loop and end the sim.

0 Kudos
Message 3 of 4
(3,252 Views)

Hello Greg,


I took a look at the scripted driver VI and I think I found the same parameters you were mentioning. The stop time on the driver VI is set to (-1) which sets the stop time to infinity.

 

Stop Time.png

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

In the Advanced System Scheduling time the Base Rate Period is set to -1 which means to use the model time step.

 

Base Rate Period.png

 

 

When we initialize the model I believe we are overwriting the end time that is specified in the dll.  Let me do a little more research on this issue and see if we can extract the end time that was originally configured for the model.

Regards,

Jon S.
National Instruments
LabVIEW NXG Product Owner
0 Kudos
Message 4 of 4
(3,232 Views)