IoSnapshot
pub struct IoSnapshot
An atomic read of every PIF channel.
Taken by ProcessInterface::read_all in one transaction, so the
values cannot skew against each other.
The decoded analog values are in each channel's configured unit,
which for a channel whose unit is a temperature is the SDK's
temperature unit (Celsius unless crate::set_temperature_unit
chose Fahrenheit). IoSnapshot::raw_analog_inputs is volts in
either unit.
IoSnapshot — methods
pub fn timestamp_us(&self) -> Result<u64>
When the snapshot was taken, on the camera's clock.
Errors
Returns Status::InvalidHandle if the snapshot is unusable.
pub fn digital_inputs(&self) -> Result<Vec<DigitalState>>
The digital inputs at that instant.
Errors
pub fn digital_outputs(&self) -> Result<Vec<DigitalState>>
The digital outputs at that instant.
Errors
pub fn analog_inputs(&self) -> Result<Vec<f32>>
The analog inputs at that instant, in each channel's configured unit.
A channel with no configuration over it has no unit of its own
and reads in volts, the same unit as
IoSnapshot::raw_analog_inputs.
Errors
pub fn raw_analog_inputs(&self) -> Result<Vec<f32>>
The same analog inputs as they are on the wire, in volts, before any channel decode.
What a multimeter on the pin would show. A readout and an alarm
want IoSnapshot::analog_inputs: "0.94 emissivity", "6.3
bar"; commissioning wants this one, because an operator wiring a
sensor asks what voltage is actually on the pin. Both are here
because a configured channel could otherwise give only the
first.
Transaction-consistent with IoSnapshot::analog_inputs, at no
extra cost in device traffic. NaN while
IoSnapshot::inputs_known is false.
Errors
pub fn analog_inputs_clamped(&self) -> Result<Vec<bool>>
Whether each analog input's decoded value is being held at one of its configured bounds.
The actionable half of IoSnapshot::raw_analog_inputs, and
the answer to "is my sensor saturated, or is my slope wrong?".
With input_min and input_max set, a sensor driven past its
bound reads as the bound and nothing else says the wire has gone
further.
False for a channel with no bounds configured, for an
unconfigured channel, and while IoSnapshot::inputs_known is
false. This is the channel's clamp only; the wire clamp (the
fixed 0-10 V the hardware can carry) shows in
IoSnapshot::raw_analog_inputs instead.
Errors
pub fn analog_outputs(&self) -> Result<Vec<f32>>
The analog outputs at that instant, as they are on the wire, in
the unit ProcessInterface::read_analog_output answers in:
volts or milliamperes, the same numbers in Celsius and in
Fahrenheit, even on a temperature channel.
Errors
pub fn inputs_known(&self) -> Result<bool>
Whether the snapshot's input readings mean anything.
Read this before the inputs. Most process interfaces
cannot be read on demand: their inputs arrive with a frame.
Before the first frame there is no reading yet, and this is
false -- the digital inputs then read as
DigitalState::Unknown and the analog inputs as NaN, so a
caller that ignores this cannot mistake them for measurements.
The outputs are valid either way: they are what the SDK drove.
Errors
pub fn fail_safe_level(&self) -> Result<DigitalState>
The level on the dedicated fail-safe terminals.
DigitalState::Unknown when nothing has driven them: no
fail-safe configured, one configured onto an ordinary digital
or analog output instead, or one armed whose first heartbeat
has not arrived.
The dedicated line is not a digital output: it has no
index and appears in neither IoSnapshot::digital_outputs
nor ProcessInterface::read_digital_output, so this is its
only readback.
Like the outputs either side of it, this is what the SDK drove rather than a measurement -- no process interface reports that terminal back.
For the line's health, read
ProcessInterface::fail_safe_health instead. This level
alternates by design, so it flickers between high and low on a
perfectly healthy system and is not a health indicator.