Skip to main content

MasterChannelConfig

The MasterChannelConfig struct contains the following generic settings that are common to all communication channels:

  • Master station address (different addresses may be used for different channels)
  • Initial decoding level
  • Transmit and receive buffer sizes
note

The timeout for responses is configured for each association individually. This is useful if the outstation is a gateway services with varying latency.

The constructor takes the master address and has reasonable defaults for all other settings. The default response timeout is 5 seconds; you may need to increase it for high-latency communication links. You should only need to adjust the default buffer size of 2,048 bytes if an outstation has a non-standard configuration.

fn get_master_channel_config() -> Result<MasterChannelConfig, Box<dyn std::error::Error>> {
let mut config = MasterChannelConfig::new(EndpointAddress::try_new(1)?);
config.decode_level = AppDecodeLevel::ObjectValues.into();
Ok(config)
}