NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

TestStand Callback customization

Hello All!

Is Anyone have dll that manage user acces and allow Teststand developper
to customize Frontendcallback i.e. using my own LoginLogout Window (LV)
instead of the default TS dialog box?

Thanks!


---------------------------------------------------------------------
Guillaume Perron
Concepteur de Logiciel/Software Designer
Averna Technologies
19 Le Royer Ouest Suite 400
Montréal
H2Y 1W4
http://www.averna.ca
0 Kudos
Message 1 of 7
(4,421 Views)
Guillaume,

I have tried modifying the existing Frontend callbacks that are provided with TestStand by copying the original ones to the /components/user/callbacks/FrontEnd directory and then go from there. As long as the name of the sequence is the same (FrontEndCallbakcs.seq), TestStand will call this sequence everytime it launches. So you can add your own Window app here instead of the frontend.dll that TestStand calls.

Hope this helps some,

Azucena
0 Kudos
Message 2 of 7
(4,420 Views)
Guillame,

I have found two fairly simple ways to make a custom Login window with a LabVIEW interface. Both use ActiveX calls to the TestStand API. Of course you must modify the FrontEndCallbacks.seq file to call your new VI instead of using the standard DLL calls. Check to make sure that you have the proper preconditions and Post Actions. Refer to the standard functions for the details.

The simpler way of implementing this in LabVIEW is a call to the TestStand engine to display a dialog box. Pass the sequence context pointer into the VI, extract the Engine reference, and use this to call the DisplayLoginDialog method. Pass empty strings for initialLoginName and initialPassword, and fill in the other inputs.

Take the userObject output, create an ActiveX property, and choose the three outputs FullName, LoginName, and Privileges. Password isn't needed here because the dialog box handles password checking for you. Send these outputs to the TestStand engine by using the TestStand-Set Property Value VI's (in the TestStand palette). For the first two, use the (String) VI. For the Privileges output, which is an Automation Reference of Class, you can use the (Variant) VI. The lookup strings are StationGlobals.TS.CurrentUser.[FullName/LoginName/Privileges]. You can then close the Engine reference and generate the Test Data cluster. I have implemented this VI and verified that it sets all properties as expected.

The more complex and customized method is to create your own LabVIEW interface to set the properties of LoginName, FullName, and Privileges. The basic method is as follows. Collect the user name from a string box. Wait for the user to press the OK button. Use the Engine.GetUser method to get a User reference. Use the User.ValidatePassword method to check to see if this is a valid user name and password. Take the User output to set the values using the TS API as described above. Create the Test Data cluster. In TestStand, make sure the checkbox for Display Front Panel is selected. The context pointer should be passed for either technique.

Obviously this is a rather rough sketch of what must be done. I have included two VI's that illustrate the specifics. login1.vi illustrates the first method. login2.vi illustrates the second method. There is currently no list box for selecting users on login2.vi, so you have to type in the user name.

These VI's could be compiled into an executable or DLL in LabVIEW. Or you could use the LV Runtime to use the VI's directly.

Please ask if you have any further questions. Good luck.

Steven Reasoner
Applications Engineering
National Instruments
Download All
0 Kudos
Message 3 of 7
(4,421 Views)
Regarding the second VI here - Login2.vi.
Once the User has been validated, is there any reason not to simply set the Engine.CurrentUser equal to the previously validated new user (obtained from Engine.GetUser)?
This would replace the need for setting three individual user properties with the Labview VIs with a simple 'write' CurrentUser property node.

Also, any pointers on how the Logout part of this would work?
Do you just set the Engine.CurrentUser equal to zero or is there more to it than that?

Regards
Dan
0 Kudos
Message 4 of 7
(4,420 Views)
Hi Steven,
 
I tried your VI (Login2.vi) and I got this error:
 
-17306 Error -17306 occurred at Unknown variable or property name 'Privileges'.
Error accessing item 'StationGlobals.TS.CurrentUser.Privileges'. in TestStand - Set Property Value (Variant).vi->Custom_Login.vi->Custom_Login.vi.ProxyCaller
This error code is undefined. No one has provided a description for this code, or you might have wired a number that is not an error code to the error code input.
 
What do I do wrong?
 
When I tried to create the variant I got that this is not supported.
 
Could anyone help me?
 
Andras
0 Kudos
Message 5 of 7
(4,179 Views)
Hi Andras,

I have modified the above VI, so it will now work and not display the error message that you are seeing.  Test it out and let me know if you have any questions.
0 Kudos
Message 6 of 7
(4,166 Views)

Thanks Terry,

 

It is working fine.

Great help.

Andras

0 Kudos
Message 7 of 7
(4,160 Views)