Search
Start typing to search...

External Control of Aximmetry via HTTP

Author:

Introduction

This document describes how to control an Aximmetry externally using the HTTP protocol.

Network setup

You can control Aximmetry via HTTP commands sent with the POST method.

For this, you have to start the Composer as administrator and with the /server command line switch.

In the Startup Configuration you'll find a new Network Settings page. There you can select the port you want to control Aximmetry through.

In most cases, you can leave it on default.

The commands must be sent to the URL:

http://ip_of_the_Aximmetry_machine:Composer_HTTP_port/AximmetryComposer

for e.g.

http://localhost:21463/AximmetryComposer

Command format

The commands themselves are presented in XML format.

The most important command is ComposerSetPinValueAction with which you set the value of any pins of any modules within your compound. It look like this:

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

For e.g. suppose you want to change between several texts to display on the screen in a compound like this:

To select the text number 7 you have to send the following:

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

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

In this case you can use the following command 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" />


You can also address control board buttons directly.

For that you can use the ComposerCtrBoardPressButtonAction command:

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

It simulates pressing a button on the panel.
For e.g. 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_A-B_Preview_3-Cam compound, within that, we need the CAMERAS control board, and within that the SELECT CAMERA panel.
For e.g. we want to "press" the CAM 2 button. All of that have to be written like this:

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

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

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

For e.g. let's turn the streaming on on the same control board:

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

(In this case the button contains an icon, but that is achieved by using the special name #On, and this is the name you have to specify for the command.)

Return values

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

<response: “Code”: “Message” />

Available commands

ComposerCloseAllDocumentsAction

Closes all open documents in Composer without asking about unsaved ones.

XML command: <action type="ComposerCloseAllDocumentsAction"/>

ComposerOpenAndRunDocument

  • Path

XML command: <action type="ComposerOpenAndRunDocument" Path="project_path"/>

ComposerSetPinValueAction

  • Module
  • Pin
  • Value

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

ComposerGetPinValueAction

  • Module
  • Pin
  • Value

XML command: <action type="ComposerGetPinValueAction" Module="module_path" Pin="pin_name" />

Return Value: <ReturnValue type="value_Type" value="pin_value" />

ComposerCtrBoardPressButtonAction

  • Module
  • Button

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

ComposerCtrBoardSetButtonAction

  • Module
  • Button
  • State (true/false) 

XML command: <action type="ComposerCtrBoardPressButtonAction" Module="panel_path" Button="button_name"  State="True/False" />


Sending commands

There are multiple ways to send XML POST commands, so the options to what you can do are limitless here.

As an example for this guide, we will use reqbin to send the commands.

First, we start by specifying the address:

It's the same one we used earlier in the guide.

Then we go to the Headers Tab and put:

Content-Type: application/xml

and then we go to the Content tab, and there we can write our XML commands:

Finally, we press Send and our commands will be applied to Aximmetry



Article content

Close
1/10