Motion Control Theory
207
PCI-8254 / PCI-8258
#include
<windows.h>
// Using event handle
#include
"APS168.h"
#include
"ErrorCodeDef.h"
void
interrupt_with_win32_example()
{
// This example shows how interrupt functions work.
I32 board_id = 0;
I32 int_no;
// Interrupt number
DWORD return_code;
// function return code
I32 item = 0;
// Axis #0 interrupt
I32 factor = ( 1 << 12 );
// bit 12 IMDN interrupt
HANDLE handle;
//Step 1:
姕⭂天䫱⼭䘬ᷕ㕟ḳẞ
, factor = IMDN
int_no = APS_set_int_factor( board_id, item, factor, 1 );
handle = APS_int_no_to_handle( int_no );
//Step 2:
姕⭂ᷕ㕟䷥攳斄
APS_int_enable( board_id, 1 );
// Enable the interrupt main switch
//Step 3:
䫱⼭ᷕ㕟妠䘤
return_code = WaitForSingleObject( handle, INFINITE );
if
( return_code == ERR_NoError )
{
//Interrupt occurred
//Step 4:
慵伖ᷕ㕟䁢䁢妠䘤䉨ン
ResetEvent( handle );
}
// Step 5:
斄攱ᷕ㕟ḳẞᷕ㕟䷥攳斄
APS_set_int_factor( board_id, item, factor, 0 );
APS_int_enable( board_id, 0 );
}
Summary of Contents for PCI-8254
Page 2: ...ii Revision History Revision Date Description 2 00 2014 08 13 First release ...
Page 8: ...viii Table of Contents Important Safety Instructions 209 Getting Service 211 ...
Page 12: ...xii List of Figures ...
Page 14: ...xiv List of Tables ...
Page 24: ...10 Introduction ...
Page 54: ...40 Getting Start with The Installation ...
Page 78: ...64 Signal Connection ...
Page 111: ...Motion Control Theory 97 PCI 8254 PCI 8258 MCP2 Bode plot page ...
Page 222: ...208 Motion Control Theory ...