NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I create a new thread to run PulseOutput.VI

Hi:
  I use NI-94729(cDAQ system) to generate pluse and want to output  pulse continuously and to check the pulse is 500Hz.
  In TestStand, the steps as follow:
  1: Call PulseOuput.vi to generate 500Hz pulse, VI use Finite Mode to generate pulse.
  2: Verify the pulse is 500Hz.
 
 Howerver, after the first step finishes, the pulse output stops, te 2nd step is failed. If a Continuous Mode is used in PulseOuput.vi to generate pluse, the 1st step can't finish.
 
Thanks a lot!
0 Kudos
Message 1 of 3
(3,498 Views)

Hello MotionBoy,

There are two ways to go about creating a new thread to run a step.  The first is to create a new sequence, into which you put the LabVIEW step you want to run and any other steps that may go along with it.  Then use a sequence call step to call this newly created sequence.  Set the Execution Options of the Sequence call step to 'Use New Thread.'  This will allow you to run a set of steps in a new thread, not just a VI.  The second method, which is only available for a LabVIEW VI, is to use the “Run VI Asynchronously” step.  This can be accessed if you right-click within your sequence and select Insert Step » LabVIEW Utility » Run VI Asynchronously.  This step will allow you to call a VI and have it automatically open in a new thread.  You can further customize this step by opening the configuration menu in the Step Settings.

To address the current behavior of your steps I would like to know if the modules in steps 1 & 2 pass data between them or it would be desirable for them to do so?  If so you are going to need a more complex synchronization structure such as TestStand/LabVIEW queues. There is a simple example you may want to look at in the TestStand examples, under the Synchronization folder that demonstrates how to use queues. Otherwise the above solution should be all you need.

John B.
Applications Engineer
National Instruments
0 Kudos
Message 2 of 3
(3,435 Views)
Hi Herosphra:
     Thanks a lot!
      I have tried the first solution(using a new thread) that can meet my requirement, but a while-loop is needed in the sub-sequence and control the loop condition by main sequence.
     For the second solution, I thinks it's better one for me than the first one, and I will try after my vocation.
    
 
0 Kudos
Message 3 of 3
(3,432 Views)