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

Similar Messages

  • 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

  • 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

  • Interrupt signal with DAQ-STC

    I want to use an interrupt service routine with a PCI6025E using the DAQ-STC.
    On which pin can I input my signal (perhaps on Gate0) and which registers
    must be configured. I'm not interested about how to create an ISR, just the
    register value to generate an IRQ on the PCI-Bus.

    The DAQ-STC Technical Reference Manual (downloadable) may help you. A quick flick through my copy suggests the section you want is 8.4.1.3 Pass-Through Interrupt and it looks like input pins IRQ_IN<0..1> are what you need, assuming your card supports this functionality.
    Jamie Fraser

  • 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

  • Generate and synchronize 6 digital channels with differents phases/frequencies/duty cycles/...

    Hello,
    For some kind of tests we need to generate, with a 6534 card, 6 signals.
    The 6534 has 32 digital E/S and can go up to 20MB/s !
    Each channel must be independant so that it can have it's own frequency and duty cycle. But for exemple the second channel can be delayed in reference at first channel. I put an image so that you can understand better what i try to do (3 signals are shown but six are needed).
    I see a lot of things on forum that are close to my probleme, but none seems to be as advanced as mine.
    http://sine.ni.com/devzone/cda/epd/p/id/4683 -> 6534 doesn't have timers
    http://forums.ni.com/ni/board/message?board.id=40&message.id=5167 -> Just a phase probleme
    http://forums.ni.com/ni/board/message?board.id=170&message.id=261289 -> Another board
    http://forums.ni.com/ni/board/message?board.id=40&message.id=5090 -> Another probleme
    I contacted NI support, they send me an exemple on "patterns" but it generates frequencies that are multiple of one with no phase consideration or duty cycle.
    Any idea ?
    Thanks in advance for your advice and help.
    Eric.
    Message Edité par Eric31 le 08-10-2007 06:52 AM
    Message Edité par Eric31 le 08-10-2007 06:55 AM
    Attachments:
    Sans titre.PNG ‏8 KB

    At best, that's gonna be a pain in the neck with that board.  If you need very precise timing for freqs, duty cycles and offsets, it gets worse.  If they need to change on-the-fly, it'll be near-impossible.
    1. You can only operate 1 hw-timed digital output task at a time.  So all 6 signals must be part of that 1 task.
    2. Thus, you need to define an output buffer representing the states of those 6 bits throughout your entire generation.
    3. There's a bunch of greatest common factor and least common multiple stuff needed to figure out the right output rate and buffer size, assuming you'll want to regenerate repetitively.  You first need the gcf of all the transition times to come up with the right output rate since all the transitions need to occur on some integer multiple of the output period.   You'll then need the lcm of the 6 signals' periods, combined with the output rate, to size up a buffer that can be regenerated.
    4. Forming the output data array may be quite complex.   Personally, I always do my stuff with raw arrays and I know that interleaving all those signals can be quite tricky, especially if there may be an occasional simultaneous transition.   However, I suppose there's a chance that some of the digital waveform functions *might* make this step a bit simpler.  I just haven't played around with that format much.
    Editorial opinion: Buy a 6602.  You can trigger 6 counters to start with different initial phasing, and will be able to change freq & duty cycle on-the-fly for each one independently.
    Editorial opinion #2: For higher channel count apps, I'd also recommend checking out the DIO-64 board put out by Viewpoint Systems, an NI Alliance partner.  It gives you much smarter hardware-timed DIO.  With the NI board, there can be huge amounts of redundant info in the DO buffer.  If you find that your GCF is 10 microsec, but the time between consecutive transitions is 10 millisec, you'll have to stuff 1000 identical values into your output buffer.   With Viewpoint's board, your data acq buffer *only* contains data at the transition times.  Timing is controlled by delivering a separate array defining the timestamps that correspond to those transitions.
    -Kevin P.

  • 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

  • Subcontracting cycle with duty payment

    Hi,
    Configration required for subcontracting cycle with duty payment (CIN) with suitable example giving detailed cycle with sap tcodes & transaction data.
    Sanjay kohli

    Plz follow the following steps for subcontracting
    Configuration: -
    - SPRO > Logistics - General > Tax on Goods Movements > India > Business Transactions > Subcontracting > Subcontracting Attributes
    Here maintain following;
    Excise Group
    Excise TT - 57FC
    Subtran Type Text   -- 57FC CHALLAN
    Subc. Period          -- 180
    1. Creation of Subcontracting PO (ME21N)
    2. Transfer Posting of Components to Subcontractor (Mvmt Type - 541) (MB1B/ME2O/MIGO)
    3. Creation of Subcontracting Challan w.r.t. Transfer Posting Doc (J1IF01)
    4 Goods Receipt w.r.t. Subcontracting PO and Refer Subcontracting Challan at the time of GR (MIGO) {GR with 101 and autoconsumption of components with 543 movement
    5 Reconciliation of Subcontracting Challan (J1IFQ)
    6 Completion of Subcontracting Challan (J1IF13)
    7Generation of Annexure IV (J1IFR)
    And you i need to maintain Accessable value in J1ID
    regards
    anamika

  • Duty cycle two AO signals with a square wave

    Hello,
    I am running two devices with sending two AO signals (sine wave) out simultanously in my code. I need to duty cycle my signals. in other words, I want to turn ON and OFF the devices continously.In order to do that, I am using a square wave generator with 50% duty cycle. The devices should be running when the square wave has positive values and should be OFF when it is negative. 
    The code almost does that, but it does not seem to be as fast as it is supposed to, based on the square wave's frequency. I was wondering if anyone can help me with this problem. In addition, I am not sure if this is the best method to do that, please let me know if there is a better way. I also attached the VI .
    Thanks,
    Pooya
    Solved!
    Go to Solution.
    Attachments:
    2AOsignal_dutycycle.vi ‏47 KB

    I am using NI-PCI 6071E with BNC 2120as an interface. I am not sure if the problem is the hardware limits. Attahced please find the subvis which I used in my main VI. 
    one of the which has a for loop (duty_cycle.vi) works just fine and the other one (duty_cycle(new).vi), which is the one I am using in my VI, does not. Any thoughts?
    Attachments:
    duty_cycle (New).vi ‏23 KB
    duty_cycle.vi ‏25 KB

  • Generating square wave with variable duty cycle

    We like to generate a square wave with variable duty cycle using LabView 6.1 and SCB-68 and this duty cycle comes from some PID controller programmed by LabView by reading a voltage and feeding back this square wave

    the story begins with some one called separately excited DC motor
    this thing sometimes changes its speed
    so we are trying to keep a constant speed
    irrespective of the load no matter how it changes
    this comes by reading the voltage out from
    the tackometer which represents the speed as voltage
    then comparing this with a reference set by the labview program
    the labview program will send a control signal to some chopper circuit
    which is connected to the field of the motor which controls the speed
    we are tending to make the labview program as pid controller
    that will generate our beatiful square wave with some duty cycle
    which will vary to increase or decrease the voltage across the field
    we tried "Real-Time PID Control.vi" example and other examples
    and we are discussing different solutions for this duty cycle thing
    but till now no output
    this is our whole story with this DC motor thing

  • I am working with the NI PCI-5411 AWG in arbitrary mode. How change the duty cycle of the square wave output located at the Sync connector by software?

    We use Labview 7.0 and NI fgen 2.1 in order to drive the pci card.Can you send me a VI example?

    Hi LtDel,
    To achieve this you will need to insert an niFgen property node from the niFgen functions palette into your code flow somewhere in amongst the configuration vi steps. Wire up the reference and error inputs and outputs. Left click on the "property" and select >>output attributes>>sync duty cycle high. Right click and set to "write" then wire in a control or constant defining the % duty cycle for the high phase.
    Hope this helps,
    Nick

  • Sine, Square & Sawtooth sweep generation with variable duty cycle/rise time & fall time

    Dear All !
    I request and need some candid advices on the subject issue keeping in view the following notes:
    1) I am a novice in LabView.
    2) I was an average Electronics Engineering graduate who graduated about 9 years ago and since then I have not been involved in Electronics Engineering.
    I have undertaken a task or generation of Sine, Square and Saw Tooth wave forms. All these waveforms are to be frequency swept form 1 Hz to 100 kHz. The amplitude of all these waveforms should be able to be adjusted. The duty cycle of Square Wave should also be adjustable (or better be able to be swept). Likewise the rise time and fall time of sawtooth wave should also be adjustable (or better be able to be swept).
    I am considering  other options as well but wanna try it on LabView.
    I wish to ask that is it possible to execute this task in Labview 7.0? If possible then considering the para 1 & 2 above, is it possible for me to finish this task in 15-20 days if I work on this for about 3 hours a day? If not then what can be reasonable estimate?
    I will be extremely grateful if you people can offer advice on whole project or part(s) of it.
    Thanking you in advance and requesting urgent response(s).
    Solved!
    Go to Solution.

    Check this thread.
    I did some similar coding, it might be usefull to you.
    http://forums.ni.com/ni/board/message?board.id=170​&thread.id=493477&view=by_date_ascending&page=1
    I am using ver 9.0 though.
    If you work 3hr /day for 2 weeks you might as well finish book basics 1& 2 and than can do whan you need in a breeze, couple of hours.
    Good luck

  • 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

  • Calculate Square wave Duty Cycle

    Hello everyone,
    I'm acquiring (with USB-6212) a square wave, "100Hz" with variable duty cycle - which can be 20%, 50% or 80% - for matters of decodification; the acquisition frequency is set to 4k. Actually, I said the frequency is 100Hz, because I get a rising edge every 10ms, but the length of the high level is defined by the communication protocol and that is what I called duty cycle (even though this does not match the exact definition of this property)
    Since I need to decode the information contained by the wave, it's necessary for me to be able to tell what the duty cycle is. I've acomplished this so far by taking the derivative of the signal, then calculating peaks and valleys index in the waveform and finally subtracting them, as shown below.
    It works ok almost the whole opeartion, however, the acquisition is not 100% exact. Sometimes I get the signal in the picture A, that is ideal for what I intended.
    Other times, the signal is like B and the derivative amplitude does not cross my threshold, even though there is a rising edge there. I could lower my threshold to 2, for instance, but then I'd get vulnerable to the signal in picture C, which would accuse 2 peaks, instead of just one.
    Anyone have an idea on how to work around this or any other method more reliable than taking the derivative of the signal?
    Solved!
    Go to Solution.

    Well, we can only answer question based on the information supplied!  The LabVIEW Mind Reading Toolkit is still in development.
    Your application is one where parallel loops may be valuable.  In the acquisition loop you read data from the data acquistion device at a rate which optimizes the DAQ perfomance (the >= 2k points you mentioned).  The data is transferred to an analysis loop via a queue. In the anaylsis loop you can put the data into a shift register.  When more data is available from the Acquisition loop, dequeue it and append it to the data in the shift register.  The Duty Cycle section will find two consecutive rising edges and the falling edge between them ( the 10 ms segment).  It calculates the duty cycle for that segment. Then it uses the second of the rising edges as the first rising edge for the next segment.  Repeat until duty cycles have been determined for all segments.
    There are a lot of details which can be imprortant in a process like this. Many of them are dependent on other things you have not specified.  What will be done with the duty cycle values? Is the raw data to be displayed? Saved to file? Discarded after the duty cycle is measured?  How long will the process continue?  How much data can accumulate?
    Lynn

  • Frquency & Duty cycle Value changes- every time

    Hello all
     im using pcie 6320 to measure the frequency and the duty cycle of a signal.i have attached my vi & the data measured for reference.The values highlighted in red ,is my actual frequency and duty cycle but values changes for every 1 sec.Please correct me if i have any mistake.
    Solved!
    Go to Solution.
    Attachments:
    measure frquency-duty.vi ‏54 KB
    HZ-DUTY.JPG ‏37 KB

    You'll need to enable digital filtering--insert the following property node into your code (call the property node before starting the task):
    Try a "Min Pulse Width" of a few us and increase it if you still are picking up incorrect readings.
    The errant numbers are coming from false edges being picked up during transitions, enabling digital filtering will cause the DAQ device to ignore any transitions with a pulse width of less than the set value.  Your 475 Hz 72% duty cycle signal should have a high time of about 1.52 ms and a low time of about .59 ms):
    656 Hz = ~1/(high time)
    1718 Hz = ~1/(low time)
    MHz values = multiple edges picked up during a single transition.
    Best Regards,
    John Passiak

Maybe you are looking for

  • Extremely long "reading" times in media browser

    We are running CC2014 on 3 edit systems with a shared 10Gbit 36TB Synology NAS.  Each workstation has approximately 12TB of local raid storage as well. We shoot P2 primarily and I have a little over 17TB archived on the Synology.  Lately, we have had

  • How do I get HDMI connection to television to work with Pavilion x2 Windows 8.1

    I tried to get my tablet/laptop to display on my televison by connecting them with a HDMI lead. I adjusted the TV to HDMI input but nothing showed on it. Can anyone advise. Thank you. Brian

  • Display as Text page items - How to change color based on Value

    Hi, I have a bunch of page items that I would like to display in red if they contain a minus "-" sign. My guess is that this can be done with a template. Right now they are using the Optional Label with Help template. How might I elegantly specify to

  • Just few photos in photo stream on iPhone

    Hi, I've reinstalled my iPhone. But after enabling photo stream, it shows only 51 pictures. My ipad shows about 200 photos. Why it didn't sync all of them to the iphone too?

  • Spotlight stuck on Indexing

    I have about 400 Gigs of files on my hard drive and everything was perfectly indexed in Spotlight. I used Entourage Time Machine to save my huge email database to a set of local XML files (tens of thousands of new files). Since then, the little spotl