Remote control protocol
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.
Commands are plaintext strings, terminated by a newline (ASCII LF (0x0A), '\n' in C).
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:
- Indicates that the connection has been established.
- Indicates that the simulation is running.
- Indicates that the simulation is paused.
- Indicates that the simulation is in standby mode (trimming, playback, or other long-running process).
- Indicates that the driver has encountered an error.
- Sent when the simulation is reset
- Sent when the simulation is shutting down
Other asynchronous notifications may also be sent, described elsewhere.
Commands may also be sent on UDP port 25200.
The driver does not send a response to commands
received over UDP, so commands like
are not useful in this mode, but for cases where
the host does not need a reply using UDP is often
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.
The following commands are available:
- Start running
- Pause the simulation
- Toggle between 'running' and 'paused' states.
- Reset the simulation (e.g., after a crash) to the
The simulation is left in the 'paused' state afterwards.
- 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.
- Returns a list of all Scope model variables in the current model, one per line (internal use).
- Update all model outputs (internal use)
- Single-step the model
- Reloads the model in its initial configuration.
- model.save filename
- Saves the current state of the model to the named checkpoint file. If the filename is omitted, a default checkpoint file is used. Subsequent 'reset' operations will restore this state.
- model.restore filename
- Restores the named checkpoint. If the filename is omitted, the most recently saved checkpoint is restored.
- Initiate the trim process. See for details.
Trimming the model
model.trim remote control command
initiates the trim process.
This will try to find a set of control positions
which will hold the aircraft at a given flight path.
By default, the aircraft is trimmed to level
flight at the current airspeed.
Additional arguments to
model.trim may be supplied as follows:
model.trim speed climbrate turnrate
- Specifies the in-plane inertial velocity in feet/sec. If omitted, defaults to the current inertial velocity
- Specifies the climb rate (if positive) or descent rate (if negative) in feet per second. Defaults to 0.
- Specifies the turn rate in radians per second. Defaults to 0.
The trim process may take up to 10 seconds. The status of the trim is reported via the following asynchronous notifications:
- !trim started
- Sent when the trim process starts
- !trim finished
- Sent when the trim process completes successfully
- !trim failed
- Sent if the trim process fails