Timer and Counter Configuration | LabJack
 

Timer and Counter Configuration

3 posts / 0 new
Last post
lnadolski
lnadolski's picture
Timer and Counter Configuration

Hello,

I am attempting to generate a PWM on FIO4 and measure the number of pulses(cycles) via a counter on FIO5. There is an exception thrown when setting the TimerClockBase parameter in the configTimerClock() function. Here is the code I am using to configure the timer (pwm) and counter:

lj = u3.U3()

lj.configIO(NumberOfTimersEnabled=1, EnableCounter0=1)  #enable 1 timer and counter0

lj.configTimerClock(TimerClockBase=3, TimerClockDivisor=0)  # for PWM use 1MHz/divisor, divisor=0 -->256

LowlevelErrorException:

The U3-HV returned an error: TIMER_SHARING_ERROR(72)

Are there limitations on the limitations on setting the clock base and divisor while using a timer and counter? Can yo please help explain what setting is incorrect and any limitations to these settings?  Thank you in advance for your help.

L

LabJack Support
labjack support's picture
Counter0 is not available

Counter0 is not available with any clock base that supports the divisor.  You need to use one of the non-divisor clock bases or use Counter1:

https://labjack.com/support/datasheets/u3/hardware-description/timers-co...

lnadolski
lnadolski's picture
Thank you so much.

Thank you so much.