GetRegistry
The GetRegistry function allows a script to retrieve a value from the registry.
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 server, where it is stored in the registry of that Geo SCADA Expert User Account.
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 the registry.
- 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 registry on the server (or the registry on the client machine if using Original WebX). |
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.