Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

generate pulses with different duty cycle and frequency

Dear all,

On my PCI-6030E I would like to generate the following. Let's say a few pulses with the same duty cycle and frequency. Wait for a specific amount of time, and do this again. To do this I thought of two things:

1. Use one counter to generate one pulse each cycle. Use this then as a trigger for the second counter which generates the few faster pulses. I tried to program this but not successful yet.

2. Use only one counter but change the duty cycle and frequency for the waiting period inbetween each series of pulses. The problem then is how to know when to send the information of the next pulse because it needs to be directly attached to the other ones. In the NI examples they put in a wait until... but I am not sure how reliable this is.

I hope you can help me with this. Thanks.

Message Edited by Kamu on 03-26-2007 09:07 AM

0 Kudos
Message 1 of 3
(3,803 Views)

I was recently in a thread that may help get you started.  Here's a link.

The basic concept is that counter A is configured to generate several identical pulses, but will only do it when the other counter, counter B, is in the high state.  Counter B is also configured to generate pulses, and you carefully control the time it spends in the high state and in the low state.  The net effect is that you get your burst of several short identical pulses from counter A, and they can be initiated at whatever interval you choose.

You can even choose to change that interval on the fly, though some care is needed.  Specifically, once you change the pulse timing on counter B, you must let it generate a full pulse with those settings before you change the settings again.  Attempts to change them too early will produce an error.  I suspect, but cannot absolutely verify, that it won't be possible to make every single pulse cycle have different timing paramaters.  At best (I suspect), you can change them on every 2nd cycle.

There is a DAQmx property node that will allow you to query Counter B's task to determine when it is ready to receive new pulse timing values.  It's buried *very* deep in the property menu hierarchy.  I'd look first under a DAQmx Channel property node, though it could possibly be under Timing or Write property nodes.  Sorry, I'm not near an LV PC to check.

(Update: look at this posting for more info...)

-Kevin P.

ALERT! LabVIEW's subscription-only policy came to an end (finally!). Unfortunately, pricing favors the captured and committed over new adopters -- so tread carefully.
0 Kudos
Message 2 of 3
(3,794 Views)
Thanks a lot. I tried the examples you pointed to. If I try to run the 2nd example from the other thread (which should exactly what I want) I get an error message. I included an image which shows the error message.

However I also found another thread: http://forums.ni.com/ni/board/message?board.id=70&message.id=2019&requireLogin=False

Here is an example to trigger one counter with the other. This is almost what I want, although I would like to generate several pulses instead of one pulse and it needs to do this everytime my first counter is giving a pulse.

Kamu
0 Kudos
Message 3 of 3
(3,781 Views)