16.3. Bind a Variable

  1. In the Notification option of the DataHub Properties window, select the TestAction template that you defined previously, and click the Edit button to open the Configure Template dialog.

  2. In the Variable Bindings tab, click the Add button.

    This will create a new binding definition set, and open a new entry in the Variable Bindings list, below.

  3. Enter the DataHub point name DataPid:PID1.Sp.

  4. Click the OK button to save the binding.

You have now bound a variable to your notification template. This means that the point DataPid:PID1.Sp will be substituted for the variable Input in all conditions and scripts that make up the template. To test, you need to enable the Notification feature and let the DataHub point value trigger it.

  1. Back in Notification Configuration, ensure that the Enable Notification box is checked, and click the Apply button.

  2. Start the DataPid data simulation program. This will change the value of the PID1.Sp point at random between 0 and 100 every 5 seconds.

  3. Each time the point value drops from above 50 to below 50, you should receive an email at the address you specified in your template script ([email protected]).