Please enable JavaScript to view this site.

Vensim Help

Navigation: Release Notes > Prior Version Release Notes > Version 4.1 and 4.2

DLL Venapp and Command Changes

Scroll Prev Top Next More

 

 

Commands (Venapp/DLL/Command Scripts)

MENU>SENS2TAB|vdffile|tabfile|*![#

Converts a sensitivity simulation file to a tab delimited file.  This command will fail silently if vdffile is not the result of a sensitivity simulation.  A number of options can follow the name of the output file.

*        causes the simulation index (or time if # is specified) to run down instead of across.

!        causes only the values at final time to be exported.

#        causes the variables names to be modified by simulation number instead of time (only applies when ! is not specified).

[        causes the variable names to be modified using a subscript instead of a prefix (only applies when ! is not specified).

MENU>SYNTHESIM|O  (Not in Command files or Minimal DLL)

Starts SyntheSim mode.  Use O to overwrite the existing run without prompting.  In SyntheSim mode all changes to model values will trigger simulations and Venapp sliders will simulate as they are moved, saving the results when they are released.  If you display a sketch in SyntheSim mode the behavior graphs for each variable will be displayed, but the sliders will not be created.

To leave SyntheSim mode use SPECIAL>STOPSIM.

SYNTHESIM>AUTO|n (n is 0 or 1) (Not in Command files or Minimal DLL)

By default when the MENU>SYNTHESIM command is used the model will be resimulated whenever a model Constant or Lookup is changed.  This behavior can be suppressed by calling SYNTHESIM>AUTO|0 (zero) to run off automatic simulation.  This is useful if you want to set a number of values at once without each change causing a new simulation.  When you turn off automatic resimulation you will need to explicitly invoke SYNTHESIM>GO.

SYNTHESIM>GO|n (n is 0 or 1) (Not in Command files or Minimal DLL)

When in SyntheSim mode causes a simulation to be performed.  This command is only useful if you have turned off automatic simulation.  If it is called with the optional argument of 0 the results will not be saved to disk and that any visible graphs will not have the scales reset.  See also the vensim_synthesim_vals and vensim_get_data.

DLL Functions

vensim_synthesim_vals(unsigned long offset,float **x,float **y) (not in minimal DLL)

This function can only be called after MENU>SYNTHESIM.  It will fetch the time and variable values for an offset as returned by vensim_get_varoff.  Vensim allocates the memory for the results and will also manage its disposal.  The returned pointers should be treated as read only pointers and are valid till the next action that will case a simulation to be made or synthesim mode to be exited.  

Returns the number of data points from the most recent simulation.

The first time you call vensim_synthesim_vals with a given offset the values returned will be from the most recently saved dataset.  Thus if you have exectued SYNTHESIM>GO|0 with the 0 flag the values may not be current.  However, if you execture SYNTHESIM>GO|0 again all successive calls to vensim_synthesim_vals will return the current results.  

vensim_synthesim_vals is very fast and can be called directly by drawing routines to determine variable values.  Using only vensim_synthesim_vals and SYNTHESIM>GO|0 is the fastest way to perform simulations and retrieve results.

See the example under MSVC60 that shows how this function can be used.

vensim_get_varattrib - has been changed so that it returns sensible information when called with Subscript Ranges and Elements.

vensim_get_data will now return x,y pairs when passed the name of a lookup.  You can also use this to fetch values from memory when using SyntheSim so as to not have to write the results to disk (a slow operation).

DLL Contexts

The Vensim DLL is now available in a configuration that allows for multiple context definitions.  This is very useful to support a server environment in which multiple models may need to be open or multiple copies of a given model may need to be open for different users.  Each context can be executed independently using different threads so that actions may be performed in one context while another may be busy performing a simulation.  See the Vensim DSS Reference Supplement for details.