Frequency divider + narrow pulse output

Hello all,
I need to divide the frequency of an incoming digital pulse by a factor of N (typically 10-50) but I would like the output signal to be 200ns wide. I'm able to divide the incoming pulse by using CO pulse ticks with the incoming pulse as the tick source and specifying the low and high ticks (low + high ticks = N). The problem is that the narrowest pulse I can generate is 2/f_in (or in my case  2/75kHz~ 26 us).
Is there any other way to divide a pulse  and control the width of the  output pulse?
I can use the "wide" pulse to trigger a narrow  pulse on a different channel but I rather not use so many channels for this application. Is it possible to use just 1 input channel and 1 output channel?
Any advise will be greatly appreciated.
I'm using Labview 8 and pci 6251
Eyal

Hello Eyal,
Let me rephrase what it is I think you want to do:
1.  You have a digital input with a frequency at or approximately 75 kHz.
2.  You want to divide down this input frequency by N, where N is between 10 and 50 or so.
3.  On every Nth pulse you want to generate a pulse with a 200ns high time and then return to a low state until the next 200ns pulse is generated.
If this is what you want to do then you would need 1 CO task to generate a pulse ever Nth rising edge of your input.  Then you would use this pulse to trigger a retriggerable pulse train to output your 200ns pulse.  All of this routing can be done internally so you would only physically connect one input and one output, however this setup would require three counters.  One counter for the CO task and two counters for retriggerable pulse generation.  Unfortunately your PCI-6251 only has two counters so to do this you would need to get a board with at least 3 counters. 
If I didn't describe what you are trying to do accurately please reply back with further clarification incase what you are actually trying to do can be accomplished on your board.
If you would like to contact National Instruments directly to speak with a technical representative about getting a counter board you can find contact information at www.ni.com/contact.
Have a good weekend!
Brooks

Similar Messages

  • Frequency of a pulse output sensor

    Hi Guys,
    I have a sensor that puts out pulses depending on the amount of flow (it's a flow meter). I hooked up an oscilloscope and it looks like the frequency is always around 30 Hz. I have a break out box (SCC-68) that does not have a counter input, just analog and digital. Is it best to use the digital input or analog input to measure the frequency of the signal in Labview which in turn translates into some flow units? Thanks! 

     I have a break out box (SCC-68) that does not have a counter input, just analog and digital.
    If your DAQ unit has counter functions they will be available at screw terminals. Which device do use?
    Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
    (Sorry no Labview "brag list" so far)

  • Frequency divider/ pulse generation from 1 to n

    Hi,
    I have a sample pulse which in some cases needs to be divided. I tried to use the pulse train generation function, which works fine (giving me a pulse every n sample pulses), but only starting at 2 input pulses. I need to be able to use this function from a division of 1 and up.
    Put in another way, can a counter be configured in such a way that it outputs a pulse every rising edge of the source signal?
    I'm using a PXI 6602 counter card and am programming it through calls to NIDAQ32.DLL under Labview 7.

    Hi Walter,
    In short, no. You can't output a pulse on every input pulse. You can however configure the degree of division. Here are the rules for division:
    When set to pulse train generation, you will have a register for the low value of the pulse train and a register for the high value. What happens in typical pulse generation is that these registers are loaded with count values such as 2 and 2 for each register respectively. In default operation, the first register will count 2 pulses on the source and then toggle the output. The second register will then count to pulses and toggle the output again. The operation then cycles back to the first register. This toggling effectively creates a pulse train that is divided by 4 and a duty cycle of 50%.
    You can however change the output mode to pulse instead of toggling upon completion of counting on a register. In the above example, you would count 2 source edges and then pulse for the first register and the count 2 more edges and pulse again for the second register. You will of course repeat this in pulse train generation mode. This mode allows you to obtain greater resolution since you are now dividing by 2 but your duty cycle will be different. Each pulsed output will be equivalent in size to the source pulse width.
    Finally, the two registers can be populated with integer values of 2 or greater. Therefore, the smallest frequency division is 2.
    You will have to work with these three elements to obtain the pulse train of your desired frequency. Hope that helps. Have a good day.
    Ron
    Applications Engineering
    National Instruments

  • Frequency divide by N doesn't work on Counter-Ti​mer PCI-6602

    Hello everybody,
    I tried to do something basic ( ?) with this Counter-Timer 6602 Board, and it doesn’t work.
    So I hope some people with more experience than me could understand what happens here.
    1) What I need:
    I need to generate 4 synchonised clocks, whose periods will be multiple of 1 ms.
    2) What I have:
    LabVIEW 7.0 and a PCI-6602 Counter-Timer Board in a DELL PC running under XP pro.
    The PCI-6602 Counter-Timer Board has 8 counter timers named CTR 0, CTR 1, ... CTR7.
    3) What I have already done, and that worked:
    - Generate a 1 kHz “Master Clock” signal from CTR 4, configured by “Continuous Pulse Generator Config.vi” (found in “Data Acquisition, Counters...).
    - configure CTR 0 and CTR 1 to work as frequency dividers, by use of “Down Counter or Divider Config.vi”.
    - Apply the output signal of CTR 4 (OUT ) to the SOURCE inputs of CTR 0 and CTR 1 by means of physical wiring in the SCB-68 connection box.
    When I do this, I get two nice secondary clock signals on my oscilloscope screen, ( with periods = 3 ms, or 5 ms or whatever multiples of 1 ms I choose) from CTR 0 and CTR 1 outputs , very clean and perfectly in phase with the 1 kHz Master Clock.
    So far, so good...
    But I still need 2 more secondary clocks...
    One would say: “No problem, do the same trick with two other counters...” Well, not so simple, it seems...
    4) What I tried to do, and that didn’t work:
    When I try to do the same frequency division with any of the remaining counters, (CTR2 to CTR7), the program stops and I get an error “ –10020 : Time base not valid “.
    I can’t figure out what happens here: I thought any counter could be configured to work as a frequency divider, but it seems not to be so, and I am stuck here.
    Has anyone an idea about how to fix this type of problem?
    Attached file: hor_div02New.vi
    Attachments:
    hor_div02New.vi ‏123 KB

    karolik,
    I'm just adding a followup in English. As Marc L. mentioned, the particular vi named "Down Counter or Divider Config" isn't compatible with the 6602. While the 6602 does have the ability to generate 4 synchronized clocks, a different syntax is needed. Here's how I'd do it:
    Traditional NI-DAQ
    1. Configure a continuous pulsetrain on CTR 4. Route its output to, say, RTSI 4. Don't start it yet.
    2. Configure CTR 0,1,2,3 for continuous pulsetrains using RTSI 4 as their "timebase source." Start them.
    3. Start the CTR 4 pulsetrain.
    4. Now CTR's 0-3 should generate separate clocks with synchronized phasing.
    DAQmx
    1. Configure a continuous pulsetrain on CTR 4. Don't start it yet.
    2. Configure CTR 0,1,2,3 for continuous pulsetrains using "Ticks" for units. Use a DAQmx property node (probably Channel property node, but am not 100% sure and don't have a LV PC handy to check) to specify that the "ctr4 internal output" should be used as the timebase. Start them.
    3. Start the CTR 4 pulsetrain.
    4. Now CTR's 0-3 should generate separate clocks with synchronized phasing.
    -Kevin P.

  • Frequency divider by 2 and 3

    Hello,
    I'll start by saying that I am new to labview and it is possible that my question will be simple for most. As the topic I need to perform frequency divider by 2 and 3. 
    To digital input card will be given a signal of frequency 50Hz. I can use a USB card 6009 and 6221.
    I found
    a few examples of the frequency dividers on the NI forum and on the
    internet but do not quite know how I could use them in my case...
    For example, the divisor using JK flip-flop in attachments.
    If
    anyone would be able to explain to me how it should look like in my
    case, or give some examples on the basis of whose ideas I will be able
    to understand the operation of such a program would be great.
    Regards,
    Mat M.
    Attachments:
    freq div.vi ‏28 KB

    Kevin is absolutely correct that the signal resulting from the method I linked earlier would have an extremely low duty cycle.  You can use this method to "divide" by 2, 3, or any other positive integer (other than 1), but like Kevin mentioned the resulting signal is a pulse every N ticks, rather than a true division of the input clock.
    You can use Kevin's method to divide by 2 and give a 50% duty cycle using either AO or DO with an external sample clock.  However, the waveform to generate would be [1, 0, 1, 0 ...], giving 1 period of output signal for every 2 clock edges.  You can't use this method to give a 50% duty cycle and divide by 3, but you can get either a 33% or 67% duty cycle by generating [1, 0, 0, 1, 0, 0 ... ] or [1, 1, 0, 1, 1, 0 ... ] respectively.  Generating [1, 1, 1, 0, 0, 0 ... ] is actually a divide-by-6.  Any odd number divisor would not give you a 50% duty cycle. 
    There is a way to divide by an odd number and maintain a 50% duty cycle, but only if your input signal is also a 50% duty cycle square wave.  Unless you absolutely need to have a 50% duty cycle then it's probably more trouble than it's worth:
        1.  Configure a DI task with Change Detection Timing.  This can be used to generate a pulse (Change Detection Event) on every rising and falling edge of your external signal, effectively multiplying it by 2.
        2.  Use the Change Detection Event as the sample clock for your DO (or AO) task.  The task would output [1, 1, 1, 0, 0, 0 ... ] for a divide-by-3 of the original signal.
    Like Kevin mentioned, any divisor >4 is easy using the counters in their default "toggle" mode, but the duty cycle would not be 50% for odd divisors (similar to the DO/AO method).  If you only care about one edge of the clock and the duty cycle is not terribly important, the Pulse Mode example that I linked in my last post can be used for any divisor between 2 and 2^N-1 on an N-bit counter.
    Best Regards,
    John Passiak

  • Pci 6602: configuring a frequency-divider with daqmx using labview7.1

    i´m using labview 7.1 and the pci6602 counter-board. i want to configure a counter as an frequency-divider with varaibale division-rate, witch is a easy thing to do with the classic "old" daq-driver.
    it´s recommended to use the "new" daqmx-driver, and i want to do so, cause i´m using also other ni-devices and want to use the same driver for all of them, but i can´t find any possibility in the daqmx-vi´s to configure such a frequency-divider.
    i also couldn´t find any example-code for this problem.
    please help me!!

    hi, thanks for the answer, but unfortunatly it´s not what i ment.
    i need to configure a counter on the pci6602 wich divides down the frequency "f_in" of the square pulses connected to it´s "source" pin by "divisor" and puts out square pulses with frequency f_out=f_in/divisor at another pin. That process should take place only on the 6602-board without using the cpu.
    i´ve found the solution already, how to configure a counter on the pci6602 with daqmx like described above. see attachment.
    servus
    markus
    Attachments:
    Divider_Config_mw.vi ‏40 KB

  • How to measure the frequency of a pulse being generated by a counter

    Hi,
    I am using labview 8.6 to generate 5 evenly spaced pulses for every 1 revolution of my shaft. However, I would also want to know the frequency of these pulses so I can determine the shaft speed. Since I am already generating the pulses using one of my counters, can I still tap into that or task another counter to measure the pulse frequency? If so, how? I have attached my code for generating the pulses and I am using an Ni 9401 module and an NI 9172 chassis. If someone can helo me modify the code to measure and tell me the pulse frequency as well, that would be really appreciated
    Attachments:
    autotrain2.vi ‏19 KB

    You'd probably get a more coherent answer if you didn't bounce around from thread to thread so much...
    How can I generate a pulse train from shaft encoder? (5/13)
    pulse train from encoder (5/15)
    how to measure rpm (5/20)
    How to measure rpm using shaft encoder and labview (5/23)
    This thread (also 5/23)
    I see you ignored my suggestion from the other thread--Kevin's solution is good too but using an encoder task offers more noise immunity (I think this is probably the cause of the problem you reported on the other thread).  You can fix it with digital filtering if you want to keep using a counter output instead of an encoder task.  Noise during transitions is pretty common for a quadrature encoder.
    A finite counter output task uses 2 counters on the 9172 (although you said 9174 earlier at one point--this wouldn't be the case on a 9174) so you wouldn't have one left to make your frequency measurement.  With the solution you have now, you can change to continuous to free up a counter if you don't care about outputing an exact number of rotation's worth of pulses (I'm not sure if you do or not--I didn't read through all of the various threads relating to this application to find out).
    For your actual question in this thread...  Have you tried running one of the frequency measurement examples?  From the code here I can't tell what you have tried (it just looks like a mangled version of the code Kevin gave to you in your other thread).
    Best Regards,
    John Passiak

  • Minimum Frequency for counter Pulse Frequency Generation

    Hello,
    What is the Minimum Frequency that the Counter Output Pulse Frequency VI can generate?
    If I need to generate a REALLY low frequency pulse train can I do that?
    Thanks
    Dan

    Hi Dan,
    If you don't explicitly specify a timebase, DAQmx will choose a default depending on the initial parameters you set up for CO Pulse Frequency.  For example, the following code should work on any DAQ device with a 32-bit counter and a 100 kHz timebase available (from my first post, 11.64 uHz is the minimum frequency in this scenario).
    So... your 10-100 second periods should be more than achievable.  The inverse of 12uHz is about 23.15 hours.
    If you're on a 24-bit counter the maximum pulse width would only be ~167.77 seconds (2^24/100000), giving a frequency of about 2.98 mHz assuming 50% duty cycle.
    The only way you should be getting an error at the 10-100 second durations that you are describing is if you start the task off at a faster rate (so DAQmx will pick a faster timebase by default) then modify it to output a lower frequency.  Rollover times for the maximum default timebases are as follows:
        E Series:   ~0.839 seconds (24-bit counter, 20 MHz timebase)
        M Series:   ~53.69 seconds (32-bit counter, 80 MHz timebase)
        X Series:    ~42.95 seconds (32-bit counter, 100 MHz timebase)
    If you want to set a different signal source as a timebase, you can do it with a DAQmx Channel Property Node:
    I'm afraid I don't really understand what you are trying to do specifically.  How does this "infinite" pulse length fit within the context of your application?  Why not simply write the line high in software?  What hardware are you using?
    Best Regards,
    John Passiak

  • In NI-DAQmx, how to change the frequency of a pulse train?

    I was using "GPCTR_Change_Parameter()" to change the frequency of my pulse train in Traditional NI-DAQ and Labwindows/CVI; is there any function can do the same thing in NI-DAQmx without restarting the task?

    You can do this in one of two ways, depending on the version of NI-DAQ you are using. If you are using 7.2 or later, you can use the counter write functions (ex: DAQmxWriteCtrFreq()), which are available for each flavor of pulse generation tasks (Freq, Time, Ticks). If you are using NI-DAQ 7.0 or 7.1, you can modify the attributes directly (DAQmx_CO_Pulse_HighTime, DAQmx_CO_Pulse_LowTime, etc). Keep in mind that for each attribute pair, one of the attributes will cause the counter to load the new pair. The attribute that causes the load is LowTime, LowTicks, and Frequency.
    I hope this helps!
    gus....

  • Single pulse output on USB-6212 PFI

    I am trying to generate a single pulse output on one of the PFI I/O lines on a USB-6212.
    How do I go about creating the task?  The pulse witdh is 100ms.
    Also, how do I trigger from one I/O line to start another I/O pulse?

    Hello johnswan,
    The first thing you need to do is make sure that you have the NI-DAQmx driver installed.  This should've came with your device, but if not you can download it from ni.com/updates.  After the driver is installed it will add examples for LabWindows CVI.  In LabWindows CVI you can go to Help » Find Examples to open the NI Example Finder and then navigate to Hardware Input and Output » DAQmx » Generating Digital Pulses.  There is a DigPulse.prj which will show you how to create a digital pulse with a specific pulse width.  There is also a project called DigPulseTrain-Cont-DigStart.prj that you can look at to see how to implement a digital start trigger.  Take a look at these and let me know if you have any additional questions.
    Regards,

  • Measre pulse width of a very narrow pulse

    hi,
    I have one query.
    I have to measure pulse width of a very narrow pulse , may be it is 0.1 ms
    or less . I m using the VI , which I m sending u with an attachment
    here....I m having doubt that this VI is able to measure the required pulse
    with. Sometimes It is giving wrong values too. So Plz suggest some solution
    which may fulfill my requirement.
    I need the answer at the earliest. I'll be grateful to u.
    Regards.
    GNS
    Attachments:
    Measure_Pulse_duration.vi ‏103 KB

    Hi GNS,
    If you are using an E Series card or a 660x card, you should have no problem making a fairly accurate pulse width measurement. When performing pulse width measurements, your maximum error will be +/- 1 pulse of your timebase (assuming the crystal oscillator error is negligible). If you are using a 20MHz timebase, you will have a measurement resolution of 50ns. 2000 pulses would occur to measure a 0.1ms signal. Your maximum measurement error will be roughly 1/2000.
    If you are trying to measure a mechanical source, there could be "bouncing" which will affect your effective pulse width. This is a situation in which you have several small glitches that occur before and after your main pulse. This is typical with push buttons etc. Anyway, these gl
    itches could seriously alter your measurement.
    The best way to test your measurement system is to use 1 of your counters to generate a 0.1ms pulse and have the other counter measure it with it's maximum timebase. This will indicate your accuracy.
    Hope that helps. Have a good day.
    Ron

  • Counting 3 pulse outputs on the 9178

    Hello everyone,
    Please note that I am very new to Labview. My issue is related to measuring 3 independent pulse outputs.
    Currently I am using a 9178 chassis. Two pulse outputs are coming from Omega FTB800B Pulse meters (water flow) which should output 20 pulses/gallon of water flow. The third pulse output originates from a wattnode pulse meter.  I am attempting to create a very simple vi (to test all three outputs).
    The wattnode seems to be working perfectly and the pulse outputs seem reasonable (connected to a 9402 card).  
    The two flow meters, on the other hand, are giving me some trouble. I have attempted to run them through both the 9402 card and the two onboard pfi ports.  
    The wattnode works using the daq assistant and selecting edge count. Since the Omega flow meters are not supplying voltage or current (reed switch), I figured this was a good guide to count pulses internally https://decibel.ni.com/content/docs/DOC-9061. Unfortunately I have been unable to measure the pulse outputs using the aforementioned method. 
    I have one USB-6009 unit which does not seem to have a problem measuring flow from either meter (one at a time due to the internal counter limitation).
    Please see the attached vi examples
    Thanks 
    Attachments:
    WaterMeter.vi ‏23 KB
    Wattnode_VI.vi ‏52 KB
    USB-6009.vi ‏49 KB

    Thanks for the reply Nick-A!
    I believe the WaterMeter VI originated from the example finder section of Labview. There seem to be a few additional prorams which help display pulses counted by the edge counter; but, the counter portion of the code appears almost identitcal to the WaterMeter VI.
    I tried utilizing the usb 6009 vi format (DAQ assistant) through the 9402 card. For some reason, I do not even measure pulse readings while running the project in the DAQ assistant properties window. Both flow meters produce the same results when connected to the aforementioned card (I have connected the flow meters to each of the 4 BNC ports). Please correct me if I am wrong, but shouldn't pulse count appear through the DAQ assistant (even if there is no other coding)?
    Thanks,
    Daniel

  • How to modify the frequency of a pulse generator without stopping application

    I need to generate pulses on a counter output of a 6024 card. But I have to change the frequency while the programm is running between 1Hz to 800 Hz.
    If I do the initalization on each loop, the system becomes very slow and I can't reach 800Hz.
    Anyone can help me?

    Good news -- you can change the frequency on the fly with no skipped pulses. You'll find a couple examples posted here on ni.com by searching on "pulse width modulator". One's for traditional DAQ, the other's for DAQmx.
    Possible caution -- not too many NI-DAQ's ago, there was a limitation about changing pulse specs on-the-fly. I'm not sure whether it still applies to the latest traditional NI-DAQ or to DAQmx. Caveats aside, here's what that limit was (is?):
    -once you set new pulse specs on-the-fly, you must allow at least one new pulse to be generated before the next time you set new pulse specs.
    Your frequency range is low enough that you'll likely need to put extra delays in your code to keep it working smoothly.

  • DC pulse output analog input

    I am using a 6221 PCI DAQ card and attempting to put out a DC level for a several different times.  During the output of each DC level I need to sample two DC inputs via the analog input.  Most of my DC levels last for 100s of seconds each and a sample rate of 1S/s on the analog inputs is OK.
    My problem arises when I attempt to place a 30ms pulse into the analog output.  During this 30ms I need to increase the data rate of the analog input.
    I have attempted to use a while loop to control the time between changes but can not get the sampling rates correct to allow for the correct number of samples.
    On suggestion has been to take all data at a fast rate.  The test will last in excess of 3000 seconds and I get way too much data at a fast rate.
    I need to be able to change data rates on the fly as I change the DC levels.
    Does any one have any ideas?
    Thanks,

    John@Saft wrote:
    I know when the pulse is to arrive before it happens.  I have an array of data including voltage outputs, duration of output, and what data rate to sample at.
    My problem is insuring the sampling starts before the pulse arrives and continues for the duration of the pulse.
    One way I'm sure can work uses "Continuous Acquisition.  "See: "Cont Acq&Graph Voltage-Analog SW Trigger.vi" example.
    If the DAQ-rate is known before leading-edge of pulse, then, start the Acquisition at whatever frequency's needed, making the input buffer bigger than required, then when the end-of-pulse arrives, reach-into the input buffer and pull-out the "pulse".  With a little work you may find an example that uses a "stop-trigger"
    There may be a "slick" way to do this without "Continuous Acquisition" using a parameter called "Pre-trigger" scans.  My first LV project (circa- 1990) used this, and I've done it with at least one "E"-series board, but not yet under DAQ-MX - and couldn't find an example with Internal clock, External Trigger.
    Cheers! 
    "Inside every large program is a small program struggling to get out." (attributed to Tony Hoare)

  • Flexmotion6C pulse output

    I am trying to get variable length digital pulses out
    of the flexmotion6 board using the UMI-Flex6 terminal
    block. Yusuf C, suggested I configure the axis to run on open loop stepper mode and tap the Step(CW) and Dir(CCW) lines during a simple move. This should
    give a pulse train. And I can change the frequency by changing the velocity of the move.
    When trying to configure axis 5 as a stepper
    and running the 1-D interactive program under the
    MAX program to test the axis, I get the error message "Error 70017
    NIMC_StepperOnlyError Occurred in set stepper loop
    mode (flex_set_stepper_loop_mode) on Axis 05
    This command is valid only on a stepper axis"
    I have also considered using the flex_load_DAC
    command to load a value into the DA
    C directly.
    Is it possible to use this cammand with DAC 1
    through 6, provided they are not associated with
    an axis (ie. the axis is disabled or the DAC channel is
    not selected for a particular axis.
    Thanks for your help

    Ysusf's suggestion should work for you. The error which you are getting indicates that you are trying to change the stepper loop mode on an axis which is set up as a servo. To fix this change the axis configuration to stepper and then hit apply and initialize board.
    In order to use the DAC on a channel it must also be configured as a stepper. And then you can do the load DAC. I'm not sure how this is to be a substitute for outputing a pulse train but if does the trick then great!
    Regards,
    Amaury Rolin
    NI Applications Engineer

Maybe you are looking for

  • Can not launch lightroom says error when reading its preview cache

    I can not launch Lightroom is puts up a error message that says it encountered an error when reading its preview cache and goes in to a loop that keeps closing the program I have restarted my comp 4 times same this each time I can't find any trouble

  • Sound quality when burning an iMovie to disc

    I just got iLife 9 and made a video using iMovie. The picture and sound quality on my computer are excellent; but when I burned the movie to a disc using iDVD the pictures remained high quality but the sound was poor. Any idea what might have caused

  • IWeb and GoDaddy Hosting of Multiple Sites

    GoDaddy users: I have the solution. I have 8 sites all hosted from one host account. The key is you must have a separate FTP login for each website. In the past I would just use the root. Now, each site has its own. Examples: iWeb document name:memor

  • Oracle 11.2 in Solaris 10 non-global zone?

    When I try to install in a non-global zone in Solaris 10, the installer system check fails; I think this problem is well-known, but I can't find the guidance notes any more. The generic documentation isn't much help, I'm afraid. This is what I get fr

  • Reducing physical RAM consumption by oracle instance in my laptop

    I wanted to reduce the amount of RAM consumed by my Oracle Instance in my machine. OS: Windows Server 2003 DB version: 10GR2.So i tried to reduce the sga_max_size to 200mb then restarted the instance. But sga_max_size remains the same. What am i doin