Duty Cycle measurement

Hello all,
I am attempting to Measure and output duty cycle to a device. I don't have the device in my possession so I have my hardware hooked up to each other. I have NI 9472 output card hooked to a NI 9423 input card. I have found these 2 examples of how to adjust duty cycle and how to read duty cycle. They work great, but the reading of the duty cycle is oppesite of the outputing of the duty cycle. For example if I set my output duty cycle to 60% the reading is 40%. If I set my duty cycle to 30% it reads that it is 70%. I looked thru the block diagram to see if the input was looking for the resting signal to be low or hi. Being a new user it might be right in front of me. Can some one take a peak at them and tell me anything? Thank you.
Attachments:
Modify Duty Cycle while running.vi ‏31 KB
Meas%20Duty%20Cycle%20Cont%20LabVIEW%208.2[1].vi ‏31 KB

Hey greentea2,
You can try taking your waveform data and adding a replica of itself to the end of the data using the Append Waveform VI, so that you have multiple cycles of data to send into the Timing and Transition Measurements Express VI or the Transition Measurements VI for calculating the rise time.  I've attached a picture that shows a simple example of this using a sine wave.
If your data does not complete a full cycle that comes back to a similar starting low point, then this example may not work for you or give you the right value.  If that is the case, then please respond with a picture of what your waveform looks like, so we can determine how to manipulate it.
Hope this helps,
Attachments:
Append Replica Wave Form Data.png ‏28 KB

Similar Messages

  • Duty cycle measurement using RLP

    Hi All,
    I 'm using a PCI-6229 in RTX environment and, I would like to measure a duty cycle.
    Is there any exemple file?
    Your help is welcome
    FV1234

    Hey,
    I would answer this ... 
    Regards
    Richard Keromen
    National Instruments France
    #adMrkt{text-align: center;font-size:11px; font-weight: bold;} #adMrkt a {text-decoration: none;} #adMrkt a:hover{font-size: 9px;} #adMrkt a span{display: none;} #adMrkt a:hover span{display: block;}
    >> Découvrez, en vidéo, les innovations technologiques réalisées en éco-conception

  • Duty Cycle Measuring with a 6211

    I seem to be having a bit of an issue reading a duty cycle from a rotational sensor. The sensor that I am attempting to read from is putting out a 3.5% duty cycle, TTL wave of 0-5, at rest. The sensor can travel to almost 100% duty.
    When I connect a function generator  (set to 3.5% and 0-5 TTL) to my USB 6211, the vi has no issues and will read the generated wave perfectly. When I connect the sensor to the USB 6211 the vi will read it correctly 80% of the time, but then all of a sudden it will throw out values much higher (i.e. 25% or 60%).
    My first instinct was to assume that the sensor had an issue so I hooked it up to an O-scope, but it reads perfectly on the O-scope 100% of the time.
    I have tried many of the example vi's online and in the help section of LV. I have included my VI, hopefully someone can see what I am doing incorrectly.
    Attachments:
    Meas Duty Cycle-Buffered-Finite.vi ‏86 KB

    Hi CETGirl,
    Looking at your code, it would appear that the issue is coming from the output of the DAQmx Read.vi. Since you said there is never an issue with the function generator, but there is with the sensor, I would like to know how these are different. I would suggest putting an indicator on the output of the DAQmx Read and compare the results of using the function generator and using the sensor. 
    Also, what sensor you are using?
    Robert R. | Applications Engineer | National Instruments

  • High accuracy duty cycle with DAQ-STC

    I am trying to measure the duty cycle of a 4 kHz TTL pulse train with high accuracy. I can do this over one cycle but actually need to average over a number of cycles because there is noise. This doesn't seem possible with the stanard VI's? Can anyone help?
    Thanks,
    Gavin

    Gavin,
    There is an example on our website that does buffered duty cycle measurement on DAQ-STC devices that should be helpful for you. From www.ni.com/support you can search under Option 3 through Example Code for +duty +cycle +stc to find it or follow this link: E Series Duty Cycle Example
    Regards,
    Molly K.
    National Instruments
    Applications Engineering
    Molly K.
    Web Support & Operations Manager
    National Instruments

  • How can I measure a 0% or 100% duty cycle signal ?

    I want to measure the duty cycle of an input signal using a counter of a 6030-E board.
    I work with a PXI Rack under Labwindows/CVI.
    My program already works properly for duty cycle between 1% and 99%, but it is not able to detect 0% duty cycle (ie : signal to ground), nor 100% duty cycle (ie : signal to power supply).
    The problem is I don't understand how the counter works in such a situation (it cannot detect any edge, as long as the signal is continuous 0V or continuous 12V).
    Please have a look on the following code :
    1- First, the counter is configured
    // Reset Compteur
    i_Status = GPCTR_Control(iDevice, iCptID, ND_RESET);
    //Definition du type de mesure du compteur (mesure temps impulsion)
    i_Status = GPCTR_Set_Application (iDevice, iCptID, ND_SIMPLE_PULSE_WIDTH_MSR);
    //Definition de la vitesse d'echantillonage (20 Mhz)
    i_Status = GPCTR_Change_Parameter(iDevice, iCptID, ND_SOURCE, ND_INTERNAL_20_MHZ);
    //Definition du signal a mesurer (defaut)
    i_Status = GPCTR_Change_Parameter (iDevice, iCptID, ND_GATE, ND_DEFAULT_PFI_LINE);
    // initialisation du compteur
    i_Status = GPCTR_Change_Parameter(iDevice, iCptID, ND_INITIAL_COUNT, 0);
    // Preparation du compteur avant de l'armer
    i_Status = GPCTR_Control (iDevice, iCptID, ND_PREPARE);
    2- Then, every 10 ms, the value of the counter is read, so that I can calculate the duty cycle...
    i_Status = GPCTR_Watch(iDevice, iCptID, ND_COUNT, ul_val_cpt);
    3- ...and the counter is armed again for the next reading
    i_Status = GPCTR_Control(iDevice, iCptID, ND_ARM);
    When duty cycle changes from x% to 0% or 100%, the counter always keep the value corresponding to x%.
    Even if I reset the counter between each measurement, it keeps this value ! I don't understand how it is possible.
    How can I know that the counter didn't see any edge, and so that duty cycle is 0% or 100% ?
    Thank you in advance for your help !
    FraB

    Hi,
    Just have a look at this link, it can be interesting for you...
    http://forums.ni.com/ni/board/message?board.id=40&message.id=2161&requireLogin=False
    Regards
    DD

  • Problem to measure 0% and 100% duty cycle of a PWM.

    Hi,
    I am using counters of USB-6341 to measure duty cycle of PWM just by following the example 'Meas Duty Cycle-Buffered-Finite.vi'. It works almost all the time. However, when the duty cycle of a input pwm is 0 or 100%, the DAQ can't read anything, in another word, it can't measure 0 or 100% duty cycle.
    How to modify that?
    Thank you very much :-)
    Nan

    That's the thing about PWMs, you never really know if the PWM is 0% or 100%.
    Let's say we have a 50% duty cycle, at 1/2Hz.  So low for 1 second, high for one second right?  What if we run at 1/20Hz, so low for 10 seconds high for 10 seconds.  Or is this a 0% duty cycle for 10 seconds, and a 100% for 10 seconds?
    A true PWM read will never be 0% or 100% it will just keep waiting until the trigger is seen, and recalculate the frequency and duty cycle of it.  The solution to your problem is for you to define a duration to watch for a change, and if one isn't seen, then you can define 0% or 100% appropriatly.
    So I would recommend taking your duty cycle like you normally are, and then at the same time watch the digital signal for however long you want, if the digital line does not change state, then output 0% if it is low and 100% if it is high and ignore what ever duty cycle you read.  But if the digital line does change state, then use the read duty cycle as the actual value.
    Unofficial Forum Rules and Guidelines - Hooovahh - LabVIEW Overlord
    If 10 out of 10 experts in any field say something is bad, you should probably take their opinion seriously.

  • NI 5105 - Measure PWM Waveform Duty Cycle

    Will the Positive Duty Cycle scalar measurement in the NI-SCOPE software calculate duty cycle correctly on a PWM (pulse-width modulated) waveform?  I have a 400Hz signal that is pulse-width modulated with a 40Hz signal that I need to measure the duty cycle for.  Since this is not a normal, continuous waveform (like a sine wave or square wave) I don't know if the NI-SCOPE software will correctly calculate the Duty Cycle.  Has anyone tried this with success?  I am looking at using the NI-5105 because it has 8 channels, but am open to using other hardware and just multiplex my signals to the digitizer.

    The positive duty cycle scalar measurement should correctly calculate duty cycle on your pulse.  By default, the measurement finds the base and top of your waveform using a histogram of the Y values (there will be peaks in the histogram at the base and top values).  Duty cycle is calculated from the 50% level crossings between these two values.  You must have at least one complete cycle and only the first cycle is measured.
    If that doesn't work for you, there are a plethora of parameters you can change (except for which pulse you measure - it is always the first).  For example, you can set the upper, lower, and level crossing values to specific % or voltage levels.  See the documentation and examples for details.
    If you need to measure the duty cycle of multiple pulses in the same pulse train, there is a LabVIEW function (Pulse Measurements.vi) which allows you to do this.  It uses the same algorithms as the internal NI-SCOPE routines.
    In either case, the measurement is independent of the hardware.  Any NI-SCOPE device will work.  If you have any other questions, let us know.
    This account is no longer active. Contact ShadesOfGray for current posts and information.

  • Measuring PWM duty cycle with Analog Input

    Hello folks,
    I have a NI 9205 module and was wondering if there was a way to measure the duty cycle of a PWM signal that I am generating with a separate microcontroller?  I have found a lot of examples with Digital inputs but not analog.. Is this possible?
    Thank you,
    Bob

    Hi Robert,
    I'm not sure what that error is, try searching for it.
    If you want to measure a PWM signal you would usually use a counter input.  A counter is a dedicated piece of hardware that is used to measure digital signals.  Since the NI 9205 is an analogue device and it doesn't have any counters onboard, you will not be able to select counter input.
    I would recommend you get the right tools for the job and buy a digital acquisition device with an onboard counter.  It will make reading PWM much easier for you.  The NI 6008 has a counter onboard and is only £99.  It will also offload processing from software to hardware since you don't have to calculate duty cycle.
    If you still want to use analogue post back and we can look into why its not working for you.  Tips to start you off: Voltage is the correct setting and  Look in the manual and make sure you have connected it like you have configured it (differential, RSE, NRSE page 14)
    Lewis Gear CLD
    Check out my LabVIEW UAV

  • Measuring the changing duty cycle of PWM waveform

    I need to measure the changing duty cycle of PWM waveform.
    conditions:
    1. the period is fixed.
    2. but the duty cycle is changing.
    goal:
    measure the every duty cycle of a period in the waveform.
    Can you please give me a help?
    Thank you in advance.
    the waveform image is attached.

    You need to provide more specific information.
    What is the period? What is the minimum, maximum, and resolution of the PWM signal? What is the time scale in your image?
    How are you measuring or generating the signal you show in the image?
    What should the output look like? An array of duty cycles expressed as percentage? Some kind of plot on a graph?
    How long will this measurement last?
    Lynn

  • How the duty cycle is calculated by Timing and Measurement.vi

    I am using the Timing and Measurement express vi(LabView8.0 is used) to measure the Duty cycle and frequency. I want to know how the same is calculated by the Timing and Measurement express vi. Please reply.

     The Timing and Measurement Express VI uses \vi.lib\measure\mascope.llb\Pulse Measurements N chan.vi to do the Duty Cycle and Frequency measurements. 
    Help says the following about this VI:
    Accepts a periodic waveform or an
    array of periodic waveforms and returns the period,
    pulse duration (pulse width), duty cycle (duty
    factor), and pulse center of a selected pulse and period.
    Refer to the Pulse and Transition Measurements VI in the labview\examples\measure\maxmpl.llb for an example of
    using the Pulse Measurements VI.Maybe NI can explain the algorithm.
    Hope that this helps,
    Bob Young
    Bob Young - Test Engineer - Lapsed Certified LabVIEW Developer
    DISTek Integration, Inc. - NI Alliance Member
    mailto:[email protected]

  • Is it possible to measure duty cycle of 6 pwn simultaneously using pci6624 board?

    Hi
    in my application i need to measure duty cycle of 6 pwm signal simultaneously  .
    Is it possible to measure duty cycle of 6 pwn simultaneously using pci6624 board?

    Here's what I mean...
    However, it only sends one command at a time. You didn't say if your servo controller requires all 4 commands at once. If so, then you can remove the case structures and concatenate all 4 slider values into one string.
    Message Edited by LabViewGuruWannabe on 11-15-2007 01:05 PM
    Attachments:
    SliderEvents-FP.PNG ‏31 KB
    SliderEvents.vi ‏36 KB
    SliderEvents-BD.PNG ‏63 KB

  • Measure high speed duty cycle in labview

    Hello.
    I'm trying to do semi-period measure for high frequency (up to around 200KHz).
    i need to know an exact duty cycle and frequency of the signal.
    all the examples i could find worked fine for low freq. (up to 50KHz) but dont match for high speed.
    for now i'm using the M series 6259 and the new X series 6353 DAQ.
    is there a solution for high speed measure?

    Hi jackedi
    Have you tried the examples in the Example Finder?  You can find the Example Finder at Help >> Find Examples.  When this opens, double click Hardware Input and Output >> DAQmx >>  Counter Measurements >> Meas Semi-Period.  This should measure your semi period.  On the 6353, the counters run at 100 MHz, so you should be able to get good resolution of a 200 kHz signal.
    Regards,
    Jim Schwartz

  • How to decode duty cycle using LabVIEW?

    The duty cycles are output of an accelerometer, which are the input of the DAQcard-DIO-24, but how to decode the duty cycles after acquisition? I knew a timer would be useful, but have no idea about how to perform with labview.
    Thanks a lot.
    --yang
    Message Edited by YangLi on 02-23-2006 05:43 AM
    Message Edited by YangLi on 02-23-2006 05:48 AM

    This will still be a very difficult task without dedicated hardware, and the 1ms resolution will still be relative to other things outside your control. Timed Loops give the tasks they execute a high priority in terms of processor time, but Windows will always be able to preempt LabVIEW in favor of anything it pleases (anti-virus software, automatic updates, screen redraws, etc.). The Timed Loop gives you the ability to dynamically handle what you do in such a situation (discard loop iterations, abort, etc.), but this is not ideal.
    You would really be much better off, as Dennis said, with dedicated hardware. Most NI MIO or DIO boards come with a couple counters, which can measure high times and low times against a high-accuracy clock and calculate the duty cycle. The advantage here is that the hardware is doing all the work with real-time accuracy, so you don't have to worry about software-timing and Windows instability. In addition, the API for this in LabVIEW is much simpler.
    If you choose to try using timed loops, then you will have pair each digital acquistion with a timestamp and for a sort of digital waveform.
    Jarrod S.
    National Instruments

  • Duty cycle on SCXI Modules

    Hi All!
    I was wondering if anyone could tell me if there is an SCXI Module available that allows me to adjust multiple duty cycles. I need to control the duty cycles of multiple signals simulataneously and was hoping to find a module to do this with. It should be a module that fits to an SCXI housing because this is the system that I am currently using for the measurements. A single module containing multiple counters and counter outputs would be ideal.
    I am sure I am not the first to need something like this, so could someone please help me out and tell me how I can solve this?
    Thanks to everyone for the help!
    Regards
    Charel Marais

    Hi Wolfgang,
    Yes I was thinking of PWM for the duty cycle control. I have done this before using counters on the NI cards, but as you mentioned it is only possible to control 2 signals. I now need to do at least four, possibly more. The system I am using now is a 6036 PCMCIA card as acquisition connected to an SCXI 1000 with an 1102, 1126, 1163R and 1124. I have considered using another DAQ card to provide more counters, but this is a very untidy solution when you have two PCMCIA DAQ cards in one notebook each with a cable going into it. The connectors push very hard against eachother and in long term use, this will destroy the connectors on the cables, the cards and the notebook.
    I gather that there is no SCXI module available that provides counters as a normal "slide-in" module (like an 1102 for instance)...? Is there then some other effective way to connect two PCMCIA cards to one notebook?
    Thanks for the advice on the counter cards.
    Regards
    Charel

  • Read duty cycle of a PWM with DAQ

    Hi,
    I am doing a test system and I have several signals that control motors. They use PWM with a max frequency of 5 kHz.
    I would like to know if with a USB DAQ or a PCI DAQ for example PCI-DIO96 could I meassure the duty cycle of these PWM signals. I mean I need to meassure with 10kHz at least.
    Which are the read frequency of these systems?
    Due to the high number of I/O to test I am also thinking of using Compact-RIO with different I/O modules. What do you think?
    Thanks in advance

    If your PWM frequency is 5 kHz and you want to measure duty cycle to 1%, then you need timing resolution of 2 microseconds or faster.
    The USB-6343 has hardware timed DIO at up to 1MHz, so it might be suitable.  There are other devices with hardware timed DIO at rates of 10 MHz or faster as well.
    Before you buy, determine how often you need to measure the duty cycle to make sure the data transfer can keep up.  USB can sometimes be a bottleneck.
    Lynn

Maybe you are looking for

  • Macbook Pro won't recognise Lacie external HD

    The beginning of this week i sold my old 2008 iMac (running Lion) as i wanted to upgrade to a new Macbook Pro. I was using my old iMac with an additional Lacie Rugged 1TB external HDD which was set-up via time-machine and i backed up everything throu

  • Services for Object activation required for VA02 in SAP 4.0B version

    Hello, This is regarding Sales Order Change (VA02) and If I select the  MENU navigation :  SYSTEM -> Services for Object in ECC 6.0 then it is populating one Pop-up stating that "Sales Order XXXXXXX" Here we have the option for "Create Attachment". F

  • Business Catalyst free web hosting

    What level of subscription do you get with the free Business Catalyst Creative Cloud site hosting? For example, is it WebBasics or WebBasics+?

  • No photos on iDVD

    I open my iDVD, I press Multimedia button and then when I click on Photos I can't see any of my iPhoto pictures that I could see before. Thank's for your help

  • How do I disable avatars in iMessage?

    I have an iPhone 6 plus with iOS 8.2 Does anyone know how to remove the avatars in iMessage? Whether its picture imported from google, facebook, or that shadow default, I want them all gone. Thanks in advance!