NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Modifying the (LV) TestStand Simple UI to start Teststand automatically

Solved!
Go to solution

Hi everyone,

I'm trying to modify the Testand Simple UI in order to make it simpler.

In order to run the sequence file with the Teststand Simple UI I have to first Log in then I have to search for the file in my computer.
And at the End I have to click Test UUTs.

What I want to do is just run the Simple Teststand UI and save some clicks. The Ideal case is to run the UI and start the Test automatically.

I read Working with the TestStand Simple User Interface - LabVIEW and I understand it the following way:

The main Job that LabVIEW here does is to connect the Visible Controls and the Manager Controls, if you click the visible controls they to whatever they have to do, independently from LabVIEW.

 

LabVIEW waits until you click close/Terminate/or something that finishes the Test, then LabVIEW closes the references and so on.

Is that correct?

I tried to modify the Testand Simple UI in order to not wait for me to open the Sequence and Run it.

I found an Example on the forums that is very simple and I took one part of it.

I did the following changes:

In order to start it

UI_start_orig.png

 

UI_start.png

 

 

and then to shut it downUI_shutdown_orig.png

 

UI_shutdown.png

 

 

 

 

But it doesn't run automatically it just loads the file, ready to click Test UUT's.

Is it possible to do what I want to do?

Thank you very much.

 

=======
My Channel: https://www.youtube.com/@LV_Lab

Download All
0 Kudos
Message 1 of 9
(4,390 Views)
Solution
Accepted by topic author AldhairGarza

Hi,

 

What I would do in your program is to use the DoClick method of TestStand buttons.

 

For example, create a ref of the Test UUT button and use the DoClick method. It will simulate a click on that button and so execute the sequence

 

Regards

Message 2 of 9
(4,339 Views)

I want to correct myself the code above does Run the sequence file but when it closes it I got warnings at the end related to incorrect closed References.

 

By the method you told me apparently I don't get any errors but it only works if I disable the Login from Teststand.

The problem is that the code does "click" on the button, but it does it so fast, that it does it before I can click the OK in the Login Window.

 

Do you know if there's any way to disable the Login function programmatically or any way to log in programmatically?

Thanks

=======
My Channel: https://www.youtube.com/@LV_Lab

0 Kudos
Message 3 of 9
(4,334 Views)

Almost all the action available in TestStand can be done with the API.

 

To disable the login, set Engine.StationOptions.EnableUserPrivilegeChecking to false

 

Regards

 

Message 4 of 9
(4,329 Views)

Thanks that works pretty good, it ignores the login input. Do you know if there's some method to avoid showing the Login Window?autorun_teststand.png

 

 

 

=======
My Channel: https://www.youtube.com/@LV_Lab

0 Kudos
Message 5 of 9
(4,318 Views)

Sorry, I don't understand your question. The login window is not displayed with the property Engine.StationOptions.EnableUserPrivilegeChecking to false

 

I looked at your code, you should close the references after you use it

 

Regards

0 Kudos
Message 6 of 9
(4,311 Views)

Thanks for your answer.

 

Are you sure? Because I did what you said and the Login Window keeps poppin up.

It does ignore when I Login and starts the process independently but the window is still there.

 


@Laurent_B 

 

I looked at your code, you should close the references after you use it

 


Which references do you mean exactly?

I'm not sure but I think the StationOptions reference is closed when I close the Teststand Engine reference.

Or do you mean the Button reference ?

 

Do you know if it's correct to close a reference, the way I did with the Teststand Engine reference?

 

 

=======
My Channel: https://www.youtube.com/@LV_Lab

0 Kudos
Message 7 of 9
(4,308 Views)

Ok

You may try Engine.StationOptions.LoginOnStart or Engine.StationOptions.RequireUserLogin

 

You must close all references that you opened dynamically, that mean with a method. So in your code, you should at least close the Station.Options ref

 

Regards

 

Message 8 of 9
(4,304 Views)

It worked thanks a lot!

=======
My Channel: https://www.youtube.com/@LV_Lab

0 Kudos
Message 9 of 9
(4,286 Views)