OptrisOptrisDocumentation

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

optris::sdk::pif::PifChannelConfig

One channel, as data.

Field-identical to the HAL's hal::PifChannelConfig on purpose: the two are converted by one function, so a divergence is a compile error rather than a behaviour bug.

When the channel's own unit is a temperature: When the channel's own unit is a temperature That is kAmbientTemperature, kInternalTemperature and a kMeasurementField on a temperature statistic. Its own unit is then the SDK's temperature unit (Celsius unless SetTemperatureUnit() chose Fahrenheit): input_min, input_max and threshold are temperatures in it, and gain and offset map that unit to the wire. The SDK keeps the mapping in Celsius and re-expresses it for the unit in force, so the same wire mapping reads back as different numbers in Fahrenheit (gain / 1.8, and an offset that absorbs the 32 F shift). A kMeasurementField on a standard deviation is a difference and takes no shift. 0 and 0 for the clamp still mean no clamp. Every other kind (emissivity, an uncommitted value, the digital ones) is not converted.

What is on the wire is never converted: What is on the wire is never converted The temperature a channel carries follows the unit: the value PifController::WriteAnalogOutput() takes and the value PifController::ReadAnalogInput() decodes. The level on the pin does not, because a wire value is never a temperature: PifController::ReadAnalogOutput(), IoSnapshot::analog_outputs, PifController::ReadRawAnalogInput(), IoSnapshot::raw_analog_inputs and the SignalField::kAnalogOut signal answer in volts or milliamperes, the same numbers in Celsius and in Fahrenheit.

Public attributes

index

uint8_t index = 0

Flat channel index. The HAL does the (device, pin) arithmetic for stacked PIFs; nothing above the line addresses a device.

direction

PifDirection direction = PifDirection::kOutput

signal

PifSignal signal = PifSignal::kDigital

kind

PifChannelKind kind = PifChannelKind::kOff

gain

float gain = 1.0F

Conversion between the wire value and the channel's own unit: inputs decode as (raw - offset) / gain, outputs encode as gain * value + offset.

offset

float offset = 0.0F

input_min

float input_min = 0.0F

Clamp applied to a decoded analog input, in the channel's own unit. Leave both at 0 for no clamp. This is configuration, not a constant: v11 pins emissivity to [0.1, 1.1] in code, while the desktop products persist the bounds per configuration.

input_max

float input_max = 0.0F

threshold

float threshold = 0.0F

Level at which an analog input counts as asserted, in the channel's own unit, for the kinds that act on a crossing rather than on a value -- kFlagControl and kResetPeakValleyHold.

This is not a convenience. The Xi80 and Xi410 firmware report zero digital inputs of any kind (MAX_SPIF_DI 0, MAX_IPIF_DI 0): an analog input with a threshold is the only way those cameras take a signal in, and the threshold is what does a digital line's job. Version 11 had no way to set it.

threshold_low_active

bool threshold_low_active = true

The channel is asserted when the input is below the threshold rather than above it.

output_range

AnalogRange output_range

Range an analog output drives into.

active_value

float active_value = 1.0F

Levels this pin drives when asserted and when not. They belong to the pin rather than to whatever asserts it, because several alarm rules can share one pin and must agree on its levels.

On an analog output these are in output_range's own unit -- volts in 0-10 V, milliamperes in 0-20 mA and 4-20 mA, never amperes. That is the one unit every analog value above the wire is in, and the converter is the only place it changes. The defaults, 1 and 0, are therefore 1 mA and 0 mA on a current range; in 4-20 mA both clamp to 4 mA, which is one converter code and no edge at all. Set them from the range.

On a digital output they are a logic level: non-zero asserts. active_low inverts the electrical sense.

inactive_value

float inactive_value = 0.0F

intermediate_value

float intermediate_value = 1.0F

A third level, for the kinds whose state is not binary: the shutter is open, closed, or moving between the two. Same unit as active_value -- output_range's own.

active_low

bool active_low = false

Digital outputs: invert the electrical sense, so "asserted" drives the line low.

autonomous

bool autonomous = false

The camera firmware drives this channel without the host. Per channel, not per device -- a device can run some channels autonomously and leave others to the application.

target

int32_t target = -1

Kind-specific target: for kMeasurementField, the region id that Imager::Regions().Add() returned. -1 when the kind has no target.

The id, not the signal slot. A slot is documented as "a runtime handle, not an identity" and changes when a region is removed and re-added, and this field is persisted -- it round-trips through the channel table and through the JSON -- so a slot stored here would come back naming a different region or none. The resolution from id to slot happens once per frame, where the regions are.

This said "the region slot", the C header said "the region id", the .NET binding said "the region", and the runtime used it as a position in the legacy measurement-field list -- four meanings, so the output was never driven on a v12 camera at all. One meaning now: the id.

A region id is a uint64_t and this field is signed 32-bit. Ids are allocated from 1 upward, so every id a camera produces in practice fits; a configuration that adopts ids of its own (loading a saved region set can) could exceed it, and such a target will not resolve. Widening the field is an ABI change across the C API and four bindings and has not been made.

statistic

SignalField statistic = SignalField::kMean

Which statistic of target a kMeasurementField channel encodes.

Deliberately the alarm system's SignalField rather than a PIF enum of its own: "the maximum of that region" means one thing in this SDK, and a rule watching the same statistic and a PIF channel driving it should name it the same way.

name

std::string name

Name and unit of a kUncommittedValue; diagnostics for other kinds.

unit

std::string unit

decimals

uint8_t decimals = 1

Display precision for a named value.