You may wish to write the simulation results to a file where you can analyze the data later or use the data as input for other software tools. There are a number of ways to do this.
To demonstrate the various possibilities to save simulation results the statistics demo is a good example. It is located at MLD Libraries→DE→Demo. The MLD_Libraries directory is, however, write protected so you must first copy the system to your own library folder. There you will be able to edit certain parameters. Right-click on the item in the Tree View and select Save As to create a copy of statistics in your library. Open the copy and proceed as follows:
Similarily you can save the results of an XGraph to a file. In this case two files are saved. One contains a list of coordinates the other the options needed to invoke the pxgraph with. Proceed as follows:
To open the simulation results dumped to a file, select the instance that produced the output file, then right-click on its parameter of type filename in the Property Editor window and choose Open.
It is possible to use the simulation and iteration number in the expression that defines the filename to generate distinct files for different simulations/iterations. If the filename is given by a parameter, you can specify an expression that combines the simulation and iteration number, e.g.:
If the filename is generated in the primitive’s code, during initialization or when the wrapup method is called, you can use the environment variables in conjunction with expandPathName function:
char* tFileName = expandPathName("results.$SIMNO.$SIMIT"); // open and write to file delete  tFileName;
Also you can use in your code the static methods of the SimControl class:
SimControl::getCurParamSet() SimControl::getAbsSimul() SimControl::getAbsIter() SimControl::getCurIter()