Constant blocks

These components output a primitive value (Boolean, Enum, Numeric or String). Constant blocks support both value and trend requests. They either use the Time Range and Interval properties from the trend request to generate a constant trend with timestamps in the time range at the configured interval and the configured constant value, or a constant trend based on the value of the Make Trends or Makes Trends property.

The four constants return data as follows:

  • A Boolean Constant Block outputs a Boolean value of either True (1) or False (0).
  • An Enum Constant Block outputs an Enumerated value. The Enum Range property configures either a frozen or user-defined range (ordinal and tag values pairs), which applies to the Value property.
  • A Numeric Constant Block outputs a numeric value.
  • A String Constant Block outputs a string value.

Consider an algorithm named BooleanConstant.

Figure 79.   BooleanConstant algorithm
Image

This algorithm has a Boolean Constant Block with Makes Trends = false (the default) and Value = true. The Out slot on the Boolean Constant Block is linked to a Result Block.

Next, consider a Px configured as follows:

Figure 80.   Px Analytic Table Binding for the BooleanConstant algorithm
Image

The px is configured with a Bound Table and an Analytic Table Binding configured with data = alg:BooleanConstant, timeRange = yesterday, interval = Five Minutes. The Boolean Constant Block handles the trend request by generating a constant trend with five-minute-interval records all of which have values set to true for yesterday.

Now, consider another algorithm named BooleanConstantLogicFilter.

Figure 81.   BooleanConstantLogicFilter algorithm
Image

This algorithm includes a Logic Filter Block and a second Boolean Constant Block.

The Logic Filter Block requires the block linked into the Trend In slot to provide a trend, but in this case the Boolean Constant does not generate a trend to pass via the link to the downstream block in the algorithm.

Figure 82.   No trend data returned
Image

The BooleanConstantLogicFilter algorithm returns no data from the trend request.

But when the Makes Trends property on the Boolean Constant Block is set to true, the algorithm generates a constant trend.

Figure 83.   Makes Trends property set to true on the Boolean Constant Block
Image

The Boolean Constant Block passes the trend data to the Logic Filter Block Trend In slot causing the BooleanConstLogicFilterMakesTrend algorithm to return a result for yesterday.

Figure 84.   Constant trend data returned by the BooleanConstLogicFilterMakesTrend algorithm
Image