search
Start typing to search...

Action Format Basics

Author: Aximmetry

Action Format

Actions are written in XML format.

Using Module Path

The most prominent action is ComposerSetPinValueAction, which allows you to set the value of any pins of any modules within your compound. The syntax is as follows:

<action type="ComposerSetPinValueAction" Module="module_path" Pin="pin_name" Value="pin_value" />

Attribute breakdown:

  • type: The action, which is ComposerSetPinValueAction in this case. For the list of all available actions, refer to the further sections of this documentation.
  • ModuleSpecifies the path to the module. The path format is structured as Root\Nested compound's name (if any)\Module's name.
  • Pin: The specific input pin of the module.
  • Value: The new value you wish to set for the pin.

Suppose you want to switch between several texts displayed on a screen.
In the following setup, you can do so by changing the Selected pin of the Switch Text module:

To set it to number 7 you have to send the following:

<action type="ComposerSetPinValueAction" Module="Root\Switch Text" Pin="Selected" Value="7" />

Using the Copy Full Path Option

To easily obtain a pin's path, right-click on any pin and select Copy Fully Path:

NOTE: This option is available in both the Pin Values panel of the Flow Editor and the Control Board. Additionally, you can access it by right-clicking directly on a pin in the Flow Editor.

In the above scenario, the path returned would be: "Root\Switch Text:Selected"
Where "Root\Switch Text" is the Module path and "Selected" is the pin.

Exposing to Root

In practice it is easier to expose all the pins you want to control on the Root level, so that you don't have to deal with module paths, for example:

NOTE: Pins exposed to the Root will also appear on the Dashboard panel, providing easy access within Aximmetry Composer.

In this case, you can use the following action instead:

<action type="ComposerSetPinValueAction" Module="Root" Pin="TextNo" Value="7" />

Of course, you can choose to set the text itself directly:

<action type="ComposerSetPinValueAction" Module="Root" Pin="Display Text" Value="The text I want to display" />

Using Panel Path

You can also address the control board buttons directly.

For that, you can use the ComposerCtrBoardPressButtonAction:

<action type="ComposerCtrBoardPressButtonAction" Module="panel_path" Button="button_name" />

It simulates pressing a button on the panel.
For example, suppose you want to switch cameras within the standard VirtualCam control board.

panel_path is very similar to module_path, but besides compound names, it can also refer to control board names.
In this case, we have the VirtualCam_3-Cam compound, within that, we need the CAMERAS control board, and within that the SELECT CAMERA panel.
For example, we want to "press" the CAM 2 button. All of that has to be written like this:

<action type="ComposerCtrBoardPressButtonAction" Module="Root\VirtualCam_3-Cam\CAMERAS\SELECT CAMERA" Button="CAM 2" />

If you have a logical ON/OFF button, pressing it will always toggle between ON and OFF. But you might want to explicitly specify which state it should be in. For this purpose, there is another action named ComposerCtrBoardSetButtonAction.

<action type="ComposerCtrBoardSetButtonAction" Module="panel_path" Button="button_name"  State="True/False" />

For example, let's turn the streaming on the same control board:

<action type="ComposerCtrBoardSetButtonAction" Module="Root\VirtualCam_3-Cam\CAMERAS\STREAMING" Button="On" State="True" />

NOTE: In this case, the button contains an icon, but that is achieved by using the special name On, which is the name you have to specify for the action.

Return Values

The returned string is also an XML with the following format:

<response Code="code" Message="message" />

Code="0" means everything went well and the action has been executed. Otherwise, it is an error code accompanied by an error message.

In the case of query actions, the response also contains a ReturnValue section, see below.

<response Code="0" Message="OK">
    <ReturnValue ...... >
</response>

Grouping Actions

If you want to change multiple properties/buttons at once and you prefer sending all actions in a single HTTP request, you can use ComposerGroupAction.

<action type="ComposerGroupAction">
    <action type=........ />
    <action type=........ />
    <action type=........ />
    .....
</action>

Note that each action can be a ComposerGroupAction as well, thus implementing a hierarchical grouping.

Article Content

Loading
Close
Loading spinner icon
1/10