NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

LabVIEW version of TestStand OI

I am working with (and trying to customize) the LabVIEW version of the TestStand 3.5 Operator Interface.  I've created a LV8 project and extracted all the VIs from the LLB file where the OI files were contained.  Now, I'm looking at the Full OI - Top-Level VI.vi and rtm files and I'm trying to understand how the two interact.  Where is the event handler for each of the menu items?  When I open the RTM file, I see the top-level items FILE, EXECUTE, DEBUG, CONFIGURE, TOOLS, HELP.  I don't see any options below that, except for HELP, which has an ABOUT option.  How do I see the options that I know exist beneath FILE, CONFIGURE, etc.so I can then modify the menu options the user sees.
0 Kudos
Message 1 of 20
(5,030 Views)

Hi,

The menu is setup by the VI Local OI.vi and the menu item have callbacks which are configured in Full OI - Configure Events Callbacks.VI except the Quit which user a user event setup.

Each item is obtained from the resourse file UIControlOperatorInterfaceStrings.ini found in the C:\Program Files\National Instruments\TestStand 3.5\Components\NI\Language\English folder or in the User folder if you have changed it

Regards

Ray Farmer

Regards
Ray Farmer
Message 2 of 20
(5,030 Views)
I copied the ... \NI\Language\English files to the \User\Language\English folder.  Then I went into my labview project file and updated the rtm file by changing the Item Tag for File to "FILEORAMA".  I then saved everything and viewed the details (within a Windows Explorer) of the two English directories.  Neither showed any updates.  I'm just wondering if I'm looking at the correct files.  Also, I'm not clear on the proper order of events when creating/updating a menu.   Do the event callback files get named automatically (auto generated)?
0 Kudos
Message 3 of 20
(5,023 Views)

Hi,

Rather an copy the files to the User folder.

There is an ini file in the ..\TestStand 3.5\Components\User\Language\English folder called CustomStrings.ini

As an Example, I have added the following to this file and saved it.

[TSUI_OI_MAIN_PANEL]
FILE = "&MyFile"


I then launched the default LabVIEW OI from the Start | All Programs | ..... (which launches the default supplied OI)

Now instead of File as the menu item its MyFile.

Regards

Ray Farmer

Regards
Ray Farmer
Message 4 of 20
(5,019 Views)
Something else I'm wondering ... When I started this whole thing, I copied all the OI code from C:\Program Files\National Instruments\TestStand 3.5\OperatorInterfaces\NI\Full-Featured\LabVIEW and placed it on a network drive - the directory structure doesn't at all follow the previous structure.   I then broke out all the VIs out of the LLB so as to be able to (eventually) track changes (via SCM) to any/all files.  The sequence editor, and all the configuration files are still back on the C-drive.  First, what directories (i.e. cfg, english, etc) should I create user versions for (given that I want to customize the LV version of the TestStand OI), second - At the same time, I'm working on another TestStand project, but the source code is developed in LabWindows/CVI (8.0).  What do I need to do to ensure the configuration files from one project don't affect the other?
0 Kudos
Message 5 of 20
(5,022 Views)
The .rtm is pretty much a placeholder.  The menu items are built programatically based on the state of TestStand in the Full OI - Rebuild Menu Bar.vi.  You will notice that for each top-level menu item, there is an array of commands that are added to the list.
 
-Allen P
NI
0 Kudos
Message 6 of 20
(5,005 Views)
I'm not sure what you mean by 'the rtm is pretty much a placeholder'.  Also, I'm looking at the code and in a little documentation I found, it says (about the Commands input to the TestStand - Insert Commands in Menu.vi) Commands is an array of TestStand command types. For each element in the array, the VI inserts the corresponding menu item(s).  I see that I can get one of these types of arrays if I right-click the Commands input and select create::constant.  Since I'm having problems finding documentation, I'm not sure how to, for example, view what options are contained in a CommandKind_DefaultFileMenu_Set.  Or, where to find the events that correspond with each menu selection, and finally, how the RTM and the C:\Program Files\National Instruments\TestStand 3.5\Components\User\Language\English\ UIControlOperatorInterfaceStrings.ini and these arrays all play together.
0 Kudos
Message 7 of 20
(4,996 Views)
The RTM is a starting point for the top-level menu items.  It is used by the Rebuild Menu Bar VI to add items to the Menu.  Menu items are added by calling the "Insert Commands In Menu" VI.  You will notice that this VI requires a top-level menu item for which it will insert items below.  The top-level menu items come from the RTM.
 
The inputs for the "Insert Commands In Menu" VI require an array of TestStand Commands.  Commands are the backbone for controlling an Operator Interface.  Commands are defined by a CommandKind enumeration.  An example of a CommandKind is CommandKind_Abort (75).  An advantage in using commands is that TestStand will automatically keep track of the disabled/enabled state of a command, along with whether or not the command should be visible.  There are also special CommandKinds that represent an array of other commands.  For example, there is a CommandKind called CommandKind_DefaultFileMenuSet.  This is the equivilent of the following set of commands:
 
CommandKind_OpenSequenceFile
CommandKind_Close
CommandKind_Separator
CommandKind_CloseAll
CommandKind_CloseCompletedExecutions
CommandKind_Separator
CommandKind_OpenWorkspaceBrowser
CommandKind_Separator
CommandKind_Login
CommandKind_Logout
CommandKind_Separator
CommandKind_UnloadAllModules
CommandKind_Separator
CommandKind_ExecutionEntryPointInsertionMarker
CommandKind_ConfigurationEntryPointInsertionMarker
CommandKind_Separator
CommandKind_MRUFiles_Set
CommandKind_Separator
CommandKind_Exit
 
You will notice in the "Rebuild Menu Bar" VI, the only command being inserted into the File Menu Item is the CommandKind_DefaultFileMenuSet.  This is equivilent to an array of the commands listed above.  However, you may want to customize your File Menu to only have three items- Open Sequence File, Close, and Exit.  To do this, you would wire in an array containing just those three elements, rather than the default file menu set:
 
CommandKind_OpenSequenceFile
CommandKind_Close
CommandKind_Exit

You can modify this VI and notice the difference in behavior.

Each of these commands are associated with Resource Strings, so that they can easily be translated.  For example, in the RTM file, you will notice that there is a menu item that is displayed as FILE, but shows up as File.  FILE is stored in the resource file UIControlOperatorInterfaceStrings.ini, under TSUI_OI_MAIN_PANEL, where you will notice it is listed as FILE = "&File".  The & symbol is to define a shortcut key for the letter F.  If you wish to change the default names for the Top-Level Menu Items, you can change this INI file.  The actual text for each menu items are defined in other language files, and can be "translated" if you wish to change the way they are displayed to the user.  For instance, rather than say "Open Sequence File", you may wish the menu item to display as "Open Test Sequence".  This can be done by changing the resource string that defines it.

Hopefully this clears things up!  Let me know if you have other questions.

Allen P.

NI

 

 
0 Kudos
Message 8 of 20
(4,987 Views)
That is fantastic information, and EXACTLY the level of documentation I wish I could find about soooo many topics.  Now you've opened up the door for some more questions.  Where can I find documentation that says CommandKind_DefaultFileMenuSet contains those 19 commands you listed.  Also, and this is my main struggle, how can I find the event handler associated with any single command.  And a related question, when you have a command 'set' how is that event handled? 
0 Kudos
Message 9 of 20
(4,974 Views)
If you go to TestStand >> Help, you can find most of the information I described regarding the API.  If you search for CommandKind, you can find information regarding all of the commands.  All of the commands are listed on one page titled "CommandKinds Enumeration".
 
Commands are executed inside of the "Menu Selection (User)" case of the Event structure. You will notice it calls the VI "TestStand - Execute Menu Command" VI.  It uses the Item Tag to look up what command was associated with it.  I wouldn't recommend changing this VI.  If you need some additional functionality, let me know what you are trying to accomplish and I can guide you in the right direction.
 
Allen P.
NI
 
0 Kudos
Message 10 of 20
(4,960 Views)