LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to override or timeout a case structure?

I am building a VI that has several subVIs in it. One of the subVIs is resposible for generating a sine/triangular/squar/sawtooth waves. This wave generator VI can be triggered manually or wait for a trigger signal to trigger the preselcted wave. My problem is with the triggering mechanism. when ever I set my VI to autotrigger, which means it will wait for a TTL triggering pulse to out put the wave, the main VI will not respond until it reseves a trigger pulse. Is there a way to make it wait for lets say couple of milliseconds or seconds and if it didnt receive a trigger pulse to passor override the case structure and continue excuting the VI?

 

Thanks

0 Kudos
Message 1 of 5
(3,977 Views)

Well, you did set your Wait For Task To Complete to wait forever (-1).  Why not set that to something more manageable.  You might also want to lower your DAQmx Read timeout.

 

Another option is to make this task run in a parallel loop and you command it to start with a Notifier or Queue.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 5
(3,962 Views)

Are you referring to the Wait Until Done VIs you have in the VI you attached? You have a value of -1 wired to the timeout input, so they will never timeout.

Cheers


--------,       Unofficial Forum Rules and Guidelines                                           ,--------

          '---   >The shortest distance between two nodes is a straight wire>   ---'


0 Kudos
Message 3 of 5
(3,955 Views)

I set it up to wait for unlimited time because when a user turn on the auto trigger he/she has to set up other parameters and make sure that the hard ware is placed right. the main point is that the user should do couple of other things before making it to auto trigger. So the time will ends before this person finishes. I just want to override the triggering wait time. In other words I want the main VI to respond to any other inputs even though the auto trigger is on with out giving an error and stoppin the main VI.

0 Kudos
Message 4 of 5
(3,946 Views)

FaisalF wrote:  In other words I want the main VI to respond to any other inputs even though the auto trigger is on with out giving an error and stoppin the main VI.

Then you really want to use a second loop.  Take a look at the Producer/Consumer to get some ideas.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 5 of 5
(3,927 Views)