Boolean pulse generation

Hello,
I am using the FFTSpectrum (Mag-Phase) VI to calculate the averaged FFT spectrum of a time domain signal from an instrument. This averaging has to be done for each value of a parameter that is being varied in a loop. So, I want to send a true pulse to the restart averaging pin of the VI just before I start the averaging but if I just feed in a constant true signal, the VI will keep resetting. How do I generate a conditional boolean pulse (as small in width as possible) ?
Thanks.

Reset averaging is uses if you wanted to average multiple sample.  Some VIs have memory that retain previous run information so initialize clears the previous sampled memory.   If you have just one data set then reset it each time it is called.  The pulse is not your solution.
Matthew Fitzsimons
Certified LabVIEW Architect
LabVIEW 6.1 ... 2013, LVOOP, GOOP, TestStand, DAQ, and Vison
Attachments:
resetAveraging.vi ‏10 KB

Similar Messages

  • Synchronous submillisecond pulse generation on 2 outputs

    I'm using a 6052E with LabView6.1. I need to simultaneously trigger two devices. The first is to send a trigger signal to another LabView program via Trig1 to tell it to begin collecting data. I can't modify that progam. The second is a TTL pulse to another device. This pulse needs to be between 100 and 500 usec. The two outputs need to be independent as sometimes the second device is activated when the first is not. I've been trying to produce two synchronized pulses using the counters, but can't figure it out. Thanks!

    Hello,
    Thank you for contacting National Instruments!
    What you are describing calls for an application called triggered pulse generation. What you can do is configure both counters to produce individual pulses when a trigger signal is received on each counters gate. You can connect the same trigger signal to gate of each counter.
    I have attached an example program that shows how to generate a triggered pulse from a single counter. You will need to do the same for the second counter. A good way to do this is to configure counter 0 then configure counter 1 ,then enter the while loop and arm counter 0 and then arm counter 1. Then when the trigger signal is received on the gates of the counters, they will both produce a pulse. If you do not want one c
    ounter to produce a pulse, you can simple not arm the counter in the while loop by using a case structure and a boolean control.
    Regards,
    Bill B
    Applications Engineer
    National Instruments
    Attachments:
    Generate_Single_Triggered_Pulse_(DAQ-STC).vi ‏104 KB

  • In Delayed Pulse Generation vi,Problem With THE PULSE WIDTH??

    In Delayed Pulse Generation vi, I want to input a very low number for the Pulse Width while using an external timebase source. But the minimum pulse width has to be 2. Does anyone know how can I solve this problem??

    Hey 45,
    Unfortunately, there is no way to generate a pulse width smaller than 2x your external timebase.
    There is an option to create a pulse of arbitrary width of your external source if you can afford some software processing in between. What you can do is use 1 counter to measure how many source edges of your card's internal timebase (80 MHz for TIO only, 20MHz or 100kHz for TIO and STC) your external signal is. This uses pulse width measurement as the counter application. Once you know how many source edges it takes to represent your pulse, then you can use triggered pulse generation and use the internal timebase with the pulse specs set to create the exact pulse width you want (and delay) and you can use your external pulse as the trigger. Th
    is works well if your pulse is always the same width and you can measure it before hand. As an example, let's say your pulse is 20 internal timebase pulses when measured. This means you can use the pulse specs to specify a pulse width of 0.75 your pulse width by using only 15 internal timebase edges for your pulse width.
    I don't know if I was clear above or not but if you give me your exact application you are looking to achieve, I might be able to help you out. Hope that helps.
    Ron

  • Monitoring pulse generation

    Hi all,
    I am using a USB-6210 card and
    measurement studio with VStudio2003. I would like to drive a stepper
    motor (which turns a miror in a spectrometer) by sending digital pulses
    to a motor driver. Using another channel on my card, i would also like
    to read a voltage (from an IR detector) every time i send 100 pulses to
    the stepper motor on the other channel. The purpose is to be able to
    log the voltage against the position of the motor.
    I am not sure what the correct method is... I can think of different options :
    Use
    \National
    Instruments\MeasurementStudioVS2003\VCNET\Examples\DAQmx\Counter\Generate
    Pulse\GenDigPulse + incrementing a variable that counts each time i
    send a single pulse. When the variable reaches 100, i take a reading.
    This concept is simplistic, however with this method i am concerned
    about having to often start/stop the task.
    I have seen interesting examples in the following directories, using a continuous pulse train + counting digital events.
    \National Instruments\MeasurementStudioVS2003\VCNET\Examples\DAQmx\Counter\Generate Pulse\GenDigPulseTrain_Continuous
    \National Instruments\MeasurementStudioVS2003\VCNET\Examples\DAQmx\Counter\CountDigEvents\
    How can i integrate these two examples to be able to count the pulses? Shall I just physically connect the counter pin and the pulse generation pin on the connector block of my card?
    To
    decide whether the motor has arrived to the aimed position I could use
    the a "counting" class to drive (=start/stop) a "pulse generation"
    class ?
    However the counting methods are driven by a Timing
    function (which runs every 50ms max), so i will always end up being
    slightly over positionned because of the lag time of the OnTime method?
    (i guess it doesnt really matters, as long as i know where i am)
    Use
    a finite pulse train. This imply using my two counters and then i would
    not be able to know where my motor is if the software was to end
    prematurely.
    Does anyone know what is the right way to do this?
    Thanks
    Laurent

    Duplicate thread:
    http://forums.ni.com/ni/board/message?board.id=250&message.id=37363

  • Pulse generation PCI-6220

    Hi there,
    I´m an absolutely newbie to labview and hope to get some advices as I´m completely stuck at the moment.
    I´d like to generate variable TTL pulses to 3 different lines. Since the PCI6220 card only has two counters I´ve to go for the normal hardware correlated DIO lines.
    For now I´d be happy to see it working just for one line as follows:
    __|   |________|           |_ ...
    I´ve to be able to set the pulse width of the high time for the first and the second pulse as well as the two different low times. This scheme should furthermore than be repeated n times. Thus having 5 variables, the length of the pulses in ms: 'Low1','High1','Low2','High2', and the number of repetitions: 'n'.
    I may be horribly wrong with this, but I think working with the duty cycle doesn´t work for that application, does it?
    Assuming I use the frequency generation of a counter as a sample clock to my pulse generation, it seems rather simple taking for instance 'High1' corresponding pulses of the counter clock to generate the 1st pulse then 'Low2' pulses for the subsequent low pulse and so forth. Could anyone give me a hint to do so, or are there better/other ways how to achieve this? Are there eventually vi's available I could start with (haven´t found proper one´s in this forum nor in the Labview implemented library)?
    Many, many thanks in advance for any help!!
    Robert

    Rob:  I looked at your example earlier when I was near my LV machine.  From memory:
    1. I think I recall that you specified PFI 2 as the sample clock source for the digital task while using CTR 0 to generate the clock.  According to this doc, the default output pin for CTR 0 is "terminal" 2.  However, that does NOT turn out to be another name for PFI 2.  Rather, terminal 2 is designated as PFI 12 as can be seen here.   (This stuff is also visible in MAX when you select your device, right-click and choose "device pinouts").
    2. I recall you used a U32 array version of DAQmx Write. You may need to use the U8 version on your 6220 board.  Also, the init values you wrote before the loop alternate between 255 (all bits high) and 0 (all bits low).  The values you write inside the loop alterate between 1 (LSB high, all other bits low) and 0 (all bits low).
    3. You defined the digital task for finite generation, filled its buffer before the loop, then attempted to keep overwriting it inside the loop.  These are not mutually consistent.  If you want finite generation, fill once only.  If you want continuous generation, it'll take some care not to overwrite too soon.
    4. Minor nit: It may not matter in your app, but often its best to start up the digital task before starting the counter task that generates its clock.  You can accomplish this by simply routing the error cluster from the digital task's DAQmx Start up to the counter task's Create Virtual Channel.
    I'm not near LV now to look at the recent example from Christian M.  Hope it suits your needs...
    -Kevin P.

  • Pulse Generation application with DAQmx and a PXI-6624 module?

    What is the best implementation method for the following pulse generation application
    using LabVIEW, DAQmx and a PXI-6624 counter\timer module?
    I have two rising edge trigger signals (Trigger-1 and Trigger-2).
    There is ample spacing between each trigger. They never occur at the same time.
    I need to generate a single pulse (fixed width, variable delay) whenever Trigger-1 occurs and
    a finite pulse train (fixed width, variable delay, N-pulses) whenever Trigger-2 occurs.
    However, the output must appear on one counter output because this composite signal
    will be used as a trigger source for another PXI module in the rack.
    With DAQmx and a TIO counter\timer can I use both the GATE (for Trigger-1) and
    AUX (for Trigger-2) at the same time on the same counter to gate out the desired pulses?
    Trigger-1 would be wired to the GATE of CTR0. One Trigger-1 event would generate one pulse on the output of CTR0.
    Trigger-2 would be wired to the GATE of CTR1 and the output of CTR1 would be routed to the AUX input of CTR0.
    One Trigger-2 event at the GATE of CTR1 would generate multiple pulses on output of CTR0.
    Would DAQmx and the PXI-6624 TIO support this implementation?
    What is the best way to accomplish the task at hand.
    Thank You.
    Best Regards,
    Scooby

    Hi Scooby,
    I have looked into the application you have described and I see a potential problem with what you describe.  In DAQmx, it is not possible to call the counters of the same DAQ device in the same task, so you cannot have the finite pulse train generation and the single pulse generation tasks running at the same time.  What you can do, since you mention the triggers will not occur at the same time, is to stop one counter task while you are triggering another.  The way I would suggest you merge the outputs is with a two input Or logic gate to avoid damaging your counters.  Your signals will effectively be added together by this logic gate.   I do not see any way to merge the outputs internal to the DAQ device. 
    Please let me know if I can be of additional assistance.
    Laura

  • How to configure a continuous pulse generation that doesn't end after the VI exits with DAQmx?

    Hi,
    I'm just learning the DAQmx and I have run into a problem.
    With the legacy DAQ API I could configure a counter to create continuous pulses and
    when I needed change the freq or duty cycle, I would just call the the configuration function
    again. The pulses were generated even after I closed LV, so it was all in the hardware.
    Now, with DAQmx api, it seems that this is not possible. I read a forum post saying that
    LV will end the pulse generation after the VI exits. Is there a workaround for this?
    I could ofcourse create a LV thread for this, but I liked the old one better
    It was simpler and I didn't need to worry about threads so much.
    All LV operations are going to be inside a DLL that is called from outside of LV, so I can't
    use LV threads in a simple way, e.g. putting things inside a while loop. Just that you'll
    know why I wan't to avoid using the threads.
    Thanks.

    It is possible to achieve this behavior using the DAQmx API by using the DAQmx Create Task VI to explicitly create the task (rather than relying on DAQmx Create Channel to do it implicitly) and setting the AutoCleanup attribute to False.  This method prevents LabVIEW from automatically clearing the task when your VI (or the function you'll be exporting to your C .dll) finishes executing.  The disadvantage is that you might accidentally "leak" a task if you're not careful.  In order to stop the pulse generation on command, you can either reset the device or somehow store the task name you created and come back later to call DAQmx Stop and/or Clear Task.
    Here's how you would start the generation:
    ...and how you could come back and stop it later, using the task name you created:
    Hopefully this helps-
    Message Edited by Tom W [DE] on 11-16-2007 07:54 AM
    Tom W
    National Instruments
    Attachments:
    autoCleanup.JPG ‏17 KB
    clearTask.JPG ‏4 KB

  • Two retriggerable pulse generations after a pulse train generation

    I am trying to generate 3 pulse trains (ABCABCABC...) one after another.
    The program currently I am using generates 2 pulse trains (ABABAB.....).
    I am using the Traditional NI-DAQ and PCI-6602.
    I am thinking about using pulse train generation first and then retriggerable pulse generation after that.
    I understand that the retriggerable pulse generation can generate a pulse train triggered (or gated) by other counter output.
    I have attached a test vi.
    It uses the pulse train generation code when the counter number is 0 and when the counter number is not 0, then it uses the retriggerable pulse generation code, which I tried to modify from the pulse train generation code.
    First of all, I am not sure if I wrote the retriggerable pulse generation code correctly.
    Secondly, I don't know if the whole code will generate ABCABCABC...
    I would really appreciate your help.
    pchemjjang

    pchemjjang,
    I believe I may have misunderstood your original concern.  It sounds like you want to output this finite pulse train on three different counters.  You will output these pulse trains for 10 minutes and cease your program.  The Finite Pulse Train.vi will output a pulse train from only one counter.  With this Traditional DAQ example you would need to have three of these Finite Pulse Train.vi programs running simultaneously in parallel to output from 3 counters.  I would strongly recommend using DAQmx for this application because you will only need to utilize 4 VIs.  The rest of the work is done behind the scenes.  There is an example in DAQmx which should accomplish exactly what you are looking for in one program.  You must make sure to make the number of pulses 2000000, the duty cycle as 1/3 and the frequency as 1/(300us).  The DAQmx driver can found here.  In terms of the counters, I believe that each task requiring two counters will use the counter adjacent to it.  If you would like to output on counter 0 using finite generation then counter 1 will be used as the gating counter.  When you have the DAQmx driver then you can find this example by selecting Help>>Find Examples and then expanding Hardware Input and Output>>DAQmx>>Generating Digital Pulses>>Gen Dig Pulse Train-Finite.vi.  I have included an image to show how the front panel of this example should be configured to work.  The major note to make is that you will need to configure all of the counters in the channel names list.  In Traditional DAQ this did not seem possible.  In Traditional DAQ you would need to create a subvi out of the Finite Pulse Train.vi run three copies of it, in parallel, in a larger program.  Please let me know if you will be able to utilize DAQmx in this application.     
    Thanks,
    Gio L.
    Digital Support - Product Manager
    National Instruments
    Attachments:
    Counteroutput.jpg ‏49 KB

  • 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

  • Error -200220 occurred at DAQmx Create Channel (CO-Pulse Generation-Time).vi:1

    Hello,
    Just a couple of days ago I was given a task to complete. To transfer a Labview program from a desktop computer to laptop.
    The program itself uses a marlin camera to count the number of seeds.
    The transfer was fine I installed Labview 8.2, installed the DAQmx drivers and labview vision.
    I then transffered the program files over and ran the program on the laptop in labview and found an ERROR: Error -200220 occurred at DAQmx Create Channel (CO-Pulse Generation-Time).vi:1
    I remember that the desktop had a kind of board attached to it: some NI board dont know the model etc.
    can this be a problem? I have ensured that the problem is not the camera by checking it in MAX and it works fine.
    When i do step by step debugging the problem comes to a VI that uses a palette called DAQmx trigger - data acquisition palette.
    please see the attached picture!!
    Is this VI the problem then and is this palette the main problem that is not enabling this program to work??
    thankyou
    p.s. Will it be necessary to use the NI board then? if so i dont think it will work on the laptop then as you will need to install the daq card
    which can only be done on a desktop i think!! 

    Hello Rob W,
    Yes I only use a Firewire to connect the camera.
    And also i am sure that the device shows up in MAX under NI-DAQmx devices and not under Traditional DAQ. and it works under max.
    I am sure the problem is as shown in the image. because i have not connected to the NI board on the laptop and the program is designed to work with the board.
    but i have also tried removing the parts in the program that use the board but because of the complexity of the program i.e. wires i had some other problems i think
    must be the wiring etc
    thankyou

  • Determine when Counter Pulse Generation has been digitally triggered to start

    A counter task has been configured for continuous pulse generation with a digital edge start.  How in LabVIEW can I determine when an external digital trigger has been received and the counter started ?  It seems that a timed loop with DAQmx Create Timing Source wired to its source could be made to work but I cannot figure out how or the most appropriate instance to use.  I would simply stop the timed loop once the counter start had been detected.
    Steve

    Querying the output state and looking for a change would probably work for many typical square-like pulsetrains.  If you have an extreme duty cycle like 1% or something though, your queries are likely to keep finding the counter in the same output state long after pulses have started.
    Some other ideas of a similar nature may work better, though I'm not near a LV machine to test them.  I can vouch for idea #1 from past usage though.
    1. Query the counter's 'count' property and look for a change.  You're pretty unlikely to query the same count value several times in a row during pulse generation.
    2. You could try querying the DAQmx property for "TotalSamplesGenerated" and look for a non-zero value.  I'm not sure if this gets updated for counter outputs though.
    3. Counters also have a property called "TC reached?" where TC means terminal count.  When you query and get a True, It automatically resets itself back to False until reaching TC again.  Again, while I know this works for counter input tasks, I'm not sure if it gets updated for counter outputs.
    -Kevin P.

  • Synchronous pulse generation

     Hi all,
    I need to generate synchronous pulses from my USB device NI M6289 connected with BNC2120 on connector-0 and SCB68 on connector-1. I need to operate 8 chips which are connected in parallel with power supply,with only one chip at a time. Two pulses are required with duty cycle of 50% for operating one chip. So total 8 pairs(overall 16synchronous pulses) of such pulses are necessary.
    I have attached explanation in the attached word file,please have a look at it any help will be very useful for me.
    Is it possible do all this with just two counters which are in-built feature of NI6289?? If not how can it be acheived with only two counters?? 
    Regards
    Anurag
    Attachments:
    Synchronous pulse generation.docx ‏31 KB

    Hi kevin,
    Thanks for your help so far I managed to sort the things
    I have managed to get my counter output on different PFI lines. I have also started both counters together in the same VI by just copying the codes two times.
    For eg selecting ctr0 on PFI1 and ctr1 on PFI2 with 30s initial delay
    I have small question now,is it possible to shift ctr0 output to PFI3 and ctr1 to PFI4 after one minute without stoping the VI and reconfiguring ctr ouputs to PFI2,4??
    Further after one more minute ctr0 from PFI3 to PFI5 and ctr1 from PFI4 to PFI6 and so on....until ctr0 goes to PFI15 and ctr1 to PFI16 and the again the same sequence ctr0 to PFI1 and ctr1 to PFI2??
    Is this possible to automate this process or not?? Or I can do it only by manually configuring it.??
    Thnaks again for your help
    Regards
    Anurag

  • Simple pulse generation toggle

    Below is an excerpt from the 6602 manual.  The figure may not show so I've attached a word document showing it.  I want to do exactly what this says but am not sure how to make it happen.  I need to generate a quadrature signal and I think this would work wonderfully.  I want to setup one counter as my source and have two others toggle appropriately (keeping 90 degree phase shift). 
    How do I get into "Toggle" mode???
    Thanks!
    In toggled mode, the counter output changes state on the SOURCE edge
    that follows the assertion of the TC pulse. Figure 3-6 illustrates the two
    output modes for a pulse generation with a delay of two and a pulse width
    of four.
    Figure 3-6. Output Modes
    Attachments:
    6602 manual excerpt.doc ‏28 KB

    Howdy,
    You can use any of three DAQmx Create Channel VI's (CO Pulse Freq, Time or Ticks) to accomplish this generation. For this particular application, CO Pulse Ticks would probably be easiest since it allows us to input an initial delay, number of high ticks, and number of low ticks. For example, looking at Figure 3-6, to generate the bottom waveform, we would have something like the following config:
    the top waveform (SOURCE) would be connected to the source of ticks input on the DAQmx Create Channel (CO Pulse Ticks).vi
    initial delay: 3
    high ticks: 4
    low ticks: 2
    The DAQmx help for DAQmx Create Virtual Channel goes into more detail about these three Create Channel VI's if needed.
    (Just in case anyone references this thread in the future, this discussion is referring to Figure 3-6 of the January 1999 version of the 6601/6602 User Manual available here.)
    Warm regards,
    pBerg

  • Comedi pulse generation VIs?

    Does anyone have a set of VIs supporting (single) pulse generation on E series or 660x series boards that use comedi drivers? I found the STC (eg E series) and TIO (eg 660x series) pulse generation VIs on this website, but they are not functional with comedi. If any R/D engineer--or other knowledgeable fellow out there--has built VIs that support pulse generation with comedi, and would like to share them, I'd be most grateful =).
    If not, I guess I'll get busy making them...
    (I'm using a NI6071E and NI6602 boards...)

    So it sounds like voo-doo magic you are doing so I will ignore the whole applications talking to eachother for a moment.
    Generating a square wave is as simple as using the "Square Waveform.vi" under the Signal Generation palette.  Give it the parameters like rate and amplitude and it generates a nice waveform that can be wired directly to the Waveform Graph.
    Unofficial Forum Rules and Guidelines - Hooovahh - LabVIEW Overlord
    If 10 out of 10 experts in any field say something is bad, you should probably take their opinion seriously.

  • Pulse generation from an encoder on a PCI6601

    qq

    Hi,
    I think you would have to use one counter to count up till x, then you would start the second counter and let it 
    generate the output pulse you want. Afterwards you can update the x-value for the next pulse-generation.
    But this would be all in Host-Software, no Hardware-Timing. If you want to do the
    same in Hardware, I would recommend LabVIEW FPGA and a FPGA-Board.
    regards
    Marco Brauner NIG

Maybe you are looking for