JS Automation LSI-3104 User Manual

Page 1
LSI-3104
ENCODER/LINEAR SCLAE
INTERFACE CARD
USER'S MANUAL (V1.3)
JS AUTOMATION CORP.
台北縣汐止市㆗興路
100號6
6F,NO.100,CHUNG-SHIN RD.
SHI-TSU,TAIPEI,TAIWAN,R.O.C.
TEL:886-2-2647-6936
FAX:886-2-2647-6940 http://www.automation.com.tw
E-mail:jsnet@automation.com.tw
jservice@automation.com.tw
Export: control.cards@automation.com.tw
Page 2
1
Contents
1. FORWARD ...................................................................................................................................2
2. PACKING LIST...........................................................................................................................2
3. FEATURES...................................................................................................................................3
3.1 MAIN CARD .........................................................................................................................3
3.2 DIN RAIL MOUNTED WIRING BOARD...........................................................................3
4. SPECIFICATIONS......................................................................................................................4
4.1 LSI-3104 MAIN CARD.........................................................................................................4
4.2 LSI-3104 WIRING BOARD..................................................................................................4
5. LAYOUT.......................................................................................................................................5
5.1 LSI3104 MAIN CARD LAYOUT.........................................................................................5
5.2 LSI3104 WIRING BOARD LAYOUT..................................................................................5
6. PIN DEFINITIONS FOR 68P SCSI CONNECTOR................................................................6
6.1 FRONT VIEW OF CONNECTOR........................................................................................6
6.2 PIN DEFINITIONS................................................................................................................6
7. I/O INTERFACE DIAGRAM.....................................................................................................7
7.1 ENCODER INPUT DIAGRAM............................................................................................7
7.2 GENERAL INPUT DIAGRAM............................................................................................7
7.3 OUTPUT DIAGRAM............................................................................................................7
8. EXTERNAL WIRING DIAGRAM............................................................................................9
9. HARDWARE SETTINGS.........................................................................................................10
9.1 CARD ID SETTING............................................................................................................10
9.2 SWITCH SETTING OF WIRING BOARD........................................................................10
10. BASIS OF OPERATIONS.....................................................................................................11
10.1 ADDRESSING METHOD
...................................................................................................11
10.2 LIST OF REGISTERS.........................................................................................................12
11.
APPLICATIONS....................................................................................................................13
12. PROGRAMMING EXAMPLES (DEMO.).........................................................................14
12.1 EXAMPLE 1(USING C)
......................................................................................................14
12.2 EXAMPLE 2 (USING C)
.....................................................................................................14
12.3 EXAMPLE 3(USING ASSEMBLY LANGUAG E )
.............................................................15
12.4 E
XAMPLE PROGRAM USING C LANGUAGE
.............................................................................16
13. DIMENSIONS........................................................................................................................17
13.1 LSI3104 MAIN CARD DIMENSION CARD.....................................................................17
13.2 LSI3104 WIRING BOARD DIMENSION..........................................................................17
14. ORDER INFORMATION.....................................................................................................18
15. COLLECTION OF FUNCTION DESCRIPTIONS...........................................................19
15.1 FUNCTIONS OF REGISTERS
............................................................................................19
15.2 REGISTERS CONCERNING HOMING (X AXIS)
............................................................20
15.3 REGISTERS CONCERNING COUNTER READ (X AXIS).............................................22
15.4 REGISTERS CONCERNING COUNT ER PRESETT ING(X AXIS)
.................................23
15.5 REGISTERS CONCERNING EXTERNA L TRIGGER AND D ATA ACCESS(X AXIS)
.24
15.6 REGISTERS CONCERNING INP U T( X A X IS )
................................................................26
15.7 REGISTERS CONCERNING OUT P UT ( X A X IS )
...........................................................28
15.8 REGISTERS CONCERNING COU N TE R 'S M O DE (X A XI S)
........................................30
15.9 REGISTERS CONCERNING INTERRUPT (XAXIS)
......................................................31
15.10 COMPLEMENTARY FUNCTION
(X AXIS)
................................................................32
15.11 COMMON CONTROL REGISTERS OF INTERRUPT................................................35
15.12 SECURITY CONTROL (OPTION)................................................................................36
15.13 COMPLEMENTARY FUNCTION.................................................................................38
Page 3
2
1.
FORWARD
Thank you for your selection of our PCI bus LSI-3104 encoder/linear scale interface card.。 In the field of automatio n, enco der and linear scale as feedb ack or measu ring element is common used in the microprocessor control system. But for the versatile application in PC based control, only a few selections you can make. We integrate 4 axes (channels) in one card with the state of the art technology of FPGA chip and provide photo coupler isolation and experienced functions such as external triggered latch function at 32 bit counter length. Low cost and high performance makes this card a better choice to use in the servo control feedback , 3D measuring system and other applications which are concerning encoder or linear scale .
Other
encoder/linear scale interface card: LSI-2104 ISA bus encoder/linear scale interface card (4 axes) ENC-9266 ISA encoder/linear scale interface card (3 axes)
Any comment is welcome, please visit our website:
www.automation.com.tw
for the up to date information.
2.
PACKING LIST
2.1 LSI-3104 MAIN CARD 1
2.2 MANUAL CD 1
2.3 DIN RAIL MOUNTED WIRING BOARD 1
2.4 SCSIⅡ68 PINCABLE(1.5m) 1
Page 4
3
3.
FEATURES
3.1 MAIN CARD
3.1.1
PCI plug and play function with card ID for 16 identical cards
3.1.2 High noise immunity with photo-coupler isolation
3.1.3 High speed of receiving pulse up to 2M pps
3.1.4 Each counter possessed 32 bit data width
3.1.5 Presetable temporary buffer to load counter by external trigger or software trigger
3.1.6 Multiple counter reset (homing) modes
3.1.7 Load counter or latch counter to temporary buffer by external trigger
3.1.8 Programmable multiply rate at X1, X2, X4
3.1.9 Programmable assignment of interrupt to system
3.1.10 Security password blocks illegal copy of software.
3.2 DIN RAIL MOUNTED WIRING BOARD
3.2.1 Dip switch selectable differential or single-end input signal
3.2.2 Jumper selectable relay or transistor output
Page 5
4
4.
SPECIFICATIONS
4.1 LSI-3104 MAIN CARD
4.1.1 Photo coupler Isolation Voltage ― 2500 Vac 1 min
4.1.2 Isolation Resistance―100M Ohm(min)1000Vdc
4.1.3 PCI data width ― 32 Bits
4.1.4 Counter width ― 32 Bits
4.1.5 Card ID ― 4 bits
4.1.6 Input channel ― 4 channels X, Y, Z and A, totally 4 compatible device units can be hooked
4.1.7 Input signal type ―photo-coupler isolated with Dip switch selectable differential or single-end input
4.1.8 Input pulse multiply rate ―X1, X2, X4 programmable (quadrature signal only)
4.1.9 Input Mode ― (QUADRATURE),(CLOCK/DIRECTION),(UP CLOCK/ DOWN CLOCK)
4.1.10 Home input per channel ―1 for Home sensor detecting
4.1.11 Latch input per channel ― 1 for external trigger latched counter data at buffer
4.1.12 Clear counter input per channel ― 1
4.1.13 General input per channel ― 1 ,with general type of photo-coupler
4.1.14 Clear counter output per channel ― 1
4.1.15 General output per channel ― 1
4.1.16 Maximum counter speed―Max. 2MHz
4.1.17 Homing (reset) counter method ― one software trigger mode and five H/W trigger mode
4.1.18 Interrupt ―IRQ 3,5,10,11,12,15 software disable/enable and selectable
4.1.19 Polarity ― all input signals are software programmable
4.1.20 External wiring board ― 4 channels per board
4.1.21 Dimension ― 175(W)*122(H)mm, 6.9(W)*4.8(H)in
4.2 LSI-3104 WIRING BOARD
4.2.1 Connection cable ― scsi 68P cable to connect main and wiring board
4.2.2 Power supply voltage to wiring board ― DC+24V
4.2.3 On board build-in s.p.s. ― DC+5V 500ma (max)
4.2.4 Dimension ― 200(W)*72(H)mm, 7.87(W)*2.83(H)in
Page 6
5
5.
LAYOUT
5.1 LSI3104 MAIN CARD LAYOUT
5.2 LSI3104 WIRING BOARD LAYOUT
Card ID
Page 7
6
6.
PIN DEFINITIONS FOR 68P SCSI CONNECTOR
6.1 FRONT VIEW OF CONNECTOR
6.2 PIN DEFINITIONS
PIN
DESCRIPTIONS
PIN
DESCRIPTIONS
1 External DC +24V supply 35
Ground。
2 External DC +24V supply 36
Ground。
3 Regulated +5V out 37
Ground。
4 Regulated +5V out 38
Ground。
5 XA+ input 39 ZA+ input 6 XA- input 40 ZA- input 7 XB+ input 41 ZB+ input
8 XB- input 42 ZB- input
9 XC+ input 43 ZC+ input 10 XC- input 44 ZC- input 11 XHOME+ input 45 ZHOME+ input 12 XHOME- input 46 ZHOME- input 13 XLATCH+ input 47 ZLATCH+ input 14 XLATCH- input 48 ZLATCH- input 15 XCLR_CNTR+ input 49 ZCLR_CNTR+ input 16 XCLR_CNTR- input 50 ZCLR_CNTR- input 17 YA+ input 51 AA+ input 18 YA- input 52 AA- input 19 YB+ input 53 AB+ input 20 YB- input 54 AB- input 21 YC+ input 55 AC+ input 22 YC- input 56 AC- input 23 YHOME+ input 57 AHOME+ input 24 YHOME- input 58 AHOME- input 25 YLATCH+ input 59 ALATCH+ input 26 YLATCH- input 60 ALATCH- input 27 YCLR_CNTR+ input 61 ACLR_CNTR+ input 28 YCLR_CNTR- input
62 ACLR_CNTR- input
29
XE_GENER_IN,general purpose input
63
ZE_GENER_IN,general purpose input
30
YE_GENER_IN,general purpose input
64
AE_GENER_IN,general purpose input
31
XE_GENER_OUT,general purpose output
65
YE_GENER_OUT,general purpose output
32
YE_GENER_OUT,general purpose output
66
YE_GENER_OUT,general purpose output
33
XEXCLR_CNTR,clear counter output
67
ZEXCLR_CNTR,clear counter output
34
YEXCLR_CNTR,clear counter output
68
AEXCLR_CNTR,clear counter output
Page 8
7
7.
I/O INTERFACE DIAGRAM
7.1 ENCODER INPUT DIAGRAM
I/O WIRING BOARD LSI-3104 CARD
<ENCODER I/P CIRCUIT>
7.2 GENERAL INPUT DIAGRAM
I/O BOARD LSI-3104 CARD
<GENERAL I/P CIRCUIT>
7.3 OUTPUT DIAGRAM
1
2
3
4
XOUT XCLR_OUT
GND
+24V
+24Ve
GND
MOSFET Output
+24Ve
GND
Page 9
8
<GENERAL OUTPUT CIRCUIT>
Relay Output
YOUT YCLR_OUT YCOM
1
2
3
4
5
GND
+24V
Relay
+24Ve
Relay
+24Ve
GND
GND
YOUT YCLR_OUT YCOM
1
2
3
4
5
GND
+24V
MOSFET Output
1
2
3
4
5
6
7
Relay
+24Ve
Relay
+24Ve
Relay
+24Ve
Relay
+24Ve
ZOUT ZCLR_OUT AOUT ACLR_OUT ZACOM
GND
+24V
Relay Output
GND
GND
GND
GND
1
2
3
4
5
6
7
ZOUT ZCLR_OUT AOUT ACLR_OUT ZACOM
GND
+24V
MOSFET Output
Page 10
9
8.
EXTERNAL WIRING DIAGRAM
X
+5V GND A
B
C
HOME LAT CLR IN0
XOUT XCLR +24V
YCOM
ZOUT
ZCLR
AOUT
ACLR
+24V GND
+5V GND
INPUT OUTPUT
A PHASE
B PHASE
C PHASE
TO ENCODER POWER
Y
Z
A
+24Vdc Load +24Vdc Load
RELAY OUTPUT
+24Vdc Supply in
+5Vdc Supply out
ZACOM
V
Load
Load
Load
Load
YOUT
YCLR
Load
Load
AC/DC
V
AC/DC
X axis only
MOSFET
type
X
+5V GND A
B
C
HOME LAT CLR IN0
XOUT XCLR +24V
YOUT
YCLR
YCOM
GND
ZOUT ZCLR AOUT
ACLR
GND
+24V GND
+5V
GND
INPUT OUTPUT
A PHASE
B PHASE
C PHASE
TO ENCODER POWER
Y
Z
A
+24Vdc Load +24Vdc Load
MOSFET OUTPUT
Load Load
MAX 120
V
Load Load Load Load
ZACOM
MAX 120
V
+24Vdc
Supply in
+5Vdc
Supply out
X axis only
MOSFET
type
Page 11
10
9.
HARDWARE SETTINGS
9.1 CARD ID SETTING
Since PCI cards have plug and play function, the card ID is required for programmer to identify which card he/she will control without knowing the physical address assigned by the Windows. A 4 bits DIP switch for extinguishing the 16 identical card.
The following example sets the card ID at 12.
DIP SW SETTING:(ID=12)
9.2 SWITCH SETTING OF WIRING BOARD
SW Set ON Set OFF
A- XA+ is SIGNLE END input XA+ and XA- is DIFFERENTIAL input B- XB+ is SIGNLE END input XB+ and XB- is DIFFERENTIAL input C- XC+ is SIGNLE END input XC+ and XC- is DIFFERENTIAL input H- XHOME+ is SIGNLE END XHOME+ and XHOME- is DIFFERENTIAL
LAH- XLAH+ is SIGNLE END input XLAH+ and XLAH- is DIFFERENTIAL input
Switch 1
CLR- XCLR+ is SIGNLE END input XCLR+ and XCLR- is DIFFERENTIAL input
A- YA+ is SIGNLE END input YA+ and YA- is DIFFERENTIAL input B- YB+ is SIGNLE END input YB+ and YB- is DIFFERENTIAL input C- YC+ is SIGNLE END input YC+ and YC- is DIFFERENTIAL input H- YHOME+ is SIGNLE END YHOME+ and YHOME- is DIFFERENTIAL
LAH- YLAH+ is SIGNLE END input YLAH+ and YLAH- is DIFFERENTIAL input
Switch 2
CLR- CLR+ is SIGNLE END input YCLR+ and YCLR- is DIFFERENTIAL input
A- ZA+ is SIGNLE END input ZA+ and ZA- is DIFFERENTIAL input B- ZB+ is SIGNLE END input ZB+ and ZB- is DIFFERENTIAL input C- ZC+ is SIGNLE END input ZC+ and ZC- is DIFFERENTIAL input H- ZHOME+ is SIGNLE END ZHOME+ and ZHOME- is DIFFERENTIAL
LAH- ZLAH+ is SIGNLE END input ZLAH+ and ZLAH- is DIFFERENTIAL input
Switch 3
CLR- ZCLR+ is SIGNLE END input ZCLR+ and ZCLR- is DIFFERENTIAL input
A- AA+ is SIGNLE END input AA+ and AA- is DIFFERENTIAL input B- AB+ is SIGNLE END input AB+ and AB- is DIFFERENTIAL input C- AC+ is SIGNLE END input AC+ and AC- is DIFFERENTIAL input H- AHOME+ is SIGNLE END AHOME+ and AHOME- is DIFFERENTIAL
LAH- ALAH+ is SIGNLE END input ALAH+ and ALAH- is DIFFERENTIAL input
Switch 4
CLR- ACLR+ is SIGNLE END input ACLR+ and ACLR- is DIFFERENTIAL input
1 234
0
1
ON
1248
Weighting
Page 12
11
10. BASIS OF OPERATIONS
10.1 ADDRESSING METHOD
LSI3104 use indirect R/W through PC's I/O port, and the data width is 16 bits. Due to LSI3104 is a PCI BUS card; the base add ress is assigned b y BIOS or Windows system. However we still offer a libra ry fo r get bas e add ress (G_p ci_adr.h,G_adr_s.obj) in DOS mode , whereas in Windows system we support DLL for application link. As the following diagram, PC writes at Base+0 I/O address to set up the index as t h e a d dr es s of on card registers. Any R/W to base+2 may follow to read or write data from/to the addressed register.
D15
D0
A0
A15
ADDRESS
REGISTERS
DATA
I N D
E
X
B
U
F F
R
I/O BASE+0
I/O BASE+2
DATA
DATADATA
DATA
DATA
DATADATA
DATA
Page 13
12
10.2 LIST OF REGISTERS
Index
address
R/W Descriptions Mnemonics Ref.
0000H R/W
hardware homing register
HARD_HOMING
0001H R
hardware clear counter flag
R_HARD_CLR_CNTR_FLAG
0002H W
software homing register
SOFT_HOMING
15.2
0003H W
update counter buffer
UPDATE_CNTR
0004H R
counter high word register
CNTR_HIGH_WORD
0005H R
counter low word register
CNTR_LOW_WORD
15.3
0006H W
preload high word to buffer
PRELOAD_HIGH_WORD
0007H W
preload low word to buffer
PRELOAD_LOW_WORD
0008H W
load preset value to counter
LOAD_PRESET_VALUE
15.4
0009H R/W
external trigger latch ena ble
LATCH_ENABLE
000AH R/W
external trigger latch/load mode
LATCH_MODE
000BH R
external trigger latch/load flag
LATCH_FLAG
000CH R
high word latch buffer
LATCH_HIGH_WORD
000DH R
low word latch buffer
LATCH_LOW_WORD
15.5
000EH R/W
general input polarity register
GENERAL_INPUT_LOGIC
000FH R
general input register
GENERAL_ INPUT
0010H R
zero input register
ZERO_INPUT
0011H R/W
zero input toggle fla g
ZERO_TOGGLE_FLAG
0012H R
home input register
HOME_INPUT
0013H R
external trigger/latch input register
LATCH_INPUT
0014H R
clr_cntr input register
CLR_CNTR_INPUT
15.6
0015H R/W
general output polarity register
GENERAL_OUTPUT_LOGIC
0016H R/W
general output register
GENERAL_OUTPUT
0017H R/W
mode register of clr_cntr out
CLR_CNTR_OUT_MODE
0018H R/W
second general output polarity register
GENERAL_OUTPUT2_LOGIC
0019H R/W
second general output register
GENERAL_OUTPUT2
15.7
001AH R/W
counter mode register
COUNT_MODE
001BH R/W
multiply register of qudrature mode
QUDRATURE_TIMES
15.8
001CH R/W
interrupt enable register
INTERUPT_ENABLE
001DH R/W
interrupt mode register
INTERUPT_MODE
001EH R/W
interrupt flag
INTERUPT_FLAG
15.9
001FH R/W
register of zero input polarity
ZERO_INPUT_LOGIC
0020H R/W
register of home input polarity
HOME_INPUT_LOGIC
0021H R/W
register of latch input polarity
LATCH_INPUT_LOGIC
0022H R/W
register of clr_cntr input polarity
CLR_CNTR_INPUT_LOGIC
0023H R/W
register of a_phase polarity
A_PHASE_INPUT_LOG
0024H R/W
register of b_phase polarity
B_PHASE_INPUT_LOG
0025H R
a_phase input register
READ A_P HASE INPUT
0026H R
b_phase input register
READ B_PHASE INPUT
0027H R/W
mode register of output1 (onl y valid for x,z axis)
SET GENERAL OUTPUT1 MODE
0028H R/W
high word register of auto increment value (only valid for x,z axis)
WRITE INCREASE COMPARE VALUE HIGH WORD
0029H R/W
low word register of auto increment value (only valid for x,z axis)
WRITE INCREASE COMPARE VALUE LOW WORD
002AH R/W
load preset value from buffer to comparator (only valid for x,z axis)
LOAD COMPARE VALUE
15.10
00C1H R/W
interrupt identify register
INTERUPT_IDENTIFY
00C2H W
eoi register
INTERUPT_EOI
15.11
00C3H R/W
register of new security code
NEW_SECURITY_CODE
00C4H R/W
register of old security code
OLD_SECURITY_CODE
00C5H R/W
set security mode register
SET_SECURITY_MODE
00C6H R
key status re giste r
KEY_STATUS
00C7H R/W
security status
SECURITY_STATUS
15.12
00C8H R/W
common tri gger mode r egi ste r
SET_X_LAT_ALL
15.13
Page 14
13
11.
APPLICATIONS
11.1 For counting pulses on the fly, such as:
- Encoder on various kinds of servo motor
- Encoder on DC/AC motor
- Optical scale output signal
- Magnetic linear scale output
- Timing disc
- Revolution sprocket
- Proximity sensor/detector with relative motion
- Timer counter
11.2 Pulse signal receiver /display
11.3 Rhenishaw ext-trigger to latch position
11.4 X-Y Table linear Scale F/B
Page 15
14
12.
PROGRAMMING EXAMPLES (DEMO.)
12.1 EXAMPLE 1(USING C)
Configure hardware clear counter during encoder input A,B,Z signals and Home
L/S are low.
C language example as follows: ( BASE the I/O base address set)
#define HARD_HOMING 0 //define HARD_HOMING register address Disable(); //disable interrupt OUTPORT(BASE + 0,HARD_HOMING); //set up register index
OUTPORT
BASE + 2,0x0001); //write data to HARD_HOMING register
Enable(); //enable interrupt
12.2 EXAMPLE 2 (USING C)
To read the counter data of X axis.
C language example as follows: ( BASE the I/O base address set)
#define UPDATE_CNTR 3 //address of UPDATE_CNTR of X axis #define
CNTR_HIGH_WORD
4 // address of READ_H_WORD of X axis
#define
CNTR_LOW_WORD
5 // address of READ_L_WORD of X axis
int Cntr_low_value; //declare Cntr_low_value as integer int Cntr_hi_value; // declare Cntr_hi_value as integer long Cntr_value; // declare Cntr _value as long integer
Disable(); //disable interrupt OUTPORT ( BASE + 0,UPDATE_CNTR)
; //
setup address of UPDATE_CNTR
OUTPORT ( BASE + 2,0X0001)
; //
command to update
OUTPORT ( BASE + 0
CNTR_LOW_WORD
) ;
// setup address of
CNTR_LOW_WORD
Cntr_low_value =INPORT ( BASE + 2 ); //read data from
CNTR_LOW_WORD
OUTPORT ( BASE + 0
CNTR_HIGH_WORD
) ;
// setup address of
CNTR_HIGH_WORD
Cntr_hi_value = INPORT ( BASE + 2 ); // read data from
CNTR_HIGH_WORD
Enable(); //enable interrupt Cntr_value = Cntr_hi_value * 65536 + Cntr_low_value; //caculate to long integer
[Note]: Disable interrupt before read/write is required to ensure no interruption of the execution of setting of address of register and read/write its data.
Page 16
15
12.3 EXAMPLE 3(USING ASSEMBLY LANGUAGE)
Write a short paragraph of assembly language to read the input buffer.
己知
RAM.
Program is as follows: ( BASE the I/O base a ddress set)
MOV DX,BASE ;Set Dx as I/O index register
MOV AX
GENERAL_ INPUT
put address
of GENERAL_ INPUT
in AX OUT DX,AX ;write to setup index register MOV DX,BASE+2 ;Set up Dx for data R/W IN AX,DX ;read data from
GENERAL_ INPUT
register
Page 17
16
12.4 Example program using C language
// This example use quadrature mode // to count the input pulse in X axis and // update the counter reading to screen
#include <dos.h> #include <conio.h> #include <ctype.h> #include <stdio.h>
#define UPDATE_CNTR 3 //address of
UPDATE COUNTER BUFFER
#define READ_H_WORD 4 // address of
COUNTER HIGH WORD REGISTER
#define READ_L_WORD 5 // address of
COUNTER LOW WORD REGISTER
#define PRELOAD_H_W 6 //address of
PRELOAD HIGH WORD TO BUFFER
#define PRELOAD_L_W 7 //address of
PRELOAD LOW WORD TO BUFFER
#define PRELOAD_CMD 8 //address of
LOAD PRESET VALUE TO COUNTER
#define BASE 0x280 //base I/O address = 280H void main() // program start
{ int Cntr_low_value; //declaration of Cntr_low_value as interger int Cntr_hi_value; // declaration of Cntr_hi_value as interger long Cntr_value; // declaration of Cntr_value as long
clrscr(); // clear screen printf("Please set base address = 280h\n"); //Request to set Dip switch to 280h
getch(); //wait for keyin printf("Press any key to preset counter value \n");
printf("set counter = 6476936 \n"); getch(); // wait for keyin outpw( BASE + 0 , PRELOAD_H_W ) ; //set index to PRELOAD_H_W
outpw( BASE + 2 , 0x0062 ) ; //write data // 6476936 D = 62D488 H outpw( BASE + 0 , PRELOAD_L_W ) ; //set index to PRELOAD_L_W
outpw( BASE + 2 , 0xD488 ) ; //write data outpw( BASE + 0 , PRELOAD_CMD); //set index to PRELOAD_CMD outpw( BASE + 2 , 0X0001); //load data
// the following are read COUNTER data and display
clrscr();
printf("X-CNTR : 00000000 \n");
printf("Press any key to stop program ! ");
_setcursortype(_NOCURSOR);
while ( ! kbhit() ) // if no key stroke read counter data
{
outpw( BASE + 0 , UPDATE_CNTR); //set index to UPDATE_CNTR
outpw( BASE + 2 , 0X0001); //command to latch
outpw( BASE + 0 , READ_L_WORD ) ; //set index to READ_L_WORD
Cntr_low_value = inpw( BASE + 2 ); //read data
outpw( BASE + 0 , READ_H_WORD ) ; // set index to READ_H_WORD Cntr_hi_value = inpw( BASE + 2 ); // read data Cntr_value = Cntr_hi_value * 65536 + Cntr_low_value; //caculate to result
gotoxy(14,1);cprintf("%08lu",Cntr_value);// print to screen
}
} // program end
Page 18
17
13.
DIMENSIONS
13.1 LSI3104 MAIN CARD DIMENSION CARD
13.2 LSI3104 WIRING BOARD DIMENSION
Page 19
18
14.
ORDER INFORMATION
PRODUCT DESCRIPTIONS LSI-3104 4 channels encoder/linear scale interface card LSI-3104 DIN DIN rail mounted wiring board with 4 channels on the board LSI-3104 DMO
Demo program of LSI-3104 card for DOS (free with user manual)
LSI-3104 WIN Dll (VB/VC/C++ Builder) of LSI-3104 card for Win95/98/NT LSI-3104 LBV Vi of LSI-3104 card for LabVIEW
Page 20
19
15. COLLECTION OF FUNCTION DESCRIPTIONS
15.1 FUNCTIONS OF REGISTERS
Collection of function descriptions
of LSI3104
=======================================================================
Format:
Address of register
XXXXH ----->means XXXXH is the address of register
Command
YYYYH ----->means d ata YYYYH will be read or write to th e register
(addressed by XXXXH) through base I/O address+2
======================================================================= Address of register for X axis 0000H ~ 002FH Address of register for Y axis 0030H ~ 005FH (Address of register for X axis +0030H) Address of register for Z axis 0060H ~ 008FH (Address of register for X axis +0060H) Address of register for A axis 0090H ~ 00BFH (Address of register fo r X axis +0090H) Address of common register 00C0H ~ 00E0H
The following examples are based on X axis only , but you can use for other axis by adding the offset value.
Page 21
20
15.2 REGISTERS CONCERNING HOMING (X AXIS)
Address of register:0000H --------- HARDWARE HOMING REGISTER
======================================================================= Command:(READ/WRITE)
0000H-->Normal operation (default) 0001H-->Clear counter while A,B,Z,Home signal are "LOW" simultaneously.
0002H-->Clear counter while home signal has just inactive and counter up count and
the first time A,B,Z are "LOW" simultaneously.
0003H--> Clear counter while home signal has just inactive and counter down count
and the first time A,B,Z are "LOW" simultaneously.
0004H-->Clear counter at the tailing edge of home signal. 0005H--> Clear counter at CLR_CNTR input active low. 0006H--> Clear counter while A,B,Z,Home signal are "LOW" simultaneously.
Once the counter cleared, this command will also cleared to "0" (Normal mode).
0007H--> Clear counter while home signal has just inactive and counter up count
and the first time A,B,Z are "LOW" simultaneously. Once the counter cleared, this command will also cleared to "0" (Normal
mode).
0008H--> Clear counter while home signal has just inactive and counter down count
and the first time A,B,Z are "LOW" simultaneously. Once the counter cleared, this command will also cleared to "0" (Normal
mode).
0009H--> Clear counter at the tailing edge of home signal. Once the counter cleared,
this command will also cleared to "0" (Normal mode).
000AH--> Clear counter at CLR_CNTR input active low. Once the counter cleared,
this command will also cleared to "0" (Normal mode).
COMMENTS : NONE
Page 22
21
Address of register:0001H ----- HARDWARE CLEAR COUNTER FLAG
======================================================================= Return:(READ ONLY)
0000H
Æ
No function
0001H
Æ
Hardware clear counter has been done.(After read the register value will
reset to "0")
Address of register:0002H ----- SOFTWARE HOMING REGISTER
======================================================================= Command:(WRITE ONLY)
0000HÆNo function 0001H
Æ
Clear counter。(Once the counter is cleared the register value will reset to
"0")
Page 23
22
15.3 REGISTERS CONCERNING COUNTER READ (X AXIS)
Address of register:0003H ----- UPDATE COUNTER BUFFER
======================================================================= Command:(WRITE ONLY)
0000HÆNo function 0001HÆ UPDATE COUNTER BUFFER. (Once buffer is updated , the register
value will reset to "0")
Address of register:0004H ----- COUNTER HIGH WORD REGISTER
======================================================================= Return:(READ ONLY)
YYYYHÆHigh word data from counter buffer.
Address of register:0005H ----- COUNTER LOW WORD REGISTER
======================================================================= Return:(READ ONLY)
YYYYHÆ Low word data from counter buffer.
Page 24
23
15.4
REGISTERS CONCERNING COUNTER PRESETTING(X AXIS)
Address of register:0006H ----- PRELOAD HIGH WORD TO BUFFER
======================================================================= Command:(WRITE ONLY)
YYYYH--> High word data preloaded to buffer
Address of register
0007H ----- PRELOAD LOW WORD TO BUFFER
======================================================================= Command
(WRITE ONLY)
YYYYH-->Low word data preloaded to buffer
Address of register:0008H ----- LOAD PRESET VALUE TO COUNTER
======================================================================= Command:(WRITE ONLY)
0000H-->No function 0001H-->Load preset value from buffer to counter. (Once counter is loaded, the
register value will be cleared to "0".)
Page 25
24
15.5
REGISTERS CONCERNING EXTERNAL TRIGGER AND DATA ACCESS(X AXIS)
Address of register:0009H ----- EXTERNAL TRIGGER LATCH ENABLE
======================================================================= Return/Command:(READ/WRITE )
0000H--> External trigger latch disable. 0001H--> External trigger latch enable. (default)
Comment:While register 000AH (EXTERNAL TRIGGER LATCH/LOAD MODE) has been set
to 1 or 2,and the external trigger/load occurred this register value will be reset to "0".
Address of register:000AH ----- EXTERNAL TRIGGER LATCH/LOAD MODE
======================================================================= Return/Command:(READ/WRITE )
0000H-->Continuous external trigger latch (counter)mode.(default) 0001H-->One shot external trigger latch mode. Once triggered the register
0009H(EXTERNAL TRIGGER LATCH ENABLE) will be reset to "0". 0002H--> Continuous external trigger load (counter) mode. 0003H--> One shot external trigger load mode. Once triggered the register
0009H(EXTERNAL TRIGGER LATCH ENABLE) will be reset to "0".。
Address of register
000BH ----- EXTERNAL TRIGGER LATCH/LOAD FLAG
=======================================================================
Return:(READ ONLY ) 0000H-->Latch/load has not been occurred.
0001H-->Latch/load has been occurred. (Once read
the value will be reset to "0")
Page 26
25
Address of register:000CH ----- HIGH WORD LATCH BUFFER
=======================================================================
Return:(READ ONLY) YYYYH-->High word data from latch buffer.
Address of register:000DH ----- LOW WORD LATCH BUFFER
=======================================================================
Return
(READ ONLY)
YYYYH-->Low word data from latch buffer.
Page 27
26
15.6
REGISTERS CONCERNING INPUT(X AXIS)
Address of register:000EH ----- GENERAL INPUT POLARITY REGISTER
=======================================================================
Command/Return:(READ/WRITE) 0000H-->Negative polarity,active low. (default) 0001H-->Positive polarity , active high.
Note: There is only one general input bit for each axis, so only one polarity bit for it.
Address of register:000FH ----- GENERAL INPUT REGISTER
=======================================================================
Return:(READ ONLY) 0000H-->Input inactive.
0001H-->Input active. Note: There is only one general input bit for each axis.
Address of register:0010H ----- ZERO INPUT REGISTER
=======================================================================
Return:(READ ONLY) 0000H-->Inactive.
0001H-->Active.
Page 28
27
Address of register:0011H ----- ZERO INPUT TOGGLE FLAG
=======================================================================
Return/Command:(READ/WRITE) Trailing edge of ZERO input toggles bit 0.
Address of register:0012H ----- HOME INPUT REGISTER
=======================================================================
Return
(READ ONLY)
0000H-->Inactive 0001H-->Active.
Address of register:0013H ----- EXTERNAL TRIGGER/LATCH INPUT REGISTER
=======================================================================
Return:(READ ONLY) 0000H-->Inactive
0001H-->Active.
Address of register
0014H ----- CLR_CNTR INPUT REGISTER
=======================================================================
Return:(READ ONLY) 0000H-->Inactive.
0001H-->Active.
Page 29
28
15.7
REGISTERS CONCERNING OUTP U T ( X A X IS)
Address of register:0015H ----- GENERAL OUTPUT POLARITY REGISTER
=======================================================================
Command/Return:(READ/WRITE) 0000H-->Active low. (default)
0001H-->Active high.
Note: Th ere is only one general outpu t bit for each ax is , so only one po larity bit for it.
Address of register
0016H ----- GENERAL OUTPUT REGISTER
=======================================================================
Command/Return
(READ/WRITE)
0000H-->Inactive. 0001H-->Active.
Note: On ly one general output bit for each axis
Address of register:0017H -- MODE REGISTER OF CLR_CNTR OUT
=======================================================================
Command/Return
(READ/WRITE)
0000H-->Generate an active low output for about 0.1s. (default) 0001H-->Take CLR_CNTR as second general output.(Only in this mode,function of
register 0018H and register 0019H is effective )
Page 30
29
Address of register:0018H --- SECOND GENERAL OUTPUT POLARITY REGISTER
=======================================================================
Command/Return:(READ/WRITE) 0000H-->Active low. (default)
0001H-->Active high
Address of register:0019H --- SECOND GENERAL OUTPUT REGISTER
=======================================================================
Command/Return:(READ/WRITE) 0000H-->Inactive.
0001H-->Active.
Page 31
30
15.8
REGISTERS CONCERNING COUN T E R ' S M O D E ( X A X I S )
Address of register:001AH ----- COUNTER MODE REGISTER
========================================================================
Command/Return:(READ/WRITE) 0000H-->A,B phases input quadrature up count mode(if A lead B).(default) 0001H-->A,B phases input quadrature down count mode(if A lead B). 0002H-->A input is CLOCK,B input is DIRECTION,up count mode. 0003H--> A input is CLOCK,B input is DIRECTION,down count mode.。 0004H-->A input is UP CLOCK,B input is DOWN CLOCK,dual clock mode. 0005H-->A input is DOWN CLOCK,B input isUP CLOCK,dual clock mode.
Address of register:001BH --- MULTIPLY REGISTER OF QUDRATURE MODE
=======================================================================
Command/Return:(READ/WRITE) 0000H-->X 4. (default)
0001H-->X 2. 0002H-->X 1.
Page 32
31
15.9
RE GISTERS CONCERNING INTERRUPT (XAXIS)
Address of register:001CH ----- INTERRUPT ENABLE REGISTER
=======================================================================
Command/Return:(READ/WRITE ) 0000H-->Disable interrupt.(default)
0001H-->Enable interrupt.
Address of register
001DH ----- INTERRUPT MODE REGISTER
=======================================================================
Command/Return:(READ/WRITE ) 0000H--> Interrupt on external latch/load occurred.(default)
0001H--> Interrupt on hardware counter clear. 0002H--> Interrupt on counter value equals counter preset register value. 0003H--> Interrupt on counter carry occurred. 0004H--> Interrupt on counter borrow occurred.
Address of register
001EH ----- INTERRUPT FLAG
=======================================================================
Command/Return:(READ/WRITE) 0000H-->No function
0001H-->External trigger latch/load occurred. 0002H-->Hardware counter clear occurred. 0003H--> Counter value equals counter preset register value occurred. 0004H--> Counter carry occurred. 0005H--> Counter borrow occurred.
Comment
The register’s value will not be “0” until INTERRUPT EOI register (00C2H) set to “1”
to confirm end of interrupt.
Write the above defined value to this register will simulate
the occurrence of the real
condition and generate interrupt.
Page 33
32
15.10 COMPLEMENTARY FUNCTION
(X AXIS)
Address of register:001FH ----- REGISTER OF ZERO INPUT POLARITY
=======================================================================
Command/Return:(READ/WRITE) 0000H--> Input pin short to ground, input buffer reads “1”, else “0”.(default)
0001H--> Input pin short to ground, input buffer reads “0”, else “1”.
Address of register
0020H ----- REGISTER OF HOME INPUT POLARITY
=======================================================================
Command/Return:(READ/WRITE) 0000H--> Input pin short to ground, input buffer reads “1”, else “0”.(default)
0001H--> Input pin short to ground, input buffer reads “0”, else “1”.
Address of register:0021H ----- REGISTER OF LATCH INPUT POLARITY
=======================================================================
Command/Return:(READ/WRITE) 0000H--> Input pin short to ground, input buffer reads “1”, else “0”.(default)
0001H--> Input pin short to ground, input buffer reads “0”,else “1”
Address of register
0022H -- REGISTER OF CLR_CNTR INPUT POLARITY
=======================================================================
Command/Return
(READ/WRITE)
0000H--> Input pin short to ground, input buffer reads “1”, else “0”.(default) 0001H--> Input pin short to ground, input buffer reads “0”, else “1”.
Page 34
33
Address of register:0023H ----- REGISTER OF A_PHASE POLARITY
=======================================================================
Command/Return:(READ/WRITE) 0000H--> Input pin short to ground, input buffer reads “1”, else “0”.(default)
0001H--> Input pin short to ground, input buffer reads “0”, else “1”.
Address of register:0024H ----- REGISTER OF B_PHASE POLARITY
=======================================================================
Command/Return:(READ/WRITE) 0000H--> Input pin short to ground, input buffer reads “1”, else “0”.(default)
0001H--> Input pin short to ground, input buffer reads “0”, else “1”.
Address of register:0025H ----- A_PHASE INPUT REGISTER
=======================================================================
Return:(READ ONLY) 0000H-->Inactive。 0001H-->Active。
Address of register:0026H ----- B_PHASE INPUT REGISTER
=======================================================================
Return
(READ ONLY)
0000H--> Inactive
0001H--> Active。
Page 35
34
Address of register:0027H – SET GENERAL OUTPUT1 MODE
=======================================================================
Command/Return:(READ/WRITE) 0000H--> (default) output1 as general output。 0001H-->when preset compare value = counter value, then output1 send out a 0.3s
active pulse. ( To use this mode register 06H,07H and 2AH must configure appropriate value first)
0002H-->when preset compare value = counter value, then output1 send out a 0.3s
active pulse and the comparator valu e auto increments with preset incremental value (in register 28H,29H). ( To use this mode register 06H,07H 2AH and 28H,29H must configure appropriate value first)
Comment: Only valid for X,Z axis.
Address of register
0028H ----- HIGH WORD OF INCREMENTAL VALUE
=======================================================================
Command:(WRITE ONLY) YYYYH-->high word of incremental value to be added to comparator
Comment : Only valid for X,Z axis.
Address of register:0029H ----- LOW WORD OF INCREMENTAL VALUE
=======================================================================
Command:(WRITE ONLY) YYYYH-->low word of incremental value to be added to comparator
Comment : Only valid for X,Z axis.
Address of register
002AH ----- LOAD COMPARE VALUE
=======================================================================
Command
(WRITE ONLY)
0000H-->no function 0001H-->load data from preset buffer to comparator. (Once the data load, the preset value will be cleared)
Comment : Only valid for X,Z axis.
Page 36
35
15.11 COMMON CONTROL REGISTERS OF INTERRUPT
Address of register:00C1H ----- INTERRUPT IDENTIFY REGISTER
=======================================================================
Command/Return:(READ/WRITE) 0000H-->no function
BIT0 -->1- X axis generate interrupt ,else 0. BIT1 -->1- Y axis generate interrupt ,else 0. BIT2 -->1- Z axis generate interrupt ,else 0. BIT3 -->1- A axis generate interrupt ,else 0.
Comment:The register’s value will not be cleared until EOI REGISTER (00C2H) receives a end
of interrupt command.
Writing to this register at the corresponding interrupt bit will generate the interrupt.
Address of register:00C2H ----- EOI REGISTER
=======================================================================
Command/Return:(WRITE ONLY) 0000H-->no function (default)
0001H-->end of interrupt (EOI).
Comment:Write the EOI command will reset the irq pin to low . Next irq is possible when irq pin
low.
Page 37
36
15.12 SECURITY CONTROL (OPTION)
Address of register:00C3H ----- REGISTER OF NEW SECURITY CODE
=======================================================================
Command/Return:(READ/WRITE) YYYYH-->New security code
Address of register:00C4H ----- REGISTER OF OLD SECURITY CODE
=======================================================================
Command/Return
(READ/WRITE)
YYYYH--> OLD SECURITY CODE
Address of register:00C5H ----- SET SECURITY MODE REGISTER
=======================================================================
Command/Return:(READ/WRITE) 0000H-->normal
0001H-->unlock 0002H-->error 0003H-->lock, if unlock error consecutively more than 10 times 0004H-->set password
Page 38
37
Address of register:00C6H ----- KEY STATUS REGISTER
=======================================================================
Return:(READ ONLY) 0000H-->key locked.
0001H-->key unlock.
Address of register:00C7H ----- SECURITY STATUS
=======================================================================
Return:(READ ONLY) 0000H-->security function not activate
0001H-->security function activate
Page 39
38
15.13 COMPLEMENTARY FUNCTION
Address of register:00C8H ----- COMMON TRIGGER MODE REGISTER
=======================================================================
Command/Return:(READ/WRITE) 0000H-->individual mode.(default)
0001H-->4 axes common triggered by X trigger input.
Loading...