Types of Scan Classes
Tags are assigned a scan class that determine how often they update. For example, how often an OPC value is polled from the PLC, how often an Expression Tag calculates its expression, and how often a Query Tag runs its query. It's easy to create scan classes in Ignition for just about any scenario you can think of. Scan classes are extremely powerful and flexible, and you can create them based entirely on your individual business requirements.
There are three different scan class modes in Ignition that you can use to build your own, each with a different options:
- Direct - executes at a fixed rate. Every Tag that uses a direct scan class will poll the PLC at the slow rate setting at all times (24x7x365). Ignition provides two Direct scan classes to help you get started, but you can change them however you'd like. It is recommended to adjust the "Default" scan class to a slower rate as all new tags are automatically added to this scan class.
- Default - runs at a rate of 1 second.
- Default Historical - runs at a rate of 10 seconds.
- Driven - executes fast or slow based on a condition. The rate of the Driven scan class is determined by a condition based on the value of the selected Driving Tag. This condition is a simple comparison between a driving Tag's value and a static number (equal to, greater than, etc.). While the condition is true, the scan class executes at the fast rate. If false, it runs at the slow rate. (It's useful to keep in mind that the driving Tag can also be an Expression Tag that performs complex calculations and references other Tags. In this way, it's possible to create robust scan class triggering).
- Driven One-shot - If you want to read Tag values only once on certain conditions (instead of polling), there are two properties that change the behavior of the Driven mode: the One-shot property, and the Any Change Operator option. Using either of these, the scan class does not run at either the fast or slow rate. Instead, it will be triggered once each time your condition is met. Any Change will execute each time the driving Tag 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.
- Leased - executes as on-demand polling. It works similar to the Driven class except there is no driving Tag. Instead, the driving mechanism is whether a Tag is being used on an open window. That is, if a user is looking at a Tag, it runs at the fast rate, and if the Tag is not being shown, it is moved to the slow rate.
Scan classes are created and edited in the Designer, and described in detail in Editing Scan Classes.