Driven Scan Class - Time of Day

Driven scan classes can be used as the polling rate for tags to trigger at different rates at different times of the day. They can also be used as a one-shot event at a specific time.

To add a driven scan class

Let's add a driven scan class that updates the tags based on a time of day (using an expression). You can also use other tag values to drive the condition, for example when a machine is on.

First, we need a tag that provides the condition.

  1. Create an Expression Tag in the root folder of Tags and call it Poll Time that is a Boolean with the following expression:

    dateExtract(now(0), "hour") >= 8 &&
    dateExtract(now(0), "hour") <= 17

    The value will be true when the time is between 8am and 5pm and false otherwise. So with that tag we can poll the PLC values during that time.

    images/download/attachments/1704351/image2015-4-22_10_26_4.png

  2. Click on the Timer icon in the Tag Browser to open the Scan Class Editor.

    images/download/attachments/1704351/image2015-4-22_10_41_42.png

  3. Click on the green + icon to add a new scan class and set the following:

    Scan Class Name: Time Driven
    Mode: Driven
    Slow Rate (ms): 0 so we don't poll when the condition is false. If you set
    the value to 10 seconds it simply would just poll slower when the condition
    is false.
    Fast Rate (ms): 1000
    Driving Tag: Poll Time expression tag and set the condition Operator:= and Value: 1.0.

    images/download/attachments/1704351/image2015-4-22_10_52_2.png

  4. Click OK to save.
    Set the scan class on any tag to this one to update on this condition. If you use this scan class for history, the tag will only store history during those times.