Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

Finite Pulse Train

Dear All,
 
I have an application where I am using digital finite pulses (see attached example) but I want the generation to be stopped by the user too in addition to the task completed function.
 
Also, when I use generate finite pulse / generate continuous pulses can I use the other counter to count the pulses.
 
I am using PCI 6221 & LV8.0
 
Regards
James
0 Kudos
Message 1 of 10
(5,925 Views)
Hey James,

Finite pulse train generation uses two counters - one to provide a gating pulse for the duration of the generation and one to generate a pulse train that is gated by the other counter. All of this is handled for you by DAQmx. This does take up both counters on the M-Series card.

To stop a finite pulse train before it is done, you can simply stop the task. You could use the DAQmx Is Task Done function along with the user stop button, query the values of both and whichever is true can stop the task and exit.

Hope this helps,
Andrew S
0 Kudos
Message 2 of 10
(5,919 Views)

Dear Stilly,

Thanks for the response, I am using IsTask Done VI in my example (attached file), but the user stopped action will be a Stop Push Button (it is a digital input), which is acquired by 6515 Digital I/O , so when I press the stop button generation stops only when the task is done.

Stopping dont occurs if I press stop push button.

 

thanks

0 Kudos
Message 3 of 10
(5,912 Views)
Hello james!

Thanks for your post. I think what you want to do instead of "wait until DAQmx task is done" just use the "is DAQmx tasks done". That way you only call the VI once in software and it either returns true or false. If you "wait" until the task is done then you program loop will not continue until the task is finished. Take a look at the following pictures that shows you how I would do it. The task will give you a warning and tell you that you have not finished generating all the pulses yet but its just a warning and the task will stop. Let me know if you have any other questions and if this helps you with your application.

Cheers!

Corby_B
http://www.ni.com/support
Download All
0 Kudos
Message 4 of 10
(5,890 Views)
Hello Corby,
 
Thanks for your suggestion, I am able to stop the generation of pulses from user stop, but now what happens if user dont interrupts generation dont stops after specified no. of samples, it is behaving in continuous mode manner.
 
Thanks
0 Kudos
Message 5 of 10
(5,873 Views)
Hello James,

Thanks for your post back! Take a look at the new picture attached as I will have to apologize for my last picture post. I showed you a picture that reconfigures and starts a task each time your loop iterates. So the reason it was acting in a finite matter was because you were clearing and restarting the task every loop iteration. So your loop never finished the pulses. A basic rule of thumb, which I should have conveyed for you, is to always do all your configuration before you enter the loop state of your program. The picture below shows a single finite pulse train that will stop if the user interrupts the counter or the counter finishes the requested number of pulses. Hope this helps and please post back if you have any other questions.

Cheers!

Corby_B
http://www.ni.com/support
0 Kudos
Message 6 of 10
(5,858 Views)
Hello Corby,
 
Thanks for your help, I am able to do it now...but I want to ask that I am stopping the task forcibly, will it have any kind of adverse affect (just doubting) on my DAQ Card (PCI-6221).
 
Thanks & Regards
 
James.
0 Kudos
Message 7 of 10
(5,845 Views)
Hello James,

Thanks for your post back!

Stopping the task forcibly in this case is OK because you are clearing the task and un-reserving the hardware. Its almost the same thing as hitting the abort button at the top of the VI but in that case it would leave the hardwear reserved until you reset the device. So its ok that you are doing this and you can even clear the error using the error handling VI's if you don't want the user to see this. Just be sure you are stopping and clearing the task when the user interrupts the counter. Good Luck with your applications and post back if you have any other questions!

Cheers!

Corby_B
http://www.ni.com/support
0 Kudos
Message 8 of 10
(5,825 Views)

Thanks Corby,

Thank you very much for your useful information, I am able to  complete my task !!.

 

With Regards

James



Message Edited by james p martin on 07-25-2008 12:56 PM
0 Kudos
Message 9 of 10
(5,810 Views)
Hello James!

Glad to hear that is going to work for you. Please make a new post if you have any other questions. Have a great day and Good Luck on your applications!

Cheers!

Corby_B
http://www.ni.com/support
0 Kudos
Message 10 of 10
(5,785 Views)