Time Filter (BTimeFilterBlock)

This block filters out values whose timestamp does not match one or more configured criteria. The Time Filter block is primarily intended for analytic trend requests, but also supports analytic value requests. The timestamp for an analytic value request is the current station time. If the analytic value request does not pass the enabled criteria, the request returns a resulting value with a null status.

In general, the timestamp must pass all of the enabled criteria for a value to be returned. If both Time Range 1 and Time Range 2 are configured, the timestamp must pass only one of the time range criteria. This is an ‘or’ gate that combines Time Range 1 and Time Range 2 into a single criterion with all of the other enabled criteria.

Figure 107.   Time Filter properties
Image

To view these properties, double-click on the Wire Sheet block or the block name in the Nav tree.

Property Value Description
Out read-only value slot Outputs a filtered value.
In read-only value slot Links from the output of other logic blocks or data sources to supply trend data to the current logic block.
Current Day of Week true or false (default) Determines if the timestamp must match the real-time day of the week.

true requires the day of week from the timestamp being evaluated to match the day of the week for the station’s current time.

For example, if true, if the station’s current time day of week is Monday, and if the trend request time range is last month, the result will contain data from all Mondays in the previous month.

false permits the resulting value to include any day of the week.

Current Week of Month true or false (default) Determines if the timestamp must match the real-time week of the month.

true requires the week of month from the timestamp being evaluated to match the week of month from the station’s current time.

For example, if true, the station’s current time week of month is 2nd week, and the trend request time range is previous three months, the result will only contain data from the 2nd week of the three previous months.

false permits the resulting value to contain data from any week of the month.

Current Month true or false (default) Determines if the timestamp must match the real-time month.

true

requires the month of year from the timestamp being evaluated to match the month of year for the station’s current time. If true, the station’s current month of the year is September 2025, and the trend request time range is previous two years, the result will only contain data from September 2023 and September 2024.

false permits the resulting value to contain data from any month.

Current Time Window hours minutes seconds Sets a time of day for evaluation. If configured, the timestamp being evaluated must fall within the configured time range of the current day.

For example, if Current Time Window is 2 hours, the station’s current time is 3:31 PM, and the trend request time range is today, the result will only contain records whose timestamp is between 1:31 PM and 3:31 PM of today.

Time Range 1 and Time Range 2 Start Time and End Time Defines a range for time of day. If configured, the timestamp being evaluated must fall within the configured time range. If you configure both Time Range 1 and Time Range 2 the timestamp being evaluated must fall within one of the time range criteria and all of the other enabled criteria. An ‘or’ gate can combine Time Range 1 and Time Range 2 into a single criterion.

For example, if Time Range 1 is 6:00 AM - 12:00 PM and Time Range 2 is 5:00 PM - 9:00 PM, and the trend request time range is last week, the result will contain records from any day during last week where the timestamp is in the range of 6:00 AM - 12:00 PM or 5:00 PM - 9:00 PM.

Invert Time Range true or false (default) Excludes from the output the time range given in Time Range 1 and Time Range 2.
 NOTE: If the time range spans to the next day, configure End Time for Time Range 1 as 11:59 PM and not 12 AM. 

Example

Consider an algorithm with a Time Filter Block configured with Time Range 1 = 8:00 AM - 5:00 PM and Invert Time Range = true. The Invert Time Range = true causes the algorithm to filter out any values whose timestamp is in the range of 8:00 AM - 5:00 PM for any day.

Figure 108.   Time range algorithm
Image

This type of algorithm is useful for analyzing data during an unoccupied or off peak time period. It creates a chart like the following.

Figure 109.   Chart filtered by time range
Image