Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

How to reset a case structure?

Solved!
Go to solution

Hi,

I am using two laser beam break ports attached to an NI USB-6259 DAQ.  What I would like is to have the second port non-active until the first port is triggered.  Once triggered I want the second port to be active for a window of time.  During this window I want to the second port to initiate an action only once even if the beam break remains broken.  I have devised two solutions to this problem involving case structures, each of which are attached and have problems.  If I use a while loop I can set the triggered action to cause the loop to stop however this program doesn't give me a time window.  Both beams have to be broken simultaneously.  The other solution uses a for loop that gives me the desired time window but continues to trigger the action if the beam remains broken.  It also doesn't reset after the second beam is broken and has to finish up the loop itereations.  Does anyone know of a way to solve this problem?  I basically need to case structure to be reset after it is triggered.

Download All
0 Kudos
Message 1 of 3
(2,873 Views)
Solution
Accepted by REK

Hi REK,

 

What you could do to alleviate this problem is compare the iterations of the while loop to a constant, and then use that as a stop condition also. That way your program can use the boolean from the sequence structure or the iterations to stop the while loop. The way this would be done is using a greater function to compare the iterations to a constant, for instance 39 if you want it to stop after the 40th run. Then wire that and the boolean from the sequence structure to an or function (on the boolean palette) so that if either sends a true response it will send that to the stop and end the process.

 

Let me know if this works out for you,

Peter W.

0 Kudos
Message 2 of 3
(2,849 Views)

Thanks!  It works perfectly

0 Kudos
Message 3 of 3
(2,842 Views)