NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

User Manager define

I want that if I define User manager with password that he is an operator , I want when I login in test stand program to open spacific sequence and run it automaticlly , I can do this or not
0 Kudos
Message 1 of 5
(3,420 Views)
I want to restate you question to make sure that I am interpreting it correctly:

If a user logs on as an operator, you want
a specific sequence opened and executed.

Let me know if this is not your question.

There are 2 approaches I might take to this problem. The first may be the best approach.

1) You have the code of the operator interface that will use in testing your products. It is not very difficult to check the prvileges of the user that logs on and, based on that, automatically open and execute a specific sequence. This is the approach that I recommend. You could even have an ini file that contains which sequence(s) to automcatically run when the operator logs on.

Currently in the Sequence Editor there is no way to programmatically open
a particular sequence file window and execute it. In addition, the Sequence Editor application does not have an API. This means that there is not a way to control what the Sequence Editor does programmatically for other code.


2) The sequence editor, CVI operator interface, Delphi operator interface, and VB operator interface all take command line arguments that allow you to execute a particular sequence in the fashion that you desire (see page 3-1 of the TestStand 2.0 User Manual or the TestStand 1.0 WhatsNew.txt file). You can create shortcuts that use the command line arguments so that a user simply double clicks on the shortcut to open TS and automatically run a sequence. This technique can be used along with the "Automatically LoginWindows SystemUser" setting (see p. 4-31 of the TS 2.0 User Manual) to login the user without the login dialog.
Message 2 of 5
(3,420 Views)
Hi :

first thank you

you said that I can change the prvilege of the user that log on and based on , automatically open and execute a specific sequence ( in paragraph 1).
I insert to prvilege and I didn't see a command or step that do this .
0 Kudos
Message 3 of 5
(3,420 Views)
Silvius just posted an answer to your problem that I like, although it raises an important question. Are you
1) looking to run a subsequence at startup when the person logging on is an operator.
2) Or, are you wanting to run your test sequences, generating a report, etc.

If you are looking for 1) then use Silvius example. If you are looking for 2) then you can

A) use the attached example, which is a modification of Silvius' example. I have simply made his Sequence Call step execute the sequence as a new execution. I also modified the preconditions of this sequence call so that it is not executed unless the property "StationGlobals.TS.CurrentUser" exist. (This prevents an error when an operator logs out but then selects Cancel on the log in dialog that appears). The new execution uses the entry point TestUTTs and the sequence file that I chose to run is C:\TestStand\Examples\Demo\C\computer.seq. However, both of these and other options could be chosen dynamically at runtime.

B) Use the approach that I tried to explain in my previous email. I don't know what programming language you will use when writing your operator interface that will be used on your test system (e.g. LabVIEW, CVI, C++, VB, etc.) We ship operator interface code is a few languages. This code includes a call to login a TestStand user. In my previous email I said you could "check" not "change" the user privileges after the login. You can modify the code of the operator interface so that when the user has operator privileges, a sequence is automatically loaded and executed. This is in contrast to what happens currently.

Currently, after login happens, the user must manually select a sequence file using the menus, and then execute the sequence. When a user opens a sequence file the operator interface calls methods including Engine.GetSequenceFileEx and Engine.GetSequence. When a user executes a sequence the operator interface calls the method Engine.NewExecution. You would need to change the operator interface so that these methods are called auomatically when the user logs in as an operator.

This approach requires reprogramming the operator interface code. If you decide to go this route then you will need to explain which language you are programming in and what exactly you don't understand in the shipping code of the operator interfaces.

It may just be easier to use solution A).
0 Kudos
Message 5 of 5
(3,420 Views)
Hi,

If I understood well your question, then the answer is Yes, you can do this. The simplest way to achieve this requirement is to customize the FrontEndCallback of TestStand. In the "LoginLogout" sequence of "FrontEndCallbacks.seq" under the "\Components\User\Callbacks\FrontEnd" folder insert a sequence call step (right after the existing "Login" step) which will point to your specific sequence to run for users that logins with operator privileges.
For this "SequenceCall" step set the following precondition:
!CurrentUserHasPrivilege("Operate")
Also change the PostAction for the "Login" step that so for "On Condition True" the Action to be "Goto next step".

The attached files exemplify the above. Just put them into the "\C
omponents\User\Callbacks\FrontEnd" folder.

Hope this answered your question,
Silvius
Silvius Iancu
Download All
0 Kudos
Message 4 of 5
(3,420 Views)