Skip to main content
Version: 8.1

Driven Tag Group Examples

Driven Tag Group - Machine State​

Driven Tag Groups that are based on a machine can be very important when you only want to poll values differently based on machine state. A machine state Tag Group is when the Tags are polled at one rate with the machine ON, and a different rate when the machine is OFF. You can easily see the rate change in the the Tag Browser using this type of condition.

Create a Machine State Tag​

First, you need to create a driving Tag if you don't already have one.

  1. In the Tag Browser, right-click on the Tags folder, then go to New Tag > Memory Tag to create a memory Tag.
    The Tag Editor window is displayed.
  2. In Tag Editor, enter the following:
    • Name: Machine On
    • Tag Group: Default
    • Enabled: true
    • Data Type: Boolean
    • Value: false
  3. Click OK to add the Machine On Tag to the Tag Browser.

Add a Driven Tag Group Based on the Machine State​

Once you have your driving Tag created, add a Driven Tag Group that updates the Tags based on when the machine is ON.

  1. In the Tag Browser, click on the Edit Tag Groups icon to open the Tag Group Editor.
  2. To create a new Tag Group, click Add icon.
  3. Enter the name of the Tag Group. For example, you can name it Driven Machine State, and set the Mode to Driven.
  4. Set the Rate to 10,000 (10 seconds) and the Leased/Driven Rate to 1000 (1 second).
  5. This Tag Group executes based on the condition you set on the Driving Expression. Set the Driving Expression by clicking the Edit icon.
  6. This Tag Group executes based on the condition you set on the Driving Expression. Set the Driving Expression by clicking the Edit icon.
  7. Click the Tag icon and choose the Tag you want to set the condition on (i.e., Machine On).
  8. Click OK on the popup and apply changes in the upper right of the Tag Group Editor.
  9. While still in the Tag Group Editor, set the following values:
    • Driving Comparison: =
    • Comparison Value: 1
  10. Click OK in the lower right of the Tag Group Editor.
  11. When the machine is on, it will use the Leased/Driven Rate (1 second). When the machine is off, it will use the Rate (10 seconds)
  12. Next, select all the Tags that you want to use for the Drive Machine State Tag Group. This example uses Sine7, Sine8, and Sine9 Tags.
  13. Right click on the selected Tags and choose Edit Tag.
  14. The Tag Editor will open showing you are editing multiple Tags. From the Tag Group dropdown list, choose Drive Machine State, and click OK.
  15. Now let's turn the machine on. In the Tag Browser, mark the checkbox next to the Machine On Tag that we created earlier.
    Now, when the machine is on, polling will be a at the 1 second rate for the Sine Tags. When the machine is off, polling will be at the 10 second rate for the Sine Tags. Test it by toggling the Machine On Tag on and off.

    You can also set the Rate (slow rate) to a value of 0, which means polling is stopped when the condition is false. So for example, when the machine is off, you will see the Tags stay at the last known value.

    Once the machine is turned back on, the Tags resume polling.

Driven Tag Group - Time of Day​

Driven Tag Groups 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 of the day. You can accomplish this by setting the condition of the Driven Tag Group to be true at certain times of the day, and false at other times.

Keep in mind, that if you use a Driven Tag Group based on the time of day with a 0 Slow Rate for history, the Tag will only store history during those specified times.

Add a Driven Tag Group Based on the Time of Day​

Let's add a Driven Tag Group that updates the Tags based on a time of day. We will use an Expression to drive the Tag Group. You can use the functions that are in the expression language to poll the PLC during the hours of 8am to 5pm.

  1. In the Tag Browser, click on the Tag Groups icon to open the Tag Group Editor.

  2. To create a new Tag Group, click on the Add icon.

  3. Enter the name for the Tag Group. In this example, we named it Time Driven, and set the Mode to Driven. This Tag Group executes based on the condition of the Driving Expression. In this example, we'll use the Poll Time Tag we created above.

  4. Set the Rate to 60,000ms so it polls at a slow rate, and the Leased/Driven Rate to 1,000ms so it polls at a faster rate.

  5. Enter the Driving Expression. Click on the Edit icon, and copy and paste the following expression in the expression box, then click Apply Changes.

    timeBetween and Machine On expression
    timeBetween(now(0), "8:00:00 am", "5:00:00 pm")

  6. While still in the Tag Group Editor, set the following values:

    • Driving Comparison: =
    • Comparison Value: 1
  7. Click OK.

  8. Next, select all the Tags that you want to specify in the Tag Group (i.e., Pressure and Temperature). Right-click on the selected Tags, and choose Edit Tag.

  9. The Tag Editor will open showing you are editing multiple Tags. To change the Tag Group, choose Time Driven from the dropdown, and click OK.

  10. In the Tag Browser you can look at the Tags to see they are updating at the correct rate. Try adjusting the time range in your expression to change the rate of polling. When the driving conditions are true, that is the time between hours of 8am and 5pm, polling is at the Leased/Driven Rate of 1000 ms. When not, polling is stopped, and the last known value is displayed.