Remote control
The standalone model driver may be controlled from a
remote host over TCP/IP. The driver listens for connections
on TCP port 25200, and accepts commands using a simple
text-based protocol.
Available commands
The following commands are available. They should be
followed by a newline (ASCII LF (0x0A), '\n' in C).
- run
- Start running
- pause
- Pause the simulation
- runtoggle
- Toggle between 'running' and 'paused' states.
- reset
- Reset the simulation (e.g., after a crash) to the
last checkpoint.
The simulation is left in the 'paused' state afterwards.
- shutdown
- Stop the simulation and terminate the driver.
- model.set varname value
- Sets the value of a Scope model variable.
varname must be the full path to the variable
(not including the WORLD group), and all upper-case.
- model.get varname
- Returns the value of a Scope model variable.
- model.update
- Update all model outputs (internal use)
- model.step
- Single-step the model
- model.reload
- Reloads the model in its initial configuration.
- model.save
- Saves the current state of the model. Subsequent
'reset' operations will restore this state.
- model.restore
- Restores the previous checkpoint.
- model.trim
- Initiate the trim process.
See @@@ for details.
Command responses
After the command has completed, the driver will respond with
a line containing a single period (".\n"). If there was
an error, it will respond with a question mark ("?\n").
Lines beginning with a '-' contain error messages in response
to the currently executing command. Lines beginning with a '+'
contain a normal (non-error) response.
Lines beginning with an exclamation point ("!...") indicate
an asynchronous message from the driver to the controlling host.
The driver may produce asynchronous notifications at any time.
Notifications include:
- !ok
- Indicates that the connection has been established.
- !running
- Indicates that the simulation is running.
- !paused
- Indicates that the simulation is paused.
- !reset
- Sent when the simulation is reset
- !done
- Sent when the simulation is shutting down
Other asynchronous notifications may also be sent,
described elsewhere.
Tips
You can communicate with the driver directly with the Unix shell
command:
telnet localhost 25200
Or from a different machine, substitute 'localhost' with the
name of the host on which the driver is running.