U3 measuring DUTY CYCLES - working but ...

Recommended Posts


I have suceeded in having U3 measuring the duty cycles of two TTL signals incoming in FIO0 and FIO1.

I am using Timer0 and Timer1 in duty cycle mode.

See attached file : this a .ctl that one can use as roadmap, still needing improvements

The TTL signal I am using as test has a frequency of about 300 Hz and 3000 Hz (switching a timing capacitor) and the duty cycle is varying from 5% to 95% (using a potentiometer and two diodes). I am using a 74HC14 Schmidt trigger powered by the U3 +5V output. An oscilloscope was connected as monitoring tool. The signal is always clean and has sharp edges in order to keep the U3 happy.

LabJack U3 delivers the measurements .... yes !

At 300 Hz, I see a total of ticks (HIGH + LOW) equal to approx 13000.

So the MSB and LSB counters don't overflow.

But I suspect I am not understanding the way DAQFactory DEVICE CONFIGURATION tries to configure the reference clock arrangement. If I change the clock in DAQFactory DEVICE CONFIGURATOR, I see no effect on the HIGH pulse count and on the LOW pulse count. My system is behaving like DAQFactory puts the Timer0 and Timer1 in a kind of "forced mode" with a fixed clock arrangement, quite a low frequency, instead of the letting the user to define the base clock frequency, and the divisor.

Then, same kind of idea, if I try to use the pin OFFSET scheme in order to relocate Timer0 and Timer1 like on FIO2 and FIO3, I get an error, and the system is not working.

This is another indication that I am not understanding the way DAQFactory DEVICE CONFIGURATION tries to configure the U3 around the Timer areas.

By the way, if I try manually sending QUICK SEQUENCES consisting on configurations words, everything gets weird and one must quit then reload the .ctl file in order to revert to something mor or less working.

Surely I need help in order to be able to manually send U3 configurations sequences, if this is really needed.

Then, because the maths for extracting the HIGH and LOW period ticks are not trivial, I have tried virtual channels enabling me to only calculate them once, then later on reuse them at my will in the total period and duty cycle calculations, and also for graphing this. Not having to retype again and again the same long formulas. No luck ... I could't properly set up the virtual channels, so any help welcome for this too.

Then, but this may be automatically solved after all points discussed here done, I have tried graphing the duty cycle, but it doesn't come on screen. Maybe it's the graphing system not accepting a long formula, I don't know. Any help welcome here too.

See attached .ctl file.

I made it specially. Hope it is self-explaining.

Do not hesitate editing it and telling me what's wrong.

Thanks in advance,


from Brussels


Link to comment
Share on other sites


This topic is now archived and is closed to further replies.