eTCConfig() [UD Library]
An easy function that configures and initializes all the timers and counters. This is a simple alternative to the very flexible IOType based method normally used by this driver.
When needed, this function automatically configures the needed lines as digital.
Declaration:
LJ_ERROR _stdcall eTCConfig ( LJ_HANDLE Handle,
long *aEnableTimers,
long *aEnableCounters,
long TCPinOffset,
long TimerClockBaseIndex,
long TimerClockDivisor,
long *aTimerModes,
double *aTimerValues,
long Reserved1,
long Reserved2)
Parameter Description:
Returns: LabJack errorcodes or 0 for no error.
Inputs:
- Handle – Handle returned by OpenLabJack().
- aEnableTimers – An array where each element specifies whether that timer is enabled. Timers must be enabled in order starting from 0, so for instance, Timer0 and Timer2 cannot be enabled without enabling Timer1 also. A nonzero value for an array element specifies to enable that timer. Array size must be equal to the number of timers available on the device.1
- aEnableCounters – An array where each element specifies whether that counter is enabled. Counters do not have to be enabled in order starting from 0, so Counter1 can be enabled when Counter0 is disabled. A nonzero value for an array element specifies to enable that counter. Array size must be equal to the number of counters available on the device.2
- TCPinOffset – Value specifies where to start assigning timers and counters.3
- TimerClockBaseIndex – Pass a constant to set the timer base clock. The default is device specific.4
- TimerClockDivisor – Pass a divisor from 0-255 where 0 is a divisor of 256.
- aTimerModes – An array where each element is a constant specifying the mode for that timer. Array size must be equal to the number of timers available on the device.1
- aTimerValues – An array where each element is specifies the initial value for that timer. Array size must be equal to the number of timers available on the device.1
- Reserved (1&2) – Pass 0.
- Number of timers UE9:6, U6:4, U3:2
- Number of counters UE9:2, U6:2, U3:2
- Pin offset UE9:Ignored, U6:0-8, U3:4-8
- Default constant UE9:LJ_tc750KHZ, U6:LJ_tc48MHZ, U3:LJ_tc48MHZ