Skip to content

Dial Exercise

Exercise: Process Mode Control

Please follow the exercise to understand the Dial functionality.

The following configuration is used to set up this exercise.

  1. Create the following tags:
    1. RecipeID
      • Data type: INT
      • Initial value: 0
    2. MotorSpeed
      • Data type: INT
      • Initial value: 0
    3. Temperature
      • Data type: INT
      • Initial value: 0

  1. Create the following recipe database:
    1. MotorProcessModes

      • Record ID Tag: RecipeID
      • Parameter bindings: MotorSpeed, Temperature

      Create two distinct records, the first labeled as MotorSpeed and the second as Temperature. Add their respected values as you see fit.

      Assign a tag to every one of these parameters to avoid an error warning. It is not necessary to actually utilize these tags.

  1. Insert Custom Script:
    1. Navigate to the tag editor and edit the RecipeID tag.
    2. Underneath the Actions tab, left-click Add New Command under Value Changed.
    3. A Command Editor window will appear, on the left-hand side, locate Script > Insert Custom Script.
    4. Insert the following script.
tag.write("MotorSpeed", recipe.getParameter("MotorProcessModes", tag.read("RecipeID"), 0));
tag.write("Temperature", recipe.getParameter("MotorProcessModes", tag.read("RecipeID"), 1));

The script is executed when the value of RecipeID changes. The script checks which record value to write to both MotorSpeed and Temperature from the recipe using the Record ID and Recipe ID tag.

  1. Add Dial:
    • Insert a dial object. Under the properties of the dial object bind the RecipeID to Value and add a 2 more values to have a total of 3 values. Label each value it's corresponding index value.

  1. Add Duct With Fan:
    • Navigate to the Symbol Library tab then Animation Library, left-click the drop-down Ducts, add the Duct With Fan object. Select the Duct With Fan object and under it's properties, bind it's Speed to the MotorSpeed tag.

  1. Add Numeric Display:
    • Insert a number display object. Under the Numeric Display properties bind the Temperature tag to its Value and add the Suffix: °F.

  1. Click Tools > Launch Simulator to launch the Canvas Simulator.

  2. The end result of this project is to have the Motor Speed and Temperature output tags instantaneously updated with predefined recipe values when the Dial is rotated. Each rotational position of the dial (1, 2, or 3) corresponds to a unique process mode (Off, Setting 1, or Setting 2).