This guide uses NI TestStand 2019 32bit and LabVIEW 2019 32bit.
Creating the Custom Privilege
This will create the privilege in NI TestStand that will be used to decide if access is correct, and enable the user to successfully place the custom step.
- In the Types window, go the User Manager
- Within the Standard Data Types menu, expand the “NI_UserCustomPrivileges”
- Create a Boolean Privilege labelled as you would like to be known:
- Right-click on <Right click to insert Field>
- Choose Insert Field
- Choose Boolean
- Set the desired name
Create the Required LabVIEW VI
This VI will be used in the next section and will execute the command to cancel the execution of placing a step dependant on whether or not the user has the correct privileges. Below is an image of the code that will need to be created. It uses the current Sequence Context to access the reference to the engine and the step by using Property Nodes.
The Engine uses an Invoke Node to access the method "CurrentUserHasPrivilege" which will access the users TestStand profile and check it against the named privilege. If they do not have access then it will set the Step property "CancelCurrentExecution" to be True. The step execution here is referencing to the process of placing a step.
The only terminal of the connector pane that is required, is the Sequence Context In. Error terminals could also be added.
Create the Custom Step Type
- Under MyTypes.ini create a new step
- Within SubSteps add a Custom step called: OnNewStep
- With that step selected, press Specify Module...
- At (1), Select the VI created in an earlier step
- The only required change is the Privilege name to check against the user.
- At (2), Edit the VI call to include the Sequence Context In by passing the parameter "ThisContext" in.
- Save and test with users with differing privileges.