UserCreate
- Last UpdatedJul 18, 2023
- 2 minute read
This function is now deprecated and will be removed in the next release. Use the UserCreateByRole function instead.
Not available for a Windows user.
Creates a record for a new Plant SCADA user. The name of the user needs to be unique.
The user can be of a specified Type or assigned to a specified Role, depending on the current setting for the parameter [Security]CreateUserByRole.
Note: Only users assigned an administrator role can create a user. Other users attempting to run this will encounter an error.
An alarm server needs to be configured and running in the project, so that all clients are notified that an online change to the users configuration has been completed.
In order to perform user configuration changes online in a system with multiple computers running SCADA nodes using these functions, you will need to use the RUN and COPY parameters to check the updates are distributed throughout the system, and that the functions are called from the computer which uses the COPY path as its RUN path.
This function is a blocking function. It blocks the calling Cicode task until the operation is complete.
Syntax
UserCreate(sName, sFullName, sPassword, sType/sRole)
sName:
The name of the user.
sFullName:
The full name of the user.
sPassword:
The password of the user.
The sPassword argument is optional. If not passed, this argument defaults to an empty string which is subsequently ignored. It is included for the purposes of handling duplicate user names and separate password identification compatibility.
sType:
The generic type of user. The type needs to be defined in the general properties for a user in Plant SCADA Studio's Security activity (see Add a Plant SCADA User).
sRole:
The role to which the user will be assigned. The role needs to be defined in Plant SCADA Studio's Security activity (see Roles).
Return Value
0 (zero) if successful, otherwise an error code is returned.
Related Functions
UserDelete, UserEditForm, UserPassword, UserPasswordForm, UserCreateForm
Example
/* Create a new user */
UserCreate("Fred", "Fred Jones", "secret", "Operator");