Number of pulses

Hello every one ;
       I intend to measure the speed of a varying speed wheel using a  photo-coupler (ir transmitter/receiver)  is used in order to detect the number of rotations i have found the output to be a train of pulses that vary in frequency with the speed of the wheel
please help me determine the number of pulses over a certain period of time.
Attachments:
my version.vi ‏56 KB

Hi arifat2k,
If I understand you correctly, you want
to measure the duration of a counter acquisition.
I recommend starting with some of the
shipping examples. In LabVIEW, if you go to Help » Find Examples… the Example Finder will pop up. Browse by
task to: Hardware Input and Output »
DAQmx » Counter Measurements » Count Digital Events » Count Digital Events.vi.
You can then add timing VIs to keep track of the approximate duration of the acquisition.
They can be found by right clicking on the block diagram and selecting Timing. There are several timing VIs
that might be useful, such as Get Date/Time in Seconds and Elapsed Time.
Attached is the example VI pictured below.
Please post back with any questions. If you do, please include more information about your hardware and application. Have a great day!
Message Edited by ryan_d on 11-06-2007 04:43 PM
Ryan D.
District Sales Manager for Boston & Northern New England
National Instruments
Attachments:
timing.png ‏8 KB
Count Digital Events - timed.vi ‏32 KB

Similar Messages

  • Learn the number of pulses created in a finite pulse train

    Hello
    I am using the PCI-6602 Board to produce a finite number of pulses with counter0.
    I want to know how many pulses that are already created by the counter, while my program is running and show this number on an indicator on the front panel of my VI.
    What is the best way to do this with LabVIEW?
    Of course I can use another counter to count the pules and route the output of counter0 to its input.
    However I wonder if it is possible to solve the problem without using another counter, because DAQmx internally already uses a second counter to produce the finite pulse train so it should be possible to read this counter, isn't it?
    Thanks for every help.

    However, I wonder where I can get such detailed Information about the internal functionallity of the DAQ-devices and the DAQmx driver?  Please let me know where you get this information from. (So that I can avoid using this forum in the future)
    Speaking just for myself --- the source has been generally the school of hard knocks. I started doing a lot of special timer/counter work right around the Y2K timeframe. The legacy driver now known as traditional NI-DAQ was then the only game in town.   The programming and terminology under trad. NI-DAQ tends to require you to understand the hardware at a lower level.  The programming used more counter-specific terminology like Gate and Source signals.
    So for a lot of this stuff, I came into DAQmx with a good understanding of the low-level hardware capabilities, and I just needed to tromp around a bit to find the right syntax.  Consequently, I'm not much help for pointing you toward info sources as I haven't relied on them much.  Meanwhile, good luck with the self-teaching but don't feel compelled to "avoid using this forum in the future."
    -Kevin P.
    Message Edited by Kevin Price on 11-01-2007 10:04 AM

  • Finite pulse train generation​... how to count number of pulses?

    hi guys,
    this has probably been solved a hundred times but i just couldnt find it!!
    i have a pulse train generation happening on my ni usb-6211... using FREQ OUT, using a divisor on this, and routing it to PFI4.
    id like to update my VI so i can specify the number of pulses....
    im pretty much a noob at this stuff so any help would be greatly appreciated!! thanks!
    dan
    Attachments:
    pulse train generation.vi ‏25 KB

    Hi,
    No problem at all, we are here to help. What I’m going to do first is to point you to a bunch of examples for that might give you a better insight of the capabilities of the card in terms of finite pulse generation. What you should be looking at is called retriggerable pulse generation and here are some examples to look at: Retriggerable Finite Pause Trigger Digital Pulse Train Generation, Creating a Delayed, Retriggerable and Finite Pulse Generator, DAQmx - Retriggerable Pulse Train Generation - LabVIEW - CVI - ANSI C - VB.NET - C#.NET and Retriggerable Finite Pulse Train with Changing Pulse Specs.
    Let me know it helps
    Jaime Hoffiz
    National Instruments
    Product Expert
    Digital Multimeters and LCR Meters

  • Change number of pulses daqmx

    Hi, I'm trying to control a servo-motor using labview, an E-series device and an omron driver. The driver will rotate the motor a certain number of degrees, proportional to the number of pulses sent by the card. I am able to successfully change the pulse frequency, but unable to do the same for the number of pulses, while the program is running.
    Does anyone know how to do this?
    Thanks in advance,
    JAlmeida

    Thanks for answering.
    I'm trying to control the position of the motor and for thatI have implemented a control algorith that changes the speed of the motor according to the difference between the reference position and the motor position. This happens dynamically as the vi is running. However, this form of control isn't the best, and the motor would respond better if i could send the reference position directly to the driver, as a finite pulse train.
    Basically, I need to send successive finite pulse trains to the driver, according to the number of degrees it has to rotate to follow the reference position.
    Here's the vi, if you want to see it.
    Thanks you,
    JAlmeida
    Attachments:
    serial_control16.vi ‏98 KB

  • Set number of pulses default 5

    Hello, 
    I have just begun to learn LABVIEW. I would like to ask you for help. 
    I need code for these quistions (not DAX). please help me.
    Thanks,
    1 Set the number of pulses. Default 5 pulses.
    2 Set the duration of the pulse. Default 0.5 (s).
    3 Set the number of points per pulse. Defualt 500 points/pulse

    Hi,
    I have been studing in a colege in Haydarabad of India. This is my toturial. I tried t build the VI but I could not. Please help me to code this. Here is the ful toturial.
    Specification
    To design a VI that can also be used as a Sub VI in another VI.
    The title of the VI will be Pulse Generator.
    The output from the VI will be of the type Analogue Waveform and be capable of being displayed on an appropriate Waveform Graph.
    The Analogue waveform will represent a continuously adjustable single pulse or multiple pulse train.
    The inputs to the VI will perform the following functions:
    1)      Set the number of pulses. Default 5 pulses.
    2)      Set the duration of the pulse. Default 0.5 (s).
    3)   Set the number of points per pulse. Default 500 points/pulse.
    4)   Set the pulse height. Default 5 (V)
    5)   Set the Offset (-5 to 5). Default 0 (V)
    6)   Set the lead in time as a percentage of the pulse width. Default 10%
    7)   Set the lag out time as a percentage of the pulse width. Default 20%
    8)   A check box that will invert the pulse.

  • How to use counters of PCI 6251 to count the number of pulses

    Hello,
    I have inputs from an optical encoder {pulse train} and i need to count the number of pulses for a short period of time to estimate the speed of the DC motor. Could you please tell me how to use the counters in PCI 6251 DAQ. I found something on DAQ STC, whichs says the input pulse should be connected to PF0 {ctr source}, but i have query where do i get the output {number of pulses counted in a particular period of time}.
    Looking for your reply.
    Thanks & Regards,
    bsnr

    Hi bsnr,
    Thanks for the post!
    In MAX (Measurement and Automation Explorer), if you find the device (DAQmx devices) and right-click, you can select pinouts - which should contain a table telling you which pins are what PFI lines.
    Then, in labVIEW, you need to generate some code to use the choosen coutner in a task to count digital edges. If your not sure on this, go to Help>>Find Examples>>Hardware I/O>>DAQmx>>Counters.. and take a look at some of the code provide.
    ps. It seems (maybe just your wording), but your expecting the counter output pin to provide the number of counted edges - this isn't the case.  
    Please let me know what you think?
    Kind Regards, 
    Kind Regards
    James Hillman
    Applications Engineer 2008 to 2009 National Instruments UK & Ireland
    Loughborough University UK - 2006 to 2011
    Remember Kudos those who help!

  • How do I send out a certain number of pulses

    I am using the E-Series DAQ board, and in my programing I have three stages, I need to send out a certain number of pulse depending on the stage selected. For example if stage one is selected 30 pulses will be sent out and thats it. The pulses will be used to move a stepper motor. The stepper motor is a linear stepper so the pulses will be used to move the shaft 1 inch or 3 inches, depending on the stage selected.

    It sounds like you want to generate a "Finite Pulse Train". Depending on which programming language you intend to implement this with (LabVIEW, LabWindows/CVI, Measurement Studio for Visual Basic or C++), we probably already have an example written. From our website at www.ni.com simply search for Finite Pulse Train. You will want to only use examples that have been written for the DAQ-STC chip, which our E-Series DAQ devices leverage.
    The finite pulse train examples will show you how to output a finite pulse, of say 30 pulses, as well as configure the frequency and duty cycle.
    Regards,
    Justin Britten
    Applications Engineer
    National Instruments

  • How to creat N number of pulses precisely with PCTIO-10

    I need to send out N number of 1us pulses precisely with PCTIO-10. This is what I try to do: I use ctr1 to create 1us pulses. The output of Ctr-1 is counted by Ctr2 and the output of Ctr-2 in turn gates Ctr1. I use NI-DAQ CTR_PULSE function. I load N number of counts and Ctr2 enables Ctr-1, when ctr2 reaches the preloaded counts it toggles the output (pulse width =0) and holds ctr1. This suppose to do it. But the result is bad. It only works if the counting time of CTR-2 is greater than 180us, yet the PCTIO-10 has a time resolution of 140ns.
    Any ideas on what is going on or alternative methods?

    The PC-TIO-10 uses source frequencys of 1 MHz, except for Source 5 and Source 10, which use 5 MHz. In order to generate 1us pulses, you may need to use the 5 MHz source. Unfortunetly, since the PC-TIO-10 is an older counter board, there are not very many examples for how to program it using NI-DAQ.
    Also, you should be able to get a finite pulse train by using only 2 counters. You should Call CTR_Config for both counters, then call CTR_Rate and CTR_Square for the counter to generate the pulse train. You may want to check the parameters returned by CTR_Rate to make sure that they will give you the correct frequency and duty cycle. You should then call CTR_Pulse for the counter that will gate the pulse generating counter.
    I would suggest starting the program by generatin
    g a continous pulse train, making sure that works, and then adding the second counter to only generate N pulses.
    I hope this helps. If you have further questions, you may want to refer to the PC-TIO-10 User Manual and look at the Specifications for the AM9513 chip.
    Also, the following Knowledgebase talks about the maximum frequency possible for the PC-TIO-10:
    http://digital.ni.com/public.nsf/3efedde4322fef19862567740067f3cc/48a4924ba92f431c8625686900773e96?OpenDocument

  • Use hardware to generate a certain number of pulses using PXI-5652

    Is it possible to generate a certain number of periods (turn on the output for a predetermined amount of time using hardware with micro-second resolution) using the PXI-5652.

    Hello Matt,
    If you had a Vector Signal Generator, this would be more controllable using something similar to this forum.
    Otherwise, the only way to control time on the 565x would be to use OOK modulation scheme. This will allow you to turn on the signal for a little time On and Off.
    There is a shipped example called "565x Digital Modulation.vi" (on versions 1.3 and later of the RFSG driver) that can perform this task. Basically it uses the function named "niRFSG Configure Digital Modulation User Defined Waveform.vi" to write the user bit sequence and with property nodes you will configure the OOK scheme and the symbol rate (refer to specifications of your card for the possible values).
    Hope this helps,
    Gerardo O.
    RF Systems Engineering
    National Instruments

  • Fixed number of pulse using agilent 33220A

    Hi all,
    I am trying to produce five pulses with Agilent 33220A function generator ..
    i am attaching my VI for your review...
    the problem is ,, i can able to send the command for digital pulse of required parameters ,, and the function generator starts producing constant pulses...
    but i want only five or fixed no of pulses ,,,
    i have tried using the loop concept and not succeded ,,
    Any suggestions would be grateful...
    by Rozita
    Attachments:
    Agilent33220A-pulse.PNG ‏51 KB

    You need to configure a burst in TRIG mode and send a software trigger to start it. Refer to the 33220A manual for more details.
    Ben64

  • Using 6602 to count number of pulses on the gate

    Hello
    I'm using 6602, NI-DAQ,WinXp,VC++
    I have an external pulse (about 30HZ 50% d.c) which I need to synchronize my process to.
    On every High level of the pulse I need to issue a thread that run for about 4ms.
    I think for 2 options to solve it:
    1. Receive an interrupt for every pulse and increase a global vaiable (counter) in memory. My applicaion will poll this varable and will issue the thread on every counter increament.
    I didn't find any way to receive this interrupt via the 6602!
    2. Increase one of the 6602 counters when the external pulse is connected to its gate/source. The problem is that I found that I can't poll (check the ND_COUNT) insoftware as long as the counter is armed.
    Can you please direct me how can I solve the problem in both cases?
    Many thanks
    Shali

    Hi Shali,
    Thanks for contacting National Instrument's support!  It sounds like you have an interesting application involving our 6602 card. 
    I would recommend going with your first solution.  You could simply perform a Count Digital events measurement and constantly monitor the output.  Then, you would use an event structure to monitor the variable where you're storing the count value.  If the value has changed, then you fire off your interrupt event.  If not, continue polling that variable. 
    I'm not sure if I understand what you're trying to do with the second solution, but hopefully the first solution will work for you.  If not, please let me know and I'd be glad to help you out further.
    Regards,
    Daniel L.
    Applications Engineer
    National Instruments

  • Define the number of single retriggerable pulses

    Hi everybody!
    I generate single retriggerable pulses using a PCI-6602 and BNC-2121 Box (sent to my spectrometer) for my data aquisition.
    For every trigger signal one spectra is aquired by our spec. It is very important to have a defined number of spectra, therefore I have to define the number of pulses in a retriggerable single pulse task.
    Unfortunatly it isn't possible to use a pulse train instead because the jitter of my source is to high so that each pulse has to be retriggered.
    Is there a way to do this?
    Thank you very much for your help!

    Hi Konradeo,
    it is a little bit difficult to understand, what du you want to accomplish. It would much more easier for me and the other forum user, if you could provide use your LabVIEW-Code and a sketch, what du you want to output with your PCI-6602.

  • How to continuously generate a pulse train with variable frequency

    Dear all,
    I am trying to use NI-USB 6259(BNC) to send Pulse signals to conduct position control of a servo motor with labview. The position control of servo motor follows these rules:
    The number of the pulse train determines how many degrees the motor rotate ;( e.g. the angular position of motor)
    The frequency of pulses determines how fast the motor rotate; (e.g. the speed of motor rotating)
    The digital determines the direction of rotation of motor (e.g. clockwise or counterclockwise)
    My question comes when I need to continuously generate a finite plus train signal in a period of time. Below is a sample:
    Time(s)
    Number of pulses
    Direction of rotation
    (1 is clockwise, 0 is counterclockwise)
    Frequency
    0-1
    923
    1
    923hz
    1-2
    3540
    0
    3540hz
    2-3
    1751
    1
    1751hz
    3-4
    2663
    0
    2663hz
    4-5
    353
    0
    353hz
    5-6
    1017
    1
    1017hz
    6-7
    3436
    1
    3436hz
    7-8
    302
    0
    302hz
    8-9
    1513
    1
    1513hz
    9-10
    570
    1
    570hz
    Here is the explanation of this table, the motor keeps rotating in clockwise direction during 0~1s. When the time reaches 1s, the motor just complete the rotation of 923 pulse signals. And then the motor starts to rotate in counterclockwise direction during 1s~2s. When the time reaches 2s, the motor just complete the rotation of 3540 pulse signals. So we can see that the rotating speed of motor in 0~1s is different from the speed in 1s~2s. Namely, the frequency of pulse signal in 0~1s is different from the frequency in 1s~2s.
    I have already use the counter output of DAQmx, it just can generate pulse signal with certain numbers and certain frequency in one time. The attachment is the vi which can generate a finite digital pulse train from a counter output channel and the frequency, duty cycle, Initial delay, and Idle state are all configurable.
    How can I continuously generate  a series of pulse train with varying numbers and frequencies during a certain period of time.
    Thank you very much for your help!
    Solved!
    Go to Solution.
    Attachments:
    Counter - Finite Output.vi ‏57 KB
    Finite output.png ‏13 KB

    Hi aacuna,
    Thank you for your reply!
    I already checked that  article.  The frequency in that Vi can change dynamically, but the method of adjusting the frequency is ‘manual’ .Below is the front panel of that Vi. When the Vi is running we can change the frequency by press the button.   
    Time(s)
    Frequency
    0-1
    923hz
    1-2
    3540hz
    2-3
    1751hz
    3-4
    2663hz
    4-5
    353hz
    5-6
    1017hz
    6-7
    3436hz
    7-8
    302hz
    8-9
    1513hz
    9-10
    570hz
    Thank you!

  • How to change the frequency of pulse train on the fly using an array of values?

    Hi all!
    First I want to thank U for the great job you are doing for this forum.
    Iam still busy trying to control a stepper motor, by sending pulses from my E-series 6024 to a compumotor s6- stepper Driver. I've managed to get it working. I desperately need to control the motor using the values from an array. I believe we can use two approaches for that:
    1st - I can get an array of the "numbers of pulses". Each element must run for 10 milliseconds. Using that we can calculate the array of frequencies to send the number of pulses within 10 milliseconds for each specific element. Could we use the arrays of "number of pulses" and frequencies in a "finite pulse train " and up
    date with each element every 10 millisecond?
    2nd - Or Could we use of the frequency array in a "continuous pulse train vi" and update it every 10 milliseconds?
    Please note that I must use the values as they are.
    Can someone please built a good example for me? Your help will be appreciated.
    Regards
    Chris
    Attachments:
    number_of_steps.txt ‏17 KB
    frequency.txt ‏15 KB

    Tiano,
    I will try to better explain the paragraph on LabVIEW. The original paragraph reads ...
    "While in a loop for continuous pulse train generation, make two calls to Counter Set Attribute.vi to set the values for "pulse spec 1" (constant 14) and "pulse spec 2" (constant 15). Following these calls you would make a call to Counter Control.vi with the control code set to "switch cycle" (constant 7). The attached LabVIEW programs demonstrate this flow."
    You can make two calls to Counter Set Attribute or you can make a call to Set Pulse Specs which, if you open this VI, you will see that it is just making two calls to Counter Set Attribute. What you are doing with the Counter Set Attribute VIs is setting two registers called "pulse s
    pec 1" and "pulse spec 2". These two registers are used to configure the frequency and duty cycle of your output frequency.
    The example program which is attached to this Knowledge Base demonstrates how to change the frequency of a continuous generation on the fly. Why continuous? Because changing the frequency of a finite train would be easy. When the train completes it's finite generation you would just change the frequency and run a finite train again. You would not care about the time delay due to reconfiguration of the counter.
    If you would like to change the frequency of the pulse train using a knob, this functionality will have to be added in the while loop. The while loop will be continuously checking for the new value of the knob and using the knob value to set the pulse specs.
    LabVIEW is a language, and as with learning all new languages (spoken or programatic) there is a lot of learning to be accomplished. The great thing is that LabVIEW is much easier than mo
    st languages and the learning curve should be much smaller. Don't fret, you'll be an expert before you know it. Especially since you're tackling a challenging first project.
    Regards,
    Justin Britten

  • HOW TO GENERATE FINITE AND CONTINUOUS PULSE TRAIN WITH USB6216 AT THE SAME TIME?

    Hello.
    I am using a USB6216 DAQ and need to generate a 20 kHz signal using the
    ct0 output and at the same time I need to generate a finite number of
    pulses, say 9, on a software trigger using the second counter output
    ct1.
    Currently, I have two VIs that can do this separately, but when I want
    to integrate these into one single VI y get an error in the finite
    pulse train for ct1 that indicates that the requested task is already
    reserved. I am thinking this has to do with the fact that maybe both
    types of task use the same timebase but I have not found the way to
    solve this problem.
    Any help would be very much appreciated.
    Thank you.
    Sincerely
    JSL

    Hello.
    If anybody is interested, the problem is solved.
    There is no resource confilct if I generate the 20 kHz continuous pulse
    signal using the frequency out terminal, and this way I can use both of
    my counters as I please with no problems.
    It's kind of fun to answer one's own questions...
    Sincerely
    JSL

Maybe you are looking for