beautypg.com

Figure 5-3: type 3 – ADLINK HSL-DI16DO16-M-NN User Manual

Page 106

background image

HSL Function Library

93

Type 3: Generates hardware interrupt when any DI data transi-
tions are detected and when the scan cycle is completed. When
interrupt occurrs, the scan pauses until the driver resets the state.

Figure 5-3: Type 3

Caution: Scanning is paused while user choice the type3 of renewal

type. This pause time depends on the user system perfor-

mance. Consequently, when using type3, constancy(always

keeping scan cycle constant) will not be maintained between

scans.

HSL_D_set_int_renewal_bit (7853/54 only):
Sets the Di data bits of specified modules that you want to monitor.

HSL_D_set_int_control (7853/54 only):
Enables or disables the DI interrupt.

HSL_D_wait_di_interrupt (7853/54 only):
Waits for the specific interrupt when you enable the Interrupt func-
tion by HSL_D_set_int_control() and set the renewal type and
data bits on specified slave DI modules by
HSL_D_set_int_renewal_bit(), HSL_D_set_int_renewal_type().
When this function is running, the process never stops even if trig-
gered or the function timed out. The following codes illustrate this
function.

I16 ret;
HSL_D_set_int_renewal_type(1, 0, 1);
// slave id = 1, monitor the states of bit 0 and

bit 1

HSL_D_set_int_renewal_bit(1, 0, 1, 0x003);
HSL_D_set_int_control(1, 0, 1); //enable