NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Comparing data within new thread in parallel with main

Solved!
Go to solution

I have a main sequence file. In the main, I have a sequence call that intializes an oscilloscope and returns to main. Next main action, I have the user turn on a power supply and confirm with a message popup. My issue now is, I need to create a new thread before the 'turn on power supply' action so the oscilloscope catches all inrush and keeps recording. So if this is the case, what I am trying to do is:

 

Oscilloscope Initialize sequence call

Oscilloscope Fetch sequence call

Message Popup, turn on power supply, confirm with 'OK'

- Now, ever since the user turned on the power supply I need compare all data, even during the time user turns on power supply and clicks 'OK' and after.

 

So, I am needing an oscilloscope running in parallel and comparing data while the main sequence is running. Any help would be appreciated.

Message 1 of 5
(3,258 Views)
Solution
Accepted by topic author TreyB

The sequence call step type has an option to call a sub sequence in a new thread.

 

Oscilloscope Initialize sequence call

Oscilloscope Fetch sequence call ( call in a new thread and it will be acquiring signals until it gets a stop signal from main seq.)

Message Popup, turn on power supply, confirm with 'OK'

Delay if required

Set the stop signal for the thread to close.

 

 

Hope this helps.

Message 2 of 5
(3,243 Views)

@SunRS wrote:

The sequence call step type has an option to call a sub sequence in a new thread.

 

Oscilloscope Initialize sequence call

Oscilloscope Fetch sequence call ( call in a new thread and it will be acquiring signals until it gets a stop signal from main seq.)

Message Popup, turn on power supply, confirm with 'OK'

Delay if required

Set the stop signal for the thread to close.

 

 

Hope this helps.


Thank you. Very much what I am looking for. I have a script set up but yet to test it. When I call the fetch sequence, I labeled it as a 'new thread' but how would I use a 'stop signal' in the main sequence to stop the fetch thread? So, once I call the fetch sequence and return to main, the fetch sequence will continue running and gathering data, or what I tell it to do, until I call it to stop in the main sequence, correct?

Message 3 of 5
(3,235 Views)

I am attaching a sample sequence.

 

You need a common variable between the main sequence and the thread to stop it.I used file globals.

Message 4 of 5
(3,222 Views)

Thank you Sun. After your original response I went back and made it very similar to what your example provided so seems I was on the right track.

Message 5 of 5
(3,208 Views)