Scan Classes

What is a Scan Class?

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 an update every 10-30 seconds.

Creating different scan classes allows you to organize your Tags into groups that subscribe (continually poll) at different rates. It is good practice to put some forethought and planning into the organization of your Tags and scan classes.

images/download/attachments/6034078/scan_classes.png

On this page ...

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 must 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.

Types of Scan Classes

Since scan classes dictate the execution schedule for tags, they therefore play a crucial role in the design of large, high-performance systems. Every Tag's scan class dictates how often an OPC value is polled from a PLC, how often an Expression Tag calculates its expression, or how often a query tag runs its query. Creating Memory, Expression, and Query Tags.

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.

There are three different scan class modes that specify the rate of Tag execution: Direct, Driven, and Leased. In addition, Driven has properties that change it's behavior to a one-shot type. You specify these scan class modes from the Mode setting on the Scan Class Editor.

Direct

The Direct scan classes 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 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 driving Tag's 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.

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.

Driven One-shot

The Driven one-shot uses the Driven scan class setting but there are two options that change the behavior: the Any Change operator and the 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.

Leased

The Leased scan class mode executes as on-demand polling. It work 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.

When using scan classes with both the fast and slow rates (Driven or Leased), a 0 poll rate can be specified. This means the Tags in this scan class will not poll at all. Do not use this on Tags that are storing history or need other regular updates.

Similar Topics ...

In This Section ...