ADLINK PCI-8258 User Manual
Page 219
Motion Control Theory
205
PCI-8254 / PCI-8258
Detailed operation methods are described below:
1. Set up interrupt events:
Use APS_set_int_factor( ) to set up interrupt event for
waiting. The function returns interrupt event number if setup is
successful. You shall store event number in a parameter to be
used by later Wait functions.
The APS_set_int_factor( ) function can be used to close
opened interrupt event as required by application.
2. Enable main interrupt switch:
Interrupt signal of hardware device can be received only when
the main interrupt switch of controller is opened. Open with
APS_int_enable( ).
3. Waiting for interrupt trigger
Use APS_wait_single_int( ) to wait for single interrupt event,
or APS_wait_multiple_int( ) to wait for multiple interrupt
events concurrently.
The program enters sleep mode after entering this function.
That is, the program (or thread) consumes no CPU resources
until there is interrupt event or timeout occurred. You may use
the returned value from the "wait" function to ensure the
occurrence of event in waiting and execute followed application
steps.
4. Reset interrupt to non-signaled state
When there is event triggered and the program left the "wait"
function, the interrupt event is set in signaled state. To wait for
the same event's occurrence again, please reset the interrupt
status to non-signaled state manually. Call the "Wait" function
before reset will cause the Wait function to return directly.
Function for reset: APS_reset_int( )
5. Close interrupt event and main interrupt switch
Finally, use APS_set_int_factor( ) function to close individual
interrupt event, use APS_int_enable( ) function to close main
interrupt switch to release all interrupt relevant resources.