Creating a Hyperlink to a ViewX ‘Document’ on Another Monitor
You can configure a Mimic so that it has hyperlinks that, when selected, cause a display to be shown on another monitor. This type of hyperlink can be useful on a Multi-Monitor setup (where a ViewX client has been configured to use more than one monitor). When you select a hyperlink on a Mimic shown on one monitor, the target display is shown in a specified Window Container on a different monitor. Before configuring such a hyperlink, please be aware of the following:
- This type of setup should only be used on systems on which only ViewX clients are used to display the Mimic (as opposed to Virtual ViewX clients, or Original WebX clients).
- Each ViewX client has to be configured to use a Startup Configuration file that contains the definition for the head on which the target document is to be displayed. (The definition comprises either the MonitorOrigin or Monitor attributes.)
If the Mimic is accessed on a ViewX client that has fewer heads than those specified, the target display is likely to appear on whichever monitor is displaying the Window Container within which the target document is configured to launch. That Window Container might well appear on the same monitor as the Primary Window Container, due to the mismatch between the Startup Configuration file's settings and the actual monitor configuration.
A diagnostic message is displayed if attempts are made to access such a hyperlink from a Virtual ViewX client, or an Original WebX client. This is because such clients do not support Startup Configuration files, so will be unable to display the target document via a hyperlink that requires a Startup Configuration file to be in place on the client machine.
A diagnostic message is also displayed if attempts are made to access the hyperlink from a ViewX client that does not have a valid Startup Configuration file with the required head definition.
You can use a hyperlink to display various ViewX displays in a Window Container on another monitor, including:
- Mimics
- Forms
- Lists
- Alarms Lists
- Trends
- X-Y Plots
- X-Y-Z Plots
- Dynagraphs
- Logic Programs
- Schedules
- Reports
- Time Profiles
- Script Libraries
- Calendars
- Value Maps
- Alarm Action Rosters
- Alarm Action Calendars
- Data Grids
- Data Tables
- Crystal Reports.
NOTE: Some drivers also have driver-specific ‘documents’ that can be used as ‘target’ displays for hyperlinks.
To create a hyperlink that causes a display to be shown on another monitor on a ViewX client, you need to configure a Script pick action that uses Execute Code Fragment mode. As part of the configuration of the pick action, you need to define code that instructs ViewX to display a specified display in a specified Window Container. The following procedure explains how to create such a hyperlink:
- Log on to ViewX via a User account that has the Configure permission for the Mimic that is to contain the hyperlink. We will refer to this Mimic as the ‘Source’ Mimic.
You can use a single monitor client to create a hyperlink to a display on another monitor, but to test your hyperlink works as expected, you will need to use a Multi-Monitor setup.
- Use the Database Bar to locate the 'Source' Mimic and display it in Design Mode (see Displaying a Mimic).
- Ensure that Scripting is enabled on the Mimic (see Enable the Scripting Feature on a Mimic).
- On the displayed Mimic, either add a new Mimic object and select it, or select an existing Mimic object. This is the Mimic object that is to contain the hyperlink (so that when you select the hyperlink in Run Mode, it will cause the ‘target’ display to appear in another Window Container.).
- Ensure that any unwanted animations that might conflict with the hyperlink's intended configuration have been removed. (Animations take precedence over other settings in the Pick Action Wizard. If a database item is dragged onto a Mimic, this results in some animations being created automatically.) For more information, see Using the Animations Window.
- Right-click on the selected Mimic object, and then select the Pick Action Wizard option to display the Pick Action Wizard.
- On the first page of the Pick Action Wizard, select Script, and then select Next.
- On the second page of the Pick Action Wizard, set the Mode to Execute Code Fragment, and then enter the following code in the Code field:
App.OpenWindowOnHead n,"<Absolute reference to target display>"
Where:
n
is the head number assigned to the Window Container in which you want the target display to be shown (see Assign a Head Number to a Window Container in the Geo SCADA Expert Guide to Client Administration).<Absolute reference to target display>
is an absolute reference to the ViewX ‘document’ that is to be the ‘target’ display. The absolute reference has to include the system name and should not include the angle brackets < >.
For more information on finding out the absolute reference for a display, Locating the Absolute Address of a Display.
- Use the Permission setting to specify the security permission that is required to select the pick action that you are configuring.
- Select the Next button.
- Enter a Pick Action Comment if required
- Select the Next button, then select the Finish button.
The Pick Action Wizard is closed.
When you display the Mimic in Run Mode, you will be able to select the Mimic object to trigger the pick action. If configured correctly, this will cause the target display to appear in the specified Window Container on another monitor.
Example:
A ViewX client is setup up to run on two monitors. Each monitor hosts a Window Container, one named 'Primary', the other named 'Secondary'. For this example, we will assume Primary is the left-hand side monitor.
The Primary Window Container is assigned the head number '1' in the Startup Configuration File, the Secondary Window Container is assigned the head number '2'.
A user logs on and displays a Mimic named ‘ControlA1’ in the Primary Window Container on the left monitor. The user configures the ‘ControlA1’ Mimic so that is has a hyperlink that, when selected in Run Mode, will cause a Mimic named ‘Sector8C’ to be displayed in the Secondary Window Container. The ‘Sector8C’ Mimic is stored on a system called ‘MAIN’ and in a Group named ‘Power Switches’.
To configure the hyperlink, the user selects a suitable object on the ‘ControlA1’ Mimic and displays the Pick Action Wizard for that object. They then configure a Script pick action that is set to Execute Partial Code. They define the code as:
App.OpenWindowOnHead 2,"SCX:///MAIN/CMimic/Power Switches.Sector8C"
The App.OpenWindowOnHead 2
part of the code instructs Geo SCADA Expert to display the defined target display in a new document window in the Secondary Window Container.
The comma separates the function command from the definition of the target display. The code that is enclosed within the straight double quotation marks (" ") defines the target display. This is an absolute reference that includes the system name and database class (in this case MAIN and CMimic respectively).
The user completes the pick action configuration and then displays the ‘ControlA1’ Mimic in Run Mode. They select the object with the pick action, which causes the ‘Sector8C’ Mimic to be displayed in the Secondary Window Container on the right-hand side monitor.
Further Information