NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Shutdown Teststand programatically

Solved!
Go to solution

Hi 

I would like to close my Teststand Operator Interface by clicking a button from a VI that runs from the normal execution.

 

My question is, how can I link this button from the VI that is called from Teststand to my Operator Interface?

 

My Idea was:

1. Create a variable in Teststand.

2. Feed this variable with the value of the Button from my VI.

3. One Step after this VI check the value of the variable and shutdown everything (correctly) depending on the value.

 

But I don't know exactly how to do it..

 

Any help would be appreciated.

 

Thanks.

Regards.

 

 

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

0 Kudos
Message 1 of 10
(3,291 Views)

I found this Shutdown method and It works good but not properly.

 

I don't know where to place it, because when it executes I still have the execution running. Is there any way to force it to be executed at the very last moment of the execution?

 

By this I mean, that when you end a Sequence, Teststand remains ready for you to run another Sequence. I don't want that I want Teststand to close after finishing a execution but I can't get it properly.

 I want to do something like this https://forums.ni.com/t5/NI-TestStand/Is-it-possible-to-shutdown-the-user-interface-or-the-editor-of...

 

Regards.

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

0 Kudos
Message 2 of 10
(3,271 Views)

First of all your link does not work for me.

 

Second you could look at the EndExecution UIMessage.  This gets triggered every time an execution ends.  You would need to determine if it is your sequence file or not because the front-end callback will also trigger that UIMessage.

 

Here are the message codes: https://zone.ni.com/reference/en-XX/help/370052R-01/tsapiref/reftopics/uimessagecodes/

 

Here is a bit about UIMessages in TestStand:

http://www.ni.com/tutorial/4532/en/

 

Hope this helps,

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
Message 3 of 10
(3,260 Views)

Hi thanks for your answer. 

I have a couple of questions that you might be able to answer.

1. This UI Messages are generated independently from the User, right? So, it doesn't matter if I make one Custom UI Message, because there are predefined UI Messages that are constantly generated, aren't they?

2. I took another approach (but maybe is the same thing) I added an Event Callback. and The VI has the following content. But it tries to close everything during the execution. I think that the reason is because there are plenty of sequences running and ending inside my main Sequence.

It's kind of the same problem you mentioned.

3. Do you have any Idea of how could I make it right or if i'm doing something wrong?

 

4. When I tried to do it by UI Messages, I edited the cases inside the Callback VI for the "8" Event but nothing happened.

 

 

 

event callback.PNGevent callback_detalles.PNG

 

 

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

0 Kudos
Message 4 of 10
(3,243 Views)

This is what I did with the UI Messages but I get the dialog "You have uncompleted executions. Do you want to continue Sthudown?" anyway.callback.PNG

 

 

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

0 Kudos
Message 5 of 10
(3,238 Views)

Sorry for the multi answers. But I want to update it so it's easier to help.

 

I tried to make my user defined UI Message but I don't know what im doing wrong that LabVIEW ignores it.

 

Here is a picture of how I define it on Teststand.(2 different ways)


UI_message_api_3.PNGUI_message_api.PNG

 

 

 

 

 

 

 

And here is a picture of how i "read" it on LabVIEW

 

reir.PNG

 

Any help would be highly appreciated.

Thanks

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

0 Kudos
Message 6 of 10
(3,231 Views)
Solution
Accepted by topic author AldhairGarza

Your event number should be 1589485 and not 10101.  The event id needs to match.

 

Also, I've been giving your issue some thought.  What is your reason for wanting to shutdown TestStand.  There might be better options here.

 

Option 1:  You can start and quit TestStand from the command line.  So create a shortcut on the desktop that passes command line arguments to TestStand.  It will close when the sequence is completed:  https://zone.ni.com/reference/en-XX/help/370052K-01/tsfundamentals/infotopics/startup_opt/

Specifically look at the /quit flag.  These flags apply to both the sequence editor and any of the UIs.

 

Option 2: Use the EndExecution event.  I was able to get it working by doing a dynamic event. See Attached.

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
Message 7 of 10
(3,227 Views)

Thanks again for your answers.

Yes first I tried with 1589485 and then I tried with 10101 but I forgot to change it for the Screenshot.

 

"Also, I've been giving your issue some thought.  What is your reason for wanting to shutdown TestStand"

 

Because I want the following thing:

1. Run the OI and run the Sequence automatically (without having to click Test UUTs)

2. Do whatever the Sequence do.

3. Stop it and exit the OI automatically (without having to click exit).

 

"Option 2: Use the EndExecution event.  I was able to get it working by doing a dynamic event. See Attached"

 

Yes that works but it gets triggered when even the "Login-Logout" Sequence ends.

The problem is to say to LabVIEW when to ignore this Callback.

 

 

 

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

0 Kudos
Message 8 of 10
(3,214 Views)
Solution
Accepted by topic author AldhairGarza

When you start your execution you can store the execution ID (functional global or LV global).  Then you can only trigger the even when you see that execution ID complete.

 

Another thing to do is look at the sequence file that is ending execution.  See the attached screenshot.

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
Message 9 of 10
(3,189 Views)

Note: not all executions have a ClientFile.  You may get an error.  In that case you will just clear the error.

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
Message 10 of 10
(3,188 Views)