Download Q173SCCF C Controller Interface Module User`s Manual (API Library)

Transcript
4. API FUNCTION DETAILS
4.22 Interrupt functions
(1) Processing procedure
An example of processing procedure for using interrupt functions is below.
C Controller module
Q173SCCF
Sets interrupt conditions (Note 1)
Processes the
parameters
(Example)
short int_fact[2] = { 0x****, 0x**** };
sts = sscChange2Parameter( bid, ch, ax, &int_fact[0] );
if( sts != SSC_OK )
{ /* error process */ }
Completes the setting
Starts up an interrupt driver (Note 2)
Interrupt driver
(Example)
sts = sscIntStart( bid, priority );
if( sts != SSC_OK )
{ /* error process */ }
Starts up the driver
Enables the
Interrupt output
Enables the interrupt output (Note 3)
(Example)
sts = sscIntEnable( bid, ch );
if( sts != SSC_OK )
{ /* error process */ }
Resets an interrupt event (signal status) as necessary
(Example)
sts = sscResetIntEvent( bid, ch, ax, ev_num, ev_fact );
if( sts != SSC_OK )
{ /* error process */ }
Commands an arbitrary operation to fulfill the set interrupt condition
Starts the
arbitrary operation
Waits for interrupt event factor occurrence (Note 3)
Finishes the
arbitrary operation
(Example)
sts = sscWaitIntEvent( bid, ch, ax, ev_num, ev_fact, 0 );
if( sts != SSC_OK )
{ /* error process */ }
Produces the
event factor
Outputs hardware
interrupt
Disables the
Interrupt output
Disables the interrupt output (Note 4)
(Example)
sts = sscIntDisable( bid, ch );
if( sts != SSC_OK )
{ /* error process */ }
Shuts down the interrupt driver (Note 4)
(Example)
sts = sscIntEnd( bid );
if( sts != SSC_OK )
{ /* error process */ }
Shuts down the driver
Finish
4 - 144