LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Event Structure for Turnining ON/Off VI

try this template and modify accordingly....

Spoiler
acq_BD.png
0 Kudos
Message 11 of 19
(1,198 Views)

eleorka, 

 

I'm also noticing that there is no true constant wired to the stop terminal in the second while loop during the"Stop Task" case.

0 Kudos
Message 12 of 19
(1,175 Views)

@WishKebab wrote:

eleorka, 

 

I'm also noticing that there is no true constant wired to the stop terminal in the second while loop during the"Stop Task" case.


In that particular example, the stop is only meant as a "halt" and pause the measurements. The "exit" was meant for exiting the aplication.

 

However, he should have moved to "apoks" example by now. Its a much better template design. 

 

Kas

0 Kudos
Message 13 of 19
(1,170 Views)

By now I am dog-tired of all possible (as well as impossible :)) ways of wiring the True/False constants inside/ outside of those two while loops involved. No desired results.

 

“Apok’s” design ( BTW, Thank you Apok!) is somehow looks even more challenging at the moment  because of the fact that it puts the AO of the DAQ into “generate” mode even after VI is terminated. So, one can terminate the VI but the analog output will be still going......Catch 22 situation. Now I am having my doubts that what I thought of  it's possible.

Thank you all who replied so far.........Anyone else have other suggestions?

 

Have a better day.....than mine 🙂

0 Kudos
Message 14 of 19
(1,159 Views)

@eleorka wrote:

 

 

“Apok’s” design ( BTW, Thank you Apok!) is somehow looks even more challenging at the moment  because of the fact that it puts the AO of the DAQ into “generate” mode even after VI is terminated. ....


hmmm...if you highlight execution, that does not happen. i think you might have to add in the end task case statement a zero volts write output with the stop task to zero out voltage from the generator. it works fine for me.....  Smiley Wink

 

Spoiler
acq_BD.png

 

0 Kudos
Message 15 of 19
(1,156 Views)

Thanks Apok,

 

I endeavour to try that ..... maybe after lunch.

0 Kudos
Message 16 of 19
(1,138 Views)

Hey Apok,

 

How you doing?

I have tried that option just now, by including a statement into the "Stop Task" that zeroes the output and freq. of the SG. Did not work for me. In your case it probably works

because you still using a static output (via 2D Waveform as in your VI). In my case it's an AC output. Also, to the property node in front of the DAQmx Timing is set to "Do not allow re-generation (changing it doesn't really help).

When set in the way I just described - SG starts OK, when you press the End Task - SG stops. and that is all. No re-generation. I cannot bring property node and the DAQmx timing into the while loop can I? It's already a big time elapse between the moment when the End Task button is pressed and the actual shut down of the SG on the AO .....

0 Kudos
Message 17 of 19
(1,121 Views)

you are right in the static generating mode, but for continuous....create it as a sub.vi (configure as continuous while loop) and any type of reference controls to it , wire a wait on notification inverse to the stop in that loop that would end the task once the loop is notified, like what i did here....

0 Kudos
Message 18 of 19
(1,112 Views)

Great Apok,

Thank you, that was a good example.

0 Kudos
Message 19 of 19
(1,070 Views)