GetRegistry
The GetRegistry function allows a script to retrieve a value from the Geo SCADA User Registry, which comprises part of the logged on user's Geo SCADA Expert User Account (or, with Original WebX, the Windows Registry on the local client machine).
From Geo SCADA Expert 2019 onwards, the location from which the value is retrieved varies, depending on the type of client from which the function is triggered and the user that is logged onto that client:
- To use the function on a ViewX or Virtual ViewX client, you have to be logged on via a Geo SCADA Expert User Account. When you trigger the function, the value is retrieved from the database, where it is stored as part of your Geo SCADA User Registry. (The value is stored as part of your Geo SCADA Expert User Account, rather than being written to the Windows Registry.)
You cannot use the function when accessing the database as the Guest User account, or when logged on as the Super User, on a ViewX Client. This is because the value is only cached with such users, and does not get written to a User Account.
- With Original WebX, the value is retrieved from the registry on the local client machine. The registry entry is specific to the Windows user account that is currently logged on to that client machine. The location is typically:
HKEY_CURRENT_USER\Software\Schneider Electric\ClearSCADA\ViewX/Mimics
Syntax |
GetRegistry (Name, Default) |
Description |
Reads a value from the Geo SCADA User Registry, which comprises part of the logged on user's Geo SCADA Expert User Account in the database (or the Windows Registry on the client machine if using Original WebX). (The Geo SCADA Expert User Registry is used to store name/value pairs in the database; it does not comprise entries in the Windows Registry.) |
Arguments |
Name {string} The Name identifies the registry entry that is to be read by the script. The Name that you enter in your script has to match the name of the required entry in the registry. Default {string or integer} The Default value is an optional variant. It is used to define the value that the function will use if the above entry does not exist in the registry. |
Returns |
Returns a string or integer value from the registry. |
Example:
RegValue = GetRegistry("CoreReg", 17)
This sets the RegValue variable (defined earlier in the script) to have the same value as the value stored for the CoreReg entry in the registry. If the script cannot find the specified entry in the registry, the value 17 is used instead; additionally, a CoreReg entry with a value of 17 is created in the registry.
Further Information
If required, an administrator can clear a user's registry settings: see Clear Registry in the Geo SCADA Expert Guide to Security.