Types of Scan Classes
Scan classes dictate the execution schedule for tags, and therefore play a crucial role in the design of large, high-performance systems. Every tag has a scan class and that dictates how often that value is polled from a OPC location, how often an expression tag calculates its expression, or how often a query tag runs its query.
It is very easy to configure scan classes and there are four different types of scan classes you can use. From the Tag Browser, click on the Edit Scan Class icon to open the Scan Class Editor. You can create new scan classes here and assign one of four types of scan classes.
The four different scan classes that specify the rate of tag execution are as follows: Direct, Driven, Driven one-shot, and Leased. You specify these scan class types from the Mode setting on the Scan Class Editor.
Direct
The Direct scan classe executes based on the slow rate setting at a fixed rate. Every tag that uses the direct scan class will poll the PLC at the slow rate setting 24x7x365 (at all times).
Driven
The Driven scan class executes based on a condition. The rate of the Driven scan class is based on the value of a driving tag which provides the condition. The condition is a simple comparison between a tag value and a number. If the condition is true, the scan class executes at the fast rate. If false, it runs at the slow rate.
There are two exceptions to this: the Any Change operator and one-shot mode. Using either of these, the scan class does not run at a rate. Instead, it will be triggered by a change in the driving tag's value. Any change will execute each time the value changes, and one-shot will execute once when the comparison condition is true and not again until the condition becomes false and subsequently true.
It's useful to keep in mind that the driving tag can be an Expression tag that performs complex calculations and references other tags. In this way, it's possible to create robust scan class triggering.
Every tag that uses the driven scan class, will poll the PLC at the fast rate when the condition is true and the slow rate when the condition is false.
Driven One-shot
The Driven one-shot executes only once when a condition is true.