Scan Classes
Scan classes dictate the rate of execution of tags, and therefore play a crucial role in the design of large and high-performance systems. It will often make sense to have more than one scan class as usually not all of your tags will need to be subscribed at the same rate. Some tags you may wish to see updated at 250-500ms, while others may not be so crucial and may only need to be subscribed at 1500ms.
Creating different scan classes allow you to organize your tags into groups that subscribe at different rates. It is good practice to put some forethought and planning into the organization of your Tags and scan classes.
Tag Execution by Scan Class
Tags are executed by scan classes inside of a tag provider. In a typical system, there are a number of scan classes and one or two tag providers: the internal tag provider and possibly an external tag provider.
-
Internal provider keeps the tag configuration in the project.
-
External provider stores tag configuration and values in a database.
Tags stored in an external provider are available to all Ignition installations that have access to that database. One of the installations can be specified as the tag's driver. The driving system has a copy of the scan class that it executes, which in turn evaluates the tag. The value is stored to the database and all of the other installations are notified of the new value.
There are several key execution modes to help create efficient projects. The different execution modes are as follows:
-
Direct executes based on the slow rate setting at a fixed rate.
-
Driven executes based on a condition.
-
Driven one-shot executes only once when a condition is true.
-
Leased executes according to on-demand polling.
Adding and Editing Scan Classes
You can add and edit scan classes by clicking on the Edit Scan Classes icon in the Tag Browser. The Scan Class Editor window is displayed showing a list of already configured Scan Classes on the left, and configuration settings on the right. To add a scan class, simply click the green + icon on the lower-left of the Scan Class Editor and then specify the name and the properties for it.
Scan Class Editor |
|
Edit Selected Scan Class |
|
Scan Class Name |
Unique name of the scan class. |
Mode |
Direct |
Slow Rate |
Base update rate, specified in milliseconds, at which tags will be executed. |
Fast Rate |
Used by the Driven and Leased modes, this is the faster rate that the tags will be executed at when those modes are active. |
Stale Timeout |
How long to wait before the tags in the scan class are determined to be stale (not running). This is calculated off of the last expected execution time of the scan class, and is particularly important for scan classes executed by other drivers through the external Tags provider. This property is not used by internal providers. |
Driven PropertiesUsed by the driven mode to determine when the scan class should run at the fast rate. |
|
Advanced PropertiesSettings that subtly affect how the scan class operates. |
|
OPC Data Mode |
This mode dictates how OPC values are obtained. The default mode, Subscription, is generally recommended. Subscribed Read |
Historical Scan Classes
Historical scan classes are simply standard scan classes used by Tags to store history. By using separate scan classes for status and history, it's possible to maintain a tag's status at a fast rate, without storing large amounts of history unnecessarily.
Despite the fact that there is not a technical differentiation between standard and historical scan classes, it is recommended that you create separate scan classes for each purpose and name them in a manner that indicates their usage. It is common to modify scan classes in order to affect a large number of tags, and without a consistent distinction it may be possible to affect tag execution in unexpected ways.
In this section ...