LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

add a quit button to the existing LV test executive

Hi,

I am currently using the full test executive provided with Test Stand to run my labview VI's. The problem that new test users are having is that they cannot find a way to quit the test result page and return back to the Test UUT's page.

Although I can show them how to do this, I must admit is is not that clear and could be made far easier by adding another button next to the Retest button saying Quit.

 

At the moment if you select the Test UUT's button and then when the box appears asking you to enter the serial number, select Stop, there is nothing obvious now showing you how to return to the main page (although if you right clck the grey panel on the left and select Close Execution, then click on the Sequence Files tab, it will return you back to where you started)

 

I have found the LV VI that is used as the test executive but this looks way to complicated for me to add an extra button to say 'QUIT' and return to the sequence file page.

 

Can anyone help

 

thanks

 

Chris

Download All
0 Kudos
Message 1 of 2
(3,047 Views)

Hi Chris

 

Hopefully the instructions below will get you going with this, just wanted to make a point that if you are looking to do a lot of customisation of TestStand, I would recommend the TestStand II training course as it cover all these concepts in detail. What I am going to talkyou through is not trivial although once you
understand how the UI work, it is not too diffucult to edit at all.

 

Firstly you will need to add the button onto the LabVIEW front panel that you want to close the execution. To do this place a 'TestStand UI Button Control' down on the front panel of the top level VI, an example is shown below.

 

Create TS Control.JPG

 

 There are potentially simpler ways to go from here, but I will talk you through making changes that keep to the architecture that is already present.

 

 On the Block Diagram of the Top Level VI, go to frame '1'of the intialise sequence structure. Right click on any of the global variable writes in that frame and click 'Open Front Panel'. This launches the front panel of the 'Full UI - Controls Globals' global variable. In the global variable, you will find 4 colums of controls, in the left hand column labelled 'AX Control Refs' locate the 'Terminate/Restart Button' control. Copy that control to the bottom of the list and re-name it 'Close Execution Button'. Save and close the global variable.

 

Modify global.JPG

 

 Modify Frame 1 of the initialise sequence structure to store the reference of the Close Execution button in the global variable as shown below.

 

 Edit Frame 1.JPG

 

After the initialise sequence structure finishes executing, the 'Full UI - Initialize.vi' runs. Open this VI (it is the VI with the text "INIT" as the icon). On the block diagram you will see a series of subVI's that run in sequence. Effectively, all these VI's do is link the various front panel objects to the TestStand Engine. (Take a look at the tutorial Best Practices for NI TestStand User Interface Developement for more information on how the UI actually works). Open the VI called 'Full UI - Configure ExecutionView Manager.vi (it is the VI with the text "CONFIG EXEC VIEWMGR" as the icon).

 

Go to the block diagram and navigate to the bottom of case structure. You want to modify this VI simply by adding another invoke node in exactly the same format. See the image below for details on exactly what you need to add.

 

 Config Exec View Mgr.JPG

 

Making this change will effectively tell the TestStand Execution View Manager, which handles the execution of your sequences, that the button on your front panel should close any open executions. If you save the changes to the VIs you have modified and then run a sequence, you will find that the button you have added will close a completed execution. You will also notice that it does not return the view to the sequence view. I will talk you through how to make this change now.

 

 If you go back into the VI 'Full UI - Initialize.vi', you will find a VI called 'Full UI - Configure Event Callbacks.vi' (labelled no. 5), open this VI. This VI looks a lot more complex than it actually is. The TestStand Engine is just an ActiveX server, when certain things happen, the TestStand  Engine will fire off an event. This VI specifies which events you want to monitor and what you want to happen when the event occurs. What we are going to do is register the 'Close Execution' event so that when we click the button we have just created to close the execution, we can also run some code to change the view.

 

- On the block diagram, go to the bottom of the Register Event Callback node and drag it down to create a new entry. This will default to EditModeChanged as this is the event registered above it.

- Wire the Application Manager reference into the EventSourceReferance terminal (currently set to EditModeChanged).

- Change the event from EditModeChanged to ExecutionClosed.

- Create a copy of the controls global variable used above in the VI, and set it to read the 'ListBar' reference. Wire this to the UserParameter terminal. 

- Right click where it says, 'VI Ref' and select 'Create Callback VI'. Whenever the an execution is closed, this VI we have just created will be run.

- On the block diagram place a property node, wire the LisBar reference to it, select the CurrentPage property and write a value of 0 to it. This will effectively be the click on the first entry in the list bar which is normally your sequence file.

 

ExecutionClosed Event Callback.JPG

 Save the VI with the rest of the UI source code and close it. The 'Full UI - Configure Event Callbacks.vi' should look something like below.

 

 Configure Event Callbacks.JPG

 

Save and close everything apart from the top level VI. If you run it you should now have the behaviour you want.

 

Hopefully this will get you to where you want to be , let me know if you have any questions.

 

Regards

 

Rich

NI | UK

 

 

 

 

 

 

Message 2 of 2
(2,923 Views)