Compose-3030: Using Compose and OML in Batch Mode
- Use the Compose console mode.
- Use the Compose batch mode.
- Pass input arguments to a script executed in batch mode.
- Save output to text file when running in batch mode.
Running Console Mode in Compose
In addition to the graphical, interactive mode described in previous tutorials, can also be used in Console mode. Console mode is basically a non-graphical mode that exposes, the OML command prompt in a shell.
From this prompt, all supported OML commands can be executed, with the exception of all GUI-related commands, such as plots.
Running OML Command/Script in Console Mode
The Console mode, which is described above, can also be used by passing either commands or scripts to the application from a standard shell.
Pass an Argument to a Script
Compose_Console.bat –e input arguments –f script.oml
Compose_Console.bat –e t=[0:0.1:20];initial=[0;0]; –f
<installation_dir>\tutorials\ode45_noplot.oml
The script file ode45_noplot.oml is located under <installation_dir>/tutorials/. Note that if you run the script file directly in the Compose GUI, it will prompt that variable t and initial are not defined. See the result when running the correct command in batch:
Save the Output to a File
Running Tcl Scripts in Batch Mode
Besides the Console mode, which is described above, Compose can be used in 'true' batch mode by just passing either commands or scripts to the application from a standard shell.
Compose also supports running scripts in full batch mode. The batch mode can be executed using the *.bat file which resides in:
<installation_dir\hwx\Compose_Batch.bat
Pass the name of the script to be executed by using the –f argument, the same as for Console mode.
Compose also supports also multiple languages. To run a Tcl script in batch, enter the following:
<installation_dir\hwx\Compose_Batch.bat –f <TCL file with .tcl extension
basic.tcl can be found in <installation_dir/tutorials/.