Applies To:
  • CitectSCADA
  • VijeoCitect
  • PowerLogicSCADA 

 Is there any way of associating privilege in a Super Genie? When I put ?INT 10? in the privilege field, I get a compile error "Bad Integer Value".

 Both the Area and Privilege fields are not supported for Super Genie substitutions by design.
 One documented workaround is the use of cicode in the "disable" or "visibility" fields, which mimics the privilege functionality.

To implement this workaround:

All object privilege levels are set to 0. The desired privilege level is passed into the supergenie code as an integer, nPrivilege.

The following code is added to the supergenie cicode.

//Associate Privilege
AssPrivilege(nPrivilege, 10)

This calls the following function:
FUNCTION AssPrivilege(INT nPrivilege,INT nOffset);
  SELECT CASE nPrivilege
    CASE 0 Ass(-2,nOffset,"'0'",0);
    CASE 1 Ass(-2,nOffset,"'1'",0);
    CASE 2 Ass(-2,nOffset,"'2'",0);
    CASE 3 Ass(-2,nOffset,"'3'",0);
    CASE 4 Ass(-2,nOffset,"'4'",0);
    CASE 5 Ass(-2,nOffset,"'5'",0);
    CASE 6 Ass(-2,nOffset,"'6'",0);
    CASE 7 Ass(-2,nOffset,"'7'",0);
    CASE 8 Ass(-2,nOffset,"'8'",0);

The following code is used in the object "disable" or "visibility" field as appropriate.

e.g. Not GetPriv(?10?,0)

(the GetPriv() function checks if the current user has a specific privlege level, refer to the help for more information)

***Submitted by Graham Ryan, Barwon Water***

 Super Genie, Privilege, Area