Periodic Polling
You should typically add periodic polls before calling MasterChannel.enable()
. However, you can also add or remove periodic polls at any time. You can specify the
association to poll, the type of request, and the polling interval.
- Rust
- C
- C++
- Java
- C#
let mut poll = association
.add_poll(
ReadRequest::ClassScan(Classes::class123()),
Duration::from_secs(5),
)
.await?;
dnp3_request_t *poll_request = dnp3_request_new_class(false, true, true, true);
dnp3_poll_id_t poll_id;
err = dnp3_master_channel_add_poll(channel, association_id, poll_request, 5000, &poll_id);
dnp3_request_destroy(poll_request);
// check error
auto event_scan = dnp3::Request::class_request(false, true, true, true);
const auto event_poll = channel.add_poll(assoc, event_scan, std::chrono::seconds(10));
PollId poll =
channel.addPoll(
association, Request.classRequest(false, true, true, true), Duration.ofSeconds(5));
var poll = channel.AddPoll(association, Request.ClassRequest(false, true, true, true), TimeSpan.FromSeconds(5));
The Request
class is a builder type that lets you construct arbitrary READ requests, including:
- Class reads (0,1,2,3)
- One- or two-byte range reads
- All objects (qualifier 0x06) reads for arbitrary variations