Outstation class
The Outstation is the handle you get when you create an outstation on any transport. Behind it, an asynchronous task
runs the outstation and answers requests from a single master. Your application keeps the handle for as long as the
outstation runs and uses it to:
| Do this | With |
|---|---|
| Update the values the master reads, in transactions | transaction (execute_transaction in the bindings), see Database |
| Start or stop communicating | enable and disable |
| Change how much of the protocol traffic is logged, for example to debug a site | set_decode_level |
The Outstation class has the same interface regardless of which transport-specific method you used to create it. This allows you to treat an Outstation operating over TCP or serial identically.
An outstation created as a TCP or TLS client starts disabled: call enable once its database is initialized, or it
never connects. Outstations on every other transport start enabled.
An outstation created on its own, as a TCP or TLS client, on a serial port or over UDP, stops when its Outstation is destroyed. In Java and .NET that happens
when the object is garbage collected, so keep a reference to it for as long as the outstation should run. Outstations added to an OutstationServer are kept
running by the server.