NI6602 pulse width measurement: Do I have to use an external sample clock?

Hi
In the .NET 4 example 'MeasPulseWidthBuf_SmplClk_Cont' it is stated in the comments that:
An external sample clock must be used. 
Counters do not have an internal sample clock available.  You can use
the Gen Dig Pulse Train-Continuous example to generate a pulse train on
another counter and connect it to the Sample Clock Source you are using
in this example.
I have an application running without specifying an external clock. The applications is running, but I'm not sure I can trust the recorded data. Here is the channel creation code:
                task.CIChannels.CreatePulseWidthChannel(readTaskCounter,
                                                        "ReadPulswidthTask", 25e-9, 20e-6,
                                                        CIPulseWidthStartingEdge.Rising,
CIPulseWidthUnits.Seconds);
task.CIChannels.All.DataTransferMechanism = CIDataTransferMechanism.Dma;
                task.Stream.Timeout = callbackTimeoutInMilliSeconds;
task.Stream.Buffer.InputBufferSize = 50000;
                task.SynchronizeCallbacks = true;
                task.Timing.ConfigureImplicit(SampleQuantityMode.ContinuousSamples);
                task.Control(TaskAction.Verify);
Note that I'm not specifying any external clock.
1) Which clock is the daq using? -It is obviously using some clock since I can collect data via this task.
2) Do I need to change the configuration to use an external clock to achieve reliable readings - as mentioned in the 'MeasPulseWidthBuf_SmplClk_Cont' example?
/mola
Solved!
Go to Solution.

Hi mola,
That specific example is for sample-clocked pulse width measurements.  This type of measurement is only supported on newer hardware such as X Series boards and will not run on the 6602.
Your application that you linked uses Implicit timing, meaning that the signal itself serves as the sample clock.  That is, at the end of each pulse width that you measure, the sample is deterministically latched in.  So, you end up with a buffered array of every pulse width that is seen by the counter.
Best Regards,
John Passiak

Similar Messages

  • Why do I have to specify a rate when using an external Sample Clock?

    Set the approximate Rate of the external clock. This allows the internal characteristics of the acquisition to be as efficient as possible.
    How to understand?
    帖子被sillyball在02-25-2007 01:48 AM时编辑过了

    I think it is for optimization of the buffer.
    Ton
    Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
    Nederlandse LabVIEW user groep www.lvug.nl
    My LabVIEW Ideas
    LabVIEW, programming like it should be!

  • Pulse width measurements

    Hello,
    I am trying to measure the pulse witdth of a signal that has a pulse width of 800 micro seconds.  I am using the pulse width measurement VI with an indicator on the pulse duration output.  The sample rate I am using to sample the signal is 10000 samples/sec.  The pulse width measurement VI is returning a value of 8.  I'm assuming that it is taking the pulse width of the signal and dividing it by (1/10000) which is the time between each sample.  Is this correct? 
    Thanks

    Hi Jimmy,
    You said that you were using the Pulse Width Measurement VI.  Are you using the Express VI (LabVIEW 7 or higher), the regular VI, or are you trying to use a counter to measure do your PWM?
    Perhaps you could post a snippet of your code.  It sounds like you've got the right answer, but knowing which method you are using could definitely help.
    Regards,
    Otis
    Training and Certification
    Product Support Engineer
    National Instruments

  • Pulse Width Measurement

    Hello Friends,
    I am new to Labview. And now I am working on a project where I have to measure the pulse width.
    I have attached a pulse waveform and would like to measure the pulse width of the first rising the falling edge and log it , rest of the signal I am not interesed in.
    I will have this signal 6 times on my digital/analog input. 
    Can someone help me with the pulse width measurements.
    Thank you.
    Kind Regards,
    Attachments:
    Pulse width.PNG ‏60 KB

    I get this pulse ( as in picture attached), I want to get it on analog or digital pins in such a way in get the pulse width of only 1st edge.
    And this 1st edge lenght is different then the rest that follows. I would like to have the pulse width for only the 1st edge and log the width.
    And similarly this signal will come from 5 more different sources. So each signal is different.
    For now i connected it to AI0 and I can see the signal.
    1) next step measure only the first edge.
    2) 6X input channel 
    2) log it.
    Attachments:
    Pulse width.PNG ‏60 KB

  • NI 9401 pulse width measurement.

    Hello,
    I'm not sure I fully understand the pin-out diagram. At present I have a NI9401 in a NI 9172 chassis. 
    DIO0 and DIO1 are connected to light gates. I have an opto switch and I want to measure the pulse width when an object blocks passes through the slot. Can I use any of the other free input to do this?
    Free inputs are, DIO2, DIO4 and DIO5.
    The other I/O pins are being used as triggers. 
    Cheers

    Solved!
    Go to Solution.

    Hi Daisy,
    If you open your DAQ Assistant properties, and read the Measuring Pulse Width help on the side, you'll see that "You can use the counters on your measurement device to measure pulse width. Pulse-width measurements measure the time between either a rising and a falling edge, or a falling and a rising edge." If you change the Pulse Width Setup Starting Edge setting to Falling edge and look at the picture above, you'll see that the pulse width it's measuring the width from a falling edge to a rising edge (the pulse width while the signal is low). So this measurement will go from the falling edge of your first measurement to the rising edge of your second measurement. If you want to measure the width of the first pulse (while the signal is high) you need to set your Starting Edge to Rising. 
    Do you know whether the width that you want to be measuring is while the pulse is high or while it's low? Starting Edge Rising and Starting Edge Falling should give you different measurements, because they're measuring different things. You should verify which result it is you want, and what it is you're trying to measure. 
    Hope this helps!
    Emily C
    Applications Engineer
    National Instruments

  • External sample clock with pulse width measurement

    Dear all,
    I am using a NI 6220 board (programming with ANSI C) and would like to perform a "single pulse-width measurement" using an external gate signal and an external signal as source.
    Using the  "DAQmxCreateCIPulseWidthChan" command the program and card works only partly as intended. Namely, the external gate did work, but the card uses the internal 80 MHz time base signal instead of the external source connected to the default source pin (PFI 8).
    I tried to route another PFI pin to the default source pin using the "DAQmxConnectTerms" command but this did not help either.
    Obviously, I am missing something...
    Best, Uli
    Solved!
    Go to Solution.

    Hi Uli,
    I posted to your thread here.
    Best Regards,
    John Passiak

  • Wiring hardware for pulse width measurement

    I am in difficulty.even with so simple pulse width measurement.
    I am using labview 7.1, DAQmx, MAX, PCI - 6220.
    I cannot find help document as to how to measure PW measurement and I find no connection diagram in MAX for using pulse width measurement.
    I connect to PFI 9 (Gate) to 5V via switch. What about timebase counter as source? Ok I wanted to use internal clock from PCI-6220. But I cannot get to measure PW.
    I want to MAX to measure. Once it is ok, then I will build a simple vi to understand its working better.
    Pls help.

    Hello,
    LabVIEW has examples that are located in the Example Finder under the Help menu inside of LabVIEW.  The examples specific to pulse width measurement are organized and located under the Browse tab of the Example Finder under the folders <Hardware Input & Output> <DAQmx> <Counter Measurements> <Period & Pulse Width>.  The Example Finder has an information section that has information on the Description, Instructions for Running, Block Diagram Steps, and I/O Connections Overview.  The last section will help with the connections.  The input for the example titled Meas Pulse Width – Buffered –Cont.vi will be the gate of the counter specified in the “Counter(s)” control on the front panel … such as Dev1/Ctr0.  So on your device the 6220, counter 0 gate is PFI 9 as you mentioned.
    I understand that you are interested in getting started with the Test Panel in MAX first.  The Test Panels are limited to Pulse Train Generation for counter output and Count Edges for counter input.  Please use the Count Edges if you are interested in testing the device with a counter input task.  However, the Count Edges will just be counting edges of the signal specified in “Edge Source”. 
    I also understand you are interested in using the internal clock from the 6220.  The example I previously suggested uses a DAQmx Timing.vi to configure the duration of the task … for example finite or continuous.  The Timing is set to implicit, since the signal wired into the gate of the counter is in fact controlling the timing.  The source of the counter task for pulse width is the internal timebase when using DAQmx Timing (Implicit). 
    “Create a Counter Input channel to Pulse Width.  It is important to set the Maximum and Minimum Values of your unknown pulse width as accurately as possible so the best internal timebase can be chosen to minimize measurement error.  The default values specify a range that can be measured by the counter using the 20MhzTimebase.” - from the description of the Block Diagram notes on the example.  I also link helpful KnowledgeBase below.
    AE KB 2X6CMDDS: What Does Implicit Mean in the DAQmx Timing VI?
    http://digital.ni.com/public.nsf/allkb/2B6477E3A9B7C07386256D1F0066FBDD?OpenDocument
    Samantha
    National Instruments
    Applications Engineer

  • Non-periodic pulse width measurement

    I came across a post with example code recently that showed how to measuure pulse width of a non-periodic signal using Transition Measurements.vi.  Now I can't find it.  Can anyone help me locate?
    Thanks.

    Hello Joe,
    I did a quick search and didn't find a post that exactly fit your description.  Do you remember anything else about the post?  Any other key words?  Any specific people that posted?
    Michael B.
    Applications Engineer

  • 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

  • [cRIO] Pulse width measurement

    Hello,  I am working with cRIO-9074 with digial I/O module 9403. I was wondering where I could find examples or a list of function relevant to measuring the pulse width of a digital input (with resolution of about 10 usec).
    - Thank you 

    I've implemented something similar using the example given above, however due to hardware limitations I'm unable to use the SCTL, this isn't too much of a problem as I simply use a while loop with a 4-tick loop timer, however when driven with a constant digital signal I get the pulse width measurements 'bouncing' between two values, it's not out by 1 or 2 ticks, it jumps around 1000 ticks, it also 'sticks' when I slowly ramp up the frequency, suddenly jumping to other values
    any suggestions? I'm currently using the FPGA open function and accessing the FPGA in (I believe) scan mode, could this be the culprit? I've not undertaken the RT training course yet so I'd be poking in the dark a little
    this is for a proof of concept demo in a few weeks time!

  • When exactly do pulse width measurements start?

    I am using a PCI-6601 to measure pulse width and period of a PWM signal in LabView (DAQmx).
    I use ctr0 for the period and ctr1 for the pulse width. The period is measured between falling edges. As I am interested in the high pulses, the pulse width measurement is configured to start with a rising edge.
    I do a buffered measurement with continuous samples.
    I use a common start trigger (ArmStart) for both tasks.
    Everything works just fine, but one thing puzzles me:
    My start trigger can occur at any phase of the PWM signal, so I expected the first measurements to be invalid. This is true for the period measurement, but the pulse width is always correct. It doesn't matter in what phase my trigger occurs, the first reading of the pulse width is always correct.
    Can someone tell me why?

    This is speculation, but it's probably just that NI decided to follow slightly different rules for pulse width measurement than for some of the other counter measurements.
    I've done triggered period and semi-period measurements before, but don't know that I've done triggered pulse width or frequency measurements.
    For the two former cases, I know that the counter will start counting time immediately after the trigger edge.  The first measurement represents the time from the trigger to the first active edge period (or semi-period) edge.  It is often meaningless as you anticipated.  For pulse widths, I suppose NI simply decided that the trigger will arm the counter but you also need the pulse's leading edge before you start counting to measure pulse width.  So the first measurement is a true measure of pulse width and is never meaningless.
    If this is true, then it may be tricky to sync / correlate the data in simultaneous measurements.  For your particular app, you could get away with performing a single semi-period measurement and then calculating the periods and pulse widths.  In other apps, it could get more difficult.
    -Kevin P.

  • When downloading iTunes onto a new computer, is there any way to automatically import old music files? Last time I got a new computer I didn't have to use an external drive to update my music library.

    When downloading iTunes onto a new computer, is there any way to automatically important songs from your previous computer? I recently cracked the screen on my computer and cannot access any files. Last time I got a new computer my iTunes media files automatically appeared in my iTunes when I downloaded it, and I did not have to use my external drive. Is this still possible?

    If your backup copy of the old computer was not stolen, then use it to put everything back.

  • Do I have to use an external clock with a cDAQ-9188 and NI 9401 to read a linear encoder? I'm seeing error message that implies that but the example code doesn't show it.

    We can set up a task that works on demand but when we go to continuous sampleing we see Error -200303, which claims an external sample clock source must be specified for this application.  However, some of the NI linear encoder example code doesn't show that (uses the cDAQ 80 Mhz clock) and the documentation didn't mention that. 

    It's mentioned in the 918x user manual:
    Unlike analog input, analog output, digital input, and digital output, the cDAQ chassis counters do not have the ability to divide down a timebase to produce an internal counter sample clock.  For sample clocked operations, an external signal must be provided to supply a clock source.  The source can be any of the following signals:
    AI Sample Clock
    AI Start Trigger
    AI Reference Trigger
    AO Sample Clock
    DI Sample Clock
    DI Start Trigger
    DO Sample Clock
    CTR n Internal Output
    Freq Out
    PFI
    Change Detection Event
    Analog Comparison Event
    Assuming you have at least one available counter (there are 4 on the backplane), I would suggest to configure a continuous counter output task and use its internal output as the sample clock.  Specify the internal counter using an "_" for example "cDAQ1/_ctr0".  The terminal to use for the sample clock source would be for example "/cDAQ1/Ctr0InternalOutput".
    Which example uses the 80 MHz timebase as a sample clock?  It is far too fast for a sample clock on the 9188 according to the throughput benchmarks (80 MHz * 4 byte samples = 320 MB/s).  There is also no direct route between the 80 MHz timebase and the sample clock terminal for the counters--making this route would use a second counter anyway.
    Best Regards,
    John Passiak

  • I have been using an external hard drive on a PC, I have now moved over to a macbookpro, is there a way to reformat the hard drive without deleting the files currently on the hard drive?

    I have been using an external hard drive on a PC, I have now moved over to a macbookpro, is there a way to reformat the hard drive without deleting the files currently on the hard drive?

    if it's fat32 then the mac can read it without problems
    if it's ntfs then you can install programs which make it possible to write to it too otherwise it's read only

  • Pulse width measurement with FieldPoint CTR-502

    I would like to measure the pulse width of a signal (ranging from 10 ms to
    400 ms out of a signal with period width of about 1 second). I would like to
    use a fieldpoint counter module FP-CTR-502. I could find examples on how to
    measure frequency but I did not know how to alter it in order to obtain the
    pulse width.
    Thanks,
    Martien

    To measure pulse width of a fixed-period signal, you only need to use one counter, so the configuration and program would be different than the frequency measurement example. Set the count source for counter 0 to "32kHz Reference" and the gate source (and wire your signal) to "Gate Input 0." You'll also need to create a control channel to reset counter 0 (as described in the frequency example).
    Your LabVIEW program should run as follows:
    - When Gate Input 0 becomes true, do nothing
    - When Gate Input 0 becomes false again, read then reset counter 0
    - repeat
    You can use FP Advise to wait for the gate to change (just like the frequency example).
    Once you have the number of counts, you can divide that by the frequency (32 kHz) to calculate the "on tim
    e" (pulse width) of your signal.
    Regards,
    Michael Shasteen
    Applications Engineering
    National Instruments
    www.ni.com/ask
    1-866-ASK-MY-NI

Maybe you are looking for

  • Finding a Script Name used in System Program

    Hello Friends, Is there any way by which we can find the name of SAP Script used in any perticular System program. If yes please tell me, Thanks in advance..... ...

  • Class object path?

    Hi I have created my own class. Lets say I called it vector I need refference to object this class, but after refering to this object it retuns [object Object] insted of full path I want my class object acting execty as MC class objects. What should

  • EVDRE report

    Hi I am trying to create  reports ( in  BPC )   of all the fixed assets categories  ( of a holding co )  ( like plant , leasedhold etc )  then additions during the year and removal of assets during the year. Opening balance plus additions minus delet

  • How to Introduce Client System in Standard Repositories

    Hi People    I am facing a problem to know how to add my client system in "VendorDemo" repository which is given as standard Repository by SAP MDM 5.5 SP2.   Is this not available in Demo system are is there any other method to add it ? Veera

  • CREATE AN EMPTY FILE ON WINDOWS 2003

    Hi, is it possible to create an empty file with nMb size ? If yes how ? Many thanks.