BACnet.Protocol.SetpointReference (bacstack v0.1.0-dev.1)

Copy Markdown View Source

A Setpoint Reference is a nullable pointer to another property that should be treated as the setpoint for a control loop object (Loop, Analog Output, etc.).

When the reference is present, the control algorithm is expected to treat the value of the referenced property as its current setpoint rather than using a locally configured setpoint. This indirection is extremely useful in cascaded control strategies, in demand-limiting applications, and anywhere the desired setpoint is computed or selected by some other object in the system.

The reference uses the common Object Property Reference type so that it can point at properties in the same device or, when the full Device + Object form is used, at properties in other devices.

Examples (Doc Test)

iex> ref = %SetpointReference{
...>   ref: %ObjectPropertyRef{
...>     object_identifier: %ObjectIdentifier{type: :analog_value, instance: 5},
...>     property_identifier: :present_value,
...>     property_array_index: nil
...>   }
...> }
iex> ref.ref.property_identifier
:present_value

Summary

Types

t()

Optionally references another property to be used as the setpoint for a control loop.

Functions

Encodes a BACnet setpoint reference into application tags encoding.

Parses a BACnet setpoint reference from application tags encoding.

Validates whether the given setpoint reference is in form valid.

Types

t()

@type t() :: %BACnet.Protocol.SetpointReference{
  ref: BACnet.Protocol.ObjectPropertyRef.t() | nil
}

Optionally references another property to be used as the setpoint for a control loop.

Functions

encode(setpoint, opts \\ [])

@spec encode(t(), Keyword.t()) ::
  {:ok, BACnet.Protocol.ApplicationTags.encoding_list()} | {:error, term()}

Encodes a BACnet setpoint reference into application tags encoding.

parse(tags)

Parses a BACnet setpoint reference from application tags encoding.

valid?(t)

@spec valid?(t()) :: boolean()

Validates whether the given setpoint reference is in form valid.

It only validates the struct is valid as per type specification.