12-14-2015 05:58 PM
I have a TestStand 2012/LabView 2012 program and need to add a user message when a duplicate serial number is scanned. This message must require the entry of the TestStand Administrator password before continuing. Does TestStand provide this function? If not, how can I programmatically access the administrator password?
12-15-2015 09:38 AM
Hello
Actually you can make a match with the password using those methods (ValidatePassword and User):
First we need to get the user using this link: http://zone.ni.com/reference/en-XX/help/370052P-01/tsapiref/reftopics/user/ see this: http://zone.ni.com/reference/en-XX/help/370052P-01/tsapiref/reftopics/engine_getuser_m/
After that
http://zone.ni.com/reference/en-XX/help/370052P-01/tsapiref/reftopics/user_validatepassword_m/
This method return a Boolean value
I hope this information will be useful to you.
Regards
12-15-2015 11:01 AM
This looks like it might work but I have no idea how to implement Engine Callbacks. Can anyone provide an example sequence with Engine Callbacks?
12-15-2015 01:10 PM
Hi
Actually I was thinking that we can do something like this:
Regards
12-15-2015 01:36 PM
I will try this later today. I think it is close to what I need. Could you comment on using your proposed solution for the following sequence:
Operator login during production test
Test error
Administrative login required to clear error
Return to operator login
Continue production test
12-15-2015 06:52 PM
I threw this little example together. I think it does what you want.
You may want to add looping in case they accidentally click the wrong button.
I also recommend adding a Privilege called ClearErrors. In my example I look for the GrantAll for Configure. This is kind of a hacky way to determine if they are an admin.
Hope this helps,
12-16-2015 07:24 AM
In reviewing these solutions, two questions:
1. I cannot seem to locate the TestStand functions shown in the LabView VI screenshots (sorry, not a LabView expert. Yet).
2. Is the TestStand administrator password programmatically accessible? I do not see the need to actually login as Administrator. All that is needed is to enter (and validate) the administrator password to approve clearing the error and to continue testing. Doing this would also eliminate the need to log back out and re-login as operator.
12-16-2015 09:04 AM
The problem is that you could have many administrators. Unless in your case you only have one and it is called Administrator.
If that is the case then you could use:
RunState.Engine.GetUser("Administrator").Password
Hope this helps,
12-16-2015 12:17 PM
Only one administrator in this case. I see the administrator password is encrypted. How do I compare an entered password (unencrypted) to this value?