Skip to main content

Sending Commands from the Interface

The most common interface task is to write numeric values to equipment addresses/registers/variables and display numeric values in the interface. Different logic for writing values (Value) may be needed, for example:

  1. a button sends the same Value, specified in the link between the button and the command, every time it is pressed
  2. a trigger alternates between the Value settings specified for it when sending to a variable
  3. a level sends a Value from its range to a variable as the slider moves

When creating an interface, choose a graphic item type whose behavior meets your requirements for controlling variables. To link a command (variable) to a graphic item, configure the item and drag the command from the device tree onto it with the mouse.

Controlling Variables from the Interface​

  1. Select a graphic item type that meets your requirements
  2. In the settings, specify the Value settings that the item should send to its linked variables
  3. Drag the command from the device tree onto the graphic item
  4. In the command-linking dialog, select the value the graphic item will send. For a button, this can be Number - a specific value to send. Other item types can send Value - the value generated by the item. For information about selecting an event such as Press or Release, see here
  5. If the graphic item needs to display data as well as send it, select "Assign feedback channel" and specify which item property the received value will affect (changing Value or replacing Text)

Studio2019_SidePanel_Drivers_add_command.png

Displaying Data in the Interface​

  1. Select a graphic item type for displaying data. This can be the same item that controls the equipment, or a display item (Label)
  2. Drag the feedback channel onto the graphic item:
  3. In value - switch the item's state using the value received from the variable (whether the state can switch depends on the item settings; see the item type instructions); display the received value in the item's text using "Show value in text" (see text settings), which displays the value with a fixed number of decimal places.
  4. In text - display the value received from the variable in the item's text. If the variable returns a floating-point number, it is displayed with six zeros after the decimal point. Use "In value" and "Show value in text" in the text settings to control numeric formatting.
  5. More... - use the value received from a feedback channel/token to affect any item property (opacity, visibility, size, and so on)

Studio2019_SidePanel_Drivers_add_relation.png

Displaying a Value in Text​

Displaying a value with "Show value in text" embeds a numeric value in the graphic item's text and lets you specify the number of decimal places. For levels, a special display template converts a value from an arbitrary range to 0-100%

The value is embedded using a special template ($V, $F1, $F2, ...). When i3 pro starts, the template is automatically replaced by the value of the variable linked to the item's "In value":

  1. Enable text editing on the item
  2. Select the data display format from "Show value in text". A template is added to the item's text field, for example $V
  3. Go to the item's text field and enter the text to display alongside the Value that replaces the template. For example, enter $V% to display a value of 100 received from the channel as 100%

ShowValueInText.png

TemplatePurpose
$VInteger part of the received value
$F1 ... $F5Floating-point value with a decimal point. 1 to 5 specifies the number of digits after the point
$F,1 ... $F,5Floating-point value with a decimal comma. 1 to 5 specifies the number of digits after the comma
$SNumber of the selected state
$XValue in HEX format
$$Dollar sign
$P(Levels only) Percentage of the Level's maximum value
$H(Levels only) Maximum value of the Level
$A(Levels only) Current value minus the Level's minimum value
$L(Levels only) Minimum value of the Level
$R(Levels only) Level range: maximum minus minimum

Enter the template in the graphic item's text field. It can be combined with other text and symbols (comments or units of measurement)

Configuring Commands in Programming​

Configuring commands in the graphic item's Programming panel:

Studio2019_SidePanel_Programming_drivers.png

Macro editor commands for interacting with drivers and project variables:

  • Send to driver (sending values to driver commands)
    • Send number. Send a constant - a decimal number (DEC)
    • Send text. Send a constant - a data string (ASCII)
    • Send data. Send a constant - a string (HEX)
    • Send tag. Send data obtained from project variables (Value, coordinates, dimensions, and so on - variable values determined by object properties)
  • Send to project token (sending data to variables - item properties, drivers and project tokens)
    • Send number to tag. Write a constant (a DEC number) to a variable
    • Send text to tag. Write a constant (an ASCII string) to a variable
    • Send tag to tag. Write one variable to another (for example, an item property to a project token)

To send a command, select the event (Press or Release), value type (a number, text or the item's Value), and variable to write to. For a number or text, specify the value to send. Save the changes in Programming.

Now, when the selected event occurs on the item (on pressing, releasing or holding), the value is sent to the variable.