Buffered freq/pulse measurement that can tolerate oversampling

I would like to synchronize a buffered freq or pulse measurement to a continuous AI task using the shared ai scan clock.
The problem is that there maybe times were there are slow to no pulses to measure and the DAQmx driver will throw an error
indicating that multiple samples clocks were received before any pulse measurements could be made.  What I would like is to have
the sample clock default to a measurement of 0 and this value would be placed into the task buffer so that it will always be sync'd
to the other tasks.

Duplicate count prevention is a pretty interesting (and probably poorly named) property.  With duplicate count prevention disabled, the sample is latched in on the rising edge of the source.  If the gate is faster than the source, you could miss the samples that you might expect to read 0 (i.e. imlpicitly-timed buffered period measurement).
This isn't exactly what's happening on the X Series (Duplicate Count Prevention is always "True" for frequency measurements on X Series).  The problem is that there is no sample available in the counter FIFO on the edge of the sample clock.  I believe the error is thrown by the hardware and there isn't much that NI could change in the driver to correct for it, but I'll investigate a bit more just in case.
In the meantime, you might have to resort to counting edges of your external signal sampled from the AI Sample Clock.  If your external signal is high frequency, this would be suitable, but I think it's probably more likely that your external signal is relatively slow so doing this would introduce a very large error.  I'll think about this some more and post back if I think of a workaround.
Best Regards,
John Passiak

Similar Messages

  • What is the min pulse width that can be measured using a 32-bit conter?

    what is the min pulse width that can be measured using a 32-bit conter?
    and also by chnaging the referenced Clock, can we measure as min as 10ns pulse width?

    You could measure a 40ns pulse, but not with a great degree of accuracy. Here's a good document on how counter pulse width measurements are handled:
    http://zone.ni.com/devzone/conceptd.nsf/webmain/7C77FB9EDC17C3C386256802007B8AB3
    With a 40 ns pulse, you'd have 3 counts per pulse so your uncertainty is pretty high (33%). Another way to look at it would be that you would read either 3 counts or 4 counts which would be values of 37.5ns (3*12.5ns) or 50ns depending on where the rising edges fall. So you wouldn't be able to tell the difference between a 40ns pulse and a 42ns pulse, but you would between a 40ns and a 100ns.
    Hope this helps,
    Andrew S
    National Instruments
    Message Edited by stilly32 on 09-18-2006 05:04 PM
    Getting Started with NI-DAQmx
    Measurement Fundamentals

  • Buffered event counting. Why can't I explicitly sequence generating the Sample Clock Pulse and reading the counters?

    At irregular occasions I need to grab counts from several counters, and buffering the counts must be done simultaneously for all counters. I'm modeling my approach after zone.ni.com/devzone/cda/tut/p/id/5404 which someone kindly pointed out in an earlier thread. However, that example only uses one counter, and you can't test the synchronization with only one counter, so I am using two counters configured the same way, and they're wired to a single benchtop signal generator (for example at 300 kHz).
    What I want to do, I can test in a loop with a somewhat random wait in it. I want to drive a hardware digital output line high for a few ms and then low again. The hardware line is physically connected to terminals for my timing vi's Sample Clock Source and so will cause them to buffer their counts for later reading. After I pulse this line, when I know new good buffered counts await me, I want to read both my counters. If their bufferings are simultaneous, then each counter will have counted the same number of additional counts since the last loop iteration, which I can check by subtracting the last value sitting in a shift register and then subtracting the two "additional counts" values and displaying this difference as "Diff". It should always be 0, or occasionally +1 followed immediately by -1, or else the reverse, because buffering and a count could happen practically at the same moment.
    When I do this using a flat sequence to control the relative timing of these steps, so the read happens after the pulse, the counters often time out and everything dies. The lengths of time before, during, and after the pulse, and the timeout value for the read vi, and the size of the buffer and various other things, don't seem to change this, even if I make things so long I could do the counting myself holding a clipboard as my buffer. I've attached AfterPulse.vi to illustrate this. If I get 3 or 10 or so iterations before it dies, I observe Diff = 0; at least that much is good.
    When I use two flat sequences running in parallel inside my test loop, one to control the pulse timing, and the other to read the counters and do things with their results, it seems to work. In fact, Diff is always 0 or very occasionally the +/- 1 sequence. But in this case there is nothing controlling the relative timing such that the counters only get read after the pulse fires, though the results seem to show that this is true. I think the reads should be indeterminate with respect to the pulses, which would be unreliable. I don't know why it's working and can't expect it to work in other environments, can I? Moreover, if I set some of the pulse timing numbers to 1 or 2 or 5 ms, timeouts start happening again, too. So I think I have a workaround that I don't understand, shouldn't work, and shouldn't be trusted. See SeparateSequence.vi for this one.
    I also tried other versions of the well-defined, single sequence vi, moving the counter reads to different sequence frames so that they occur with the Sample Clock Source's rising edge, or while it is high, or with the falling edge, and they also often time out. I'll post these if anyone likes but can't post now due to the attachment limit.
    Here's an odd, unexpected observation: I have to sequence the reads of the counters to occur before I use the results I read, or else many of the cycles of this combine a new count from one counter with the one-back count from the other counter, and Diff takes on values like the number of counts in a loop. I though the dataflow principle would dictate that current values would get used, but apparently not so. Sequencing the calculations to happen after the reads fixes this. Any idea why?
    So, why am I not succeeding in taking proper control of the sequence of these events?
    Thanks!!!
    Attachments:
    AfterPulse.vi ‏51 KB
    InSeparateSequence.vi ‏49 KB

    Kevin, thanks for all the work.
    >Have you run with the little execution highlighting lightbulb on? -Yes. In versions of this where there is no enforced timing between the counter and the digital line, and there's a delay inserted before the digital line, it works. There are nearly simultaneous starts on two tracks. Execution proceeds directly along the task wire to the counter. Meanwhile, the execution along the task wire to the digital high gets delayed. Then, when the digital high fires, the counter completes its task, and execution proceeds downstream from the counter. Note, I do have to set the timeout on the counter longer, because the vi runs so slowly when it's painting its progress along the wires. If there is any timing relationship enforced between the counter and the digital transition, it doesn't work. It appears to me that to read a counter, you have to ask it for a result, then drive the line high, and then receive the result, and execution inside the counter has to be ongoing during the rising line edge.
    >from what I remember, there isn't much to it.  There really aren't many candidate places for trouble.  A pulse is generated with DIO, then a single sample is read from each counter.  -Yup, you got it. This should be trivial.
    >A timeout means either that the pulse isn't generated or that the counter tasks don't receive it. - Or it could mean that the counter task must be in the middle of executing when the rising edge of the pulse arrives. Certainly the highlighted execution indicates that. Making a broken vi run by cutting the error wires that sequence the counter read relative to the pulse also seems to support that.
    >Have you verified that the digital pulse happens using a scope? -Verified in some versions by running another loop watching a digital input, and lighting an indicator, or recording how many times the line goes high, etc. Also, in your vi, with highlighting, if I delete the error wire from the last digital output to the first counter to allow parallel execution, I see the counter execution start before the rising edge, and complete when the line high vi executes. Also, if I use separate loops to drive the line high and to read the counter, it works (see TwoLoops.vi or see the screenshot of the block diagram attached below so you don't need a LV box). I could go sign out a scope, but think it's obvious the line is pulsing given that all these things work.
    >Wait!  I think that's it!  If I recall correctly, you're generating the digital pulse on port0/line0...  On a 6259, the lines of port 0 are only for correlated DIO and do not map to PFI. -But I'm not using internal connections, I actually physically wired P0L1 (pin 66) to PFI0 (pin 73). It was port0/line1, by the way. And when running some of these vi's, I also physically jumper this connection to port0/line2 as an analog input to watch it. And, again, the pulse does cause the counter to operate, so it clearly connects - it just doesn't operate the way I think it is described operating.
    For what it's worth, there's another mystery. Some of the docs seem to say that the pulse has to be applied to the counter gate terminal, rather than to the line associated with the sample clock source on the timing vi. I have tried combinations of counter gate and or sample clock source and concluded it seems like the sample clock source is the terminal that matters, and it's what I'm using lately, but for example the document I cited, "Buffered Event Counting", from last September, says "It uses both the source and gate of a counter for its operation. The active edges on the gate of a counter is used to latch the current count register value in a hardware register which is then transferred via Direct Memory Access...". I may go a round of trying those combinations with the latest vi's we've discussed.
    Attachments:
    NestedSequences.png ‏26 KB

  • Can pulse measurement.vi measures 2M points with 10ns time interval?

    Hi,
    I used pulse measurement.vi to measure the pulse duration of waveforms when the waveforms exceed certain threshold level. The data file has 2 millions data points with 10ns time interval.  But I got error message saying that
    "The waveform did not cross the mid reference level enough time to perform this measurement. Check the signal length, mid reference level, and reference level unit."
    I was wondering if pulse measurement.vi is capable of handling such large file or it was due to my paramenter errors.
    Thank you for your help in advance.

    I realized that I can't really modify the percent level settings or specfication of the pulse measurement.vi. For instance, I changed the percent level setting to peak instead of the default auto select. After running the VI unsuccessfully and I reopened the pulse measurement.vi, I saw the percent level setting was set to auto select again instead of peak method. I have attached the image of the block digram and a very small part of the waveform data. I hope you can open both.
    Thank you.
    Attachments:
    pulse measurement.doc ‏45 KB
    example.txt ‏2 KB

  • How can show the result of a measuring that is done in a sub-program in my main panel?

    How can show the result of a measuring that is done in a sub-program in my main panel?

    In your subvi, wire the result(s) you want to ouput to the main program to an output terminal on the connector pane.
    For a tutorial on subvi's, search the help for "connector panes" anc click on tutorial.
    ~Tim

  • Quick Question On Pulse Measurements

    I was wondering what the percents are the percent of on the Pulse measurments.vi   Default (10,50,90)%
    I understand the low,mid, and high part of the vi. But what are the percents referencing? It it simply  % of your largest pulse?
    I know it isn't very clear what I am asking but Im not sure how to ask it more clearly.
    Link to help doc

    johnsold wrote:
    Nate...,
    Typically the Pulse Measurement VI used on something which looks like a rectangular pulse with a little noise, overshooot, ringing, ...  Your signal is not what one would normally call a pulse by that definition.
    In the first image you posted how many pulses do you count? 11? The little spikes (amplitude about 0.1 at 3.318, 3.331, 3.341, and others): Are they to be counted or rejected? Do they alwyas occur before a big spike? Some little ones are not followed by big ones but all the bigones seem to be preceeded by a small one.  Is there a minimum dleay between successive pulses?  Analyzing data like this can be challenging.  Use all the knowledge you have about the process which generates the data to help.
    Lynn
    Hmm, all I had seen was sine waves before with the pulse. But, you seem to be right, rectangular pulses make a lot more sense.
    Yes, I am just counting each period. I just was planning on using the pulse vi to measure the giant spikes to count how many of those occur each second. That first graph is a sound wave of a weld shorting. I want to know how often it shorts a second. I currently just have it detecting an absolute value (looking for that giant spike) and however many times it detects that I average and turn into total shorts and average shorts.
    It works but it is not very elegant.
    And you are correct about some of the small spikes not being followed by a big spike. That is molten slag splashing about. This short one right before the sharp spike is the sound of the arc igniting (300 Amps worth).
    Can you think of any more elegant solutions to detecting the pulse? I am going to do some digging around..
    Thanks Lynn!

  • Is my idea feasible?(pulse measurements.vi)

    Dear All,
    I am using the "Pulse measurements.vi" to analyse the waveform get by DAQ card. And it need at least 1.5 periods of
    waveform data. Due to the unknown frequency of the signal, I don't know how to set the sample rate which is too fast
    that one time of N sample acquisition won't obtain the enough period for the vi, while too slow that the high
    frequency signal will not be get.
    So I am wondering that if the sample rate can be adjust dynamic. For example, at beginning a high sample rate is
    initialed while if the pulse measurements.vi give error that "the waveform did not cross the mid reference level
    enough times to perform the measurement", a lower sample rate will be adjust until the error is not absent.
    I don't know if it is feasible or someone have done some experience of this.
    If some example vi is absent, would you please attach it? Or if there is some other good way to solve it?
    Thank you very much.
    Hugo

    Lynn,
           Thank you!
           I have modified your vi which runs better
           In the zero case of the inner shift register I wired the new data to it which can measure the waveform dynamicly when I change the frequency during it running
          Thank you for your help!
    Hugo
    Attachments:
    frequency2.2.vi ‏31 KB

  • Pulse Measurements vi modification

    Hi,
    I am currently using LabVIEW 7.0.
    The pulse measurements vi histogram method uses the 40% lower and upper histograms to find the low and high state levels.
    My application requires me to take a look at the 10% lower and higher histograms, does anyone has a suggestion on how to modify that vi to fit my needs?
    Thank you

    Just to clarify, the 40% refers to the range of the histogram that is searched to find the peak histogram levels (or state levels). Then the reference levels are typically set at 10% and 90% of the resulting range defined by the two peak histogram values.
    There is no way to modify the 40% histogram search range in the Pulse Measurements.vi. The alternative would be to perform a histogram separately on your input data and process it according to your requirements. The resulting reference levels can be passed into Pulse Measurements by changing the ref units input of the reference levels cluster to "absolute".

  • Looking for a simple app that can output 8 channels simultaneously.

    Hello esteemed audio community.
    I have to create a little effect for an upcoming party. For this I have created the following audio tracks in Garage Band:
    - 4 separate audio channels (stereo front and stereo rear)
    - one mono combination of these four tracks (to drive a Light organ gizmo - makes the light flicker with the audio)
    - and finally two separate tracks with simple 1Khz pulses to trigger relays for a fog machine.
    I now need to be able to play these 7 tracks simultaneously and send them to different amplifiers and relays. So I need two things: 1) a software that can play them and 2) a hardware interface that can take these 7 channels out of the computer and convert them to line levels analog signals.
    I thought this would be pretty straight forward but it turns out that it is not, unless you want to throw $$$ at it which I really can't afford.
    Software wise, unfortunately, GB can only output 2 audio channel at one time. So I need to find a little app that can offers multitrack output. Ideally it would some shareware thing that would allow me to load in up to 8 tracks saved from GB, adjust their individual levels and then output them.
    Second issue is hardware. Here I have found the M-Audio 410 firewire. This box will take up to 10 audio "returns" and output them to analog. They can be found used for about $150. So I think this might work.
    Budget for this setup is very limited, hopefully no more than $150. Quality does not have to be very high although a good bass response will be important for the effect. I don't need any recording. Only playback.
    Would any one have any suggestion on how to best accomplish this? If this software does not exist, how complicated would it be to write it? Would Applescript be useful for this? All it needs to do is read 8 audio files (2 minutes max), allow me to adjust their level and output all 8 at the same time.
    Thank you very much for any help.
    Bo

    Ah. I'm surprised, but there we go.
    Have a look here ...
    http://jam.hitsquad.com/vocal/about2136.html
    (courtesy of googling 'OSX free multitrack recording software')
    Didn't have time to do more than skim, but 'Ardour' looked promising. Protools is the only one I've used, the full product is one of the industry standards, but the free 'lite' version listed here seems to be limited to 2 in/out as well.
    Referring to your original post, I'd think trying to write or 'script' something would be a nightmare ... synchronisation of streams within something like Applescript would be a major issue, quite apart from anything else.
    G5 Dual 2.7, MacMini, iMac 700; P4/XP Desk & Lap.   Mac OS X (10.4.8)   mLan:01x/i88x; DP 5.1, Cubase SX3, NI Komplete, Melodyne.

  • Looking for devices that can perform straight forward I/Q demodulation process

    Hi guys, 
    I am looking for a high speed NI board that can perform the quadrature demodulation (for a 20 MHz signal), I have looked through the web but so far I can only find 5620, 5660 and 5142.
    cos(wt) ----> Device under Test (DUT) -----> Acos(wt + theta)
    cos(wt) is the original tranmitting signal (20 MHz). After it is passed through the DUT, amplitude change (A) and phase shift (theta) is then introduced into the output signal (the frequency still remains the same.) The purpose of this setup is to measure the amplitude change and phase shift, relative to the original signal.
    Thus I need a simple I/Q demodulation board that can perform this job. Is there any NI board that one can recommend? Or is there a board that can generate the driving signal and do the IQ domodulation at the same time? I think 5620, 5660 and 5142 can only perform I/Q demodulation process...
    Thanks for the help!

    Duplicate post.  See response here. 

  • Does anyone know of an iPad app that can lock the iPad after a period of months (i.e., 6 months)?

    Does anyone know of an iPad app that can lock the iPad after a period of months (i.e., 6 months)? I am looking to give ipads to contestant participants and need a way to automatically lock the device once the set duration (measured in days, weeks, months or years) is complete. Does anyone know of an iPad app that locks the device after a period longer than 24 hours (ike most parental control apps)??
    Thanks for any help!!

    It's called "SelfControl". It can be a little hard to learn to use but it's worth the effort.

  • Convert the all the quantity units into one Unit of measure that is 'CSE'.

    Hi all,
    I want to convert the all the quantity units into one Unit of measure that is 'CSE'.
    would anybody tell me what is the FM that converts all the quantity units into one Unit.
    Thanks in advance,
    Mythily

    Hi Mythily,
    You can check the following function module - -
    FCO_CONVERT_FROM_BASE_UNIT
    MD_CONVERT_MATERIAL_UNIT
    MS_CONVERT_UNIT_TO_TIME
    RV_CONDITION_CONVERT_UNITS
    VHUMISC_CONVERT_TO_ALTERN_UNIT
    VHUMISC_CONVERT_TO_BASEUNIT
    WALL_QUANTITY_CONVERT_UNIT
    WALL_QUANTITY_CONVERT_UNIT_RND
    WSTP_CONVERT_UNIT
    Regards
    Pinaki

  • SSAS- DAX expression : Is there any DAX function that can return multiple values ?

    Hi,
    Iam in search of a DAX function that can return multiple values as result. please find below scenario where i want to implement the same.
    I have three  Tables: Table A (typeid, Cost, Qty ) ,Table B (typeid, Cost, Qty ) , Table C ( typeid,Typename ) .
    Table A                                       Table B                               
    Table C
    type id  cost  Qty             type id   Cost    Qty                 
    typeid  typename
    1           100    100                3         300     
    300                  1           aa
    2           200    200                4          400    
    400                  2           bb
                                                                                             3           cc
                                                                                             4          
    dd 
    i have to club cost and Qty of two tables(four measures)  as two measures in the  UI report. There are more columns in these tables that restrict the  UNION of the tables.(for the sake
    of understanding , i have not mentioned the othr columns). In the UI report(Execl 2013-power pivot) iam plotting these measures against the
    Table C.Typeid. Hence the measures drill down against each 
    Table C. Typeid as shown below:
    Typeid  Table A.cost  Table A.Qty  TableB.cost  TableB.Qty                              
    1              100             100
    2              200             200
    3                                                    
    300             300      
    4                                                    
    400             400
    My requirement is to club these measures so that the report will be as below
    Type id  cost   Qty
    1          100    100
    2          200    200
    3         300     300
    4         400      400
    Since i cannot club these in model,as a work around, i created a calculated measure in excel(Analyze tab->Calculations->olap tools->calculated measure) with the condition as below:
    new cost = IIF (ISEMPTY(TableA.cost)="TRUE",TableB.cost,TableA.cost)
    new Qty = IIF(ISEMPTY(TableA.Qty)="TRUE",TableB.Qty,TableA.Qty) and dragged these new measures into the report. It was working fine as expected.
    But  this functionality of Creating calculatedmeasure in excel report is possible only in 2013 excel version.
    Now the requirement is to get the same result in 2010 excel. Can you please help me in implementing the same in 2010 excel? or any other alternative method to bring the columns in model itself. I tried to create a measure in table A with DAX expression as
    : new cost :=CALCULATE(SUM(Table B.cost),ISBLANK(TableA.cost)) -> but this will return only 1 result .i need Sum(Table A.cost) also if it is not blank.
    Thanks in advance

    You can use SUMX ( 'Table A', 'Table A'[Cost] + 'Table B'[cost] )
    However, if you install the latest version of Power Pivot in Excel 2010, it supports the ISEMPTY function, too.
    http://support.microsoft.com/kb/2954099/en-us
    Marco Russo http://www.sqlbi.com http://www.powerpivotworkshop.com http://sqlblog.com/blogs/marco_russo

  • How can I change the margin settings in the pages inspector to make them more specific for label templates. I need margins that can be set to hundreths of a centimetre not just tenths.

    How can I change the margin settings in the pages inspector to make them more specific for label templates. I need margins that can be set to hundreths of a centimetre not just tenths.

    I doubt you need hundreths as you would not even be able to measure that and the printer doesn't hold the paper to those tolerances.
    fruhulda is right. Pages accepts higher measure but rounds it in the measure field.
    If you want absolute accuarcy you need to set your measures to points. Everything else is being recalculated.
    Peter

  • Making a pulse width that is independent of frequency

    I'm using the arbitrary waveform generator vi to output two simultaneous signals. I need one to have a 1000 micro second pulse width that remains constant as frequency varies between 200 and 300 Hz. Can this vi do this? If not is there an example vi that can or do I have to program my own?

    Hello;
    You can do that with the Analog Output channels of your DAQ device. To change the frequency, you just need to change the datapoints to output on the channels. You need to come up with a subVI that calculates the necessary datapoints to be output on the analog output channels, so the width is maintained as you change the waveform frequency.
    Hope this helps.
    Filipe A.
    Applications Engineer
    National Instruments

Maybe you are looking for

  • Error while starting Upgrade Assistant Server

    Hi everyone, I'm trying to upgrade a 4.7 System to ECC 6.0, but did not get very far. When I try to start the Uprgade Assistant Server using java -cp ua/ua.jar UaServer, I get the following error right after entering and conforming the password: java

  • Which table will have Page(XML) info

    After importing say TestPG.XML using import command, where to check whether this page is imported not. Where is the MDS info r stored?

  • HP Pavillion dv7 Notebook

    Hello I have been experiencing some problems with my sound card in my HP laptop. The sound will just stop if I have it turned up 3/4 or higher. The sound works most of the time, however there are certain times when it will just stop altogether. I'm n

  • BI Authorisation Roles???

    Hi there, I have been having a problem with the BI authorisations on our Dev box.  It seems that all our Characteristics werent marked as authorisation relevant and the 0BI_ALL authorisation object doesnt help.  The only way to get a user to open a r

  • 3GP feed - The feed has no episodes

    Hey iTuners, Can someone please help me work out why the feed at: http://www.oneminuteworld.com/omw-rss.xml Works in itunes when you subscribe manually, but thinks there's no episodes when I try to submit it to the podcast directory? Thanks!