DataSourceBlocks and calculations

The DataSourceBlock is the primary means to supply data to an algorithm. The block supports both value and trend requests. Logic blocks, of which there are many, provide the algorithm calculations. Each algorithm’s Wire Sheet contains these blocks.
Figure 12.   Example of a DataSourceBlock
Image

The Data property in the block does not reference specific end points in the station by slot path or handle ORD, rather it references a type of data available in the station based on metadata, which are implied or based on direct tags or tag groups, or another algorithm.

An edit icon on the right side of the Data property launches a Select Data field editor. You use this editor to configure the desired tag or algorithm for the block to use. You may use metadata tags, such as hs:power or hs:zoneAirTempSensor, to reference specific data in the station, or you may reference another algorithm from the station using the alg: prefix, such as alg:CostCalculation.

If the configured data are not available for the analytic request to process, the request uses the value from an object linked into the Fallback In slot as an alternate data source. This makes it possible to design an algorithm to use against components in the station that function the same but my not have identical data sources. For example, not all zones might have an unoccupied cooling setpoint (hs:zoneAirTempUnoccCoolingSp) so the DataSourceBlock may need to have a numeric constant block linked to the Fallback In slot. You may link the Fallback In slot from the output of other logic blocks, constant blocks, or another DataSourceBlock.

The framework processes the data in the DataSourceBlock using these properties, which you can configure:

  • Aggregation combines the values from multiple data sources into a single value.
  • Rollup combines records from a single data source into less granular records. This typically only applies to trend requests, but may also apply to value requests where the algorithm contains a block like Runtime or Sliding Window, which processes a trend request.
  • Totalize applies to requests where the Data Source resolves to a history with ever increasing values tagged with the hs:hisTotalized tag.
  • A Data Filter is an optional NEQL predicate used to configure data sources in the sub-tree of the node specified by the request. When a node meets the predicate, its sub-tree stops searching for additional values.
Figure 13.   Logic Folder used to organize logic blocks
Image

You may use a Logic Folder within the Algorithms component to organize these calculations. A logic folder is like an algorithm. It does not do anything itself, meaning that it contains no special code to perform calculations or evaluations, rather it executes all of the child blocks in its Wire Sheet, which must terminate in a final link to the Logic Folder’s Result block.

When you nest a Logic Folder in an algorithm, you may think of it as a DataSourceBlock and link its Out slot to other blocks in the algorithm.