Add Processed Historic Values to Function Block Diagrams
You can add processed historic values (historic values that have been calculated using a historic algorithm) to your Function Block Diagrams. This may be useful if you need to use a daily average or some other calculated value as part of the Function Block Diagram Logic.
To add a processed historic value to a Function Block Diagram:
- Display the Add Direct Variable window by performing one of these procedures:
Either:
- In the Variables list (above the Function Block Diagram display), select the Direct tab.
A list of the Function Block Diagram's direct variables is shown. - Right-click on the direct variable that you want to use again.
A context sensitive menu is displayed. - Select the Add option.
The Add Direct Variable window is displayed.
Or:
- In the Variables list (above the Function Block Diagram display), select the Direct tab.
A list of the Function Block Diagram's direct variables is shown. - Right-click on the direct variable that you want to use again.
A context sensitive menu is displayed. - Select the Add option.
The Add Direct Variable window is displayed.
- In the Variables list (above the Function Block Diagram display), select the Direct tab.
- In the Name field, enter a suitable name for the variable.
- Use the Tag Type combo box to define whether the variable is Read Only, Write Only, or Read/Write.
- Select the browse button next to the Tag field.
A context sensitive menu is displayed. - Select the OPC Historic Tag option to display the Select Historic Tag window.
- Expand a Root Group folder. Each Root Group folder represents a system.
- Expand the group folders until you locate the item that has the required historic data.
This is the item that has the historic data that you want to use as a value on your Function Block Diagram. - Select the item. This will associate the variable tag with the historic data of the selected database item.
- Use the check box and combo boxes at the bottom of the Select Historic Tag window to define the time span and algorithm:
- Relative—Use to determine whether a relative or absolute reference is used to reference the item's historic tag.
- Check the check box to use a relative reference to the item's historic tag. The reference will work as long as the location of the selected database item remains the same in relation to the Function Block Diagram.
- Clear the check box to use an absolute reference. The reference will only work when the selected database item remains in the current location.
- Algorithm—Choose the type of historic algorithm that ClearSCADA uses to process the historic data .
- Start Date—Choose or enter the start time for the range of historic values. The Function Block Diagram can only use historic values that have been recorded after the selected date.
You can choose from the following default options or you can enter a start time:
- M—The time period starts at the beginning of the current minute.
- M-1M—The time period starts at the beginning of the previous minute.
- H—The time period starts at the beginning of the current hour.
- H-1H—The time period starts at the beginning of the previous hour.
- D—The time period starts at the beginning of the current day.
- D-1D—The time period starts at the beginning of the previous day.
- W—The time period starts at the beginning of the current week.
- W-1W—The time period starts at the beginning of the previous week.
To enter a start date, simply enter the time in the OPC format. For example, if you want the start date to be 3 weeks prior to the start of the current week, enter W-3W.
- Interval—Enter or choose the duration of the time period. The Function Block Diagram will only use those historic values that were recorded after the start date and within the specified interval. For example, if the Start Date is H and the Interval is 30M, the time period is 30 minutes after the start of the current hour. Any historic values that were recorded for the item outside of this time period are disregarded.
As with the Start Date, you can choose from the list of default intervals, or you can enter your own interval in the OPC time format. If you set the interval to 0, the program cannot be executed.
- Relative—Use to determine whether a relative or absolute reference is used to reference the item's historic tag.
- Select the OK button to confirm your selection and close the Select Historic Tag window.
- On the Add Direct Variable window, use the Type combo box to choose the type of value for the historic variable. The type of value that you select has to be appropriate for the type of database item. For more information, see Built-In Data Types.
- Leave the Retained check box clear. The Retained feature is designed to be used with internal variables. When selected, it allows the internal variable to be stored and transferred to other servers (in a multi-server setup).
For more information on the Retain feature, see Using the RETAIN Keyword in an ST Program.
- Use the No Cache check box to determine whether the program uses the latest value or the initial value for a variable on each execution. If you check the No Cache check box, the program will use the latest value for the variable rather than the default value. If you clear the No Cache check box, the program will use the default value for the variable on each execution.
The No Cache feature is especially useful with variables that are used as counts. For more information on the No Cache feature, please refer to Using VAR NOCACHE to Prevent Cached Values Being Used in an ST Program.
- Select the OK button to confirm your selections and close the Add Direct Variable window.
- Select the historic variable in the Variables list (Direct tab). Keep the left-hand mouse button pressed down.
- Drag the historic variable from the Variables list onto the Function Block Diagram.
A context sensitive menu is displayed. - Select the option that corresponds with the type of internal variable that you are adding to the Function Block Diagram (see Function Block Diagram Components).
A new variable is added to the Function Block Diagram.