App.WorkstationName
If the ViewX clients on your system are each assigned a Workstation Name, you can reference this in your scripts. To do this, use the App.WorkstationName property to return the Workstation Name of the ViewX client from which the script is called. This property can be useful when producing scripts in which different functionality is required per workstation/ViewX client.
A ViewX client might be assigned multiple workstation names (one per Geo SCADA Expert database). The Workstation Name that is returned is the one that applies to the system (database) context of the script. When used in Alarm Banner scripts, the App.WorkstationName property will return the Workstation Name that applies to the default system (or an empty string if the Workstation Name field is unpopulated on the client).
The Workstation Name property is local to the client and does not require a server call.
In scripts that are accessed from a Virtual ViewX server, the App.WorkstationName() property will return an empty string. This is because Workstation Names should only be used for ViewX clients (as opposed to Virtual ViewX clients) and have to be unique on the system. Therefore, the Workstation Name will be blank in the connection settings for a Virtual ViewX server.
Syntax |
App.WorkstationName |
Description |
Returns the Workstation Name that is assigned to the ViewX client on which the script is running, or an empty string if the Workstation Name field is unpopulated on the client. |
Arguments |
None. |
Returns |
String. The Workstation Name of the ViewX client on which the script is running, or an empty string if the Workstation Name field is unpopulated on the client. |
Example:
This script returns the Workstation Name of the ViewX client from which the script is called and displays the value in a message box. The message box is empty if the client does not have a Workstation Name assigned to it.
Public Sub MyWorkstationName
name = App.WorkstationName
MsgBox name
End Sub
If one user logs in to more than one ViewX workstation, you can use the App.WorkstationName property in conjunction with the Geo SCADA User Registry to create different Registry variables per workstation. Give the custom registry variables a name such as:
App.WorkstationName()+'<VariableName>'