09-30-2023 09:22 AM
Hello. Good evening
There are 15 sequence procedures inside one seq file.
Depending on the user, I want to make sure that only some of the selected sequences are capable of performing them, rather than checking all 15 sequences, but I can't find any example files at all.
I'd really appreciate it if you could give me some reference materials or help
Solved! Go to Solution.
10-02-2023 10:54 AM
You can use TestStand API expressions to evaluate certain criteria, and use that as a precondition to the steps you want to skip.
You must make sure that User Privilege Checking is enabled in your Station Options (Station Options»User Manager»Check User Privileges)
JorrEl_0-1696261873146.png
For example, if you wanted TestStand to automatically skip certain steps based on the user's privilege level, you could first obtain flags that indicate the user's permissions:
Statement Step
Locals.Operator = RunState.Engine.CurrentUserHasPrivilege("Operate"),
Locals.Technician = RunState.Engine.CurrentUserHasPrivilege("Debug"),
Locals.Developer = RunState.Engine.CurrentUserHasPrivilege("Develop"),
Locals.Admin = RunState.Engine.CurrentUserHasPrivilege("Configure")
Then, using each of those flags as preconditions in your steps, you can make them run/skip depending on the user's privileges:
Precondition (Run this step if the user is an Operator OR a Technician
Locals.Operator || Locals.Technician
I have attached an example sequence file showing how this works
10-02-2023 10:57 AM
Here are some other threads that contain similar questions and answers to yours that may help you get exactly the behavior you want:
https://forums.ni.com/t5/NI-TestStand/How-to-skip-a-step-programmatically/td-p/1034909
https://forums.ni.com/t5/NI-TestStand/Skip-or-run-any-step-during-execution/td-p/243014