How to Customize Front End Callbacks in TestStand
Downloads
Filename: frontend.zip
Requirements: View
Front End callbacks are sequences in the FrontEndCallbacks.seq file that the Operator Interfaces call using the Engine method CallFrontEndCallbackEx. Front End callbacks allow multiple Operator Interfaces to share the same implementation for a specific operation. The version of FrontEndCallback.seq that TestStand installs contains one Front End callback sequence, LoginLogout. The sequence editor and all of the Operator Interfaces that come with TestStand call the LoginLogout sequence. Because a Front End callback is implemented as a sequence, you can modify it without modifying the source code or rebuilding the executables for the Operator Interfaces. For example, to change how the various Operator Interfaces perform the login procedure, you only have to modify the LoginLogout sequence in the FrontEndCallbacks.seq file.
TestStand installs predefined Front End callbacks in the FrontEndCallbacks.seq file in the <TestStand>\Components\NI\Callbacks\FrontEnd directory. You can add your own Front End callback or override a predefined callback in the FrontEndCallbacks.seq file in the <TestStand>\Components\User\Callbacks\FrontEnd directory. You can then invoke this sequence from your Operator Interfaces using the Engine method CallFrontEndCallbackEx. Since you cannot edit the source for the TestStand Sequence Editor, you cannot make the Sequence Editor call new Front End callbacks that you create.
The following are steps which modify the LoginLogout Front End callback. After you modify the callback, a successful user login will result in a message popup dialog box indicating: "<Username> logged in successfully."
1. Begin by copying the contents of the <TestStand>\Components\NI\Callbacks\FrontEnd directory to the <TestStand>\Components\User\Callbacks\FrontEnd directory.
Note: Do not delete the FontEndCallback.seq file in the <TestStand>\Components\User\Callbacks\FrontEnd directory.
2. Launch the TestStand sequence editor. The sequence editor is now using <TestStand>\Components\User\Callbacks\FrontEnd\FontEndCallback.seq when you login.
3. Open <TestStand>\Components\User\Callbacks\FrontEnd\FontEndCallback.seq and insert a Message Popup step after the Login step in the LoginLogout sequence.
4. Right-click the new step and select Edit Message Settings from the context menu. For the Message Expression, type or use the Expression Browser to create the expression below. The Expression Browser is available when you click the Browse button.
RunState.Engine.CurrentUser.LoginName + " logged in successfully."
5. Click OK until you return to the Sequence File window.
6. By default the PostAction of the Logout step and the Login step is configured to always jump to the end of the sequence. This means that any steps following the Login step will never be executed unless you change the PostAction of the Login step. To change the PostAction, double-click the Login step to open the Step Properties dialog box.
7. Select the Post Actions tab and disable the Specify Custom Conditions option. Make sure that the On Pass option is set to Go To Next Step, and the On Fail option is set to Go To Next Step.
8. Click OK and save this file.
Now when you successfully login you will see a Message Popup dialog box displaying "<Username> logged in successfully."
In order to create a custom login dialog while modifying the LoginLogout callback, refer to the Developer Zone Example: How to Create a Custom Login Dialog for TestStand
Requirements
Filename: frontend.zip
Software Requirements
Application Software: NI TestStand Development System 1.0.2
Language(s): None
Reader Comments | Submit a comment »
Legal
This example program (this "program") was developed by a National Instruments ("NI") Applications Engineer. Although technical support of this program may be made available by National Instruments, this program may not be completely tested and verified, and NI does not guarantee its quality in any way or that NI will continue to support this program with each new revision of related products and drivers. THIS EXAMPLE PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND AND SUBJECT TO CERTAIN RESTRICTIONS AS MORE SPECIFICALLY SET FORTH IN NI.COM'S TERMS OF USE (http://ni.com/legal/termsofuse/unitedstates/us/).
