Generating a ramped pulse train

I have a PXI-6608 counter/timer card that I am using to control a motor via a pulse train. I need to create ramped pulse trains for acceleration and was wondering if there is an easy way to do that in LabView. I have been buiding them a few pulses at a time just changing the frequency and it seems very crude. I was hoping someone has a better idea.
Thanks.
Kasey

By "ramped" I assume you mean to sweep the frequency without stopping and restarting the counter. The following link should help you set up your operation to do this. There is an example program at the bottom of the page.
http://sine.ni.com/apps/we/niepd_web_display.DISPLAY_EPD4?p_guid=B9DF85FD9CD023DEE034080020E74861&p_node=DZ52328&p_submitted=N&p_rank=&p_answer=&p_source=External
David Staab, CLA
Staff Systems Engineer
National Instruments

Similar Messages

  • How to generate sequence of pulse trains with DAQmx?

    I need to generate a sequence of pulse trains with DAQmx (the card I have is a PXI-6229 card). As an example:
    - 10'000 pulses at 20kHz every 5 seconds with an initial offset of 2 seconds (let's say 10 pulse trains in total).
    If I use the CreateVirtualChannel.vi in "CO pulse ticks" mode, I can only specificy offset, high ticks and low ticks, but not that the sequence of pulses should be repeated after some time. 
    Now I thought that I could solve this problem if it were possible to multiply two counter outputs: the first counter would generate the pulses (continuously) whereas the second one would switch between low and high on a slower timescale in order to gate the first counter, thereby providing an initial offset and the "off" phases between the pulse trains.
    Is it somehow possible to multiply two outputs with DAQmx and the card I have? Or is there another solution to the problem?
    Thanks a lot in advance for any hints!

    Hi dlanger,
    what you want to do requires a little bit more work. 
    First look at the example "Gen Dig Pulse Train-Continuous.vi" from the LV example finder.
    This example generates a continuous* pulse train. As you see, you need a sample clock VI for setting the sample mode. 
    * NOTE: Generating a finite pulse train with a M-series card requires 2 counter.
    With a pause trigger (DAQmx trigger property node) you can gate the output of that counter.
    Now you have to generate a gate-signal with the the 2nd counter. That means, only if  Ctr1-out is high Ctr0-out outputs the 20 kHz-signal. 
    Maybe you have to adjust the times in my example a bit. 
    Unfortunately there is just one "small" problem: "let's say 10 pulse trains in total" 
    This is not possible, because a 3rd counter would be necessary (*). 
    As a workaround you can modify the while-loop that both tasks are cleared after 50s. This is not brilliant, but should work fine for you. 
    A more sophisticated way is to perform a correlated DIO. So you can generate custom pattern for multiple outputs. 
    A good example can you find here: 
    Retrigger and Repeat Finite Digital Pulse Train in LabVIEW
    http://decibel.ni.com/content/docs/DOC-8473 
    or here:  
    Generating More Than 2 Pulse Trains Using CompactDAQ
    http://decibel.ni.com/content/docs/DOC-2167 
    Hope this helps.
    With best wishes,
    Ralf N. 
    Attachments:
    Gen Gated Dig Pulse Train-Continuous.vi ‏38 KB

  • How to generate a bipolar pulse train in LabView using USB DAQ 6211?

    Hi,
    I am setting up a system to generate either a single square pulse or a train of square pulses using LabView, with controls to adjust the frequency, amplitude, number of pulses etc. I have had a lot of help from NI tech support setting up the actual VI itself which seems to be working fine, and outputting the pulses via a USB DAQ 6211 using a square waveform generator and the AO1 channel on the DAQ.
    The problem that I now have is that I need to pulses generated in a train to be bipolar (as they are connected to electrodes so need to be bipolar o avoid salt build up on the electrodes from the voltage going in one direction only, at least that is how I understand it!).
    How can I set up my LabView VI to generate a bipolar pulse train instead of always being positive voltage? I am new to this area and so am trying to learn but there is so much to learn!
    Thanks,
    spamjam

    Hi Shalini,
    Apologies for taking a while to get back to you, I hope I can explain what it is that we need to create with the pulses. I understand what you mean about the existing pulses having a positive and negative on the graph - but we need the pulses to start from a resting voltage and the first pulse to be positive, then back to zero, then the second pulse to be negative then back to zero etc. This is to do with reversing the direction of the current between two electrodes to prevent build up of salts on one electrod from the current always passing in the same direction. 
    I have attached a .Tif file to this post to try to illustrate what I mean - the top picture shows how the pulses are currently generated, then bottom on is what we would like to produce if this is possible?
    Thanks for your help,
    Spamjam
    Attachments:
    Slide1.jpg ‏38 KB

  • How do I generate two finite pulse trains using counters on PXI-6251

    I'm trying to use Counter 0 and Counter 1 on the PXI-6251 to generate two finite pulse trains.  But, I get this error:   "The specified resource is reserved. The operation could not be completed as specified."  See attached example.
    Inside the disabled box is what I'd like to run on both counters.  I stripped things down to creating the task, starting, and stopping.  I then started to add things to see what my problem was.  The timing VI seems to be what causes me issues but I don't know why. 
    My end objective is two identical pulse trains with one delayed by 5us, which I figured would be easy to do in the initial delay.  I tried both in a single task and as separate tasks with no avail.
    Attachments:
    2_counter_outputs.vi ‏32 KB

    Hi SirMutt,
    Creating a finite pulse train requires
    two counters. What’s really happening is that one counter is creating a
    continuous pulse train while the other counter applies a finite pulse to “window”
    the pulse.
    What you want to do is correlated DIO. I’ve
    done a search on our website for “correlated DIO” and have come up with a few
    resources. Hopefully that will help you get started.
    Digital Output and Pulse Generation
    Performing Correlated Digital IO with an M Series Device in LabVIEW
    M Series Hardware-Time DIO with Counter Clock Generation
    Mark E.
    Precision DC Product Support Engineer
    National Instruments
    Digital Multimeters (DMMs) and LCR Meters
    Programmable Power Supplies and Source Measure Units

  • How can I generate synchroniz​ed pulse trains with 6602?

    Hi,
    I would like to generate multiple pulse trains with different frequencies with the 6602 TIO card. Currently I am able to generate pulse trains with different frequencies. But is there any way to synchronize all the pulse trains? For example, I'd like to have all pulse trains with their first low-to-high at the same moment.
    Thanks!
    Dan

    Dan,
    Absolutely, the NI-TIO chip on the PCI-6602 supports a start trigger. If you configure all of the counters that are generating a pulse train to use this start trigger, they will be synchronized. The example Generate Pulse Train - Start Trig (NI-TIO).vi demonstrates this process for one counter. In LabVIEW 7, this example can be found in the following location:
    Examples >> Hardware Input and Output >> Traditional DAQ >> Counters >> NI-TIO
    You will need to add code for the other counters, but this example should give you the general idea. Furthermore, this example demonstrates how you can use one of the digital lines to generate the start trigger.
    Good luck with your application.
    Spencer S.

  • Can I generate pulse trains on more than one counter output at the same time?

    I have a PCI 6601 card with a BNC 2121 to connect the signals to two devices. The card is used as a trigger for both devices and I want to be able to generate pulse trains on two output channels at the same time, with a time delay between the two. How do I do that in Labview 7.1 Development with DAQmx?

    I feel foolish for not being able to figure this out, but it still doesn't work. Attached is the VI I use now. Counter 0 generates a finite pulse train and I programmed Counter 1 to generate a retriggerable single pulse triggered by CtrOinternaloutput. I still get the same error message: -50103 The specified resource is reserved. The operation could not be completed as specified.
    The same happens if I set the trigger for counter 1 at PFI36 (default output of counter 0) or any other PFI line. If I try a pulse train generation on only one of the counters, both work fine.
    If I try the example in traditional DAQ for multiple counter outputs with phase delay, it works fine.
    Can you tell me what I'm doing wrong?
    Attachments:
    Shutter_AND_lamp_trigger.vi ‏103 KB

  • How to generate a pulse train with different pulse width and delay?

    How to generate a triggered pulse train with different pulse width. for example, after each trigger signal, let's say 2 ms, then the counter output a pulse with pulsewidth of 1 ms, and then after 3 ms delay after the first pulse, the second pulse was generated with a pulse width of 4 ms.  Next cycle when the trigger signal comes, the same two pulses will be generated and so on. Is it possible to achieve this by using 6601 counter card? and if yes, how to achieve this? Thanks!

    Unfortunately you can not create a hardware timed pulse train with different widths on each pulse from a counter. Whilst it can be changed on the fly using software, since you require a hardware triggered signal getting the software involved will not give a huge amount of accuracy when the pulse will actually change.
    So in short you can't use your 6601 card (or a counter timer) to achieve this
    There are three possible Alternative solutions
    1 You could use a high speed digital IO device such as the (6533/34) to generate your variable signal which would require setting up the pulse train as a series of states based around the burst transmission mode where the clock would give you your specific timing.
    2 A timed analogy output (for example on a MIO card with a clock (PCI-6220 / 62xx), i.e. Not the 6704 style static analogy output cards)
    3 A high speed digital waveform card such as the (, 656x , 655x, 654x, 6534, 6533 (http://www.ni.com/modularinstruments/find_right.ht​m) ) this could then be scripted to work with your triggering and also there is a digital waveform editor which will enable you to set up the pattern you wish to generate (http://sine.ni.com/nips/cds/view/p/lang/en/nid/135​55) 
    Hope that helps
    Tim Matthews
    NI (UK)

  • On E series Card with 2 counters I want to generate a fixed length pulse train and want to continuously monitor it.

    On E series Card with 2 counters I want to generate a fixed length pulse train and want to continuously monitor it.

    Depending on the software you are using, there are many shipping examples and example programs on the web that illustrate generating a finite pulse train. The E series boards have the DAQ-STC counter/timer chip, and so make sure you search for DAQ-STC examples. I have included links to a LabVIEW example and Measurment Studio Example in Visual Basic.
    Generate finite pulse train in LabVIEW.
    http://eagle.ni.com/stage/we/niepd_web_display.DISPLAY_EPD4?p_guid=B45EACE3DA2156A4E034080020E74861&p_node=DZ52328&p_submitted=N&p_rank=&p_answer=&p_source=Internal
    Generate finite pulse train in Visual Basic with Measurement Studio
    http://eagle.ni.com/stage/we/niepd_web_display.DISPLAY_EPD4?p_guid=B45EACE3D96156A4E034080020E74861&p_node=DZ52328&p_submitted=N&p_rank=&p_answe
    r=&p_source=Internal

  • How to generate an (re-) synchronized pulse train

    Hello,
    using a PCI-6601
    I want to generate an endless pulse train of (e.g. 80Hz, high==low) synchronized to an external clock (ca.1Hz, ca 5ms pulse width).
    The output should _re_synchronize with the clock if there is a clock signal but if one clock-pulse is missing it should continue hoping for the next.
    It should look like this:
    Perfect:
    A1) tt________________tt________________tt_________...
    A2) ooo___ooo___ooo___ooo___ooo___ooo___ooo___ooo__...
        0__1__2__3__4__5__6__7__8__9__0__1__2__3__4__5_...
    Output is too fast:
    B1) tt_________________TT________________tt________...
    B2) ooo___ooo___ooo___oxxx___xxx___xxx___xxx___xxx_...
        0__1__2__3__4__5__6__7__8__9__0__1__2__3__4__5_...
    Output is too slow:
    C1) tt_______________PP________________tt__________...
    C2) ooo___ooo___ooo__xxx___xxx___xxx___xxx___xxx___...
        0__1__2__3__4__5__6__7__8__9__0__1__2__3__4__5_...
    Clock is missing:
    D1) tt________________._________________tt__________...
    D2) ooo___ooo___ooo___xxx___xxx___xxx___xxx____xxx__...
        0__1__2__3__4__5__6__7__8__9__0__1__2__3__4__5__...
    The external clock is assumed to be "the truth", so the pulse width for the 80Hz output is recomputed from time to time
    by measuring the clock and then setting then output pulse width.
    Until now I used register programming but this is not a must.
    The examples I've found either generate finite pulse trains or the sync only once.
    Is there a way to do what I want without software interaction?
    Thanks in advance
    Toni Schilling

    I have a possible idea for you, but my experience is with LabVIEW so I can't offer any help with register programming, interrupt callbacks, etc.  Also, the continuous syncing will have to be a software function that continuously performs cycles of measure/adjust, measure/adjust, measure/adjust...   I know of no way to set up the hardware to do this autonomously.
    The approach I would take is to add another counter task and a little extra wiring.  The other task will be for "Two Edge Separation", and you want to measure from the active (lead) edge of the master clock to the passive (trail) edge of your sync'ed pulse train.  There's a reason NOT to measure to the active (lead) edge of your pulse train and it's because counters can only measure finite times of at least 2 timebase cycles.  Whereas you would *like* to have an actual two-edge separation time of 0 between the lead edges.  That just seems like the kind of detail that's gonna burn you sooner or later.
    Let's just suppose the master clock is nominally about 1 Hz and your pulse train is nominally 100 Hz and 50% duty cycle so I can talk through details with some specifics.  Whenever the two lead edges are truly sync'ed, you'll measure a 0.005 sec two edge separation time from the master clock to your pulse train's trail edge.  If you measure slightly *less* than that, your pulse train is going just a little too fast and needs its freq slightly reduced.  If you measure slightly more, then your pulse train is too slow and needs its freq slightly increased.
    It is probably quite likely that you *cannot* expect to maintain perfect sync *without* constant monitoring and adjustment.  Fundamentally, you can only produce pulses with high and low times that are an integer multiple of the 6601's timebase of 20 MHz.  That card's oscillator won't be perfect, nor will it be utterly constant over temperature variations, etc.   So its idea of a perfect 100 Hz pulse train will in fact be very very close but not *actually* perfect.
    And your ability to adjust the frequency away from a nominal 100 Hz will only be possible in discrete steps.
    A 100 Hz pulse train takes 200000 cycles of the 20 MHz clock.  If you adjust your square wave to take 199998 or 200002 cycles, you can produce a nominal freq of 100.001 or 99.999 Hz.  Those are the smallest increments away from 100.00000000 that are possible with a 50% duty cycle. 
    Statistically, it's very unlikely that the frequency needed to perfectly match the external master clock is even *possible* to produce exactly.  I think you need to *expect* an imperfect sync with continual subtle adjustments to your pulse train.  If you watched the signals on a scope while triggering from the master clock, I think you should expect to see your pulse train oscillating back and forth by some small amount, perhaps in the microsecond realm.
    Summary (for 1 Hz master clock, 100 Hz user pulse train at 50% duty cycle):
    Measure two-edge separation from lead edge of master clock to trail edge of user pulse train.  Use units of "Ticks" with 20 MHz timebase.  Nominal expected value when sync'ed is (1/2)*(20 MHz / current user freq) = 100000.
    Subtract measured ticks from nominal to produce your "error signal". 
    Use current error signal its recent history in a control algorithm to determine the amount of adjustment to make to your pulse train.  Hint: it will probably NOT be correct to directly change the user pulse width by an amount equal to the error signal.  I suspect that you'll want to pay closest scrutiny to the derivative of the error signal.  Note also that the correct AMOUNT of adjustment will depend on the RATE at which you run your measurement / adjust loop.
    Change user pulse specs on-the-fly.
    Return to step 1.
    Caution: Let's suppose your software measurement / adjust loop runs at a nominal 10 Hz.  From the time you make an adjustment until the next time you do a measurement, your user pulse train will have generated almost 10 cycles with the recently-adjusted specs.  If you weren't careful to make your previous adjustment subtle enough, you'll find that you now have a *larger* error of the opposite sign, and you are well on your way to instability.
       You need to do an adjustment that lets you expect your *next* measurement to have an error close to 0.
    -Kevin P.

  • Generate PULSE TRAIN VI & Measure Frequency VI

    Can I RUN both Generate pulse train VI and Measure Frequency VI without either slowing down? Is Generate pulse train VI same as generate PWM VI? I have only attached the generate pulse train VI as I can only attached one file at a time.
    Attachments:
    Generate Pulse Train VI.vi ‏15 KB

    Hi labview1958,
    This depends on the kind of frequency you'd like to generate, and the range of frequency you'd like to measure. You didn't mention the kind of hardware and software (version) being used, so I'll assume you're using an E Series DAQ device and programming in LV 7.1. If you're generating a continuous pulse train, only one counter is required, hence there should be another counter available (for most DAQ devices). If you're generating a finite pulse train, two counters are required, and there'll be no counter available for frequency measurement. Also, frequency measurement can use one or two counters depending on the frequency range. You can find LV shipping examples (Help >> Find Examples) for both pulse train generation and frequency measurement. These make a good starting point for your development. In the case that you don't have a counter available for frequency measurement, you can also use the "Extract Single Tone Information" VI to measure the frequency in software.
    These tutorials will provide more details:
    Generating a Pulse Train with a Counter
    Making Accurate Frequency Measurements
    Hope this helps,
    Lesley Y.

  • Generating multiple Pulse Trains.

    I am trying to generate two different pulse trains. Once the first pulse train has begun I need to start the
    second pulse train approximately .69444 ms after the first has started. I am currently using the two counter channels on the NI ELVIS, but the second pulse doesn't always start after the first, but it does work sometimes. How can I fix this? Attached is my vi file.
    Thanks,
    David
    Note: Each pulse train has a 33% duty cycle.
    Attachments:
    SaO2.vi ‏91 KB

    Hello,
    Here is what I would try:
    1. Set up counter 0 to perform a continuous pulse train (see the LabVIEW example called Gen Dig Pulse Train-Continuous.vi)
    2. Set up counter 1 to perform a continuous pulse train with a digital start (see the LabVIEW example Gen Dig Pulse Train-Continuous-Dig Start.vi)
    A. Modify this example code so that the trigger source is your counter 0 output.
    B. Modify this example code so that the initial delay value of the pulse train is 0.7 milliseconds (or whatever delay you want). Create the delay with the input to the DAQmx Create Channel VI (the delay is currently set with a default of 0.00 seconds).
    What you are doing is triggering the second counter off of the rising edge of the first counter. So, counter 0 will start generating a pulse train. Counter 1 will not start until the rising edge of counter 0's first pulse has occurred. Once this trigger has occurred, Counter 1 will start (after the initial delay time of 0.7 ms has passed). You can cut and paste to put the code of the two examples together.
    Hope this works for you,
    Sam

  • NI 6711 pulse train generator

    What is the maximum frequency that I should be able to generate a continuous pulse train using the 6711? I am playing around with it, and I can get to 5Mhz. The specs say that it should be able to run up to 20Mhz.
    I am simply using the pulse train generator examples included in labview. Is there a better way to do this to reach closer to 20Mhz?
    Thanks again,
    -EVan

    Evan;
    You will never reach 20MHz through a pulse train generation. The maximum Time Base of the counter is 20MHz, that means, since you need, due to hardware features, two timebase pulses on the pulse train delay and two more on the pulse train width, the maximum frequency that can be generated by the counter, when operating as pulse train generation mode is 5MHz.
    Regards
    Filipe A.
    Applications Engineer
    National Instruments

  • How do I send a 2-10 MHz pulse train to my DAQ 6052E why simultaneously reading in data? I'm using the NIDAQ Tools with Igor Pro.

    I need to send a continuous 2-10MHz TTL timing signal to a low pass filter (to set the cutoff frequency) while I collect data from one of the analog inputs. I'm hoping that I can send the TTL signal and collect the data through the same DAQ 6052E board.
    I've been told that I can send a pulse train using one of the two counters on the board. But does anyone have more specific advice how to implement this using the NIDAQ Tools extensions to IGOR Pro? In particular I'm concerned about how I can send a continuous TTL signal and simultaneously read data. Or can you just turn on the timing signal and it stays on until it's
    turned off again?
    Thanks for your help

    You can program one of the counters to generate a continuous pulse train. Once programmed to do so the counter needs no further interaction. It will continue to generate the signal until stopped through SW. So you can start the counter using the functions provided to you, then forget about it and program the AI operations.
    Christian Loew, CLA
    Principal Systems Engineer, National Instruments
    Please tip your answer providers with kudos.
    Any attached Code is provided As Is. It has not been tested or validated as a product, for use in a deployed application or system,
    or for use in hazardous environments. You assume all risks for use of the Code and use of the Code is subject
    to the Sample Code License Terms which can be found at: http://ni.com/samplecodelicense

  • Need to unreserve a counter in a finite pulse train generation

    Hi. Let´s introduce my application first: I´m trying to generate a N-pulse train with the M series PCI-6221, in order to achieve a high frequency clock for an SSI transducer. That´s why i can´t use a software generation (because of the high frequency) and i have to use a finite pulse train. Besides, I would need to use another counter for a variable and finite count (but not simultaneously). The problem is that, as i think i have understood, this finite pulse train involves the two counters working together, so I can´t programm another task with that resources.
    My question is, Is there any way to do the finite pulse train generation, unreserve the counters, wait for a finite count to finish and so on?
    Thanks.

    Hello,
    My knowledges tell me that you need two counter to generate a finite pulse train.
    The first counter generates a pulsed of desired width and the second counter generates the pulse train which is gated by the pulse of the first counter (Counter 0=Pulse Generation, Counter 1=Pulse train generation).
    However, the finite pulse train generation and the continuous pulse train generation seem similar. The key difference is the generation mode from continuous to finite and the use fo a DAQmx Wait Until Done vi instead of a loop to monitor user input. From a point of view of the hardware there is a difference between the two. Continuous pulse train generation requires only 1 COUNTER.
    Maybe you can try with a continuous pulse train generation and with this method you have another counter to do a finite count.
    Regards
    DiegoM.

  • Question of pulse train generation

    Hi,
          I need to change the frequency of a continuous pulse train to control a stepper motor.
    All examples I found is to update the parameters of a counter in a while loop. How fast
    the frequency can be updated depends on the execution time of the loop. Most examples
    have a 10ms delay function in the loop. I want to update the frequency in 0.01ms interval,
    I wonder if is it possible to use this method. Is there a better way to do it?
          Thanks for help!
          Regards,
          Tao

    Tao,
    Unfortunately, you're not going to be able to update your frequency at a rate of 0.01 msec (100 kHz) for at least two reasons.
    1. If you're using Windows, the OS won't loop at a consistent rate.  The variations wil easily be in the order of milliseconds, possibly more.
    2. The counter hw won't allow you to change a frequency until a full pulse has been generated at the prior frequency.  You couldn't change the freq at 100 kHz unless the step rate was in the 100's of kHz.
    I've been waiting for NI to provide NI-DAQ support for buffered pulse generation for about 7 years now, largely for the kind of stepper control you're describing.  At this point, I've stopped holding my breath...
    Meanwhile, there may be some other options.  You could consider a dedicated motion control card.  Or you could use a card supporting timed DIO (such as the new M-series cards).  Finally, here's a link to an example I worked up that allows you to generate a finite pulse train with varying frequency.  It isn't everything you need, but it might be a nudge in a useful direction...
      http://forums.ni.com/ni/board/message?board.id=40&message.id=2411#M2411
    -Kevin P.

Maybe you are looking for