From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How to terminate the Sequence Test?

Hi,
 
We do something similar to your suggestion, where we have a function that perform the Initialise, Get Status, discard handle, depending on a mode parameter to the function. A static variables, in the function rather than a global, maintains the termination object handle, an the Current Execution Object. 
This seems to work well.
 
Regards
Ray Farmer
Regards
Ray Farmer
0 Kudos
Message 11 of 15
(1,561 Views)

Thank you Ray and Caroline,

I'm still confused...

Let's take this example:

TSfunc1()

{

    func1()

func2()

 

0 Kudos
Message 12 of 15
(1,550 Views)
Continued from my previous message  (sorry, I hit the wrong key...)

TSfunc1()

{

   func1()

   func2()

}

TSfunc2()

{

   func1()

   func2()

   func3()

}

 

Now, I can go 2 different ways:

a) I can handle the termination inside the func1()  and func2() etc....  This way there will be no termination possibilities outside those functions.

b) I can handle the termination in the TSfunc1() and TSfunc2().  In this case, in order to terminate within func1() and func2(), I must set up some globals.  I have done it this way and it works fine!.  However, using globals is a problem because you must maintain them.

QUESTIONS: 

1. Am I right in my view of using the Termination process?

2. Which method is more efficient in your openion?

3, When you talked about static veriables.  Where exactly did you intend to use them?  They are valid only in the procedure where you defined them,   and they keep there value until the next time you call this procedure, right?  so, I don't see how I can benifit from that.

 

Thanks again,

Rafi

0 Kudos
Message 13 of 15
(1,550 Views)
Would you happen to have any LabVIEW code that solves the problems discussed in this thread?
0 Kudos
Message 14 of 15
(1,307 Views)

Hi Rafi2003,

All you need to do is  call TS_ExecutionGetTerminationMonitorStatus (exec, NULL, MON,  CA_DEFAULT_VAL, &term); in your lower level functions.

You could initialise and close the TerminationMonitor at the higher level eg in TSfunc1, 2 and 3 providing you pass the exec handle down to the lower level.

I hope I have understood your problem correctly.

Regards

Ray Farmer

Regards
Ray Farmer
0 Kudos
Message 15 of 15
(1,305 Views)