×

Adding Control Tools to the Application

You use the control tool buttons in the Vdraw Toolbox to create control tools. Control tools dynamically connect to the Vsystem database and enable you to monitor and control equipment from any workstation on the network.
For this tutorial, the first control tool you will place in the drawing window is a button that turns the furnace on and off. Buttons are binary control devices, so they are appropriate for situations in which an object needs to toggle between "on" and "off."

Creating Button Control Tools

To create a button control tool, select the Button control tool .
In the drawing window below the furnace object, hold the mouse button and drag the mouse pointer to draw a box the size you want the activated Button control tool to be, as shown below
When you release the mouse button, the Button Control Tool Properties dialog appears. A control tool dialog provides a form for specifying all of the information necessary to configure the control tool.
Once you have created a Button control tool in the drawing window, you can use the editing tools to create additional buttons.
For this tutorial, specify the following options in the Button Control Tool Properties dialog:
Control Channel Name
Control channels are output channels that attach to and control the hardware. On the Channel tab, in the Control Channel Name field, enter the name of the control channel to which you want to connect the Button control tool, in this case, tutor::furnace_control.
Note You must specify the database name (tutor) , followed by double colons (::), before the name of a channel (furnace_control) in a specified database.
You can also use the Choose button to specify the control channel. Click the Choose button above the Control Channel Name field. In the Database field of the Channel Selector window, enter the name of the database you created for the furnace application, tutor , and press ENTER on the keyboard. The tutor database name displays in the list box, along with all of the channels you defined in the tutor database, as shown in Figure 12
Figure12 - Channel Selector window, showing database channels
 
Select the furnace_control channel; the channel name becomes highlighted. Then click OK to apply your selection to the Button Control Tool Properties dialog. The selected tutor::furnace_control channel name now displays in the Control Channel Name field, as shown in Figure 13
Figure13 - Channel name displayed in Button Control Tool Properties dialog
Button Type
A toggle button switches a channel between its two binary states, while a push button places the channel into a true (B1) state as long as the mouse button is depressed. When you release the mouse button, the channel is set to a false (B0) state.
Select the Options tab in the Button Control Tool Properties dialog as shown in Figure 14 and specify the button type for your Button control tool by selecting Toggle from the Button Type drop-down list.
To create a three-dimensional button that more clearly shows its pushed (on) and nonpushed (off) state, click the Three-D Appearance checkbox.
Figure14 - Button Control Tool Properties Options tab
Click OK to apply your selection to the new Button control tool. The box you drew in the drawing window is now labeled "Button" in the window. To modify the text of the button label, select the Attributes tab in the Button Control Tool Properties dialog.
Labeling Button Control Tools
After you have created the first Button control tool, use the Text drawing tool button in the Vdraw Toolbox to create the label "Furnace Control."
In the Vdraw Toolbox, click the Text drawing tool .
1. Place the mouse pointer where you want the text to begin, below the Button control tool, and click the mouse button to display the text entry box.
2. In the text entry box, enter Furnace Control .
3. Click OK .
The drawing window should appear as shown in Figure 15
Figure15 - Labeled Button control tool
 
To modify the text in the label
Select the label with the Pointer tool.
1. In the Vdraw Toolbox, click the Properties button.
-or-
On the Object menu in the menu bar, select Properties.
-or-
On the pop-up editing menu, select Properties.
1. In the Graphic Properties dialog, make your text modifications. 
 
Note Once you have created a control tool, you can use the editing options to resize or reposition it, as described in the next section.

Creating Additional Button Control Tools Using the Editing Options

You can use the Button control tool you just created to create additional Button control tools. By using one button to create another, you save time and maintain size consistency.
To copy the Furnace Control Button control tool
Using the Pointer tool, select the Button control tool you just created.
  • The editing rectangle frames the object, as shown in Figure 16
  • Click the right mouse button to display the pop-up editing menu.
  • On the menu, select Copy. The copy of the control tool will not activate (appear) until you either move it or paste it, as described in step 4.
  • To reposition the new Button control tool, do one of the following:
  • With the mouse pointer on the middle right handle of the editing rectangle surrounding the Button control tool, press and drag the mouse pointer to the desired location for the control tool, then release the mouse button. (See Figure 14 for an illustration of the editing handles on the editing rectangle.)
-or-
  • Deselect the control tool by placing the mouse pointer outside of the editing rectangle and clicking the mouse button; then select Paste from the pop-up editing menu.
Figure16 - Editing rectangle and handles
A new Button control tool appears at the selected location. Figure 17 shows the drawing window with the original Button control tool duplicated.
Now you will assign a different channel to the newly created Button control tool. The editing rectangle should still be framing the new Button control tool; if it is not, click the Pointer tool in the Vdraw Toolbox and then select the Button control tool in the drawing window to produce the editing rectangle.
Figure17 - Button control tool duplicated
To assign a channel to the new Button control tool
  • In the Vdraw Toolbox, click the Properties button.
                    -or-
        On the Object menu in the menu bar, select Properties.
  • In the Control Channel Name field of the Button Control Tool Properties dialog, change the channel name to tutor::furnace_status . You can also use Choose to select this channel from the channel list in the specified database.
  • Click OK to complete the modification.
  • The drawing window should now contain two Button control tools below the furnace object.
Next, you will add the label "Furnace Status" to the second Button control tool.
To label the second Button control tool
  • Following the instructions above for copying the Button control tool, copy the label of the first Button control tool to a position beneath the second Button control tool.
  • With the duplicated label still selected, in the Vdraw Toolbox, click the Properties button or on the Object menu in the menu bar, select Properties .
  • In the Graphic Properties dialog that appears, in the Text field, change the text of the label to Furnace Status, then select OK.
Figure18 - Drawing window with two Button control tools
The control tools that control the dampers for Room 1 and Room 2 are also buttons. These two Button control tools are located to the right of the furnace object. The Button control tool closest to the furnace controls Room 1.
To create the two Button control tools that control the dampers
  • Use the editing options to copy an existing Button control tool and move it to the base of the left duct.
  •  With the new Button control tool still selected, click the Properties button in the Vdraw Toolbox.
           -or-
         On the Object menu in the menu bar, select Properties.
  •  In the Control Channel Name field of the Button Control Tool Properties dialog, change the control channel to tutor::room_1_damper; or, use Choose to select this channel from the channel list.
  • Add the label Room 1 Damper to the Button control tool by copying and changing the label of the Furnace Control button.
  • Copy the Room 1 Damper Button control tool and move it to the base of the right duct.
  • Repeat step 2 above.
  • In the Control Channel Name field, change the control channel to tutor::room_2_damper; or, use Choose to select this channel from the channel list.
  • Add the label Room 2 Damper to the Button control tool by copying and changing the label of the Room 1 Damper button.
    The furnace drawing window now displays all of the Button control tools defined, as shown below.
Figure19 - Completed Button control tools
 To save the drawing window
  • In the Vdraw Toolbox, click the Save button.
-or-
  • On the File menu in the menu bar, select Save.

Adding Meter Control Tools to the Application

Meters and dials are control and monitoring devices for double-precision floating-point, integer, and real channel types.
 To create a Meter control tool
  • Click the Meter control tool button in the Vdraw Toolbox and move the mouse pointer to the drawing window.
  • Drag a box the size you want the meter to be, as shown.
    Note The size of the meter box determines the appearance of the activated meter; the software tries to make a best-fit based on the parameters of the meter. For example, if you create a box that is too large, the meter will appear off-center within the box when activated. If you are not happy with the appearance of the activated meter, resize the meter box until it has the look you desire.
When you release the mouse button, the Meter Control Tool Properties dialog appears, as shown below.
Figure20 - Meter Control Tool Properties dialog
Adding Control Tools to the Application
As you can see in the dialog, there are numerous options from which to choose when you define a Meter control tool; however, for this tutorial, you will create a simple style of meter. The first meter you will create serves as a temperature gauge for Room 1.
For this tutorial, specify the following options in the Meter Control Tool Properties dialog:
1

Label

On the Bank tab in the Meter Control Tool Properties dialog, select the Meter tab in the middle of the dialog. In the Label field, enter the label Room 1 Temperature for the active Meter control tool. This label displays directly below the Meter control tool when the meter is activated.
2

No. of Needles

Number of Needles, Keep the default of 1 in the No. of Needles field.
3

Channel tab

Select the Channel subtab at the lower part of the dialog.
4

Channel Name

In the Channel Name field, enter the database channel name to which you want to connect the meter needle, in this case tutor::room_1_temp . You can also use the Choose button to select a channel from the channel list.
Changing the Needle Color and Style
Figure21 - Meter Control Tool Properties lower Attributes subtab
Adding Control Tools to the Application
1

Attributes tab

Select the Attributes subtab at the lower part of the dialog
2

Needle Color

To change the color of a needle, click the color box next to Needle Color to display the Needle Color window. In the Needle Color window, Figure 22, click on a color and then click OK .
Figure22 - Needle Color window
3

Needle Style

To choose a style of needle for the meter, select Open Arrow from the Needle Style drop-down list box.
Controllable
Set the meter to controllable. When the needle of a meter is controllable, you can change the value of the Meter control tool by moving the needle on an active control display window with the mouse pointer.
Adding Control Tools to the Application
1

Options Tab

Select the Options subtab at the lower part of the dialog,4
2

Controllable

Click the Controllable checkbox .
Display Digital Readout
Enable the Digital Readout
Adding Control Tools to the Application
1

Readout Tab

Select the Readout subtab at the lower part of the dialog
2

Display Digital Readout

Click the Display Digital Readout checkbox to display the value below the activated Meter control tool.  Once this is selected, Readout Label From will be enabled.
3

Readout Label From

Because this Meter control tool is small and in a limited space, select None from the Readout Label From drop-down list. The digital readout will display centered, with no label under the Meter control tool.
Direction
Adding Control Tools to the Application
1

Attributes Tab

With the Bank tab selected at the top of the Meter Control Tool Properties dialog, select the Attributes subtab in the middle of the dialog,
2

Display Alarm Bar

Select Display Alarm Bar to show the alarm limits in the meter
3

Direction

Select Counterclockwise from the Direction drop-down list, so that the needle of the Meter control tool moves in a counterclockwise direction.
4

No. of Degrees

In the No. of Degrees field, enter 180. The value entered in this field determines the number of degrees the Meter control tool spans.
Limits
Adding Control Tools to the Application
1

Limits Tab

Select the Limits subtab in the middle of the dialog
2

Limits

To specify the display limits for the Meter control tool. Select From Form from the Limits drop-down list.  The Min and Max fields will be enabled.
Adding Control Tools to the Application
1

Min

Enter 0 in the Min field
2

Max

Enter 120 in the Max field.
Note The value for the limit that you enter in the Min field overrides the lower display limit value (if one is defined in the Vsystem database) for the channel to which you connect the Meter control tool. The value for the limit that you enter in the Max field overrides the upper display limit value (if one is defined in the Vsystem database) for the channel to which you connect the Meter control tool.
3

No. of Decimal Places for Scales

This option enables you to override the number of decimal places specified with the format keyword in the Vsystem database. Because this Meter control tool is small and in a limited space, enter 0 in this field.
4

Minor Ticks

In the Minor Ticks field, enter a value for the interval between the display of short scaling marks on an active Meter control tool. For this tutorial, enter 15 in this field. Short tick marks will appear at 15-degree intervals between 0 and 120 degrees.
5

Major Ticks

In the Major Ticks field, enter a value for the interval between the display of long scaling marks on an active Meter control tool. For this tutorial, enter 30 in this field. Long tick marks will appear at 30-degree intervals between 0 and 120 degrees.
6

Labeled Ticks

You can select the interval at which the tick marks for a Meter control tool are labeled with a numerical representation. Enter 60 in the Labeled Ticks field. Because the upper display value is 120, numbered tick marks will appear at 0 degrees, 60 degrees, and 120 degrees.
 
Note The more numbered tick marks you assign to a Meter control tool, the more likely it is that the numbers may overlap each other. The quantity of numbered tick marks present on a Meter control tool depends on the upper and lower display limits.
Button Label
Adding Control Tools to the Application
1

Options Tab

Select the Options tab in the Meter Control Tool Properties dialog. In the Button Label field, enter the label to appear on the Meter control tool when it is deactivated, in this case Meter . Click OK to apply all of your modifications.

Steps to take after creating a Meter control tool

After you have created the Meter control tool,
  • click the Text drawing tool in the Vdraw Toolbox to create the label "Room 1 Temperature".
  • Place the mouse pointer below the Meter control tool where you want the text to begin, and type Room 1 Temperature . Then click OK .
  • To modify the characteristics of the label text, select the label, then in the Vdraw Toolbox, click the Properties button.
    -or-
    On the Object menu in the menu bar, select Properties.
  • Make your modifications in the pop-up Graphic Properties dialog.
    The following illustration shows the first Meter control tool.

Creating Additional Meter Control Tools

To create additional Meter control tools:
  • Copy the Meter control tool by selecting it and clicking the right mouse button to display the pop-up editing menu.
  • On the menu, select Copy, then move the copy to the right of the original Meter control tool. The new Meter control tool serves as the thermostat for Room 1.
  • Select the new meter, then in the Vdraw Toolbox click the Properties button.
    -or-
    On the Object menu in the menu bar, select Properties .
  • On the Bank tab in the Meter Control Tool Properties dialog, select the Meter subtab in the middle of the dialog. In the Label field, change the label to Room 1 Thermostat.
  • On the lower Channel subtab, in the Channel Name field, change the channel to tutor::room_1_thermostat, as shown below.
  • Click OK on the Meter Control Tool Properties dialog to apply the changes to the new Meter control tool.
  • Copy the meter label Room 1 Temperature and move it below the Meter control tool for Room 1 Thermostat.
  • To change the text of the label from "Room 1 Temperature" to "Room 1 Thermostat," select the label for the second Meter control tool, then perform one of the following actions:
  • In the Vdraw Toolbox, click the Properties button.
    -or-
  • On the Object menu in the menu bar, select Properties .
  • In the Graphic Properties dialog that appears, in the Text field, enter the new label text.
    Note Don't forget to periodically save you file.

Adding a Bar Control Tool to the Application

Bars graphically reflect the current value of a double-precision floating-point, integer, or real channel type. Here, we will create a Bar control tool to control the temperature of Room 1.
In the Vdraw Toolbox, click the Bar control tool button.
Adding Control Tools to the Application
1

Bar Control

Move the mouse pointer to the drawing window and drag a rectangle the size of the bar you want to create.
Bar control tool
The Bar Control Tool Properties dialog appears.
Adding Control Tools to the Application
For this tutorial, you will specify the following options in the Bar Control Tool Properties dialog.
1

Triangle Channel Name

The triangles on Bar control tools serve the same purpose as the needles on Meter control tools. If specified as "controllable," you can adjust the value of a Bar control tool by moving the triangle back and forth.
On the Channel tab in the Bar Control Tool Properties dialog, enter the name of the channel to which the triangle will connect when the Bar control tool is activated. Here, in the Triangle Channel Name field, enter the channel name tutor::room_1_temp. You can also use the Choose button to select a channel from the channel list. If you do not enter a channel name, a triangle will not display on the Bar control tool.
 
Triangle Fill
Adding Control Tools to the Application
1

Attributes Tab

Select the Attributes tab in the Bar Control Tool Properties dialog
2

Triangle Fill

From the Triangle Fill drop-down list, select Status Color. When this option is selected, the triangle appears in only one of three color states--green (normal), yellow (warning), or red (alarm)--depending on which limit has been reached for the assigned channel.
Options
Adding Control Tools to the Application
1

Options Tab

Select the Options tab in the Bar Control Tool Properties dialog.
2

Border on Bar

Then click the Border on Bar checkbox . When this option is selected, a one-pixel-width border outlines the Bar control tool. The color of the border is the same as the line color currently selected in the Vdraw Toolbox.
3

Control

From the Control drop-down list, select Triangle, so that you can change the value of a channel by sliding the triangle on the screen with the mouse. When this option is selected, the channel name entered in the Triangle Channel Name field becomes the control channel.
4

Show Alarm Ranges

From the Show Alarm Ranges drop-down list, select Bar to display an alarm bar, which depicts the alarm and warning regions on the Bar control tool. Normal regions display in the "OK" color, warning regions display in the warning color, and alarm regions display in the alarm color specified in the Vdraw definition file.
5

Triangle Size

From the Triangle Size drop-down list, select one of the options to specify the size of the triangle appearing on the Bar control tool (remember: a triangle appears only if a channel name is entered in the Triangle Channel Name field). The available triangle sizes are Small, Medium, and Large. For this tutorial, select Medium from the drop-down list.
Scale Tab
Adding Control Tools to the Application
1

Scale Tab

Select the Scale tab in the Bar Control Tool Properties dialog
2

Show Limits

Click the Show Limits checkbox so that the Bar control tool displays the maximum and minimum limits specified. When the Bar control tool is activated, the database channel limits display in the font style specified on the Attributes tab.
3

Limits

From the Limits drop-down list, select Use Form Limits to override the upper and lower display limits given in the channel definition. Because this Bar control tool will be connected to the same control channel as the meter for Room 1, the maximum and minimum display limits should be the same as those you assigned to the Room 1 meter.  The Min and Max fields will now be enabled.
4

Min and Max

Enter 0 in the Min field as the minimum display limit and 120 in the Max field as the maximum display limit.
5

Show Tick Marks

Click this checkbox to display tick marks on the scale of the Bar control tool. Because this Bar control tool will be connected to the same control channel as the meter for Room 1, the units for major (and minor) tick marks should be the same as those you assigned to the Room 1 meter.
6

Major and Minor

Enter a value of 15 in the Minor field for the interval between the display of short scaling marks on an active Bar control tool; short tick marks will appear at 15-unit intervals. Enter a value of 30 in the Major field for the interval between the display of long scaling marks on an active Bar control tool; long tick marks will appear at 30-unit intervals.
7

Scale Type

From the Scale Type drop-down list, select Linear ; the bar will use linear scaling.
8

Scale Side

From the Scale Side drop-down list, select Top/Left so that the scale and triangle are drawn on the top of the activated Bar control tool.
Adding Control Tools to the Application
1

OK

Click OK to apply your modifications.

Steps to take after creating a Bar control tool

In the Vdraw Toolbox, click the Text drawing tool to label the bar Room 1 Temperature.
1. Place the label below the Bar control tool; then click OK .
2. To modify the font of the label, select the label, then in the Vdraw Toolbox, click the Properties button.
-or-
On the Object menu in the menu bar, select Properties .

Creating Additional Bar Control Tools

To Copy the Bar control tool, select it and click the right mouse button to display the pop-up editing menu.
1. Select Copy , then drag the copy below the original Bar control tool.
The new Bar control tool controls the thermostat of Room 1.
1. Select the new Bar control tool, then in the Vdraw Toolbox, click the Properties button.
-or-
On the Object menu in the menu bar, select Properties.
1. In the Triangle Channel Name field (on the Channel tab), change the channel to tutor::room_1_thermostat . Then click OK to apply the change to the new Bar control tool.
2. Copy the label Room 1 Temperature and move it below the Bar control tool for Room 1 Thermostat.
3. Change the text of the label from Room 1 Temperature to Room 1 Thermostat:
Select the label of the second Bar control tool.
1. In the Vdraw Toolbox, click the Properties button.
-or-
On the Object menu in the menu bar, select Properties.
1. In the Graphic Properties dialog that appears, in the Text field, change the text of the label to Room 1 Thermostat, then click OK .

 To save the drawing window

  • In the Vdraw Toolbox, click the Save button.
-or-
  • On the File menu in the menu bar, select Save.
The drawing window now appears as shown
 
Note As you can see, the arrangement and size of some of the objects in the drawing window have changed. This was done to accommodate the information that displays on these objects when the window is activated. As you create your own objects, you will probably need to modify their size and arrangement to make the information display in a useful manner.