REGION
Manage regions on a single display or multiple displays on a desktop client.
- A physical display may be divided into a number of virtual screens.
- On systems with a multi-screen graphics card (or multiple graphics cards), each region can be set up to appear on a different physical screen.
When a window is opened in a multi-region system, the position at which it opens is relative to the selected region.
The instruction REGION provides 2 main capabilities:
- The modes SETSYSREGION and GETSYSREGION allow you to set and retrieve the number of regions to manage on the current station host. In most cases, the number of regions you set is the number of screens on the host.
In practice, you use the mode SETSYSREGION in an initialization script run at project start-up to set the number of regions on the current station host (the number of screens), and use the mode GETSYSREGION at any time to check the currently configured number of regions. - The modes SETREGION and GETREGION allow you to set the region where Link Open animations will open a window (on which screen). Conversely, use the mode GETREGION to retrieve the region where Link Open animations will open a window when executed.
In practice, you use the mode SETREGION in a script designed to define where a mimic should be open based on current operational state, currently configured number of regions, currently set region, and open it using the instruction WINDOW.
The modes SETSELECTION, GETSELECTION and GETSELECTIONMODE are used together and similar to modes SETREGION, and GETREGION but designed for more advanced use cases. They offer differentiation of the target region for the next mimic opening and for the subsequent mimic openings.
When using a set-up with more than one region, you can also configure advanced behaviors to manage mimic close using the HMI options. They are accessible via the menu Configure.HMI options, category Regions.
WebVue support - Not applicable. Returns an unsuccessful code if used in this context.
|
Mode |
Mnemonic |
Syntax |
| 1 | SETSYSREGION | 1 |
| 2 | GETSYSREGION | 2 |
| 3 | SETREGION | 1 |
| 4 | GETREGION | 2 |
| 5 | SETSELECTION | 3 |
| 6 | GETSELECTION | 2 |
| 7 | GETSELECTIONMODE | 2 |
Syntax 1
IntVal = REGION(Mode, Regions);
Return type: INTEGER.
|
Argument |
Meaning |
|
Regions |
The number of regions (mode 1), or a particular region (mode 3). Type INTEGER. |
Return type: INTEGER.
Execution
|
Mode |
Mnemonic |
Action |
|
1 |
SETSYSREGION |
Set the number of regions on the current station host. |
|
3 |
SETREGION |
Set the region in which all future window opening initiated by a Link Open animation will occur. |
|
|
|
Return: -1 if error else OK. |
If using multiple regions, you must set the region before executing any instructions that interacts with the HMI (WINDOW, ALARMDISPLAY etc.).
Dim iRegion As Integer;
iRegion = 1;
Region ("SETREGION", iRegion);
Window("OPEN", "Alarmwindow", "");
If you run a program from an animation, you can get the region in which the calling animation is located using the instruction GETARG("GETREGION")
Dim iRegion As Integer;
iRegion = GETARG("GETREGION");
Region ("SETREGION", iRegion);
Alarmdisplay("ACK_SELECTED", "Alarmwindow", "", "Alarm1");
Syntax 2
IntVal = REGION(Mode);
Return type: INTEGER.
Execution
|
Mode |
Mnemonic |
Action |
|
2 |
GETSYSREGION |
Return the number of regions on the current station host, as set with the mode SETSYSREGION, or -1 if unsuccessful. |
|
3 |
GETREGION |
Return the region in which all future window opening initiated by a Link Open animation will occur, as set with the mode SETREGION, or -1 if unsuccessful. |
|
6 |
GETSELECTION |
Return the current selection, or -1 if unsuccessful. |
|
7 |
GETSELECTIONMODE |
Return the selection mode, or -1 if unsuccessful. |
Syntax 3
IntVal = REGION(Mode, Region[, SubMode]);
Return type: INTEGER.
|
Argument |
Meaning |
|
Region |
The identifier of a region. Type INTEGER. |
|
SubMode |
Any numeric type |
Execution
|
Mode |
Mnemonic |
Action |
|
5 |
SETSELECTION |
Set the region in which all future window opening initiated by a Link Open animation will occur. The behavior depends on SubMode as follows: 0 - The window is opened in the same region as the window in which the Link Open animation resides. Return: -1 if error else OK. |
Example
For an example, select the Example link above.