Initializing help system before first use

run

run


Purpose
Run a model.
Synopsis
procedure run(mo:Model)
procedure run(mo:Model, plist:string|text)
Arguments
mo 
Model to be executed
plist 
String composed of model parameter initializations separated by commas
Further information
1. This procedure starts the execution of a model in a new thread: when the procedure returns, the model is not necessarily started (this may be delayed depending on the operating system load) and not necessarily terminated (the second model is executing concurrently to the caller).
2. By default the execution starts in the working directory of the Mosel instance (that might be different from the working directory of the calling model). A different initial path can be setup using setworkdir.
3. When the execution of the model is completed (normal termination, interruption after calling stop, or runtime error) or could not be started, an event of class EVENT_END is sent to the caller. The execution status is returned via the event value but it may also be obtained using getstatus. The exit code related to the last execution may be retrieved using getexitcode.
4. An event EVENT_END is also received after a model has detached itself although its execution may continue (see detach). In this case the model status is RT_DETACHED and its associated instance is disconnected.
5. The specified model must have been previously initialized with load and must not be running. If the same model has to be executed several times concurrently, it must be loaded several times in different model objects.
6. The parameter string plist may be built and modified using setmodpar and resetmodpar. These routines handle transparently the protection of parameter values by adding the appropriate quotes when required.
Related topics
Module