Custom Meters

If your site uses meters that do not look like any that are included with VTScada, you can build your own using the components provided in the Tools >> Meter parts folder of the Widgets palette.

A custom meter is a Tag Widget, typically including several parameters for configuration. The subtopics listed in the menu describe the components that are available. For the instructions to assemble these components into a new meter please refer to Create a Tag Widget For One Tag.

Note that the bezel and the glass overlay are images, found in the Meter Parts folder of the Images palette.

Example:

  1. Working in the Idea Studio, create a new, empty tag widget.

  1. When prompted for tag types, select Analog Status tags (assuming that these are what you use most often). You will probably want to also be able to use the meter with other tags that have analog data such as Analog Input and Calculation, but this can be left until later.

  1. You will be prompted for a title. In this example the widget will be named Custom Meter 1.

  1. A nearly-blank screen will open, containing only the Tag Icon Marker. Ignore the marker for now.
  2. In the Widgets palette, navigate to the Tools >> Meter Parts folder.
  3. Start by dragging a scale to the screen. For this example, a Radial Scale was used.

  1. Open this object's properties dialog and adjust the appearance as you wish.
  2. Make a note of any properties that you want to be adjustable in the finished widget. For each, you must create a parameter in your widget. For the scale in this example, only the number of major divisions will be made available to users of our custom widget.
  3. Close the properties dialog then open the Widget Properties ribbon.
  4. Open the Manage Parameters tool and click Add.
  5. The example parameter was named pMajorDivisions (where "p" stands for "parameter"). The type is Short because there should never be more than a few divisions in the meter.

  1. After adding the parameter, click OK to close the Manage Parameters dialog.
  2. Click the Values tool in the Widget Properties toolbar to open the Edit Parameters dialog. Setting values here does not assign defaults. It simply gives the parameter a value to show while working in the Idea Studio.
  3. In this example the value for pMajorDivisions is set to 6.
  4. Re-open the properties dialog for the legend. Set the data source for Major Divisions to Parameters, then select pMajorDivisions.

It is unlikely that you will want to make every parameter of every component of your meter available to users to customize. For those parameters that you do want to want to expose, you must repeat the same sequence of steps that you have just completed.

 

  1. The next step in this example is to add a radial legend. Drag one to the screen, placing it above the scale.
  2. Re-size the legend so that the text fits within the circle of the scale, then align midpoints.
  3. The number of labels must match the number of major division marks, which is one greater than the number of divisions. You can use the pMajorDivisions parameter as part of an expression.
  4. Change the data source for the number of labels to use Expression.

  1. In the expression field, type pMajorDivisions + 1

  1. Leave the properties dialog open after completing this step. If you would rather have whole numbers in the legend, change the value of the pMajorDivisions parameter to be an odd number.

 

The numbers in the legend should reflect the scaling of the linked tag. Several steps will be required to achieve this.

  1. Expand the data source for the Tag parameter of the legend and choose Linked Tag Property.

  1. In the drop down list, select Linked Tag (Analog Status).

  1. In the Scaling section of the properties, select the option, Use Tag Scaling, then click OK to close the properties dialog.

The next component to add will be the indicator. A radial Indicator was used for this example.

  1. Place the indicator so that it is aligned with the other components, scaling if desired. If you would like to change the color of the indicator, note that the starting color is blue rather than the standard gray. This means that you must open the advanced options for the indicator and adjust the hue and saturation sliders rather than simply applying a color. Refer to the notes for the Radial Indicator for more information.
  2. The data source must be the Linked Tag (Analog Status), as for the legend. Ensure that the Use Tag Scaling option is selected.
  3. To add a finish to the meter, add images for the bezel and glass overlay. A selection can be found in the Images palette under Widget Parts >> Meter Parts.
  4. Select all components and align midpoints.
  5. Move the entire selection so that your meter just touches the top and left edge of the Idea Studio window. This corner is the standard reference location for all widgets.

  1. If you use the meter with tags other than Analog Status, return to the Widget Properties ribbon and use the Tag Types tool to associate other tags. Analog Input and Calculation are suggested.

 

To find and use your new meter, you will need to add it to a palette.

  1. In the Widgets palette, open the Gauges folder.
  2. Right-click anywhere within this palette and select New from the menu that opens.
  3. In the New Item dialog, select Advanced.
  4. In the New Menu Item Properties dialog, select Widget.
  5. Find and select Custom Meter 1.
  6. When you return to the New Menu Item Properties dialog, click the Set Parameters button. You may choose to assign a default value here for the number of major divisions. Click OK when finished.
  7. Open a page in the Idea Studio (not a widget) and drag your new meter to that page. Link it to a tag. You may open the properties dialog to adjust the parameter, Number of Major Divisions.