LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to load sequence file programatically when full-featured UI run button pressed

Solved!
Go to solution

I'm using Labview Full-Featured User interface to run TestStand sequence files.

 

When I open top level VI and press RUN button:

Untitled.png

Then this window is opened and I have to go File->Open Sequence File to open sequence:

Untitle2d.png

 

How loading sequence can be programatically defined, so that the Open Sequence File... will be loaded automatically when run button (image 1 ) is pressed??

 

0 Kudos
Message 1 of 4
(2,021 Views)

As this would need some modification of the TS GUI, I would suggest contacting NI Technical Support Engineers, they might find the answer more quickly.

0 Kudos
Message 2 of 4
(1,950 Views)

I have managed to modify the Full GUI to have the desired functionality, here is the process how I achieved it.

 

  1. First I added a new state called "Open Sequence File" to TS Full LabVIEW UI Dependencies.lvlib:Full UI States.ctl, which is a typedef for the Top-Level VI's state machine states.
  2. Added Open Sequence File state to the state machine loop in Top-Level VI.vi
  3. In Initialize state's decision for next state, instead of going to Handle Events state, we will first have our new Open Sequence File state 
     ulaci_0-1587032952216.png

     

  4. Implement the new state by trying to imitate the process when the user clicks on File and selects the option. If we try to follow the execution of the original program, we can notice that clicking on the File>>Open Sequence File... menu item fires the Menu Selection (User) event in the Handle Events state. This event sends the TS_3 string (the item tag corresponding to the Open Sequence File... option) to the TSUIMenuQueue using the Add to Menu Queue.vi. This part itself will not be enough, because there is also an event firing, when the user clicks on File menu item (before selecting from the drop-down list). This event is the Menu activation? event, which is responsible for populating an array in the Menu Handler Loop, based on which the different actions can be executed when the user selects an option. So we need to copy also the relevant content from this event, which is the TestStand - Does TestStand UI Control Have Focus.vi and the Rebuild Menu Bar.vi (the latter needs a menu refnum input, which we have stored in a global variable)These functions would be enough for implementing the desired behavior, however, they need the user to be logged in to TestStand. When initializing TestStand, it prompts for login, but in the meantime the GUI is continuing the execution, so we need to wait until the user logs in. This is done with the while loop, where we are continuosly checking the currently logged in user's name using property nodes. If it's an empty string, no one is logged in, so we have to wait, and we exit the loop as soon as the user name is not an empty string (don't forget to close the references). If there is no user management, this while loop can be omitted of course. The only part left is adding the decision at the end, which should be the Handle Events case.
    ulaci_1-1587032952224.png

 

0 Kudos
Message 3 of 4
(1,909 Views)
Solution
Accepted by topic author AndrazS

I was playing a bit with the TestStand API, and found a much simpler solution. To get the dialog for opening the sequence file, we can simply use the Application Manager's method called OpenSequenceFileDialog (we keep the while loop waiting for user login) as shown below. The Application Manager's reference is stored in a global variable (see the Initialize state):Image_2020-04-16_18-29-05.png

0 Kudos
Message 4 of 4
(1,893 Views)