OptrisOptrisDocumentation

Documentation/OTC SDK/OTC SDK — C API referencev12.0

optris_sdk_pif_fail_safe_config

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_ms; 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. On every frame the camera delivers, the watchdog checks 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. optris_sdk_pif_poll() does not move the line at all.

Public attributes

struct_size

uint32_t struct_size

Set to sizeof(optris_sdk_pif_fail_safe_config).

enabled

uint8_t enabled

Non-zero to arm the watchdog.

on_alarm

uint8_t on_alarm

Deprecated

Never implemented, on any camera. optris_sdk_pif_set_fail_safe() answers OPTRIS_SDK_ERROR_NOT_SUPPORTED when this is non-zero, 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

uint8_t on_flag_timeout

Deprecated

Not configured from here, and there is no C entry point that does configure it. The shutter is watched by the imager, through a legacy setting reachable only from a legacy configuration file. optris_sdk_pif_set_fail_safe() answers OPTRIS_SDK_ERROR_NOT_SUPPORTED when this is non-zero, so no application believes it has a shutter interlock it does not have.

index

uint8_t index

Which channel carries the line.

signal

optris_sdk_pif_signal signal

The line's electrical nature.

active_value

float active_value

Level driven when the watchdog is satisfied.

Used only when signal is OPTRIS_SDK_PIF_SIGNAL_ANALOG. 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's 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. Two levels you set that land on one converter code are still refused by optris_sdk_pif_set_fail_safe() and by optris_sdk_pif_configure() with OPTRIS_SDK_ERROR_INVALID_ARGUMENT, 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

Level driven when it is not. See active_value for the unit.

period_ms

uint32_t period_ms

Shortest interval between edges, in milliseconds. The watchdog offers a step on every passed check; a step that arrives sooner than this is skipped.

Bounded above by optris_sdk_pif_hardware_info::fail_safe_max_period_ms -- 250 on every interface today. A longer period is refused with OPTRIS_SDK_ERROR_OUT_OF_RANGE, not clamped: a value the interface's relay cannot hold produces exactly the fault this line exists to report.

Zero means "step on every passed check", which is what the hardware group would rather an application asked for: the SDK knows the frame rate and the interface. It does not mean "never step".

flag_cycles

uint16_t flag_cycles

Deprecated

Inert. Meaningful only alongside on_flag_timeout, which is refused, so this can never be reached. Deliberately not refused on its own: it 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.

default_to_range_endpoints

uint8_t default_to_range_endpoints

Non-zero to beat between the two ends of the channel's range when no level was given. Non-zero by default; optris_sdk_pif_fail_safe_config_init() sets it.

With this set and active_value / inactive_value still at their defaults, an analog fail-safe drives the top and the bottom of the channel's output range -- 20 and 4 mA, 20 and 0 mA, 10 and 0 V -- the largest edge the channel can make, so a receiver with no levels configured still sees a heartbeat. Set either level to anything else and that is what is driven instead: this governs the default, it never overrides an instruction.

A flag rather than a sentinel in the floats because telling "the caller asked for 1" from "nobody set a level" needs a third state, and these values round-trip through JSON, which writes NaN as null and throws reading it back. 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.

Appended into the first byte of what was a two-byte reserved0, so sizeof(optris_sdk_pif_fail_safe_config) is unchanged and a caller built against the previous header still passes a struct_size this one accepts. Such a caller reaches optris_sdk_pif_fail_safe_config_init() for its defaults and so gets this set, which is the intended new default; one that zeroed the struct by hand instead gets the previous behaviour.

reserved0

uint8_t reserved0

Reserved; always zero.