Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

Use one counter to trigger another

Hi Matthieu

Strangely I do not get the same error message as you, but the same as described yesterday (see attached file). (However, only for a finite series of pulses.)

I have once coded a solution with starting and stopping the task repetitively in a loop and timed  this loop in software (with a timed loop or with the "wait ms"-VI). However I prefer not to mix hardware and software timing, because the latter is not exact and not guaranted ona (non deterministic) MS-Windows system.


0 Kudos
Message 11 of 15
(1,626 Views)
Hi Matthieu

I am still experimenting with different operation modes of my two counters on the 6025E-Board.

Every time I try to use both counters and at least one of those in the "finite samples" mode, I get the error message attached to the last posting. Thus I still assume that there are simply two counters needed to produce a finite number of pulses even if I only use one explicitly in my code: The first to count the clock cycles in order to produce the desired frequency and the other to count the pulses produced by the first one.

So I simply do not have enough counters to produce two series of finite samples (according to my reasoning there would be 4 needed).

Please let me know, if my speculation is right.




0 Kudos
Message 12 of 15
(1,611 Views)
Hi MG83,

I did not receive the same error as you because I tried with the value "1" on the field "Pulse to generate"...

You are completely right. You cannot use this function because the "Finite Samples" generation need 2 counters.

Since E Series and M Series boards only have 2 counters, there is an alternative solution.  Please see
http://digital.ni.com/public.nsf/allkb/4A9AF19480E50C6D862571B70058142A?OpenDocument
for an example of how to generate a finite pulse train using only one counter.  This solution requires the use of an external signal to gate the finite pulse train generation.  If you aren't using the analog input on this board then you could use the AI sample clock as this signal.  If you cannot use the AI sample clock then you will need to use a counter/timer device, such as the PCI-6602, that has more than 2 counters.

Regards.

Matthieu

0 Kudos
Message 13 of 15
(1,609 Views)
Hi Matthieu

Thanks for your answer.

Is there a possibility to learn, which hardware ressources (including counters) are used at a moment in a program during debugging, in order get more insight in the functioning of a program and to avoid such error messages?

As I need more counters for my final application anyway, I have already ordered the PCI-6602-Board.

Best Regards.


0 Kudos
Message 14 of 15
(1,596 Views)
Hi Mg83,

There is no possibility to do that...unfortunately...

You only receive the error message and you can see if a ressource is called twice.

Regards.

Matthieu

0 Kudos
Message 15 of 15
(1,590 Views)