20-sim scripting allows you to run tasks in 20-sim automatically using specialized scripting functions. With these functions you can open models, run simulations, change parameters, store results and much more. Scripting support was introduced in 20-sim 4.4.
20-sim session automated by a script in Octave, Matlab or Python.
These scripting functions are not very useful stand-alone, but you can use them to write scripts to automate various tasks in 20-sim.
The 20-sim scripting functions are based on XML-RPC calls, so any other programming language with support for XML-RPC can be used to automate various 20-sim steps.
In this chapter you will learn how to run basic scripts and make scripts on your own.
The next sections explain:
|•||Installation for scripting:|
|o||20-sim: enabling the XML-RPC scripting interface in 20-sim|
|o||Octave: installing Octave as scripting environment|
|o||Matlab: installing Matlab as scripting environment|
|o||Python: installing Python as scripting environment|
|•||Prepare Scripting Folder: extract the 20-sim scripting functions and documentation to your work directory.|
|•||Advanced Scripts: see how you can expand the basic script to perform more advanced tasks in Octave/Matlab.|
Note: Scripting is not supported in the 20-sim Viewer/Demonstration Version. If you would like to try the scripting functionality, you will need licensed 20-sim version or a trial license.