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

Copy Markdown View Source

BACnet Limit Enable is a two-bit bit string that controls which of the intrinsic or algorithmic limit-detection mechanisms are active for an object (primarily Analog Input/Value, Large Analog Value, etc.).

BitNameWhen TRUE the corresponding limit algorithm runs
0LOW_LIMIT_ENABLELow-limit (low-limit + deadband) detection is enabled
1HIGH_LIMIT_ENABLEHigh-limit (high-limit + deadband) detection is enabled

The flags appear as the limit_enable property and directly affect whether OUT_OF_RANGE or OUT_OF_RANGE / DOUBLE_OUT_OF_RANGE events can be generated.

BACnet Specification References

  • ASN.1 (Clause 21): BACnetLimitEnable ::= BIT STRING { low-limit-enable (0), high-limit-enable (1) }
  • Object types: Used by Analog Input (12.2), Analog Value (12.4), Large Analog Value (12.39), and several other numeric objects that support intrinsic alarming.

Examples (Doc Test)

iex> enable = %LimitEnable{low_limit_enable: true, high_limit_enable: true}
iex> enable.low_limit_enable
true

See Also

Summary

Types

t()

Two Boolean flags controlling low- and high-limit detection (see module docs).

Functions

Encodes a BACnet limit enable into application tags encoding.

Creates from an application tag bitstring a limit enable.

Parses a BACnet limit enable from application tags encoding.

Creates an application tag bitstring from a limit enable.

Validates whether the given limit enable is in form valid.

Types

t()

@type t() :: %BACnet.Protocol.LimitEnable{
  high_limit_enable: boolean(),
  low_limit_enable: boolean()
}

Two Boolean flags controlling low- and high-limit detection (see module docs).

Functions

encode(flags, opts \\ [])

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

Encodes a BACnet limit enable into application tags encoding.

from_bitstring(bitstring)

@spec from_bitstring(tuple()) :: t()

Creates from an application tag bitstring a limit enable.

parse(tags)

Parses a BACnet limit enable from application tags encoding.

to_bitstring(t)

Creates an application tag bitstring from a limit enable.

valid?(t)

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

Validates whether the given limit enable is in form valid.

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