ICP DAS USA 3-axis encoder card, 2-axis stepping/servo Computer Hardware User Manual


 
I-8091 User Manual Version 1.0 06/2001
http://www.icpdas.com 2-39 ICPDAS
4. Example
4.1 Detect I-8091 card
//---------------------------------------------------
// detect i8090,i8091,i8092 card
//---------------------------------------------------
#include "8000.h"
#include "s8090.h"
#define i8090 0x0d
#define i8091 0x0e
#define i8092 0x0f
#define NOCARD 0x00
#define MAX_SLOT_NO 8
unsigned int PortAddress[8]={0x080, 0x0a0, 0x0c0, 0x0e0, 0x140, 0x160,
0x180, 0x1a0};
//---------------------------------------------------
void main ()
{
unsigned char slot,temp;
for (slot=0; slot<MAX_SLOT_NO; slot++)
{
temp=inportb(PortAddress[slot]);
switch (temp)
{
case i8090: //i8090 3-axis encoder card
Print("Slot %d = i8090\r\n",SlotNum);
return i8090;
case i8091: //i8091 2-axis stepping card
Print("Slot %d = i8091\r\n",SlotNum);
return i8091;
case i8092: //i8092
Print("Slot %d = i8092\r\n",SlotNum);