How do I measure pulse width in VeriStand 2010?

I'm using an NI PXI-6229 M Series DAQ.
I the channel set up in System Explorer and I have my input signal routed to the Gate of Counter 0.  When I deploy and open the Workspace the measurement says 0 seconds although an oscilloscope shows a 7ms square wave at the terminal.
I think the problem may be that I don't have a timebase applied to the Source of Counter 0.  How do I put an internal timebase on the Source?  I would prefer to do so without changing any VIs and I definitely don't want to add an external frequency generator to my setup.

I think that the gate terminal cannot be used in that case. You might want to try to connect the external signal to the input terminal of the counter.
Once you have rewired the external connection you will notice, that NI VeriStand might not update the frequency that often. NI VeriStand doesn't measure the frequency/period by using a frequency task. We have used a simple edge counting task that takes the upper and lower limit of the frequency to determine the update rate of the frequency value. The more accuarate the settings are, the higher is the update rate. In order to get a feasible update rate, increment the lower limit to a value that will never be below the real minimum frequency of the external signal and set the upper value to the maximum expected frequency.
Thanks,
Tom
http://www.newgistics.com

Similar Messages

  • Measure pulse width of signals generated by DAQ

    Eventually, I would like to:
        Start a counter pulse width measurement and analog out at the same instant.
        Stop the pulse width measurement with an external digital signal.
    My current plan is to use a digital out on the DAQ to go to a digital input and the counter start input.  The digital input will be a start trigger for the analog output.  This works, except for the counter.
    While trying to implement this, I tried a simpler test of just generating a digital pulse with the DAQ and wiring that to the counter inputs.  That doesn't work, even though it looks fine on an oscilloscope.  Then, without changing the software at all, I connect a function generator to my  counter inputs, and it measures pulse widths flawlessly.
    I'm actually implementing this with a Python wrapper around the DAQmx C API, but I recreated it in LabVIEW, and it behaves the same.  VI attached.  I have the latest DAQmx drivers.
    Attachments:
    meas_pulse_width_simple.vi ‏32 KB
    screenshot.png ‏99 KB

    ColeTrain wrote:
    apaulsen,
    Just a
    friendly heads up, but this is more of a DAQ post and you will
    generally get more replies to these types of questions by posting in
    the proper forum.
    That being said, try taking a look at
    the Example Finder and look under the DAQmx examples at
    synchronization/multifunction as this would be a good place to start
    working on what you're trying to wind up doing down the road. 
    I am actually the OP.  apaulson is my coworker, and he was logged in to the forums on the workstation from which I posted.
    I
    realized that it ended up in the LabVIEW forum, so I reposted on the
    DAQ forum:
    http://forums.ni.com/ni/board/message?board.id=40&thread.id=7185. 
    I understand why there is a search-to-post policy, but it's rather
    unintuitive and clunky, and I got confused.  IMHO, ubuntuforums.com
    does this the right way and automatically searches before you submit
    your post.
     Anyway, I figured it out.  See the other post for solution.

  • I am having data i want to measure pulse width without using hardware and tell me how to start and stop soft timer using labview

    soft pulse width measurement

    If you are creating a pulse in software somehow, then you can use Pulse Measurements.vi that's on the Analyze>Waveform Measurements palette. This will require that the input is of the waveform data type with signal and timing information. There's several timing functions on the time & Dialog palette that you could probably use. Check out Tick Count and Elapsed Time. If you could provide more details on what exactly you need to do, we could provide more help.

  • Measure pulse width with 4 counter simultaneously

    Hello,
    I am using NI PCI-6601 measure the pulse width with 4 counter simultaneously, due to only a DMA channel on this card so I selected interrupt data transfer mode to read data from PCI bus for 4 counters, but it working only for few seconds then a error message prompted:
    Error -200141 occurred at DAQmx Read (Counter 1D DBL 1Chan NSamp).vi
    Measurements: Data was overwritten before it could be read by the system.......(See attached picture: TestUI and Error MSG.bmp)
    I know the problem caused due to system is unable to read back data from PCI6601's memory as fast as they card countered. My quesition is:
    1. The timebase is 20Mhz(Sample rate), how to change the sample rate slower (like 100Khz) ?
    2. Any good solutions can meet my requrement?
    Attached is my source code, Test.vi is the main VI.
    Thanks for your help.
    Steven
    Attachments:
    Test.zip ‏557 KB

    What's more, you could include four channels in one task, so you don't need to build four task!
    Attachments:
    4 counters in one task.png ‏719 KB

  • Measure Pulse Width and Period Statistics

    Hello,
    I'm trying to solve what should be a very simple problem. I would like to measure common characteristics of a binary analog voltage input, pulse width and period. The canned pulse width/duty cycle/period VIs and express VIs use a histogram or peak to peak method on a set buffer size of data and produce one output. I would like to measure these signal characteristics over a long period of time and collect statistics on pulse width and period data (max, min, median, mean, standard deviation, etc.) to indirectly measure the eccentricity of a system. Although I am relatively inexperienced in LabView scraping off a considerable bit of rust, I did not think this task would present a challenge, but I have been stumbling around for a couple of days trying to create an array of output parameters such as pulse width so that I may calculate the statistics on all measurements.
    If anyone can step me through some of the thought process to a solution or show me how to format data collection so that this can be done, I would very much appreciate the help.
    Thanks,
    Evan
    Attachments:
    Example.jpg ‏194 KB

    Hi Gena,
    I am assuming you are using the DAQmx drivers in LabVIEW for your
    PCI-6014.  Avoiding a While loop may be difficult if you need to
    perform this measurement many times and you might not know when the
    signal is going to begin.  Without a While loop, you'll have to
    set up your timeout period long enough so the pulses will begin before
    your VI stops.
    With this in mind, you may want to look at some of the shipping
    examples with the DAQmx driver.  You can find these in LabVIEW's
    Help menu by going to Find Examples.  For measuring the pulse
    width, browse the folders in the Example finder by going to Hardware
    Input and Output>>DAQmx>>Counter Measurements>>Period
    or Pulse Width.  In this folder, there is the Meas Pulse Width.vi,
    which measures the pulse width once and stops.  You should be able
    to take the pulse width measurement you get from here and check to see
    if it's in your range, then output a pulse on the other counter if it
    is in the range.  The pulse output examples can be found in
    Hardware Input and Output>>DAQmx>>Generating Digital
    Pulses>>Gen Dig Pulse.vi.
    Thaison V
    Applications Engineer
    National Instruments

  • Can counter measure pulse width difference between two signals

    I am interested in determining the high pulse width time that two signals have when they are in various phases between eachother.

    Why don't you try one of the pulse width examples. I don't know what ADE you are using, but you can search for examples (http://www.ni.com/devzone/dev_exchange/ex_search.htm) with the key words "+pulse +width" and find several examples in different languages. This will measure the pulse width of one signal, but you can program most of the counters to do multiple tasks at the same time. Just copy the code twice and change the counter number to program counter 2 as well. If you want the ORed pulse width time, I would recommend adding a OR gate to your circuit and then feeding that into a counter.
    I hope this helps.
    Joshua

  • Looking for VI to measure pulse-width on a waveform

    does anyone know of a VI to measure the pulse width of a pulse trace in a waveform?

    The examples to look for would be located under the DAQ >> Counters examples, and you would probably be looking for anything using the DAQ-STC chip (which is the counter chip on our E-Series board). Advanced examples that are in addition to the shipping examples can be found by searching the website as well.
    Jim Cahow
    Applications Engineer
    National Instruments

  • Measure pulse width and generate pulse depends on the width

    Hi,
    i have a serias of pulses ... 600 micro,30 micro,30 micro (around 10 times) ........ nothing for 1 mili second ..
    so i need to generate a pulse after the first pulse arrives ... (its width around 600microSecond)
    1. use the first counter to measure the pulses ...
    2. if arrived pulse ... 500microSecond<the pulse width<700microSeconds .... then generate pulse with second timer ....
    the problem is that i dont want to use the while loop inside the labview ...
    can i programm the counters to make the width calculation and if the width is bigger to generate trigger to the second counter .... ?
    the hardware is 6014 sample card ....
    thanks
    gena
    (see attached)
    Attachments:
    F0087TEK.JPG ‏27 KB

    Hi Gena,
    I am assuming you are using the DAQmx drivers in LabVIEW for your
    PCI-6014.  Avoiding a While loop may be difficult if you need to
    perform this measurement many times and you might not know when the
    signal is going to begin.  Without a While loop, you'll have to
    set up your timeout period long enough so the pulses will begin before
    your VI stops.
    With this in mind, you may want to look at some of the shipping
    examples with the DAQmx driver.  You can find these in LabVIEW's
    Help menu by going to Find Examples.  For measuring the pulse
    width, browse the folders in the Example finder by going to Hardware
    Input and Output>>DAQmx>>Counter Measurements>>Period
    or Pulse Width.  In this folder, there is the Meas Pulse Width.vi,
    which measures the pulse width once and stops.  You should be able
    to take the pulse width measurement you get from here and check to see
    if it's in your range, then output a pulse on the other counter if it
    is in the range.  The pulse output examples can be found in
    Hardware Input and Output>>DAQmx>>Generating Digital
    Pulses>>Gen Dig Pulse.vi.
    Thaison V
    Applications Engineer
    National Instruments

  • Measure pulse width cont - failure in example? NI-DAQmx

    Hello!
    I tried the "PulseWidth-Buff-SampClk-Cont.c"-Example. I got the following error:
    DAQmx Error: Invalid timing type for this channel.
    Property: DAQmx_SampTimingType
    You Have Requested: DAQmx_Val_SampClk
    You Can Select: DAQmx_Val_Implicit, DAQmx_Val_OnDemand
    Task Name: _unnamedTask<0>
    Status Code: -200300
    Here is the Example-Code:
    #include <stdio.h>
    #include <NIDAQmx.h>
    #define DAQmxErrChk(functionCall) if( DAQmxFailed(error=(functionCall)) ) goto Error; else
    int main(void)
        int         error=0;
        TaskHandle  taskHandle=0;
        int32       read;
        float64     data[1000];
        char        errBuff[2048]={'\0'};
        // DAQmx Configure Code
        DAQmxErrChk (DAQmxCreateTask("",&taskHandle));
        DAQmxErrChk (DAQmxCreateCIPulseWidthChan(taskHandle,"Dev1/ctr0","",0.000000100,0.838860750,DAQmx_Val_Seconds,DAQmx_Val_Rising,""));
        DAQmxErrChk (DAQmxCfgSampClkTiming(taskHandle,"/Dev1/PFI0",1000.0,DAQmx_Val_Rising,DAQmx_Val_ContSamps,1000));
        //DAQmxErrChk (DAQmxCfgSampClkTiming(taskHandle,"/dev1/PFI13",1.0,DAQmx_Val_Rising,DAQmx_Val_ContSamps,1000));
        //DAQmxErrChk (DAQmxCfgImplicitTiming(taskHandle,DAQmx_Val_ContSamps,1000));
        // DAQmx Start Code
        DAQmxErrChk (DAQmxStartTask(taskHandle));
        printf("Continuously reading. Press Ctrl+C to interrupt\n");
        while( 1 ) {
            // DAQmx Read Code
            DAQmxErrChk (DAQmxReadCounterF64(taskHandle,1000,20.0,data,1000,&read,0));
            printf("Acquired %d samples\n",read);
            fflush(stdout);
    Error:
        if( DAQmxFailed(error) )
            DAQmxGetExtendedErrorInfo(errBuff,2048);
        if( taskHandle!=0 ) {
            // DAQmx Stop Code
            DAQmxStopTask(taskHandle);
            DAQmxClearTask(taskHandle);
        if( DAQmxFailed(error) )
            printf("DAQmx Error: %s\n",errBuff);
        printf("End of program, press Enter key to quit\n");
        getchar();
        return 0;
    What could i do?
    Thanks
    Andreas

    The help says this:
    Sets only the number of samples to acquire or generate without specifying timing. Typically, you should use this function when the task does not require sample timing, such as tasks that use counters for buffered frequency measurement, buffered period measurement, or pulse train generation.
    So this line is only needed for specific applications. The counter has no sampleclock, like the analog input or the analog output, so you can not use this, but have to use implicit timing instead.
    Hope this helps!
    André

  • 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

  • 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

  • PCI-6602, How to convert Pulse Width to RPM and stop updating datalogging at 30 RPM

    Hi all,
    My objective is to stop updating data logging pulse width measurements at 30 RPM so I can record the time lenght it takes the RPMs to stop from 6000 to 30 RPM. When I turn off the tool. I have an encoder attached to an output shat of a 6000 RPM circular saw. I have created 3 program methods, but I was not able to stop at 30 RPM. The last pulse width value the data log updates is around 200 RPM. I don't know if I'm using the right method to read RPMs? 
    System:
    1)     NI-PCI 6602 Counter/Timer Card
    2)     SBC-60 Connector Block
    3)     TRD-S1000-VD Encoder. 1000 PPR
    4)     LabVIEW 8.5.1
    5)     PC Dell Precision T3400 (32-bit), Intel Core Quad 2.4GHz, Memory 2GB. Windows XP prof.
    In method 1: I reading pulse width and converted to RPM with this formula. RPM = 60/(1000 PPR/ Pulse Width).
    In method 2: I just measuring pulse width and try to stop while loop when pulse width value is greater than 0.002 mSec. by using this formula 60sec/30rpm = 2 sec/rev, 1 Rev = 1000 counts. Therefore,     2 Sec / 1000 Counts = 2 mSec/Cnt (0.002)
    In method 3: I measuring pulse width using this formula,                                                                   Pulse Width (in Sec) = Count/Counter Timebase Rate (20MHz), One period is 1000 cnts X 0.002mSec = 2. Therefore, Pulse Width = 2 / 20MGz = 0.000000100  
    All three methods stop recording pulses around 200 rpm. I wonder if the formulas I utilizing, are not using them properly. Or there is floating point number conversion???? Please See attached Picture.
      Any help is greatly appreciated. THANKS!!!
    Carlos G.

    Charles_DeJesus,
    Could you check the output waveform of the encoder? Do you see spikes? Sometimes spikes might produce wrong counts. 
    CarmenC

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

  • Sum low pulse width over fixed time period

    Hello,
    I'm using a NI cDAQ-9178 with the NI 9411 DI module.  I'm looking to read a (not very clean) ~100kHz square wave
    signal and sum the low pulse width (1-3us each) over a 5ms period.  The falling transition is relatively clean, but
    the rising transition is a bit slow (0.5-1us).
    Any advice on how to code this?  I've looked at the counter examples for measuring pulse width and semi-periods,
    but the values I get with those examples do not match what I measure with an oscilloscope.
    Thanks,
    Anna Liao

    Hi Anna
    It does not sound like you are receiving any errors, but maybe the suggestion provided in the document I Get Error -10920 When Counting Square Waves without an Adequate Rise Time can help in your application. It sounds like it could explain why your values do not appear correct.
    Milan

  • Measuring puls width and time of 5 signals

    Hello,
    I have 5 signal lines that generate different pulses in time. I need to measure the pulse width on every line but also the exact time when the pulse occurs on each line.
    I have a PCI-6602 that I can use for this.
    Measuring the pulse width is not that difficult. I wanted to use a buffered pulse width measurement using 5 of the counters of my PCI-6602.
    But I do not know how I can also get the exact time for these 5 channels ???
    Any ideas how I can accomplish this with my PCI-6602?
    Note: I do not need to use the maximum source frequency for my counters. Measuring the pulses with a timebase of 1Mhz is enough. (maybe even 100 kHz but I need to do some more experiments to be sure).
    Thanks in advance for all your help!

    Only have time to outline some suggestions:
    1. Choose 1 of your counters to generate your timebase to make it easy to experiment with timebases like 1 MHz that aren't directly available on the board.  The other measurement counters should be configured to use it as their Timebase.Source signal (can be found in the DAQmx Timing property node.)
    2. I assume you want the 5 measurements to start at the same time=0 point, right?  You should configure all 5 to use the same signal as a digital "Arm Start" trigger.  In LabVIEW, this can be found in the drop-down menu for the DAQmx Trigger property node.   I would typically use PFI0 as the trigger signal because this maps to the same pin that I can control via software as digital port0/line0.  Thus, no screwdriver work for wiring a signal.
    3. If you're buffering 5 measurements, you'll need to configure at least 2 of the tasks to operate in interrupt mode because the board only supports 3 DMA channels.  This is yet another DAQmx property node setting.
    4. There, now that the prelims are out of the way, here's how to get both pulse widths and pulse start times.  It's gonna take a bit of work in software though.
       Configure the counters for semi-period measurement.  This will cause the tasks to buffer up arrays with alternating values representing high times and low times of the incoming signals.  You should be careful and always read even #'s of samples from the buffer, never odd #'s.  You'll also need to configure so that you can predict which comes first -- high or low time.
      The high times will be your pulse widths, and the cumulative historical sum of *all* the semi-periods up until that high time will be your timestamp.
    5.  Further description for handling 1 such task.  Create a while loop for reading values from the task.  Initialize a shift register to a count of 0 to hold your historical cumulative time.  (Note: depending on your duration and resolution, you may need to make this a double rather than an integer.)   Inside the loop, read an even # of samples from the task, say, 1000.   Pass the 1D array into the Reshape Array function to make it 500 rows x 2 columns.   Pass that 2D array into a For loop using auto-indexing.  Also pass in the value from your outer loop's left-side shift register into an inner loop shift register.  The inner loop will index out 1 row at a time.  The pulse width will be either index 0 or index 1, depending on your config settings.  Index it out and pass it out to the inner loop boundary with auto-indexing.  If your pulse width is index 0, the left-side shift register represents the timestamp for the beginning of that pulse.  Pass it out to the inner loop with auto-indexing as well.  (If pulse width is index 1, you may first want to add the duration of index 0 to the cumulative time.)  Finally, add the sum of indices 0 and 1 to the left-side shift register and pass it out to the right-side shift register.  Pass this shift register out to the outer loop shift register.  Pass the 2 arrays of data (pulse widths and timestamps) out to your main app via queue or something.
    That's all the time I've got right now.  I realize the info is packed kinda dense, but if you do some further searching on the terms I've brought up, you can hopefully figure out a good share of it.  Once you've got it pretty close, post back and I can try to suggest some tweaks.
    -Kevin P. 

Maybe you are looking for

  • Remote system Producing Errors "In sufficient Privileges" while running scr

    Hi I have Machine with Oracle 10g 64bit(software only) on windows 2003 server and that machine located at Remotely(UK) In fact i d'not know who installed the Oracle on that machine, To access that mechine they given user/password to me Now I have to

  • Powerbook g4 17" wont start up

    Hey there. I was having problems with my internal super drive, so I just put in a new one, but now the laptop won't startup. I hit the power button and nothing happens. I purchased the superdrive from ifixit.com, and followed their instuctions to the

  • Error while executing dbms_resource_manager_privs

    Hi, The user SCE has been granted execute on DBMS_RESOURCE_MANAGER and DBMS_RESOURCE_MANGER_PRIVS. However, I get the following error while using it. SQL> SELECT USER FROM DUAL; USER SCE SQL> select GRANTEE,PRIVILEGE,TABLE_NAME from dba_tab_privs whe

  • Multiple files picked and to zipped at target file system

    Hi In my scenario multiple files to be picked from FTP server by using Sender File Adapter then it has to be Zipped at the receiver file system. Please help me in this scenario. Sri

  • How do I open music after moving files from 1 drive to another?

    I ran out of disk space on my C drive. The computer is partitioned w/ C & D drives. I moved all itunes folders to the D drive and cannot open the music. I went to advanced and redirected to the D drive and appropriate file without any luck. Signed Tu