Skip to main content

Other requests

Besides reads and controls, an association can send these requests. In Rust they're methods of the AssociationHandle; in the bindings they're MasterChannel methods that take the association id.

RequestWhy
Time synchronization (synchronize_time)Sets the outstation's clock now, rather than when it asks for the time. See Time Synchronization.
Cold or warm restart (cold_restart, warm_restart)Restarts the outstation, and returns its estimate of how long the restart takes.
Freeze countersCaptures the counters' values at the same moment, or on a schedule.
Write deadbands (write_dead_bands)Tunes analog event reporting remotely.
Generic request (send_and_expect_empty_response)Sends writes and freezes that have no dedicated method. It succeeds when the outstation answers with no objects and doesn't reject the request.
Link status check (check_link_status)Checks that the outstation's link layer answers. It's for testing: prefer the keep-alive, which the master sends on its own (see Scheduling).

Freezing counters​

Freeze counters with the generic request, giving it a freeze function code and the counters it applies to. The outstation copies each counter to its frozen counter, and can also clear the counter or freeze it on a schedule. The example freezes all the counters once a day:

let headers = Headers::new()
// freeze all the counters once per day relative to the beginning of the current hour
.add_freeze_interval(FreezeInterval::PeriodicallyFreezeRelative(86_400_000))
// apply this schedule to all counters
.add_all_objects(Variation::Group20Var0);

self.association
.send_and_expect_empty_response(FunctionCode::FreezeAtTime, headers)
.await?;

Writing deadbands​

A deadband is how much an analog input has to change before the outstation reports an event. Writing deadbands lets you tune event reporting without visiting the device. An outstation that should keep them across a restart saves them in its saving callbacks. To check the values, read the analog input deadbands back: they arrive at the ReadHandler.

self.association
.write_dead_bands(vec![
DeadBandHeader::group34_var1_u8(vec![(3, 5)]),
DeadBandHeader::group34_var3_u16(vec![(4, 2.5)]),
])
.await?