SetInstanceName

(Engine-Level Function)

Description: Set the name of an instance of a module.
Returns: Nothing
Usage: Script or steady state.
Function Groups: Basic Module
Related to: GetAccountID
Format: SetInstanceName(Instance, Name)
Parameters:  
Instance
Required. The object value for which the name is to be assigned. Typically, Self() .
Name
Required. The text string name of the instance. Must be unique.
Comments:

Retained variables allow each separate instance of a module to retain its value on disk between VTScada executions or between instantiations of the module. Each instance must be assigned a name, and this SetInstanceName() function provides this facility.

If storing user-specific property settings, use the GetAccountID function to retrieve a unique identifier for the current user, to be used as part of the name.

Example:

Within a module that is to retain information on a user-by-user basis:

Init [
  If 1 Main;
  [
    SetInstanceName(Self, \SecurityManager.GetAccountID());