blockSelectSortedAvailable

Generate a true array of n elements based on priority order and availability

Information

This block selects n lead/lag alternate units to enable, choosing among available units in priority order.

The output has size nEqu (total equipment count), not nEquAlt (number of lead/lag alternate units), so it can be combined directly with the required-unit enable signals from Buildings.Templates.Plants.Controls.StagingRotation.BaseClasses.SelectEquipmentAtStage.

Parameters

TypeNameDefaultDescription
IntegernEquNumber of units
IntegernEquAltNumber of lead/lag alternate units

Connectors

TypeNameDefaultDescription
Buildings.Controls.OBC.CDL.Interfaces.IntegerInputnNumber of required lead/lag alternate units
Buildings.Controls.OBC.CDL.Interfaces.IntegerInput[nEquAlt]uIdxSorIndices of lead/lag alternate equipment sorted by increasing runtime
Buildings.Controls.OBC.CDL.Interfaces.BooleanInput[nEqu]u1AvaEquipment available signal
Buildings.Controls.OBC.CDL.Interfaces.BooleanOutput[nEqu]y1Enable signal

Components

TypeNameDefaultDescription
Buildings.Controls.OBC.CDL.Conversions.BooleanToInteger[nEqu]avaIntCast available signal to integer
Buildings.Controls.OBC.CDL.Routing.IntegerVectorReplicatoravaIntAltRepReplicate to support reordering at next step
Buildings.Controls.OBC.CDL.Routing.IntegerExtractor[nEquAlt]avaIntIdxEquAltAvailable signals of lead/lag alternate equipment reordered based on idxEquAlt
Buildings.Controls.OBC.CDL.Integers.Multiply[nEquAlt]excUnaFilter out unavailable units
Utilities.TrueArrayConditionaltruArrConGenerate array of size nEqu with nAltReq true elements at uIdxAltSor indices

Revisions

  • June 10, 2026, by Antoine Gautier:
    First implementation.