Display with Cockpit

Objective: Information about the status of the agent and the currently available memory of the computer should be displayed in a CockpitVisualisiert Werte und Zustände der Automation Engine oder von den überwachten und gesteuerten Systemen. Auch ein eigener Objekttyp in der Automation Engine..

Objects used: Cockpit, Event and Variable

ScriptEigener Objekttyp in der Automation Engine elements used: GET_FILESYSTEM, PUT_VAR and SYS_HOST_ALIVE


Example

Use static VariableSpeichert oder ermittelt Werte dynamisch zur Laufzeit. Auch ein eigener Objekttyp in der Automation Engine. objects for displaying values in a cockpit. Usually, these variables contain data set by the script element :PUT_VAR. These data can, of course, also be changed manually. The status displayed should be based on up-to-date information therefore, a Time event retrieves the values cyclically.

Variable

Create a static variable (STATIC) with the following attributes in a first step:

This variable will contain the data of a particular host.

Event

In a second step, create a Time event and specify an execution interval in the Event tab. In the !Process tab you can set the steps which are to be processed periodically. In this example, the following script lines apply:

!Query if the agent WIN01 is active
:
SET &host_active# = SYS_HOST_ALIVE('WIN01')

!The status of activities is stored as a number in the Variable !object for being displayed in the cockpit.

:
IF &host_active# = 'Y'
:   
PUT_VAR 'HOST_WIN01','HOST_ACTIVE', '1'
:
ELSE
:   
PUT_VAR 'HOST_WIN01','HOST_ACTIVE', '0'
:
ENDIF

!Query for the available memory and storage of the value in the Variable object.

:
SET &memory_total# = GET_FILESYSTEM('WIN01','C:*',FILESYSTEM_SPACE_TOTAL,GB)
:
PUT_VAR 'HOST_WIN01','MEMORY_TOTAL', &memory_total#

:
SET &memory_used# = GET_FILESYSTEM('WIN01','C:*',FILESYSTEM_SPACE_USED,GB)
:
PUT_VAR 'HOST_WIN01','MEMORY_USED', &memory_used#

:
SET &memory_available# = GET_FILESYSTEM('WIN01','C:*',FILESYSTEM_SPACE_FREE,GB)
:
PUT_VAR 'HOST_WIN01','MEMORY_AVAILABLE', &memory_available#

First, the system checks if the agent WIN01 is active. Its status is displayed in the cockpit with a "lamp", therefore the return codes (Y/N) must be stored in the variable as numbers. The script element GET_FILESYSTEM offers the opportunity of retrieving information about the file system (such as the available memory or the number of files).

Cockpit

In a last step you create a cockpit, thereby using various display elements. First assign the previously created variable including the validity key to each particular display element (select Properties in the context menu). You can also specify values from which on the color of the display elements should change.

Now start the Event and Cockpit objects. The event stores the current values to the variable HOST_WIN01. Then highlight the Cockpit object in the Activity Window and open its monitor (click on the monitor symbol in the toolbar or right-click the context menu and select Monitor). The values are now displayed graphically: