Following is example pseudocode for various digital I/O operations:
t all
on.
go/get.
0, 0);
to execute multiple requests.
ddRequest (lngHandle, LJ_ioGET_DIGITAL_BIT, 2, 0, 0, 0);
ead from FIO4-EIO5 (10-bits starting
high.
e, LJ_ioPUT_DIGITAL_BIT, 3, 1, 0, 0);
=0, EIO7=0, CIO0=1,
ndle, LJ_ioPUT_DIGITAL_PORT, 14, 20, 5, 0);
/Execute the requests.
oOne (lngHandle);
oGET_DIGITAL_BIT, 2, &dblValue);
etResult (lngHandle, LJ_ioGET_DIGITAL_PORT, 4, &dblValue);
s used to writ
r mode IOType:
//16-bit PWM output
//8-bit PWM output
//Period input (32-bit, rising edges)
//Period input (32-bit, falling edges)
m timer low read (no FIO)
J_tmSYSTIMERHIGH //System timer high read (no FIO)
/Execute the pin_configuration_reset IOType so tha/
//pin assignments are in the factory default conditi
d/
//The ePut function is used, which combines the ad
Put (lngHandle, LJ_ioPIN_CONFIGURATION_RESET, 0,
e
//Now, an add/go/get block
//Request a read from FIO2.
A
Request a r
//
//from digital channel #4).
ddRequest (lngHandle, LJ_ioGET_DIGITAL_PORT, 4, 0, 10, 0);
A
-
//Set FIO3 to output
ddRequest (lngHandl
A
//Set EIO6-CIO2 (5-bits starting from digital channel #14)
//to b10100 (=d20). That is EIO6
/CIO1=0, and CIO2=1.
/
AddRequest (lngHa
/
G
/Get the FIO2 read.
/
GetResult (lngHandle, LJ_i
/Get the FIO4-EIO5 read.
/
G
4.3.6 Timers & Counters
There are eight IOType e or read digital I/O information:
LJ_ioGET_COUNTER
LJ_ioPUT_COUNTER_ENABLE
LJ_ioGET_COUNTER_ENABLE
LJ_ioPUT_COUNTER_RESET
LJ_ioGET_TIMER
LJ_ioPUT_TIMER_VALUE
J_ioPUT_TIMER_MODE
L
LJ_ioGET_TIMER_MODE
In addition to specifying the channel number, the following mode constants are passed in the
value parameter when doing a request with the time
LJ_tmPWM16
LJ_tmPWM8
LJ_tmRISINGEDGES32
J_tmFALLINGEDGES32
L
L
J_tmDUTYCYCLE //Duty cycle input
LJ_tmFIRMCOUNTER //Firmware counter input
LJ_tmFIRMCOUNTERDEBOUNCE //Firmware counter input (with debounce)
LJ_tmFREQOUT //Frequency output
LJ_tmQUAD //Quadrature input
LJ_tmTIMERSTOP //Timer stop input (odd timers only)
LJ_tmSYSTIMERLOW //Syste
L
66