Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

Plant SCADA

UserCreateByRole

  • Last UpdatedSep 09, 2026
  • 2 minute read

This function is 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 assigned to a role defined within the current project (not an included project). For more information, see Roles.

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

UserCreateByRole(sName, sFullName, sPassword, sRole)

sName:

The name of the user.

sFullName:

The full name of the user.

sPassword:

The password of the user (limit of 64 characters).

The sPassword argument is required. If an empty string is passed, the user will not be created and error message 274 (invalid argument passed) will be returned.

sRole:

The role(s) to which the user will be assigned. If required, you can enter multiple roles as a comma separated list. The role(s) you specify need to be defined in Plant SCADA Studio's Security activity (see Roles).

Return Value

0 (zero) if successful, otherwise an error code is returned.

UserDelete, UserEditForm, UserPassword, UserPasswordForm, UserCreateForm

Example

/* Create a new user */

UserCreateByRole("Fred", "Fred Jones", "secret", "Operator");

See Also

Security Functions

In This Topic
Related Links