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]

Similar Messages

  • 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

  • Is there a way to reverse the active/inactive portions of the duty cycle?

    I'm trying to sync the start times for an AI operation and a buffered encoder read. These two operations happen at different sampling rates and different sampling intervals, so I can't just port the AI scanclock over to the gates of the encoder counters.
    My approach is to use three counters: one to generate a triggered pulse that has a width equal to the total sampling time (the trigger for this pulse comes from the AI start). The OUT from this counter then feeds the GATE for a counter that generates a pulse train while the GATE is high. Therefore, it generates a finite pulse train for the desired acquistion time. The out from this second counter goes to the GATEs of the encoder counters to
    generate the DMA transfers.
    The problem is that the pulse train always puts the active portion of the duty cycle at the end of the period, so the DMA transfer happens at a delay of T/2 relative to the start of the AI acquisition.
    Is there a way to put the active portion of the duty cycle at the start of the period? i.e., when the gate goes high, I want the pulse train to start high then go low at the end of the duty cycle.
    Thanks,
    rgames

    The simplest seeming answer would often be to use 'Set Attribute.vi' to change the counter's output polarity. Then the counter will be at a high state during the delay and low during the pulse. However, that would also put it in the high state while armed and waiting for the trigger, and again after the pulse completes. It doesn't seem like that would work for you.
    A near-miss idea would be to leave the polarity alone and simply specify the shortest possible delay. Use the internal max timebase as a source and set "Pulse Spec 1" == 2. On a 660x device, that'll only delay you by 25 nsec.
    In fact, you may be able to change that near-miss into a perfect hit. The short delay may or may not change the timing of the DMA transfers relative to the trigger, depending on exactly how the "generate pulse train while gate is high" function is implemented. Here are some ways I can imagine:
    A. The "pulse while gate is high" counter is always cycling internally. An output signal is always being generated on the TIO chip and is always being AND'ed with the state of the Gate signal coming in. The result of the AND is sent to the actual IO pin.
    B. Similar to (A), but the AND'ing is done only when there's a state transition and the result is latched until the next state transition.
    C. Internally, the pulse train counter always *wants* to run, but its Source is always being AND'ed with the Gate signal. Then, as far as the pulse train counter is concerned, time is frozen when the Gate is in the inactive state. This is how I *think* I remember it working.
    In cases (A) and (B), the timing of the DMA transfers wouldn't be affected except for the rare case where the trigger event occurred within 25 nsec of a "scheduled" transfer. In case (C), you can compensate by changing the duty cycle of the "pulse while Gate is high" counter. Simply subtract 2 from "Pulse Spec 1" and add 2 to "Pulse Spec 2". Then (assuming its polarity is low state delay, high state pulse) make sure the encoder counter Gate is set to do DMA transfers on the low-->high transition.
    Final note: if timing synchronization between analog and encoder is really important, there may be a better way. As I recall, the AI start signal does not have deterministic timing relative to the actual A/D conversions. You might instead have two counters of the 660x set to "pulse while Gate is high" and set up the other one to be the AI scan clock. Then you'd be more fully in control of their time==0 marks.

  • I want to store the data form the PWM and the value of the changing duty cycle into a file simultaneously and continually

    i want to store the data form the PWM and the value of the changing duty cycle into a file simultaneously and continually but having problem.Please can anyone help out.
    Attachments:
    data.vi ‏60 KB

    Hello,
    Have you looked at the "Write Binary File.vi" and "Read Binary File.vi" examples?
    They give you a good clue as how to write and read arrays to and from binary files.
    For your data it means that you could put the two data items to write in an array and write the array to file, for the read its important to in what sequence the number were written to file.
    Kind regards,
    André
    Regards,
    André
    Using whatever version of LV the customer requires. (LV5.1-LV2012) (www.carya.nl)

  • TO change the Duty Cycle(DAQmxSetCOPulseDutyCyc)

    I have an application that uses Pulse Width Modulation (PWM) to control the speed of a motor. Thus, it requires that I change the duty cycle of my square wave. My continuous pulse is being generated on the output of my counter. When I use the function "DAQmxSetCOPulseDutyCyc" to update the duty cycle when the task is run, the changes aren't reflected. What is the problem? thanks in advances!
    cinzia

    Masa-
    Kevin is correct. Unfortunately, there is little we can do to change this behavior in DAQmx. There are only two options:
    1) change which property updates the pulse train value, which would leave you with the same issue you are currently having if you have a situation where the frequency needs to change but not the duty cycle, or
    2) add a third property that would be a "switch" command. This option would add more work for users, as a third property would have to be called.
    One other thing you might trying using instead of the properties (assuming you are using DAQmx 7.2 or later) is the DAQmxWriteCtrFreqScalar() method. This write method added in DAQmx 7.2 allows you to update the frequency on-the-fly without having to use the properties.
    I
    hope this helps!
    gus....

  • How the replication latency is calculated?

    Hi All
    Currently we have some 3-peer replication setup(SQL 2012). Everything works fine, all tracers can be inserted and we have a total latency of less than 10 seconds. However, once in a while we can see Performance Critical in the replication monitor (up to
    10 minutes latency). When we view the details we can't see any pending commands. This will fix itself randomly after some time (usually 30 mint or 2 hours). During all of this time everything just worked fine. 
    I am curious as to how the latency is calculated. Has anyone seen the same behavior and if it is save to ignore this.
    Cheers

    Hello,
    Can you look at the sys.dm_exec_requests DMV when this latency issue occurs? Look at those records returned by the DMV
    that are related to replication like records with the wait type (wait_type field) REPL_SCHEMA_ACCESS. Examine the wait_duration_ms field and check if the wait times shown on this column correlate what you see in the replication monitor.
    Having more than one reader agent can increase latency.
    Hope this helps.
    Regards,
    Alberto Morillo
    SQLCoffee.com

  • What is the use of Alternative Calculation Type =2 and 4

    Dear Friends
    In pricing procedure in gross value, Net value for Item and Net value has Alternative calucation type is 2.
    What is the use of it?
    Without using it these value line are also fetching net value then what is the work of it. Please give me detail information with its effects in pricing condition tab page in sales document.
    Thanking You
    Arun

    Arun biswal,
    Correct Biswal. We have at varoius stages within Pricing procedure the "net value" which is calculated. Not only the alternative calculation type "2" is used if you notice carefully they are stored as subtotals at various levels.
    For Ex Gross Value  --> Subtotal =1 --> Calc type = 2
    similarly for Net value for Item --> Subtotal =2 --> Calc type = 2
    Net value 2 --> Subtotal =3 --> Calc type = 2
    See, these are used to calculate the net value at various levels in pricing. The calculation Type has got a set of routines that will facilitate us in pricing. SAP has provided certain clauclated formulas or routines to facilitate us during calculation within pricing . Here the "2" is used for calculation without tax and store it as subtotal and display it or use it for further calculations.
    We can use this "netvalue" amount for further calculations. It is used for clarity purpose when you issue a statement to customer. (like Confirmation order) at various levels like discount amt involved, Freight involved, Rebate amount invloved.....
    Even without this Calc type or using sub total u can proceed....
    Finally we have  TOTAL  --> Subtotal =A --> Calc type = 4
    In the above line we have Calc type as 4, which means when you use TAX this calc type is used .
    Routines are used to facilitate your process....
    Regards
    Sathya

  • How the heck do I change my temp and cache directory loctions? I checked every single "option". It isn't there. I should use some other browser.

    I don't want the cache and temp directory on my SSD and can't figure out how to relocate. I guess a person needs an IQ of 220 to use a computer in 2011.

    See Clear Recent History
    *https://support.mozilla.com/kb/Clear+Recent+History

  • How the heck do i create a playlist and put it ON my ipod?

    ok, hi... im sorry if this is a novice question...
    but i have scoured google search results for way too long... you are my last hope.
    i can create a new playlist, and it shows up in itunes. i can sequence the songs to any order i please within that playlist and i love it -- but for the love of god -- how do i put the PLAYLIST (song order) on the shuffle itself so i can sequence songs for it?
    as i said, im sorry if this seems like a stupid question... i suspect im over looking something simple. but here i am...
    thanks!
    Message was edited by: thisismyname1234

    Not a stupid question at all...I am looking for the answer to that very question myself!!! Only difference is that I have a 1st generation shuffle. Would someone please help? FYI, I'm working on a new MacBook with the latest version of iTunes loaded...Does that have anything to do w/ my not being able to get the playlist copied (in the correct song order) onto my shuffle? Also, can I have more than one playlist and random other songs on my shuffle at the same time? Please help us both!

  • I have a Creative Cloud for teams (one year membership) called Chuna AG.  I have an Adobe ID...how the hell do I sign into it and see the media that is being uploaded

    I signed on for a chat with someone, waited 15 minutes and then it closed with no one appearing and is now telling me to quit my browser and start again which I do not want to do as I have a load of windows open I need to keep available

    Well guess I will try another chat window and see if that closes before anyone answers me and forces me to close my browser

  • 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

  • Bad Duty Cycle readings

    Hello!
     I’m building an application in which I want to measure a duty cycle.  I can control the “Duty Cycle In” and the FCM analyzes the info and sends a signal to the Motor. I want to measure the “Duty Cycle Out” of the motor. (I attached diagram) For this measurement I just connected a wire to the negative side of the motor. To calculate this Duty Cycle I am measuring the period and the pulse width. The program works very good when I have a “Duty Cycle Out” from 1% to 99%, but whenever is 0 or 100% it shows wrong info. I would expect that the pulse width at 0% or 100% is cero, but LabVIEW shows a value (1,1E-5 s) and calculates a Duty Cycle of about 23% which is totally wrong.  Also, if I run the program for the first time and I measure this pulse width with a “Duty Cycle In” of 0%, pulse width is cero., but whenever I change the “Duty Cycle In” to 10% or higher, and then I go back to a “Duty Cycle In” of  0% it shows a value, and calculates a bad Duty Cycle. I don’t know why this only happens when I put higher “Duty Cycles In”, and then I go back to 0%. I measured the signal with an oscilloscope and there is nothing, not even noise! I don’t know how the card gets these lectures.   Do you have any suggestions of what can be wrong?
    Appreciated! 
    Solved!
    Go to Solution.
    Attachments:
    Diagram.JPG ‏33 KB

    Hi Elmar
    Thanks for the reply. I attached my Code. I am measuring the period with ctr0 and pulse width with ctr1. I divide Pulse Width / Period to obtain the Duty Cycle. To detect 0% and 100% I compare the value of pulse width to zero. I created an additional Digital Input, with this channel I check if the signal is high or low. So if Pulse Width is zero, I read from the Digital Input the level of the signal, and then I know whether is 100% or 0%. My problem is when I have a Duty Cycle of 0 or 100%, the DAQ keeps sending a value for the pulse width, and I cannot apply the method explained before. I think this value should be zero, I don’t know if I am mistaken.    
    Attachments:
    PWM_Measurement.vi ‏61 KB
    PWM_Measurement.JPG ‏151 KB

  • How to generate a pwm whose duty cycle has to be varied depending on the frequency of the input trigger??

    Sir/madam,
    I am quite new to the Labview FPGA module. 
    I am currently working on an application where i have to generate a pwm to control the ON time duration . The pwm ON time depends on the frequency of an input signal.I want to retrieve the ON time value from a lookup table which contain the duty cycle values for the pwm at different frequencies of the input.This input also has to work as a trigger. The input is pulsed and the trigger has to generate the pwm at every rising edge. I am using a PCI 7831R-  RIO series. I am urgently in need of some help and i have hardly a  couple of weeks before i meet the deadline.
    I am trying hard to learn the basics from the shipping examples but not able to quite make my vi work. 
    Kindly lend a helping hand and i would be very grateful to anybody who can help. Thanks a lot in advance.
    Do ask in case of any clarifications required. I  think i have explained my problem quite well. 

    Hello Manu,
    You can refer 
    Developing a PWM Interface using LabVIEW FPGA or PWM Output with LabVIEW FPGA
    How this helps.
    Best Regards, 
    Hardik Asawa
    AE
    National Instruments  
    Message Edited by Hardik Asawa on 05-05-2010 12:46 AM

  • 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

  • How can I vary a PWM´s duty cycle inside a while loop?

    Hi,
    I'm using the "Generate Pulse Train.vi" to generate pwm signals in counters 0 and 1 in order to drive a DC motor both ways.
    The problem is, I need to control the movement of the dc motor with my PI controller which is inside a while loop. I've tried letting the "generate pulse train.vi" outside the while loop, but the problem is, it only changes the value of the duty cycle when the loop is stopped. I also tried putting it inside the loop, but then it doesn't even work.
    So, how can I vary a PWM´s duty cycle inside a while loop?
    I'm attaching the VI with the PI controller.
    Thanks for your help!
    Guilherme
    Attachments:
    controleValvula.vi ‏332 KB

    Here's some code I threw together a while back to change a duty cycle on the fly. It generates a fixed 5KHz or 25KHz frequency depending on laser selection, then allows duty cycle to be changed continously. Maybe you can use the premise of it for your application.
    ~~~~~~~~~~~~~~~~~~~~~~~~~~
    "It’s the questions that drive us.”
    ~~~~~~~~~~~~~~~~~~~~~~~~~~
    Attachments:
    Pulse_Width_Modulator.llb ‏197 KB

Maybe you are looking for