Cicode Programming Reference > Cicode Function Categories > Security Functions Introduction > Login


Not available when logged in as Windows user.

Logs a user into the CitectSCADA system, using CitectSCADA security and gives users access to the areas and privileges assigned to them in the Users database. Only one user can be logged into a computer at any one time. If a user is already logged in when a second user logs in, the first user is automatically logged out.

When using Windows security use UserLogin to limit Windows credentials being exposed as plain text.

At startup, or when the user logs out, a default user is active, with access to area 0 (zero) and privilege 0 (zero) only. Use the LoginForm() function to display a form for logging in to the system.


Login(sUserName, sPassword,bSync)


The user's name, as defined in the Users database.


The user's password, as defined in the Users database.


Specifies whether the function operates in blocking or non-blocking mode. . If set to 1 blocks caller until login is complete. If set to 0 (default) does not block caller.

Return Value

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

Related Functions

LoginForm, Logout, LogoutIdle, Message, Input, UserLogin


/* Log in a user whose user name is "FRED" and whose password is 
"ABC". */

See Also

Security Functions