Initializing help system before first use

Procedures and functions

Mosel instance management

The type Mosel is used to reference a Mosel instance. Before an instance can execute commands (like loading or running a model), it must be connected. Connecting an instance consists in starting an additional operating system process running Mosel: this is done by the connect function. To improve readability of the model source, one can use host aliases (defined by means of the sethostalias routine) to designate connection targets. Once work with a particular instance has been finished, the instance can be disconnected (disconnect): this terminates the process running Mosel (and releases all associated resources).

clearaliases
Delete all defined aliases.
connect
Connect a Mosel instance.
disconnect
Disconnect a Mosel instance.
findxsrvs
Search xprmsrv servers on the local network.
getaliases
Retrieve the list of all defined aliases.
getbanner
Get the banner displayed by an instance on startup.
gethostalias
Get the value of a host alias.
sethostalias
Define a host alias.

Model management

The type Model is used to reference a Mosel model. This section describes the procedures and functions available for model management: compilation of source model files, loading of bim files, execution and retrieval of model information. Note that before it can be used, a model has to be initialized by loading a bim file (load).

compile
Compile a source model.
detach
Detach the current model from its parent node.
getannidents
Get model identitifiers for which annotations are available.
getannotations
Get model annotations associated to a given symbol.
getdsoprop
Get module information.
getexitcode
Get the exit code of a model.
getgid
Get the group ID of a model.
getid
Get the ID of a model or Mosel instance.
getmodprop
Get model information.
getnode
Get the ID (node number) of the Mosel instance of a model.
getrmtid
Get the ID of a model on a remote instance.
getstatus
Get the status of a model.
getuid
Get the user ID of a model.
load
Load a Binary Model file.
reset
Reset a model.
resetmodpar
Remove a parameter from a model parameter string.
run
Run a model.
setcontrol
Set an instance control parameter on a remote instance.
setdefstream
Set default input/output streams of a model.
setmodpar
Add or change the value of a parameter in a model parameter string.
setworkdir
Set the initial working directory of a model.
stop
Stop a running model.
unload
Unload a model.

Synchronization

Synchronization between running models can be implemented using events. Events are characterized by a class and a value and may be exchanged between a model and its parent model. The model from which an event has been sent is identified by its unique ID, its user ID and its group ID. An event queue is attached to each model to collect all events sent to this model and is managed with a FIFO policy (First In – First Out). Depending on the needs, a model may check whether its queue is empty or simply suspend its execution until it has been sent an event.

The type Event represents an event in the Mosel language. Objects of type Event may be compared with = or <> and assigned with :=. The function nullevent returns an event without class and value: this is the initial value of a newly created event and no model can send an event of this kind (i.e. the class is necessarily not null).

canceltimer
Cancel an active timer.
dropnextevent
Drop the next event in the event queue of the model.
getclass
Get the class of an event.
getfromgid
Get the group ID of the sender of an event.
getfromid
Get the ID of the sender of an event.
getfromuid
Get the user ID of the sender of an event.
getnextevent
Get the next event in the event queue of the model.
gettimer
Get the amount of time remaining before a timer expires.
getvalue
Get the value associated with an event.
isqueueempty
Check whether there are events waiting in the event queue.
nullevent
Return a `null' event.
peeknextevent
Peek the next event in the event queue of the model.
send
Send an event to a running model.
setgid
Set the group ID of a model.
settimer
Create or update a timer.
setuid
Set the user ID of a model.
wait
Wait for an event.
waitexpired
Indicate whether the previous 'wait' or 'waitfor' expired.
waitfor
Wait for specific events.