Examples of Scheduling Polled Triggers
You can schedule calculations using polled triggers, as shown in the following examples.
Example 1: Scheduling a Trigger to Fire Once a Day
- Select the tagname to which you want to apply the trigger.
- In the Collection tab, select Polled from the Collection Type drop-down list.
- Set the Collection Interval to 24 hours.
- Set the Collection Offset to 8 hours.
- Click Update.
Example 2: Scheduling a Trigger to Fire on a Specific Day
- Select the tagname to which you want to apply the trigger.
- In the Collection tab, select Polled from the Collection Type drop-down list, and configure the time of day by setting the Collection Interval to 24 hours and the Collection Offset to 17 hours.
- Click Update.
- Click the Calculation tab.
- Monday is the second day of the week, so enter the following VBScript in the Calculation pane:
Dim curDate curDate=CurrentTime IF (Weekday(curDate))=2 THEN Result=50 <Place your calculation here> END IF
- Click Update.
Notice that the
CurrentTime
built-in function is used in this example instead ofNow
.
Example 3: Scheduling a Trigger to Fire on the First Day of Every Month
The following is an example of how to schedule a calculation to occur on the first day of every month:
Dim curDate curDate=CurrentTime
IF (day(curDate))=1 THEN
Result=50 <Place your calculation here>
END IF
Example 4: Scheduling a Trigger to Fire on the Last Day of Every Month
The following is an example of how to schedule a calculation to occur on the last day of every month:
Dim curDate curDate=CurrentTime+1
IF (day(curDate))=1 THEN
Result=50 <Place your calculation here>
END IF
Example 5: Creating a Controlled Sequence of Polled Tags Using a Collection Offset
A controlled sequence is a calculation that is based on the result of another calculation. The following is an example of how to configure a controlled sequence of polled tags by using the collection offset. The collection offset is greater than 0 in this example.
A tag named SumOfData
has a Collection Interval of 60 seconds and the Collection Offset of 0 milliseconds.
SumofData
performs the first calculation:Result = CurrentValue("DataTag1") + CurrentValue("DataTag2")
Another tag, named CorrectedUnits
, uses a Collection Interval of 60 seconds, but a Collection Offset of 1000 milliseconds.
CorrectedUnits
fires and performs another calculation based on the output of the first calculation: Result = CurrentValue("SumOfData") *.0001