ICP DAS USA I-8091 User Manual

Size:
211.56 Kb
Download

I-8090/I-8091User Manual

Version 1.0 06/2001

User Manual

Part 1: I-80903-axisencoder card Part 2:I-80912-axisstepping/servo

control card

http://www.icpdas.com

ICPDAS

I-8090/I-8091User Manual Version 1.0 06/2001

I-8090Contents

_

1. Hardware

1-4

1.1

I-8000hardware address

1-4

1.2

Registers of I-8090Board

1-5

1.3 LED indicator

1-8

1.4

Connection

1-9

2. Software

1-13

2.1

Constants and Functions

1-13

2.2

Eaxmples

1-17

 

2.2.1 Detect I-8090card

1-17

 

2.2.2 Start to use I-8090card

1-18

 

2.2.3 Get X, Y, Z-axisencoder counter’s value

1-18

 

2.2.4 Software 32 bits encoder counter programming

1-20

http://www.icpdas.com

ICPDAS

I-8090/I-8091User Manual Version 1.0 06/2001

I-8091Contents

_

1. Introduction

2-4

1.1

System Block Diagram

2-4

1.2

DDA technology

2-5

2. Hardware

2-8

2.1

I-8000hardware address

2-8

2.2

Register of I-8091board

2-9

2.3

LED indicator

2-10

2.4

Hardware configuration

2-11

 

2.4.1 Limit switch configuration

2-11

 

2.4.2 Output pulse mode configuration

2-12

 

2.4.3 Direction configuration

2-12

 

2.4.4 Turn Servo ON/OFF (Hold ON/OFF)

2-12

 

2.4.5 Automatic protection

2-12

 

2.4.6 Set limit switch as normal close condition

2-13

2.5

Connection

2-14

 

2.5.1 Pin assignment of connector CN2

2-14

 

2.5.2 The internal circuit of CW_PULSE, CCW_DIR, HOLD

2-15

 

2.5.3 The internal circuit of limit switch input

2-15

 

2.5.4 Example of connection

2-16

3. Software

2-18

3.1

Functions

2-18

 

3.1.1 Setting commands

2-20

 

3.1.2 Stop commands

2-24

 

3.1.3 Simple motion commands

2-25

 

3.1.4 Interpolation commands

2-30

 

3.1.5 Others

2-35

3.2

Start up and end of program

2-37

4. Example

2-39

4.1

Detect I-8091card

2-39

4.2

Example: DEMO.cpp

2-40

4.3

Example: DEMO1.cpp

2-40

http://www.icpdas.com

ICPDAS

I-8090User Manual

Version 1.0 06/2001

I-80903-axis encoder card

User Manual

Version 1.0 06/2001 Edition

Warranty: All products manufactured by ICP DAS are warranted against defective materials for one year from the date of delivery to the original purchaser

Warning: ICP DAS assumes no liability for damage consequent to the use of this product. ICP DAS reserves the right to change this manual at any time without notice. The information furnished by ICP DAS is believed to be accurate and reliable. However, no responsibility is assumed by ICP DAS for its use, nor for any infringements of patents or other rights of third parties resulting from its use.

Copyright

Copyright 2001 by ICP DAS. All right are reserved

Trademark

The names used for identification only maybe registered trademarks of their respective companies.

http://www.icpdas.com

1-1

ICPDAS

I-8090User Manual

Version 1.0 06/2001

I-80903-axisencoder card

I-8090is a3-axisencoder counter board onI-8000platform.I-8090encoder card has internal digital filter, 16 bits counter and high counting rate 1Mpps. The application ofI-8090board is position/distance measurement, velocity measurement, feedback for motor control, handwheel input and so on.

A system including I-8000(main system),I-8091(2-axisstepping/servo control card),I-8090(3-axisencoder card) can be implemented as a standalone motion controller system for low cost automatical machine.

Features

!I-8000series.

!3-axis,16 bits encoder counter.

!32 bits encoder counter by software.

!Maximum counting rate : 1M pulse/sec.

!Differential input A+, A-,B+,B-,C+,C-.

!Quadrant counting mode, CW/CCW counting mode, Pulse/Dir counting mode.

!2500V optical isolation

http://www.icpdas.com

1-2

ICPDAS

I-8090User Manual

Version 1.0

06/2001

8090 Contents

 

_

1. Hardware

 

1-4

 

1.1

I-8000hardware address

 

1-4

 

1.2

Registers of I-8090Board

 

1-5

 

1.3 LED indicator

 

1-8

 

1.4

Connection

 

1-9

 

2. Software

 

1-13

 

2.1

Constants and Functions

 

1-13

 

2.2

Eaxmples

 

1-17

 

 

2.2.1 Detect I-8090card

 

1-17

 

 

2.2.2 Start to use I-8090card

 

1-18

 

 

2.2.3 Get X, Y, Z-axisencoder counter’s value

 

1-18

 

 

2.2.4 Software 32 bits encoder counter programming

1-20

 

http://www.icpdas.com

1-3

ICPDAS

I-8090User Manual

Version 1.0 06/2001

1. Hardware

_

 

 

 

 

 

1.1 I-8000hardware address

The hardware address of I-8000main system is fixed as following table. There are 4 slotsI-8000and 8 slotsI-8000.

 

Slot 1

Slot 2

Slot 3

Slot 4

Slot 5

Slot 6

Slot 7

Slot 8

I-8000,4 slot

0x080

0x0A0

0x0C0

0x0E0

---

---

---

---

Address

 

 

 

 

 

 

 

 

I-8000,8 slot

0x080

0x0A0

0x0C0

0x0E0

0x140

0x160

0x180

0x1A0

Address

 

 

 

 

 

 

 

 

Slot 1 Slot 2 Slot 3 Slot 4

88888

I-8000,4 slots

Slot 1 Slot 2 Slot 3 Slot 4 Slot 5 Slot 6 Slot 7 Slot 8

88888

I-8000,8 slots

Fig(1) I-8000hardware address

http://www.icpdas.com

1-4

ICPDAS

I-8090User Manual

Version 1.0 06/2001

1.2 Registers of I-8090board

The I-8090 card’s registers table as following.

Register

Add.

R/W

Bit 7

Bit 6

Bit 5

Bit 4

Bit 3

Bit 2

Bit 1

Bit 0

ID

0x00

R

 

 

 

0x0D

 

 

 

XDATA

0x01

R

 

 

X-axisencoder value

 

 

YDATA

0x02

R

 

 

Y-axisencoder value

 

 

ZDATA

0x03

R

 

 

Z-axisencoder value

 

 

INDEX

0x04

R

 

 

 

 

 

ZI

YI

XI

XCTRL

0x00

W

 

 

S1

S0

 

/RST

/INH

/SEL

YCTRL

0x01

W

 

 

S1

S0

 

/RST

/INH

/SEL

ZCTRL

0x02

W

 

 

S1

S0

 

/RST

/INH

/SEL

Register

Add.

R/W

Bit 7

Bit 6

Bit 5

Bit 4

Bit 3

Bit 2

Bit 1

Bit 0

ID

0x00

R

 

 

 

0x0D

The ID register is read only and its value is fixed as 0x0D. User can check this register to identify I-8090card or not.

Register

Add.

R/W

Bit 7

Bit 6

Bit 5

Bit 4

Bit 3

Bit 2

Bit 1

Bit 0

XDATA

0x01

R

 

 

X-axisencoder value

XDATA: the X-axisencoder counter value can be read out from this register. The low byte value of 16 bits encoder counter can be read out when set /SEL=0 (XCTRL register), the high byte can be read out when set /SEL=1 (XCTRL register).

Register

Add.

R/W

Bit 7

Bit 6

Bit 5

Bit 4

Bit 3

Bit 2

Bit 1

Bit 0

YDATA

0x02

R

 

 

Y-axisencoder value

YDATA : the Y-axisencoder counter value can be read out from this register. The low byte value of 16 bits encoder counter can be read out when set /SEL=0 (YCTRL register), the high byte can be read out when set /SEL=1 (YCTRL register).

Register

Add.

R/W

Bit 7

Bit 6

Bit 5

Bit 4

Bit 3

Bit 2

Bit 1

Bit 0

ZDATA

0x03

R

 

 

Z-axisencoder value

ZDATA : the Z-axisencoder counter value can be read out from this register. The low byte value of 16 bits encoder counter can be read out when set

http://www.icpdas.com

1-5

ICPDAS

I-8090User Manual

Version 1.0 06/2001

/SEL=0 (ZCTRL register), the high byte can be read out when set /SEL=1 (ZCTRL register).

Register

Add.

R/W

Bit 7

Bit 6

Bit 5

Bit 4

Bit 3

Bit 2

Bit 1

Bit 0

INDEX

0x04

R

 

 

 

 

 

ZI

YI

XI

The index input C+/C- can read out from this register. These bits are active high.

XI : indicate the index of X-axis(C+/C- input).

YI : indicate the index of Y-axis(C+/C- input). ZI : indicate the index ofZ-axis(C+/C- input).

Register

Add.

R/W

Bit 7

Bit 6

Bit 5

Bit 4

Bit 3

Bit 2

Bit 1

Bit 0

XCTRL

0x00

W

 

 

S1

S0

 

/RST

/INH

/SEL

YCTRL

0x01

W

 

 

S1

S0

 

/RST

/INH

/SEL

ZCTRL

0x02

W

 

 

S1

S0

 

/RST

/INH

/SEL

The XCTRL,YCTRL and ZCTRL register are control registers for X-axis,Y-

axis, Z-axisrespectively.

/RST : reset counter to zero

/INH : inhibit the counter data latch. This bit must be set 0 before read out the counter value to inhibit the counter data latch to DATA registers.

/SEL : to select low byte or high byte for reading the counter value.

0 : low byte

1 : high byte

S1, S0 : to select counting mode00 : quadrant counting mode

A

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

B

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

counter

1

2

3

4

5

6

 

 

 

 

 

 

 

 

 

 

 

Quadrant Counting Mode

 

 

Fig(2) Quadrant counting mode 01 : CW/CCW counting mode

http://www.icpdas.com

1-6

ICPDAS

I-8090User Manual

Version 1.0 06/2001

CW

 

 

 

 

 

 

 

 

 

 

 

 

CCW

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

counter 1

2

3 2

1

 

 

X2=0

CW/CCW Counting Mode

Fig(3) CW/CCW counting mode 10 : Pulse/Direction counting mode

Pulse

 

 

 

 

 

 

 

 

 

 

 

 

 

Direction

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

counter

1

2

3

 

2

1

 

X2=0

 

 

Pulse/Direction Counting Mode

 

Fig(4) Pulse/Direction counting mode Example: assign counting mode

x_mode=y_mode=z_mode=0x00; card[cardNo].ctrl1 = 0x07 | x_mode; card[cardNo].ctrl2 = 0x07 | y_mode; card[cardNo].ctrl3 = 0x07 | z_mode;

outportb(card[cardNo].base + WR1, card[cardNo].ctrl1); outportb(card[cardNo].base + WR2, card[cardNo].ctrl2); outportb(card[cardNo].base + WR3, card[cardNo].ctrl3);

Example: read X-axisencoder value

card[cardNo].ctrl1 &= 0xFC; //1111 1100 low byte outportb(card[cardNo].base + WR1, card[cardNo].ctrl1); value = inportb(card[cardNo].base + RD1); card[cardNo].ctrl1 |= 0x01; //0000 0001 high byte outportb(card[cardNo].base + WR1, card[cardNo].ctrl1); value += inportb(card[cardNo].base + RD1)*256; card[cardNo].ctrl1 |= 0x03; //0000 0011 outportb(card[cardNo].base + WR1, card[cardNo].ctrl1);

http://www.icpdas.com

1-7

ICPDAS

I-8090User Manual

Version 1.0 06/2001

1.3 LED Indicator

power

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

3B

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

1A

1B

 

 

 

 

 

 

1C 2A

 

 

 

 

 

2B

 

 

 

2C

 

 

3A

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Fig(5) I-8090LED indicator

Where

1A, 1B, 1C indicate X-axis’s1A+/1A-,1B+/1B-,1C+/1Csignal input. 2A, 2B, 2C indicateY-axis’s2A+/2A-,2B+/2B-,2C+/2Csignal input. 3A, 3B, indicateZ-axis’s3A+/3A-,3B+/3Bsignal input.

http://www.icpdas.com

1-8

ICPDAS

I-8090User Manual

Version 1.0 06/2001

1.4 Connection

CN2

DB25M-90

 

1A+

 

1

 

1A-

 

14

 

1B+

 

2

 

1B-

 

15

 

1C+

 

3

 

1C-

 

16

 

E5V

 

4

 

EGND

 

17

 

2A+

 

5

 

2A-

 

18

 

2B+

 

6

 

2B-

 

19

 

2C+

 

7

 

2C-

 

20

 

E5V

 

8

 

EGND

 

21

 

3A+

 

9

 

3A-

 

22

 

3B+

 

10

 

3B-

 

23

 

3C+

 

11

 

3C-

 

24

 

E5V

 

12

 

EGND

 

25

 

EGND

 

13

Fig (6) Pin out of CN2 connector

Table of CN2 connector

Pin name

Pin number

description

1A+

1

A+ input of X-axisencoder

1A-

14

A- input of X-axisencoder

1B+

2

B+ input of X-axisencoder

1B-

15

B- input of X-axisencoder

1C+

3

C+ input of X-axisencoder

1C-

16

C- input of X-axisencoder

E5V

4

Isolated 5V supply, max. 50mA (sum of pin 4,8,12)

EGND

17

Signal ground

2A+

5

A+ input of Y-axisencoder

2A-

18

A- input of Y-axisencoder

2B+

6

B+ input of Y-axisencoder

2B-

19

B- input of Y-axisencoder

2C+

7

C+ input of Y-axisencoder

2C-

20

C- input of Y-axisencoder

http://www.icpdas.com

1-9

ICPDAS

I-8090User Manual

 

Version 1.0 06/2001

 

 

 

 

 

E5V

 

8

Isolated 5V supply, max. 50mA (sum of pin 4,8,12)

EGND

 

21

Signal ground

3A+

 

9

A+ input of Z-axisencoder

3A-

 

22

A- input of Z-axisencoder

3B+

 

10

B+ input of Z-axisencoder

3B-

 

23

B- input of Z-axisencoder

3C+

 

11

C+ input of Z-axisencoder

3C-

 

24

C- input of Z-axisencoder

E5V

 

12

Isolated 5V supply, max. 50mA (sum of pin 4,8,12)

EGND

 

25

Signal ground

EGND

 

13

Signal ground

 

CN2

DB25M-90

 

A+

1A+

1

 

A-

1A-

14

 

B+

1B+

2

Encoder

B-

1B-

15

C+

1C+

3

C-

1C-

16

 

 

5V

E5V

4

 

GND

EGND

17

 

 

2A+

5

 

 

2A-

18

 

 

2B+

6

 

 

2B-

19

 

 

2C+

7

 

 

2C-

20

 

 

E5V

8

 

 

EGND

21

 

 

3A+

9

 

 

3A-

22

 

 

3B+

10

 

 

3B-

23

 

 

3C+

11

 

 

3C-

24

 

 

E5V

12

 

 

EGND

25

 

 

EGND

13

Fig (7) Connection between encoder and I-8090card

http://www.icpdas.com

1-10

ICPDAS

I-8090User Manual

 

 

Version 1.0

06/2001

 

 

 

CN2

 

 

 

 

DB25M-90

 

 

A+

1A+

1

 

 

B+

1A-

14

 

 

1B+

2

 

Encoder

C+

1B-

15

 

1C+

3

 

 

 

1C-

16

 

 

 

E5V

4

 

 

 

EGND

17

 

 

 

2A+

5

 

 

 

2A-

18

 

 

 

2B+

6

 

 

 

2B-

19

 

 

 

2C+

7

 

 

5V

2C-

20

 

 

GND

E5V

8

 

 

 

EGND

21

 

 

 

3A+

9

 

 

 

3A-

22

 

 

 

3B+

10

 

 

 

3B-

23

 

 

 

3C+

11

 

 

 

3C-

24

 

 

 

E5V

12

 

 

 

EGND

25

 

 

 

EGND

13

 

Fig (8) Connection between open collecter type encoder and I-8090card

CW/PULSE

CCW/DIR INDEX

CN2

DB25M-90

 

 

1A+

1

 

 

1A-

14

 

 

1B+

2

 

 

1B-

15

 

 

1C+

3

 

 

1C-

16

 

 

E5V

4

 

 

EGND

17

 

 

2A+

5

 

 

2A-

18

 

 

2B+

6

 

 

2B-

19

 

 

2C+

7

 

 

2C-

20

 

 

E5V

8

 

 

EGND

21

 

 

3A+

9

 

 

3A-

22

 

 

3B+

10

 

 

3B-

23

 

 

3C+

11

 

 

3C-

24

 

 

E5V

12

 

 

EGND

25

 

 

EGND

13

Fig (9) The connection for CW/CCW or Pulse/Direction counting mode

http://www.icpdas.com

1-11

ICPDAS

I-8090User Manual

 

 

Version 1.0

06/2001

 

 

CN2

 

CN2

 

 

DB25M-90

 

DB25M-90

 

S5V

1

1A+

1

 

 

14

1A-

14

 

CW_PULSE1

2

1B+

2

 

CW_PULSE2

15

1B-

15

 

CCW_DIR1

3

1C+

3

 

CCW_DIR2

16

1C-

16

 

HOLD1

4

E5V

4

 

HOLD2

17

EGND

17

 

SGND

5

2A+

5

 

 

18

2A-

18

EXT_VCC

EXT_VCC

6

2B+

6

 

19

2B-

19

(12V~24V)

 

PHOME1

7

2C+

7

PHOME2

 

20

2C-

20

PLS11

8

E5V

8

 

PLS21

21

EGND

21

 

 

9

3A+

9

 

 

 

 

22

3A-

22

 

 

10

3B+

10

 

 

23

3B-

23

 

PLS14

11

3C+

11

PLS24

24

3C-

24

 

PEMG

12

E5V

12

 

 

25

EGND

25

 

 

EXT_GND

13

EGND

13

 

 

S8091 card

S8090 card

Fig (10) The connection between I-8090andI-8091for function testing or pulse feedback byI-8090encoder card.

http://www.icpdas.com

1-12

ICPDAS

I-8090User Manual

Version 1.0 06/2001

2. Software

_

 

 

 

 

 

User’s applications could be compiled under DOS Turbo/Borland C/C++ environment. It should be include i8090.h and i8090.LIB to compile the target execution file. The execution files can be downloaded under I-8000main system (execute 7188x.exe), and then run the target execution file as under PC system. About theI-8000’sresource or environment, please refer to the manual ofI-8000system or its software programming guide.

The following section will introduce the I-8090’sfunctions and examples.

2.1 constants and functions

Constants

 

 

 

#define YES

 

1

 

#define NO

0

 

#define ON

1

 

#define OFF

 

0

 

#define X_axis

1

 

#define Y_axis

2

 

#define Z_axis

3

 

#define ENC_QUADRANT

0x00

#define ENC_CW_CCW

0x10

#define ENC_PULSE_DIR

0x20

Functions

(1) unsigned char i8090_REGISTRATION(unsigned char cardNo, unsigned int address)

In order to distinguish more than one I-8090card inI-8000platform, theI-8090cards should be registrated before using it. This command will assign a card number=“cardNo” toI-8090card address=”address” .

If there is not I-8090at the given address, this command will return “NO”.

cardNo: 0~19, assign the address as which card.

http://www.icpdas.com

1-13

ICPDAS

I-8090User Manual

Version 1.0 06/2001

address: hardware address which defined at chapter 1.1

Return: “YES” : registration successful “NO” : registration failure.

Example: This example will assign I-8090card address=0x080 as CARD1 (1). Then initial theI-8090card and reset X,Y,Z axis encoder counter value to 0.

#define CARD1 1

i8090_REGISTRATION(CARD1, 0x080); i8090_INIT_CARD(CARD1, ENC_QUADRANT, ENC_QUADRANT,

ENC_QUADRANT); i8090_RESET_ENCODER(CARD1, X_axis); i8090_RESET_ENCODER(CARD1, Y_axis); i8090_RESET_ENCODER(CARD1, Z_axis);

(2) void i8090_INIT_CARD(unsigned char cardNo, unsigned char x_mode, unsigned char y_mode, unsigned char z_mode)

This command will reset all three axis’s counter value of “cardNo” card, and assign its counting mode. The counting mode (S1,S0) has been explained in registers XCTRL, YCTRL, ZCTRL.

cardNo: 0~19, select which card.

x_mode, y_mode, z_mode: select the counting mode. 0x00 : quadrant counting mode

0x10 : CW/CCW counting mode

0x20 : Pulse/Direction counting mode

Example:

#define ENC_QUADRANT 0x00 #define ENC_CW_CCW 0x10 #define ENC_PULSE_DIR 0x20

http://www.icpdas.com

1-14

ICPDAS

I-8090User Manual

Version 1.0 06/2001

i8090_INIT_CARD(CARD1, ENC_QUADRANT, ENC_QUADRANT,

ENC_QUADRANT);

(3) unsigned int i8090_GET_ENCODER(unsigned char cardNo, unsigned char axis)

This command will return the counter value of the selected “axis” and

“cardNo”.

cardNo: 0~19, select which card. axis : select which axis.

1 : X-axis

2 : Y-axis

3 : Z-axis

return : a 16 bits unsigned integer value.

(4) void i8090_RESET_ENCODER(unsigned char cardNo, unsigned char axis)

This command will reset the counter value of the selected “axis” and

“cardNo”.

cardNo: 0~19, select which card. axis : select which axis.

1 : X-axis

2 : Y-axis

3: Z-axis

(5)unsigned char i8090_GET_INDEX(unsigned char cardNo)

It will return the “INDEX” register’s value of the selected “cardNo” card. cardNo: 0~19, select which card.

Register

Add.

R/W

Bit 7

Bit 6

Bit 5

Bit 4

Bit 3

Bit 2

Bit 1

Bit 0

INDEX

0x04

R

 

 

 

 

 

ZI

YI

XI

The index input C+/C- can read out from this register. These bits are active high.

XI : indicate the index of X-axis.

YI : indicate the index of Y-axis.

ZI : indicate the index of Z-axis.

http://www.icpdas.com

1-15

ICPDAS

I-8090User Manual

Version 1.0 06/2001

32 bits encoder counts command sets

(6)void i8090_ENCODER32_ISR(unsigned char cardNo)

(7)void i8090_RESET_ENCODER32(unsigned char cardNo, unsigned char axis)

(8)long i8090_GET_ENCODER32(unsigned char cardNo, unsigned

char axis)

cardNo: 0~19, select which card. axis : select which axis.

1 : X-axis

2 : Y-axis

3 : Z-axis

The above three commands provided a software method to get 32 bits encoder counts.

The i8090_ENCODER32_ISR(unsigned char cardNo)command calculates the difference pulse between present and last time, and then add this difference into a ”long type” variable. According to this idea, so, the i8090_ENCODER32_ISR()command should be executed periodically in 2~10ms by timer interrupt or manually call it.

The i8090_RESET_ENCODER32((unsigned char cardNo, unsigned char axis)command can reset the “long type” variable to zero.

The long i8090_GET_ENCODER32(unsigned char cardNo, unsigned char axis)command can return the value of the “long type” variable.

http://www.icpdas.com

1-16

ICPDAS

I-8090User Manual Version 1.0 06/2001

2.2 examples

2.2.1 Detect I-8090card

//---------------------------------------------------

// detect i8090,i8091,i8092 card

//---------------------------------------------------

#include "8000.h" #include "i8090.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-axisencoder card

Print("Slot %d = i8090\r\n",SlotNum); return i8090;

case i8091: //i8091 2-axisstepping card Print("Slot %d = i8091\r\n",SlotNum); return i8091;

case i8092: //i8092

Print("Slot %d = i8092\r\n",SlotNum);

http://www.icpdas.com

1-17

ICPDAS