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

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

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

Similar Messages

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

  • Pulse train generation fails with certain values for "number of samples"

    I'm generating a retriggerable analog output signal, and so I'm using a counter as the sample clock (see: Retriggerable AI Using Retriggerable Counter). I am finding that, above a certain number of samples, and only for certain values of the number of samples, the counter task gives me error -200305, "Desired finite pulse train generation is not possibe." The error crops up only when actually starting the task.
    The analog signal that I'm trying to generate will be about 800 kHz, so my counter is set to run at the same frequency. I find that the counter task works fine if the number of samples to generate is anywhere between zero and 671,088 samples. Setting the number of samples to 671,089 gives the error above, as does 671,090 samples and so on. However, using 671,096, the counter task works fine. After that, the counter seems to output fine only if the number of samples is divisible by 8.
    The only thing I can think of is that (617088 samples) / (800000 Hz) = 0.839 s. At the internal clock rate of 20 MHz, 0.839 s is 2^24 samples, and it is a 24-bit counter on this hardware. So if it's this internal counter rolling over, that's fine and I can work around that. But if that's the case, what I don't understand is why increasing the number of samples in increments of 8 samples still works.
    The hardware is a PXI-6733 board, running with LabView 7.1.1 and NI-DAQmx 8.1.

    Hmmm,  multiples of 50 & 100?  Now I'm puzzled again.
    Here's how to make sense of the 100 kHz timebase idea though, even if it turns out not to be the right explanation.  For a retriggerable finite pulse train, you actually use a pair of counters.  If you were to program it manually, you could set your output counter to generate a continuous pulsetrain at 800 kHz using the internal 20 MHz timebase.  This output counter would also be configured to use the other counter's output as a digital level-based pause trigger.  So the 800 kHz pulsetrain is only output while the other counter's output is, say, high.
    The other counter is configured for retriggerable pulse generation.  The pulse duration or high time should be set for (# pulses) / (800e3 pulses/sec).  This other counter can be configured to use the 100 kHz timebase, so its high time would then have to be an integer multiple of 10 usec.
    So let's see...  An 800 kHz pulsetrain is possible with a 20 MHz timebase (exactly 25 cycles).  A 700 kHz (28 + 4/7 cycles) or 900 kHz (22 + 2/9 cycles) is not.  So when you request those other frequencies, you actually get a near approximation.  I dunno if DAQmx can be queried for the actual value correctly or not -- I recall an early version that reported back whatever freq you had asked for rather than what it actually used.  Queries based on ticks (rather than time or freq) did return what was actually used, as I recall.
    Let's suppose a request for 700 kHz gets truncated to 28 cycles of the 20 MHz timebase making a 1.4 usec period.  Then 50 of those periods becomes 70 usec, which is evenly divisible by the 100 kHz timebase.  Bingo!  (Note: 70 is the least common multiple of 10 and 1.4)
    Now suppose the request for 900 kHz turns into 22 cycles of the 20 MHz timebase, or a 1.1 usec period.  Now it takes 100 of those periods to get to 110 usec, which is also evenly divisible by the 100 kHz timebase.  Bingo again!  (Note: 110 is the lcm of 10 and 1.1).
    Did you follow the method here?  It should help you figure out expected results for various output freqs and #'s of samples.
    -Kevin P.

  • Finite pulse train generation?

    i am trying to generate a very specific pulse with my tio-6602 in labwindows. after a 20us delay, i want the board to generate 20 pulses, with a width of 1 us and an interval of 5us. ideally, this would be retriggerable at 100 Hz. any suggestions on what would be the best way to approach this problem?

    Paco,
    You can use a gated pulse train, which is similar to finite pulse train generation. With finite pulse train generation, you have one pulse for the gate of a counter set to generate a pulse train. The pulse train will only be output based on the gate, so if one pulse appears, you have a finite pulse train. Now, if you make the gate be a pulse train itself, then you can continuously output bursts of pulses. For instance, you can set it up such that the pulses are output when the gate is high. When the gate is low, the counter pulses would pause and when the gate resumes to the high states, your pulses would continue. I've attached a code excerpt for using NI-DAQ function calls to generate a finite pulse train that is in our database. I will see abo
    ut getting it put onto the http://www.ni.com/support pages. You can also find more information about the function calls used by referencing the NI-DAQ Help file installed with the NI-DAQ driver software and with the NI-DAQ User Manual, which is available at the web pages.
    Regards,
    Geneva L.
    Applications Engineering
    National Instruments
    http://www.ni.com/ask
    Attachments:
    finitepulsetrain.txt ‏2 KB

  • Loss of Synchronization for Finite Pulse Train generation

    I have successfully generated a finite pulse train on my 6608. My program is based off an example I got from NI Zone (Square_Wave_Trigger.zip).
    Unfortunately, the Finite Pulse Train loses synchronization every once in a while, and I'm not sure why. Is there anyway to prevent the loss of synchronization???
    When I say loss of synchronization, here is what I mean exactly. I'm generating 4 pulses, but every once in a while, when I reprogram my equipment, I lose those 4 pulses. They seem to go out of phase or something.
    I have included my code as well (Sync.txt), which is slightly different from the example code. In my code, the finite pulse train is generated by the "Sequence Gating Pulse"
    and the "USIP Firing Sequence" lines of code, which are clearly marked.
    Any help would be greatly appreciated. =)
    Attachments:
    Sync.txt ‏14 KB
    TIOgenSquareWaveStartTrig.C ‏6 KB

    I lose the pulse train until I reset my counters. The pulse train shifts out of phase with the main pulse. It's easier to see in the pictures below.
    Attachments:
    Good_Pulses.jpg ‏203 KB
    Shifted_Pulses.jpg ‏220 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

  • USB-6009 pulse train generation with digital output....

    Hello!
    I've bought a new USB NI-Card (USB-6009) and now I'm trying to adopt an old vi that uses traditional DAQ drivers. I wrote that vi for a PCI NI-Card (PCI-6024E), which has two counters to generate two pulse trains simultaneously. Now I've only one counter and that's why I'm searching for a good way to create pulse trains using a digital output! The pulse trains are both ranging between 100 Hz and 100 kHz.
    I'm sure somebody has an idea how I can solve the probem in the best way
    Kind regards,
    Peter

    You can't do it with this low cost board. Both digital and analog outputs are software timed only. The analog out is rated at only 150  samples/sec and the digital is about the same. You can't even use one of the counters because it is not a hardware timed counter output. It is an event counter only as an input.

  • How to count number of sales orders generated in a month in SAP SD

    Hi SD Gurus,
    I have a very strange query from client. I have to count the number of sales order created in a month for a z report. For example 30 in Jan, 25 in Feb etc. Could anyone suggest me How to count number of sales orders generated in a month in SAP SD.
    Regards
    Vinod Kumar

    Hi,
    Goto the T.Code "SE16" or "SE16n" or "SE11".
    Enter the table name as VBAK
    Enter the created on date as the starting date of the period and to date as the end date.
    Enter.
    Click on "Number of Entries".It will tell you the number of entries created in a particular period.
    If you want a report,goto the T.Code "VA05n".
    Regards,
    Krishna.

  • How to Count Number of completed line items in past 6 months / 12 months ?

    How to Count Number of completed line items in past 6 months / 12 months ?
    Hi,
    I am trying to count "Number of Completed Line Items in Purchase Order Document" for my Key Figure ZPO_CNT.
    Purchase Order document = ZEBELN
    Line Item = ZEBELP.
    I need to find and count if the Line Item has been received in the past 6 months from today and similarly in the past 12 months.
    I have "Delivery Completed" field, ELIKZ.
    So, based on this would I be able to calculate it in Query Designer?
    If so, Please let me know how

    Hello Deva
    If youe want to calculate the completed line item for last 6 or 12 month then i think u will be displaying the query data for these montrhs...create a customer exit to give you date range and restric it in filter area....
    Now Choose any of the below option
    1. I would suggest to implement an additional key figure "counter" in cube and fill values with one for which delivery is completed.
    Now use calculated key figure in Query Designer based on logic
    IF counter = 1 THEN counter ELSE 0
    OR
    2. create a formula variable based on ELIKZ and use replacement path variable, it will display you no. of docs for which delivery is completed....
    Award points if it solves your problem
    Revert back in case of further assistance...
    Thanks
    Tripple k

  • How to count number of ones in table

    Hello,
     i created one table 16x32 each cell is updating 1 byte of data,how to count number of one in all cell,and is it right way to calculate check sum??
    thank you

    The simplest way is to call GetTableCellRangeValues with VAL_ENTIRE_TABLE as the range, next summing array elements.
    But I don't understand your comment on checksum, so this may not be the more correct method for your actual needs: can you explain what do you mean?
    Proud to use LW/CVI from 3.1 on.
    My contributions to the Developer Zone Community
    If I have helped you, why not giving me a kudos?

  • Pulse train generation with better precision

    I was wondering if there is a way to generate a pulse train with a width that is less than 2 milliseconds using labwindows 7.0 and a PCI-6602, I need more precision.
    Derek

    I use LabVIEW, not LabWindows, but I know that the 6602 device can certainly generate a pulse train with a width of way less than 2 msec. Way less than 2 microsec even. As low as 25 nanosec in fact.
    Aren't there any shipping examples for pulse train generation? If not, there's a few in the Dev Zone example library you could modify. Here's a link: Pulse Generation examples
    -Kevin P.

  • How to count number of rows in table

    can I get number of row in table except Count(*) in pl/sql
    is there any other way

    Also posted and answered here
    how to count number of rows in table
    count(*) will be the fastest way. It is only slow if the table has a vast number of rows, in which case why do you need to know the tables has 73552436467721 rows and not 73552436467737 rows. It doesn't seem to be much use. Either that or you are counting them a lot, which again seems rather pointless.

  • How to count number of online user

    i am developing bid application using servlet/jsp. how to count number of online user ple help me.

    hi,
    may be the following code help you...
    import javax.servlet.http.HttpSessionListener;
    import javax.servlet.http.HttpSessionEvent;
    public class ActiveUserCount implements HttpSessionListener {
         private static int activeUsers = 0;
         public void sessionCreated(HttpSessionEvent se) {
              activeUsers++;
         public void sessionDestroyed(HttpSessionEvent se) {
              if(activeUsers > 0)
                   activeUsers--;
         public static int getActiveUsers() {
              return activeUsers;
    }Dhaval

  • Please let me know how to Count Number of completed line items in past 6 mo

    How to Count Number of completed line items in past 6 months / 12 months ?
    Hi,
    I am trying to count "Number of Completed Line Items in Purchase Order Document" for my Key Figure ZPO_CNT.
    Purchase Order document = ZEBELN
    Line Item = ZEBELP.
    I need to find and count if the Line Item has been received in the past 6 months from today and similarly in the past 12 months.
    I have "Delivery Completed" field, ELIKZ.
    So, based on this would I be able to calculate it in Query Designer?
    If so, Please let me know how
    Krishna

    Hi Experts,
    I dont have a defined Restricted key figure yet.
    I have populated 0COMPL_DEL(Delivery Completed Indicator)  and 0EBELN (Purchasing Document Number) and 0EBELP (Line Item Number in Purchasing Document) .
    This is what I think how I need to calculate:
    Number of completed line items in past 6 months:
    If  Delilvery Completed Indicator (0COMPL_DEL) = x, calculate No. of Line Items (ZPO_CNT) from 0CALDAY to 6 months
    and
    Number of completed line items in past 12 months:
    If  Delilvery Completed Indicator (0COMPL_DEL) = x, calculate No. of Line Items (ZPO_CNT) from 0CALDAY to 12 months
    Please let me know if the logic is correct. If so, how I can create this in report

  • Counter/Timer Pulse Train generation

    Hello,
    I am having some trouble understanding why a particular VI I have isnt working(upper part of image below), I was wondering if someone could give me an idea of the cause from the error message.  I have a counter/timer which I am using to generate a pulse train.  It works fine on 'Continuous samples'  but when I switch it to 'finite samples' I get a 'resource is reserved' error when it gets to the DAQmx 'Play' VI
    I made a separate VI (lower part of image) and it works just fine with finite samples.  So  I am basically wondering what is different about finite versus continous sampling which could cause a resource to be reserved or not. (the board is a PXI 6281 if that matters)
    Thanks,
    Adam
    Solved!
    Go to Solution.

    You're correct on what the problem is. 
    For what it's worth, the newer X Series boards (63xx) and 2nd Generation Compact DAQ Chassis don't require the use of two counters for finite pulse generation (although technically there is a paired internal counter to accomplish the finite pulse generation, it's not really evident to the user). These products also have 4 counters available instead of 2. 
    Best Regards,
    John Passiak

Maybe you are looking for

  • Menu Bar Shaking on Desktop

    Hi everyone. I just got a macbook air 11 inch 2013 model and have a problem. Let's say I am in amazon and when I swipe right with 4 fingers I see that menu bar shakes a little on desktop. Do you have any idea what this is because of?

  • How much does reinstalling Mac 10.4.11 cost at the Apple Store?

    My iBook freezes at startup. No matter how many online tutorials I have used, it just will not work. How much does reinstalling Mac 10.4.11 cost at the Apple Store in the Danbury Fair Mall?

  • Converting CC InDesign to CS2

    Does any one know how to convert a CC indesign file to CS2? or how to open a CC indesign file in CS2??? I created the file in CC2014 and ran out of trail time and now am working at my work station at work with CS2... any help?

  • Mail account not working in iPhone

    One of my POP mail accounts is suddenly not working - I click on the inbox and it shuts down. Any suggestions? Thanks!

  • Why can't we resize log buffers??

    Why can't we resize log buffers?? Regards Vijay