NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Global status monitoring with parallel model?

Solved!
Go to solution

Hi all,

 

This may be a very simple question, I am new to TS, so please excuse my lack of knowledge!

 

I'm using the TestStand parallel model to test 16 individual UUT's. I have the parallel processes nailed down pretty well, but I am trying to figure out how to "monitor" system global parameters.

 

For example, some global sensor X sets a boolean if something happens (lost air pressure etc) how can I detect this boolean change and do something in response? Do I need to monitor the boolean in each thread execution?

 

Thanks in advance for the help!

0 Kudos
Message 1 of 4
(4,511 Views)

Hi,

 

1)For your use case you can use fileglobals variable type which can share the data between parallel threads/sockets.

2) If you want that a particular step be executed only for say parallel thread/socket 0 then do the following :

 Click on the step

 Go to step settings - Properties

 Go to Preconditions and add the following : "RunState.TestSockets.MyIndex ==0"

The variable "RunState.TestSockets.MyIndex" contains the socket\thread ID of the thread/socket which is running.

 

Lets consider your use case when there is a pressure loss and you want some action to take place.Assuming you will also want to pause all other threads testing till the action taken is completed.

 

if  pressure loss

     if RunState.TestSockets.MyIndex ==0

           execute a specific task

     else  // all other sockets

            wait till pressure loss is restored

     end if

end if

 

Hope this helps.

 

Ravi

 

 

0 Kudos
Message 2 of 4
(4,489 Views)

Hi Ravi,

 

I appreciate your reply. I think I may have been a little ambiguos with my first post.

 

What im looking for is more so to have a single "background" sequence. So in total I will have 16 UUT threads and 1 background sequence which will monitor important sensors/inputs that affect each station.

 

If I insert a new sequence called "Background Sequence", and I have my "Main Sequence" which does all the testing, will I have 16 threads of "Main Sequence" and 1 thread of "Background Seqquence?"

 

Thanks!

 

Andrew

0 Kudos
Message 3 of 4
(4,477 Views)
Solution
Accepted by topic author ademedeiros

Hi Andrew,

 

You can create a sub sequence.

Call the sub sequence in a new thread so that it runs in parallel.

You will need to use a sequence call step type for this purpose.

 

Few things that you need to take care :

 

Ensure that the above step runs only for one socket.

Ensure that this thread is closed in the end before your main sequence ends ( you can use fileglobal variables as flags for communication between the thread and main sequence or notification steps)

 

 

Hope this helps.

 

Ravi

Message 4 of 4
(4,472 Views)