State
– Returns the state of the digital input. 0=False=Low and 1=True=High.
4.2.20 - eDO()
An easy function that writes the state of one digital output. This is a simple alternative to the very flexible IOType based method
normally used by this driver.
When needed, this function automatically configures the specified channel as a digital output.
Declaration:
LJ_ERROR _stdcall eDO ( LJ_HANDLE Handle,
long Channel,
long State)
Parameter Description:
Returns: LabJack errorcodes or 0 for no error.
Inputs:
Handle
– Handle returned by OpenLabJack().
Channel
– The channel to write to. 0-19 corresponds to FIO0-CIO3.
State
– The state to write to the digital output. 0=False=Low and 1=True=High.
4.2.21 - eTCConfig()
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.
1
Number of timers UE9:6, U6:4, U3:2
2
Number of counters UE9:2, U6:2, U3:2
3
Pin offset UE9:Ignored, U6:0-8, U3:4-8
4
Default constant UE9:LJ_tc750KHZ, U6:LJ_tc48MHZ, U3:LJ_tc48MHZ
4.2.22 - eTCValues()
An easy function that updates and reads all the timers and counters. This is a simple alternative to the very flexible IOType based
method normally used by this driver.
Declaration:
LJ_ERROR _stdcall eTCValues ( LJ_HANDLE Handle,
long *aReadTimers,
long *aUpdateResetTimers,
long *aReadCounters,
long *aResetCounters,
double *aTimerValues,
double *aCounterValues,
long Reserved1,
long Reserved2)
Parameter Description:
Returns: LabJack errorcodes or 0 for no error.
Inputs:
Handle
– Handle returned by OpenLabJack().
aReadTimers
– An array where each element specifies whether to read that timer. A nonzero value for an array element
specifies to read that timer.
1
aUpdateResetTimers
– An array where each element specifies whether to update/reset that timer. A nonzero value for an
array element specifies to update/reset that timer.
1
aReadCounters
– An array where each element specifies whether to read that counter. A nonzero value for an array
element specifies to read that counter.
2
aResetCounters
– An array where each element specifies whether to reset that counter. A nonzero value for an array
element specifies to reset that counter.
2
aTimerValues
– An array where each element is the new value for that timer. Each value is only updated if the appropriate
element is set in the aUpdateResetTimers array.
1
Reserved (1&2)
– Pass 0.
Outputs:
aTimerValues
– An array where each element is the value read from that timer if the appropriate element is set in the
aReadTimers array.
aCounterValues
– An array where each element is the value read from that counter if the appropriate element is set in the
32