Triggering each pulse!

I am using a general purpose counter to generate continuous digital pulses at counter's output.
Is there any way that I can trigger each pulse by software or a digital signal or anything?
I am usnig NI 6229 with NI-DAQmx and Borland C++ Builder.
Thank You!

sspeed,
I saw your other post:
http://forums.ni.com/ni/board/message?board.id=40&message.id=2724
and answered your "task done" quesions there. I just wanted to let you
know that this method will also work with actual retriggering (as suggested by Lorne). Please
note that calling DAQmxGetCOPulseDone
will always reset this property to false. Additionally, if a trigger is
received while a pulse it being generated, it will be ignored - you may
not even need to poll in software.
Regards,
Message Edited by Ryan V on 09-29-2005 07:36 AM
Ryan Verret
Product Marketing Engineer
Signal Generators
National Instruments

Similar Messages

  • Trying to trigger multiple analog measurements with each pulse of a 500PPR encoder

    I am trying to take multiple analog measurements form 6 sensors with each pulse of a 500 ppr encoder and write these to a file.  Problem I have run into is I am not getting 500 readings with 1 revolution of the encoder the most I have received is 187 however this isnt consistant.
    using
    6024 E Series card
    BEI L25G encoder
    Still relatively new to labview along with using an older version 7.0
    Thank You in advance
    Solved!
    Go to Solution.
    Attachments:
    Rotary.vi ‏213 KB

    Never mind after looking at it somemore i found i was using the wrong sample rate

  • Frequency each pulse on sound card

    " I am trying enters a square sign (of encoder), the sound card filters the waves of high frequency and therefore he lacks labview information to show the perfect sign. But I believe that it is not necessary, that the sign is perfect to calculate the frequency of each pulse. Is it this way?. I alone want to know the frequency of each pulse. I don't care amplitude.
    I have tried to calculate the frequency of each pulse. I have recorded the sign and once saved. I have tried to calculate counting the pulses, with the option ' indices', subtracting at the 2º -1º, 3º-2º,... .
    but this is not accurate because the sample rate is to 44100 hz and I use signs from 50 hz to 10khz. To high frequency it counts very few points, to 10 khz it co
    unts 4 and this is not accurate.
    Is there some form of calculating it more accurate?. What vi's can I use?.
    Thank you!."

    Well, if I understand what you're saying. You are trying to read the frequency of a squarewave coming from an encoder. The problem with doing this with a DAQ card is (to put it simply) the required Nyquist samplng rate. Think for a moment, what is the frequency content of a squarewave? The fundamental (which is what you want) and a theoretically infinite number of harmonics. To adequately sample a squarewave and correctly represent the vertical edges would require an infinitely high sample rate.
    If what you need is to measure the squarewave repetition rate, doing it with a DAQ card (or sound card) is the wrong way to do it. What you need is to do a pulse width measurement using a counter.
    Mike...
    Certified Professional Instructor
    Certified LabVIEW Architect
    LabVIEW Champion
    "... after all, He's not a tame lion..."
    Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps

  • Acquire single analog point on each pulse

    Hi,
    I have a query on what i hope is a simple application. Im using a PCI-6220 card and what I would like to do is aquire a single data point which is to be triggered by a digital pulse. The pulse will come from an encoder, and what I would like to do is aquire a single analog data point each time the encoder channel pulse goes high (retriggerable daq?)
    Which would be the best way to approach this?
    Thanks,
    David

    David,
    this is easily done by importing your encoder-signal as external clock for your AI (which is either finite or continuous then!)
    hope this helps,
    Norbert
    [EDIT]: This will work out directly if the encoder creates CMOS/TTL pulses. If it doesn't, you should consider some kind of signalconditioning for your encodersignal
    Message Edited by Norbert B on 11-19-2007 03:41 AM
    CEO: What exactly is stopping us from doing this?
    Expert: Geometry
    Marketing Manager: Just ignore it.

  • Is there a way to detect each pulse of a signal

    Hi All,
    I need to detect every pulse of my input signal pulse, is there a way to do that, I tried using basic level triggering but the trigger doesnot switch true and false between pulses.
    I need to detect the input pulse for some ms  and then generate an output pulse at the falling edge of the input pulse.
    can someone tell me way to do that, i do have a daq board usb 6361, but couldnt find a proper way to do something like this.
    my input signal frequency varies between 100-450 hz with amp -0.1v and pulse width of 5 microsecond

    I think we can do this with some extra circuitry.  First of all, we need to gain up that input puse to be a +5V.  You will need an inverting amplifier with a gain of 50.  Now you have a TTL level signal that you can feed into a PFI line to use as a trigger.  You can use an analog output to output a waveform (your 2V pulse) when that trigger line goes high.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • Triggered single pulse width measurement

    I am trying to measure the width of a single pulse, but would like to use the pulse itself as the trigger for a counter input pulse width read using a PXI-6608.  I would like to do this since the pulse can come at any time (much longer than any practical timeout)  and I would like to avoid having to place a DAQmx read in a while loop waiting for the pulse to appear.  Also, while the pulse is high, I would like to produce front panel feedback (light a boolean indicator).  I seem to be able to achieve that by using a digital input line, but again requires a DAQmx read in a while loop.  I haven't had much experience with triggers and my attempts so far appear to seem like triggers are not compatible with counter input pulse width measurement.  Is it possible to set up a trigger for a pulse width measurement?

    Hello kayotik,
    I think the best thing to do here is to use separate while loops. You can put most of your code in a main while loop, and then put your DAQmx read in a separate while loop. Both loops can run in parallel (just don't wire any outputs of one while loop to the other while loop, because then one will become dependant on the other). In order to pass data between the two loops, you will need to use a local variable. The DAQmx read can write to a local variable, and the main loop can read from that local variable. 
    You will also need to stop both loops with a single stop button. This article shows how (and also demonstrates the use of local variables to pass data between independent while loops):
    http://digital.ni.com/public.nsf/allkb/267704CDE91156D186256F6D00711AAE
    Colden

  • Software triggered single Pulse Generation

    Hi,
    I have an AT-MIO-16E10 board and I am trying to generate multiple but
    finite digital pulses without having to reset, configure and rearm the
    counter for every pulse. This takes too much time for my application. I
    would like to configure just once the counter and gate it by any
    software method. I am using LabWindows/CVI.
    Does anybody know if it is possible to rearm the counter without having
    to reset and configure it previously?.
    Does anybody know how to generate a software trigger?
    Thanks
    Manolo

    Hi Manuel,
    Configure your counter for retriggerable pulse generation, and connect
    one of the digital lines to the counter gate. Toggle the digital line each
    time you want to generate a pulse. See GPCTR_Set_Application(),
    application = ND_REGRIG_PULSE_GNR in the NI-DAQ Function Reference
    Manual for details. Please feel free to email me if you need more help.
    Regards,
    Reed.
    Reed Blake
    Beta Technology
    Industrial and Scientific Computing
    Manuel Prieto Mateo wrote in message <[email protected]>...
    >Hi,
    >I have an AT-MIO-16E10 board and I am trying to generate multiple but
    >finite digital pulses without having to reset, configure and rearm the
    >counter for every pulse. This takes too much time for
    my application. I
    >would like to configure just once the counter and gate it by any
    >software method. I am using LabWindows/CVI.
    >Does anybody know if it is possible to rearm the counter without having
    >to reset and configure it previously?.
    >Does anybody know how to generate a software trigger?
    >
    >Thanks
    >
    >Manolo
    >

  • How to measure signal duration and statistics for each pulse

    The attached vi has data for the maximum value of six different cutting tools while machining a part for 48000+ consecutive cycles. How would I measure the length of time each tool was used before being changed??(when profile makes a large negative transition.) Since the first three tools are related to the same holes in the part, I would also like to be able to get statistics(average) for each individual peak to see how the life of one tool affects the other tools. I am not sure if I need to do some more averaging or a differentiation to detect slope change points?? The peak detection vi's did not work real well since the peaks are not a constant value each time. This is a version 7 file.
    Attachments:
    display_tooling_data_max_values.vi ‏1643 KB

    Judging by your graphs, what you need is a differential operation:
    Break the wire going from the MEAN output to the graph.
    Insert a TIME DOMAIN MATH block (from the ARITHMETIC AND COMPARISON palette)
    Make sure it's set for DIFFERENTIAL.
    Wire the output to your graph.
    See all those negative spikes? That's the transitions in your data. Put a threshold on those, and you'll determine where the changes are.
    Steve Bird
    Culverson Software - Elegant software that is a pleasure to use.
    Culverson.com
    Blog for (mostly LabVIEW) programmers: Tips And Tricks

  • Generate complement​ary digital signals with dead time between each pulse and controlled by duty ratio

    I am to generate  two complementary digital signals using NI 9606 conected by RIO Mezannine Card to NI 9683 (Half Bridge DO).
    I am able to generate the signals but I am not able to put dead time between high and low signal and also, low and high signal.
    Requirement:
    (1) When the first signal goes high and the second signal goes low, there should be a controllable dead time.
    (2) Also when the second signal goes high and the first signal goes low, there should be a controllable dead time.
    I am able to do requirement 1, but I am unable to fulfill requirement 2.
    Please have a look at my VI and let me know how to go about satisfying requirement 2.
    Attachments:
    complementary test 2.vi ‏69 KB

    Hi Frank ,
    I have already taken note of the example Tannerite has provided  and have built my vi ( attached in previous post) surrounding that example.
    Now I require to control the PWM duty cycle as you can see from the vi using a knob and that control refers to both the signal 1 and 2.
    Now the signal 1 end and signal 2 generation requires a controllable dead time. Similarly, signal 2 end and signal 1 geneeration also requires another controllable dead time.
    I am able to do either one dead time at a time using delay but not two dead time simultaneously.
    I feel that I have two put the delays at the appropriate data flow point. I am working on that.
    I would really appreciate if you could give some insight on how to solve this dead time issue and generate two complementary waveform with dead times whose duty cycle can be controlled by a knob controller in fronty panel .
    I have also posted the required timing diagram for reference as suggested by Tannerite.
    Best regards.

  • DAQ triggering after X pulses

    I'm working on optogenetic stimulation and silencing of dopaminergic pathways in rat brains.  Currently I have a labview program that once triggered, sends a pulse train that controls a laser.  However, instead of the user triggering the pulse train, we are now letting the rats press a level to trigger it.  The problem arises in that I need to the program to now trigger only after X pulses instead of on every pulse.  To make matters more complicated, X is a function not just a variable:
    X=5*e^((LaserCount+1)*.2)-5
    where LaserCount is the amount of times the program has been triggered and sent the pulse train.  I been unable to find away to even set it to trigger after a constant number of pulses. Any help in this matter is appreciated.
     - Adonis

    Hi Adonis,
      I came across a Dev Zone article that contains an example VI to do something similar to what you're trying to do.  In this VI, a counter is used to generate a start trigger after a number of pulses have been detected.  It also contains a stop trigger set up the same way. 
    Using the DAQmx Export Signal Property node with CtrOutEvent.Output Behavior property, you can select "toggle" to change output states (in the example, they are using a pulse) once a certain number of pulses has been detected on the input counter channel. 
    You could use some of the math/ numeric functions to set up your equation and use the output of that to set your 'number of ticks before' control as seen in the example.
    Hope this helps get you going in the right direction. 
    DevZone Example:
    http://decibel.ni.com/content/docs/DOC-7372
    Regards,
    Austin S.
    National Instruments
    Academic Field Engineer

  • Generating a pulse sequence in NI5401 board

    Sirs,
    I?m sending this email massage because I have a doubt concerning NI 5401 Function Generator Board.
    I?m working with a PXI system together with a NI5401 board, and I want to generate a pulse sequence with this board.
    The propose of this is to synchronize my pulses with the acquisition of data by another board (PXI board from Goeppel ? Boundary Scan board which has 4 I/0 ports of 8 bits)
    I want for each pulse generated to acquire and transfer data in that board, thus I need to know how can I send a predetermined sequence of pulses, (N pulses and then stop). (attached I send a figure to illustrate my question)
    Please, I tried to understand the triggers but....
    If the triggers is the solution for my probl
    em please send me an example.
    Note: Now I'm generating a sequence of pulses using a simple pin I/O of the Goeppel Board but the problem is if I run many Labview applications sometimes the software is not fast enough to generate that pulses. Then I think if I use a hardware solution, like in the 5401 board,I could get faster a better responses for my pulses. Note that I'll need to now, in each instant, how is the level of each pulse.
    Note2:I'm using LabView6i software.
    Thanks very much.
    Attachments:
    PULSE.jpg ‏25 KB

    Hi
    The NI 5401 is a Function Generator; this is significant in that it is made to make periodic waveforms such as Sine, Square, and even a user defined periodic waveform that a user can download (the 16K buffer). The board can be triggered to start generation, and with a software call, abort generation. But there is no hardware that can specify how many cycles of a waveform has been generated to control the number of cycles at the output.
    Depending on the rate of the pulses you need, it may be possible to do something. A pulse train is essentially a square wave with a certain duty cycle. Set up the device for a certain frequency that matches the rate of your pulses, and program it to start with a Software trigger. The best output to use is the Sync output which w
    ill give you a TTL pulse.
    After the software trigger is called in your code, use the Wait VI to wait a certain amount of time that corresponds to the number of cycles/pulses for the signal that you need, and then after the wait, immediately call NI-FGEN Abort to stop the output generation.
    If you are unable to control the number of pulses through software, the NI 5401 really isn't made for this operation. The NI 5411 Arbitrary Waveform Generator is the device made to do this, create the pulse waveform you need, select how many times you want it to "loop", and then generate a waveform of zero volts. The NI 5411 has the hardware to count number of loops, and trigger, etc.
    I hope this helps.
    Jerry

  • 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)

  • Retriggerable gated counter or analog pulse trains

    Hi all,
    I have a problem I could not resolve in the last days. It might be even a question of creativity of how to come up with a solution.
    I have an external pulse train 1 at ca. 8 kHz (frequency not fully stable). With this pulse train, I want to trigger with each pulse an analog waveform. Using X-series boards, this works perfectly.
    But now I want to gate this analog signal with another pulse train 2 that is much slower than the other one (pausetrig option). Theoretically, this works nicely, too. But in reality, the analog signal simply ends at the point where it is stopped by the pause trigger, whereas I want it to stop at the end point of the waveform.
    Please have a look at the drawing attached
    I would be really glad about any ideas on how to solve this problem.
    Best regards,
    Peter

    I don't think I've ever defined both a start trigger and a pause trigger defined for the same task.  Good to know it's allowed.
    Given what you've already found, the solution is to control the timing of the end of the pause trigger pulse's active state (shown here as high). 
    Here's one approach:
    1. Create the pause trigger pulse with a retriggerable single pulse task.  Use a minimal "low time" and "initial delay".  Set the high (active) time to be approximately (N+1) periods of your AO sample clock.  Technically, N+1 periods is a bit more than necessary, but it's sure to be enough and doesn't require research into deep details of AO timing.
    2. Configure the AO task to use the pulse as *both* its start trigger (rising edge) and its pause trigger (pause when low).
    Comments: this makes for a different timing diagram than you've drawn.  Each external 8 kHz pulse causes a minimally-delayed pause trigger pulse which lasts long enough to generate the full AO waveform but ends before the next 8 kHz pulse.  The choice of when to start and stop this trigger pulse will be up to your own logic and will be governed by software timing. 
       Oh dang!  That still leaves you susceptible to a partial waveform since you can't sync the software timing to occur during the desired small fraction of the 8 kHz interval with no AO waveform.
    Second approach:
    1. Similar to #1 above, but set the high (active) time to cover multiple 8 kHz periods and *don't* make the task retriggerable.  To get the timing right in hardware, you'll need to generate a pulse that's *approximately* the requested length, but you'll reserve the right to tweak it so the edges fall in the right place.   You'll also define your pulse in terms of the external 8 kHz signal rather than in terms of internal board time.
         Specifically, configure to generate a pulse based on units of "Ticks" using the rising edges of the external 8 kHz signal as the "source of ticks."  Set a minimal value (probably 2) for both the "low ticks" and "initial delay" inputs.  The "high ticks" setting is where you do your tweaking.
        Suppose the desired pause trigger time is 10.3 msec.  Nominally, that's 82.4 intervals of the 8 kHz external signal.  Well, just round up or down as you see fit and wire this integer # into the "high ticks" input. 
    2. AO task is configured to retrigger off the external 8 kHz signal and be pause triggered by #1's counter pulse.
    Comments: When you start the pause trigger pulse task, it will remain in its low idle state for the first two 8 kHz pulses.  It will go high on the 3rd pulse and then revert low on the 82nd subsequent pulse.
       Because this pulse *also* acts as a pause trigger for the AO task, you're now synced such that the AO task is paused exactly as it is being retriggered, meaning that the previous waveform must have been allowed to complete.  (The deep details of timing will prevent the AO task from generating 1 sample at this instant.)
    -Kevin P

  • 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

  • Continuous, triggered, high-speed motion capture

    Hello,
    I'm attempting to perform a continuous triggered high speed motion capture independent of the motion, and it's not clear that this is possible. Before I spend a few hours on a wild goose chase, I thought I'd ask around.
    I have a digital pulse train coming in at about 100 Hz and I'd like to measure the position of my motion system in all 3 axes at each pulse. Having acquired the data, it should then get dumped to a file. This should happend continuously until the user exits the program. The continuous part of this seems unnecessarily complicated, involving on-board programming, if my reading of examples such as onboard-hsi-gpbuffer.vi and continuous_hsc.vi is correct. However, if that's the worst of it, I'll survive.
    Meanwhile, the system is undergoing random motion, including starting and stopping of the axes. This is the part that has me particularly concerned. All of the examples that I have seen, both bundled and otherwise, seem to include a single move as part of the program. Since my system will be undergoing multiple moves controlled by the user, I'm concerned that these moves (or the end of the moves) will cancel the capture operations.
    Does anyone have any insight into this sort of setup?
    Thanks,
    Jason

    This seems to do the trick. It's based on the "Onboard Program - Continuous High Speed Capture into General Purpose Buffer" which can be found in the online examples. It implements an on-board program which fills a general purpose buffer. Most importantly, it runs continuously and independent of the motion or stops of the various axes. Hope someone else finds it useful.
    Still curious if this is really the easiest way to accomplish this.
    Jason
    Attachments:
    ContHSCapture.llb ‏160 KB

Maybe you are looking for

  • BI Publisher and TomCat JDBC error

    Hey Folks, I have BI Pulbisher up and running in a cluster mode on a Solaris box with a shared folder such as (/u01/app/BI_Publisher/xmlp) as the file path in WEB-INF\xmlp-server-congfig.xml. All my reports and XMLP configuration folders are stored i

  • HP LaserJet 1020 Printer - booklet printing (Operating System Windows XP)

    We were using above option earlier in HP Laserjet 1020 Printer. Presently, the printer is not responding to this option. We tried to reinstall several times using the driver software supplied with the printer but this particular option did not work.

  • How do I get Itunes U on my MacBook Pro?

    I have Itunes u on my phone and Ipad but the lectures take forever to load.  How can I get it on my MacBookPro?

  • Change apple id in ios 5

    I just updated my Iphone 3GS with IOS 5 and need to change my apple ID from the one I initially loaded.  I can not find a setting anywhere to change the apple id on the phone.  I was going to restore the phone to original settings but was hoping for

  • Windows and Mini?

    Is it possible to connect a Mac Mini into a PC monitor and keyboard, cuz thats all I have