LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Pulse count in a certain amount of time

Hi,
 
I have a pulse and would like to know how much pulse there are in 2 seconds.
 
May I know which block to use and where they are?
 
Thank you very much,
 
Alexander
0 Kudos
Message 1 of 7
(5,091 Views)
1) What version of LabVIEW are you using (this always helps)
2) What hardware (and model numbers) are you using to try and count the pulses, i.e., NI DAQ, RIO (FPGA), etc. (this is imperative)

We'll be better able to answer your question once this information is supplied.
0 Kudos
Message 2 of 7
(5,073 Views)

Hello Alexander,

This type of operation is best performed with counters. That is why Bill was asking what hardware you have, to see what resources are available.

 If you have a DAQ device with two counters available:
So, what you want to do is Event Counting with a Pause Trigger (gated).

 Counter 0 will be configured as a Event Counter w/Pause Trigger.
 Counter 1 will be configured as a Pulse with duration of 2 seconds.

What will happen is Counter 0 will be armed and waiting to count, it will wait until the Gate goes active. When the gate is active it will count the edges on Source input.
 Counter 1 will output a single long pulse, duration of 2 seconds. This will be routed to the Gate of Counter 0.

There are examples in the Example Finder that show how to accomplish these two seperate tasks. Specifically:
    Gen Dig Pulse.VI (from Hardware Input/Output->DAQmx->Generating Digital Pulses)
    Count Digital Events-Pause Trigger.VI (Hardware Input/Output->DAQmx->Counter Measurements->Digital Events)
 
 If you don't have a DAQ device with two counters then please post back, this will be much more difficult and nowhere as accurate. You will count digital events in a software timed loop.

MatthewW
 Applications Engineer
 National Instruments

  

0 Kudos
Message 3 of 7
(4,880 Views)

Hi,

I must use DAQmx

I am doing VIs to control the position or speed of a DC motor.

The encoder give a pulse function (100 counts per turn of the DC motor).

1- Speed VI,
1.1- I want to calculate the speed with two ways.
Fisrt one: In 2 seconds, how much impulse count is there.
Second: How much time before another step.

1.2- Graph the speed history.
The problem here is that


2- Position VI

1.1- I have to keep a track of the position of the motor. To do that I have to count the number of pulses since the start of the program.

1.2- I also have to know if the rotation is clockwise or anti-clockwise.
To know if my motor is turning clockwise or counter clockwise, I have to know if the second signal is to "1" or to "0" when the first signal is going from "0" to "1".

 

Thank you very much,
Alex

0 Kudos
Message 4 of 7
(4,692 Views)
 Hi Alexander,

 DAQmx is the driver that some of our hardware requires.
 What NI hardware are you using? These type of questions are difficult to specifically answer unless we know what hardware you are using.
 

 Thank you,

MatthewW
Applications Engineer
National Instruments


Message Edited by Matthew W on 08-06-2007 12:04 PM

Message Edited by Matthew W on 08-06-2007 12:05 PM

0 Kudos
Message 5 of 7
(4,503 Views)
Sorry,
 
The material is :
PCI-6251 from National Instruments.
 
Thank you very much,
 
Alexander
0 Kudos
Message 6 of 7
(4,485 Views)
 
 Hi Alexander,

 These tasks shouldn't be too hard with the PCI-6251.
 
 The PCI-6251 has the NI-TIO timing engine which will allow directly measuring the position and subsequently velocity.

 1. Here is a forum posting where JoshuaP addresses how to calculate the velocity given the change in position.

 2. You will need to create the buffered period measurements and continous pulse train generation counter operations.
     This can be done with DAQ Assistants or by looking at the examples in the example finder.
     Look under Counter Measurements and Generating Digital Pulses for the appropriate examples.

 3. To measure position alone you could also use the Measure Angular Position.VI from the example finder.

Good luck!

Please post back if you have difficulties implementing this.

MatthewW
Applications Engineer
National Instruments.


Message Edited by Matthew W on 08-07-2007 07:13 PM

0 Kudos
Message 7 of 7
(4,404 Views)