Creating a String Command Control

Scenario: You want to create a graphic or symbol that contains commands for the Description of the Present Value property of an Analog Value data point.

There are two methods of doing this:

  • You can gather object type information for a data point and then draw and configure a customized command symbol or graphical element, such as a button, that allows you to send commands from within a graphic.
  • You can drag an existing default command symbol from a project library to a graphic. To add a default command symbol from a project library, proceed directly to Designating and Adding a Default Command Symbol to a Graphic.

 

Reference:

  • For overall background information, see Command Control Configuration.
  • For Command Control and Navigation properties background information, see Command Control Properties and Command and Navigation Properties.
  • For symbols background support when creating command control symbols, see Symbol Property Substitution.

 

Workflow diagram:

 

 

Prerequisites:

 

Steps:

To draw and configure the String command control, do the following:

1 – Draw and Configure a String Command Control

The following is just one way to draw and configure the String command control to command from within a graphic.

  • You have reviewed or completed the Preparing to Create Controls to Command Objects workflow.
  1. To create a new command control element on your graphic, from the File menu, select New Graphic .
  1. Click Command Control , and draw a rectangular shape on the canvas.
  • The undefined element displays on the canvas.
  1. From the Property View (Command Control Properties), expand the Command Control properties, and from the Control Type drop-down menu, select String.
  • String displays in the command control element.
  1. In the Parameter Name field, type the data point’s Parameter name obtained from the Models and Functions Command Configuration table. This field is case-sensitive. This property will be the same Parameter property later defined in the Command and Navigation section for each control.
  • For this example, type: Value.
  1. To configure the String Command Control properties, do the following:
  • Minimum Length: Enter the minimum number of allowable characters.
  • Maximum Length: Enter the maximum number of allowable characters.

 

2 – Configure the String Command and Navigation Properties

The following instructions are just one example of how a numeric command control can be drawn or configured to issue a command from within a graphic.

Scenario: You want to configure a string command control on your graphic that allows you to enter a description for an Analog Value data point.

Information

NOTE:
If you create a command control element in a symbol instead of on a graphic, follow the steps below, replacing the Target and any other hard-coded references with * substitutions in the Evaluation Editor. For more information, see Symbol Property Substitutions.

  • You have completed the steps in the Gathering Data Point Command Information section and you have reviewed the Command and Navigation Properties section and have a full understanding of the fields and the options available to you for configuring the command control.
  • You have drawn a string command control on the graphic, and configured the Command Control properties
  1. Select the string command control on the canvas, and from the Property View expand the Command and Navigation properties section.
  1. In the Target field, drag a designated data point from System Browser. If the target designation does not contain a property, the default property is targeted. Otherwise you must specify the property by typing a period (.) and then the property name after you drag the data point into the Target field, for example: CCProject.LogicalView:Logical.PXRack.B.Block.Hcrv;.Property_Name.
  • For this example: drag an Analog Value and at the end of the path type .Description.
    NOTE: If you have the data point selected in System Browser, or you have selected a symbol instance of the data point on the canvas, the data point information is displayed in the Extended Operations tab, from there, drag the property you want to target into the Target field. The property name is added automatically.
  1. From the Command Name drop-down menu, select or type the command rule that you want applied to the property.
  • For this example, type or select: Write.
    NOTE:
    The command name must match the name of the command of the Command Configuration section in the Models and Functions tab. This field is case-sensitive.
  1. In the Parameter field, do one of the following:
  • Select the value from the drop-down menu.
    NOTE:
    For a stand-alone command control, if you have multiple parameters, only one parameter receives the value from the control itself and all other parameter values must be hard-coded.
  • For this example, delete everything but the parameter name, which in this case is: Value.
  1. For string controls, commands are sent by pressing ENTER. The Trigger drop-down menu is irrelevant for this control.
  1. (Optional) In the Description field, type a brief description of the command that will appear in the tooltip.
  1. From the Cursor drop-down menu, select the cursor preference that you want to display when the command is active.
  1. Select the Command Trigger check box to enable the command control to initiate and send a command.
  1. To disable the command control, select the Disabled check box, and from the Disabled Style drop-down menu, select how the disabled command control displays when disabled.
  • For example, if the selected data point is Out_of_Service and the command is disabled, the disabled style will be active at runtime to reflect this.
  1. The Extended Tooltip check box is selected by default. It displays the following command object details: Target, Command Name, and Parameter.
    NOTE: If enabled, the extended tooltip is added to any existing tooltips configured for the element.
  1. Click Save As .

 

3 – Format the String Command Control Properties

Scenario: You have created a String command control, and you want to format the control properties:

  1. To format the command control Text properties, do the following:
  • Font Family: From the drop-down menu, select a font to determine the command control text font. The default Font Family is Arial.
  • Font Size: Type a number to determine the font size. Default Font Size is 14.
  • Precision: Use the UP and DOWN buttons to determine the number of decimal places that display when the value is rounded. The default is blank.
  1. To format the command control Colors properties, do the following:
  • Background: Type the name of a color for the background.
  • Fill: Type the name of a color for the command control outline.
  • Stroke: Type a name of a color for the command control characters.
  1. Click Save As .
  1. If you created a symbol and you want to designate it as the default command symbol for an object type proceed to Designating and Adding a Default Command Symbol to a Graphic.