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

VerifyPrivilegeTagWrite

Displays a form that allows any single user to enter their credentials in order to approve a write of a specific value to a specific tag. These credentials are checked against a specified set to ensure the user has the required privileges before allowing the operation to proceed.

The usernames can be Citect or Windows users.

Syntax

VerifyPrivilegeTagWrite(sTagName, sValueToWrite, sLogDevice, sAccess, sGlobalPriv, sPriv1, sPriv2, sPriv3, sPriv4, sPriv5, sPriv6, sPriv7, sPriv8)

sTagName:

The name of the tag to which a write needs to be approved.

sValuetoWrite:

The value to write to the tag if approval succeeds.

sLogDevice:

The name of a log device if logging is required, otherwise pass an empty string.

sAccess:

The required user viewable areas, or pass an empty string for none.

sGlobalPriv:

The required global privilege, otherwise pass an empty string.

sPriv1..8:

Specifies the required areas for privileges 1 - 8. That is, sPriv1 contains the areas (1,2,3,4,...,255) where the user has Privilege 1. Each argument needs to be either specified or an empty string for none.

Return Value

Name of user that met the required privileges (and therefore the value was written to the specified tag), otherwise ""

Related Functions

FormSecurePassword

MultiSignatureForm

MultiSignatureTagWrite

VerifyPrivilegeForm

Example

// This example generates a form to request a user to approve the tag write operation.
// This user needs privilege levels of 6 and 3.
// When approved, the PLC_VAR1 tag is written with the value 123 and a page string
// is set to indicate the approval status.
IF (VerifyPrivilegeTagWrite("PLC_VAR1", "123", "ApprovalLog", "PlantWide", "", "6", "3", "", "", "", "", "", "")<>"") THEN
PageSetStr(1, "TagWrite Successful");
ELSE
PageSetStr(1, "TagWrite Not Successful");
END

See Also

Security Functions

Form Functions