NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

A thread problem when calling a vi

Hi,

 

I have to make a sequence where I:
1) call a vi

2) wait until I get one boolean status True in vi (When Ready to Continue Seq is True)

3) left this vi running background and continue sequence

4) exit vi when the sequence wants (Send Stop Vi boolean = True to vi from sequence).

 

How to do that?

I have attached Example files to demonstrate the problem. Vi is ready but how to configure the sequence?

 

Thanks for any help!

 

Br,

Jick

Download All
0 Kudos
Message 1 of 12
(4,472 Views)

Here is an example that might work for you.

 

I have saved the sequencefile back to 2013 version.

 

regards

Ray

Download All
Message 2 of 12
(4,451 Views)

Hi,

 

Could you also save vi back to 2013 version, thanks!

 

Br,

Jick

0 Kudos
Message 3 of 12
(4,433 Views)

here you are

Message 4 of 12
(4,430 Views)

Thanks a lot!

One more thing, how can I send Stop request from sequence to vi? In your example I have to go to vi and press stop button.

 

Br,

Jick

0 Kudos
Message 5 of 12
(4,424 Views)

Instead of the Wait step which waits for the user to press the Stop button on my example VI, you could use a Statement step with the expression:

FileGlobals.throbj.AsThread.Execution.Terminate()

 

or another way would be to read the state of a boolean in the Timeout Event such as FileGlobals.Stop and set this True in you Sequence when  you want to close the VI.

 

Hope this helps

Ray

Message 6 of 12
(4,421 Views)

Thanks again!
By the way, why green resume arrow is disabled if I set breakpoint after do-while loop and the vi stays running on background? I need to be able to continue stepping even the vi is running.

Br,

Jick

0 Kudos
Message 7 of 12
(4,409 Views)

you probably need to change to a New Execution rather than a thread

 

regards

 

0 Kudos
Message 8 of 12
(4,406 Views)
Message 9 of 12
(4,402 Views)

Hi,

 

I have now a problem with using this:
FileGlobals.throbj.AsThread.Execution.Terminate()
It works well BUT my UUT result status is always "Terminated" even the sequence passes/fails. How can I ignore this step status changing affect or is there any other solution?

0 Kudos
Message 10 of 12
(4,164 Views)