optris::sdk::pif::PifFailSafeConfig
The fail-safe line: a watchdog that must keep changing, plus the conditions that trip it.
The toggle is the load-bearing part. The line alternates every period; a receiver that sees it stop knows the host stopped, which is the entire point. A constant level would be indistinguishable from the fault it exists to signal.
The alternation is produced by the fail-safe watchdog and by nothing else. The watchdog checks, on every frame the camera delivers, that frames are still arriving, that the pipeline still finishes them, that the shutter still cycles and that the application has not asked for an interrupt; only a check that passes moves the line. Nothing here paces itself off a timer, and PifController::Poll() does not move the line at all.
Public attributes
enabled
bool enabled = false
index
uint8_t index = 0
signal
PifSignal signal = PifSignal::kDigital
active_value
float active_value = kFailSafeActiveLevelDefault
The level driven when the watchdog is satisfied, and when it is not.
Used only when signal is PifSignal::kAnalog. On a digital line and on the dedicated fail-safe terminals the watchdog drives the pin's own two states and these two fields are inert.
On an analog line they are in the channel's output_range own unit -- volts in 0-10 V, milliamperes in the two current ranges.
A level you set here is driven exactly as set, whatever default_to_range_endpoints says. The flag governs what happens when you set nothing; it never overrides an instruction. Two levels you set that land on one converter code are still refused by SetFailSafe() and by Configure(), because a line that cannot move is the fault this signal exists to report.
The defaults, 1 and 0, are logic levels inherited from the digital case and mean nothing on an analog line -- on a 4-20 mA line both clamp to 4 mA and land on one converter code. They are left in place as the mark that no level was given, and default_to_range_endpoints is what resolves them.
inactive_value
float inactive_value = kFailSafeInactiveLevelDefault
default_to_range_endpoints
bool default_to_range_endpoints = true
Beat between the two ends of the channel's range when no level was given. On by default.
The hardware group's decision: "beat over the whole range. In 0-20 mA a 1 mA swing is too small to count on downstream, so please make the default beat between the range's two ends ... so a customer who sets no levels still gets a heartbeat a PLC can see. Levels a caller sets stay as set."
So with this set and active_value / inactive_value still at their defaults, an analog fail-safe drives output_range.max and output_range.min -- 20 and 4 mA, 20 and 0 mA, 10 and 0 V -- the largest edge the channel can make. Set either level to anything else and that is what is driven instead.
Why a flag and not a sentinel in the floats. Telling "the
caller asked for 1" from "nobody set a level" needs a third state, and a float here cannot carry one: these values round-trip through JSON, which writes NaN as null and then throws reading it back, so a NaN mark would make a saved configuration unloadable. The flag carries the third state out of band. Clear it to drive a literal 1 and 0 on an analog line -- which on a live-zero range is then refused, correctly, as a flat line.
Inert on a digital line and on the dedicated fail-safe terminals, where the two levels are inert as well.
period
std::chrono::milliseconds period = kFailSafePeriodDefault
Shortest interval between edges. The watchdog offers a step on every passed check; a step that arrives sooner than this is skipped, so the command channel is not saturated on a fast camera.
Bounded above by PifHardwareInfo::fail_safe_max_period -- 250 ms on every interface today. A longer period is refused, not clamped: a value the interface's relay cannot hold produces exactly the fault this line exists to report, and accepting it while reporting success would be a defect.
Zero means "step on every passed check", which is what version 11 did and what the hardware group would rather the application asked for: the SDK knows the frame rate and the interface, and an application guessing at a cadence cannot do better. It does not mean "never step".
On a digital output the interval is at least 100 ms, whatever is set here. A digital output is a relay, and it is capped at a few changes a second regardless of the frame rate; at zero it would otherwise switch on every frame. GetFailSafe() still answers the period that was set.
on_alarm
bool on_alarm = false
Deprecated
Never implemented, on any camera. SetFailSafe() rejects this with PifError::kUnsupported rather than accepting it and ignoring it. Drive an ordinary digital or analog output from the alarm instead, and keep the fail-safe line for camera and pipeline health.
on_flag_timeout
bool on_flag_timeout = false
Deprecated
Not configured from here, and there is no v12 surface that does configure it. The shutter is watched by the imager, via the legacy IRImagerConfig::failSafeFlagTimeouts, which is reachable only from a legacy configuration file -- not from this API, the C ABI or .NET. SetFailSafe() rejects this with PifError::kUnsupported so no application believes it has a shutter interlock it does not have.
flag_cycles
uint16_t flag_cycles = 1
Deprecated
Inert. Meaningful only alongside on_flag_timeout, which is refused, so this can never be reached.
Deliberately not refused on its own: the field is part of the record every caller round-trips, and refusing a value that was merely read back and written again would reject a plain watchdog that asked for nothing.