Documentation for Axxon One 2.0. Documentation for other versions of Axxon One is available too.

Previous page Run external application on client  Control layouts Next page

On the page:

 


General information

This action starts an external program on the selected server of the Axxon-domain.

Attention!

We don't recommend running programs with GUI on the server. If you have problems with running interactive services, refer to the Windows OS user manual. 

Configuring an action

To configure this action, do the following:

  1. Allow interaction of the server NGP Host service with desktop: StartControl PanelAdministrative ToolsServicesNetlogonPropertiesLog On.

    Note

    For the Failover server and client installation type (see Installation), you must allow the NGP RaFT supervisor service to interact with desktop.

  2. Add to folder <Axxon One installation directory>\UserScripts\ one or more .bat files with the application startup command. The command must include a path to the executable file of the program. You can specify a network path, command line parameters (see Run external application on client) and use templates (see Text templates in the action settings).
  3. Go to the Programming tab.
  4. In the Event rules or Cycle rules list, click Create... (see Configuring macros).
  5. Select a start condition that triggers a macro (see Configuring start conditions).
  6. Click the button below start conditions.
  7. From the drop-down list, select General: Run external application on server.
  8. In the Launch external program on server parameter, select the server where you want to run the program.

  9. In the Executable files parameter, select a .bat file with the run command.
  10. In the Launch parameters parameter, enter templates, if they were set in a .bat file.

    Attention!

    If you expect a wildcard to contain spaces and/or some special shell characters (> & | <, and so on) as a result of the query, the template must be enclosed in quotation marks (""). For example, "{rectangles}". It is necessary to quote the entire template string.

  11. Click the Apply button.

Configuration of the Run external application on server action is complete.

Example use

Example 1

If you use a bat file with contents:

SET "datatime=%1"
SET "cameraIpAddress=%2"
 
msg * Current time is %datatime%, IP-address: %cameraIpAddress%

executing the macro results in the following message:

Example 2

Export events about camera status changes (signal lost/restored) in csv format, a bat file with contents:

SELECT "timestamp"
    ,REGEXP_REPLACE("object_id", 'hosts/', '') as device,
    CASE
                                WHEN ("any_values"::json->>'state') = '4' THEN 'Signal Lost'
                                WHEN ("any_values"::json->>'state') = '3' THEN 'Signal Restored'
                                ELSE ''
        END as state
FROM public."t_json_event"
WHERE type = '0' AND ("any_values"::json->>'state'='3' OR "any_values"::json->>'state'='4') AND timestamp >= '20200211T0000'
ORDER by timestamp DESC

Example 3

Export of all input events in csv format, a bat file with contents:

SELECT "timestamp",
        REGEXP_REPLACE("object_id", 'hosts/', '') as device,
        CASE
                                WHEN ("any_values"::json->>'phase') = '1' THEN 'Closed'
                                WHEN ("any_values"::json->>'phase') = '2' THEN 'Opened'
                                ELSE ''
        END as state
FROM public."t_json_event"
WHERE type = '1' AND timestamp >= '20200209T110000' AND "object_id" LIKE '%ray%'
ORDER by timestamp DESC
  • No labels