NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How to call a custom FrontEnt callback from the user interface?

Hi all,

 

I have made a custom FrontEnd Callback and saved it in the folder where I keep my project's files. In order to call this callback from my user interface, I added the piece of code showed on the attached image but when I run the UI I get an error that says that this file does not exist in the Simple_UI.vi (vi of the user interface). What have I done wrong?

 

Thank you!

0 Kudos
Message 1 of 4
(3,689 Views)

2 issues:

 

1- You are going about the FrontEnd Callback incorrectly.  You should add your code to the sequence file located here: C:\Documents and Settings\All Users\Documents\National Instruments\TestStand 2010 SP1\Components\Callbacks\FrontEnd\FrontEndCallbacks.seq.  That is what it's for.  Read chapter 10 in the TestStand Reference Manual for more info on that.

 

2- You are passing a sequence file to that method when it is asking for a sequence.  They are different objects.  Basically the CallFrontEndCallbackEx is asking for a sequence from the FrontEndCallbacks.seq file.  Not a whole new sequence file.

 

Hope this helps get you in the right direction.

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
0 Kudos
Message 2 of 4
(3,682 Views)

Jigg, thank you so much for your reply.

I did the corrections you suggested, I transferred the modified LoginLogout sequence to FronEndCallbacks.seq and I renamed it to LoginLogout_ so that the editor will still be using the standard dialog of TestStand, and I passed the right name at the CallFronEndCallbackEx method (see attached image). The problem now is that when I run the GUI both login dialogs appear. How can I determine that the modified sequence is the LoginLogout procedure for the GUI without changing the standard dialog for the editor? (Maybe my questions are really basic but I am extremely new to TestStand and a lot of things are unclear to me...)

0 Kudos
Message 3 of 4
(3,668 Views)

You can add a popup Message

 

Whenever the Sequence Editor is opened, a frontend callback is used (located in the program directory of your computer \Components\Callbacks\FrontEnd. Inside this frontend sequence file are two steps, Login and Logout. What you could do is create a numeric variable in your Station Globals set to a value of 0. A Post Action function could be used for the Login step of the callback that would increment this variable by 1. This way, anytime the Login step executes, the station global would increment by 1 indicating one instance of the Sequence Editor is running. To detect this instance, whenever another instance begins, the same callback is ran and as a Precondition for the step, you could check to see if the value of that station globals equals 0. If it does not, you could terminate that new instance of the Sequence Editor. If it does equal 0, then proceed. Also, in the Logout step of the callback, you'll want to set a Post Action function the decrements the station global variable back to 0.

Whenever TestStand Sequence Editor is opened, the Frontend Callback Sequence is called and executed. It automatically calls a logoff function to a DLL and then execute the login step which cals the login function in the same DLL, which in turns brings up the prompt to login.

Once this is complete, if you go to File>>Login the frontend callback sequence is called again (i.e. automatic logout, then login). If you select File>>Logout, the direct function to logout from the frontend.dll is called. Because this is the behavior, the TestStand Sequence Editor can only have one user logged in at a time. To implement the behavior you're wanting, the frontend callback handles the decrementing of the variable because whenever File>>Login is selected to login with a new user, the old user is automatically logged out.

 

Here some Basic Information about How Can I Disable User Management in TestStand?

http://digital.ni.com/public.nsf/allkb/4979F8FDB7ED698B8625712B000CFD14?OpenDocument

 

How Can I Programmatically Add a User In TestStand?

http://digital.ni.com/public.nsf/allkb/563B5DDFA5014A0886256F880018D1FB?OpenDocument

 

Best Practices for NI TestStand User Interface Development

http://www.ni.com/white-paper/7560/en

 

CallFrontEndCallback Method

http://zone.ni.com/reference/en-XX/help/370052H-01/tsapiref/reftopics/obsolete_engine_callfrontendca...

Kais Mekacher
Applications Engineer
Germany - Munich
0 Kudos
Message 4 of 4
(3,659 Views)