LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

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.

0 Kudos
Message 1 of 6
(4,538 Views)

Hey Kmay,

One thing you could try to use is the Timing and Transition Measurements Express VI.

You can use this to measure various aspects of your signal (which is usually a pulse or pulse train). This would give you the frequency, period, pulse duration, DUTY CYCLE, preshoot, overshoot and slew rate.

Caveat: If your signal you put into the Express VI does not contain enough edges to complete the measurement, LabVIEW will return error -20310 or -20308. To fix this raise the frequency and/or the number of data points of the signal.

I hope this helps.

Ricky V.

National Instruments
Applications Engineer
0 Kudos
Message 2 of 6
(4,515 Views)

Hello All,

I am trying to calculate the rise time of a pressure waveform and I keep getting an error-20310 but cannot increase my sampling rate or the number of data points.

 

Any sugguestions?

Message 3 of 6
(4,401 Views)

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,

0 Kudos
Message 4 of 6
(4,351 Views)

My problem seems to be solved when I change the high, mid and low reference values to 90, 50 and 10 as opposed to 95, 50 and 5. Does changing the values really make a huge difference? I am very confused on the explanation of the high, mid and low reference values for the Timing Measurement vi.

 

Thank you so kindly!

0 Kudos
Message 5 of 6
(4,348 Views)

Hey greentea2,

 

All of the reference values relate to a percent of the total signal, so a high reference level of 90, represents the value that is 90% of the total signal for example.

 

These values are used during the measurements.  For the rise time, the vi is checking to see how long it takes the waveform to go from the low reference level to the high reference level, so changing those values does make a difference.  The default is set at 90 and 10 because that is generally the percentage levels that people measure from.

 

The quantitative amount describing how much it will change depends on how large the signal is, as well as the slope of the rising portion of the signal.

 

Hope this helps clarify,

0 Kudos
Message 6 of 6
(4,320 Views)