Home
IK 121 - CTI Software
Contents
1. Bit Function D2 Offset value D3 for the 90 signal in two s complement form D4 D5 D6 D7 D8 D9 D10 D11 No function D12 D13 D14 D15 4tisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Registers 18h Amplitude for 90 signal read access After each analog digital conversion the result is stored Before reading the values should be frozen by bit D4 in Control Register 2 Bit Function DO D1 D2 D3 D4 D5 D6 D7 D8 D9 D10 D11 D12 D13 D14 D15 Amplitude for the 90 signal No function Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantd Som Registers 1Ah Timer Register write access The 13 bit timer value is stored in Registers 1Ah and 1Bh The Timer Register can therefore hold values from 0 to 8191 The cycle time is indicated in us one us must be subtracted from the desired cycle time Example Desired cycle time 1 ms 1000 us Value to be programmed 1000 1 999 Note that writing this register does not start the timer The timer is started by setting bit D2 in Initializing Register 1 OCh Furthermore the corresponding bits must be set in Enable Registers 12h 13h or 14h Bit DO D1 D2 D3 D4 D5 D6 D7 D8 D9 D10 D11 D12 D13 D14 D15 Function Timer value No function 1Ah Read mode has no function Mttisan T
2. ssssssssssseesseeseeeeeenn enne nennen nennen tnnt nn nennen ens 8 Technical Description of the IK 121 9 Time to access measured values 11 Hardware 1 c nen ogneniupuac ente pio eate terit tia UR cie sube 12 PC bus specification 12 Encoder inputs IK 121 A ssssssssssssssees 12 Encoder inputs IK 121 V 13 Encoder outputs 14 Encoder signal adjustment ssssssssssssess 16 External functions sssssssssssssssseeeeeeenenes 17 Assembling the connector for the external functions 18 Latching measured values via external inputs 18 Latching output X3 OUT sssssssssssse 19 Latching inputs X3 LO X3 L1 and latching output X3 OUT Time diagram and voltage level 19 Latching measured values from multiple IK 121s 21 lazio c 21 Addressing dtd reete trad tie 22 Registers dorem ete eee entendu tieu dele eie ee eke 24 Overview of registers sssssssssssssssseeee 24 Data registers for the counters sssssssssssssssess 25 OCH Initializing Register 1 write mode 26 OCH Initializing Register 2 write mode 27 OEh Control Register 1 write mode 28 OEh Status Register 1 read mode 29 OEh Status Register 2 read mode 30 10h Reference Mark Register write mode
3. 31 10h Amplitude Value Register read mode 34 12h Enable Register for measured value latch write mode ssssssemR mme 35 12h Register for axis cascading and for I C bus control write mode 36 14h Interrupt Enable Register write mode 37 14h Interrupt Status Register 1 read mode 38 14h Interrupt Status Register 2 read mode 39 16h Offset Register for 0 signal write mode 40 16h Amplitude for O signal read mode 41 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Contents 18h Offset Register for 90 signal write access 42 18h Amplitude for 90 signal read access 43 1Ah Timer Register write ACCESS cece eee 44 1Ch Control Register 2 write access 45 ICh Status Register 3 read access 46 1Ch Code Register read ACCESS ssssse 47 1Eh Control Register 3 write access 48 1Eh Status Register 4 read mode 49 The IK 121 in DOS Applications Quick Start IK121 O files Basic functions for writing and reading the I GglSters nts eroe nal ven e d ect d pede rg 54 Procedure for writing to the registers 54 Function for read
4. Address of the address register adr reg baseadr or 0008 Value of the address register RO to R2 address of the counter without BO and B1 adr point address shr 2 Load address register portw adr reg adr point Calculate port address if axes 1 then adr gate baseadr or address and 03 else adr gate baseadr or 0004 or address and 03 Read datum from the counter read g26 portw adr gate END 1 g26 is the HEIDENHAIN designation of the counter Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantd bom The IK 121 in DOS Applications Function in BORLAND C unsigned int read g26 unsigned int baseadr unsigned char axis unsigned int address unsigned int adr_reg adr_point adr_gate Discard the last four bits of the card address baseadr baseadr amp OxOFFO0 Address BO to B4 of the counter address address amp OxI1F Load address pointer into address register Form address of the address register adr reg baseadr 0x0008 Value of the address register RO to R2 address of the counter without BO and B1 adr point address gt gt 2 Load address register outpw adr reg adr point Calculate port address switch axis case 1 adr gate baseadr address amp 0x03 break case 2 adr gate baseadr 0x0004 address amp 0x03 break Read datum from the cou
5. Titisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com The IK 121 in DOS Applications Procedure read adr Reads the address of the IK121 from the file IK121 INI Prototype PROCEDURE read adr board ik121 pointr Procedure write adr Writes the address of the IK 121 into the file IK121 INI Prototype PROCEDURE write adr board ik121 pointr Procedure read signal status Reads the data for the structure signalstate from the registers 11h 16h 17h 18h and 19h Prototype PROCEDURE read signal status pointr g26 pointr Procedure read count status Reads the data for the structure countstate from the registers OEh and OFh Prototype PROCEDURE read count status pointr g26 pointr Procedure read int status Reads the data for the structure intstate from the registers 14h and 15h Prototype PROCEDURE read int status pointr g26 pointr Procedure soft latchO Stores a measured value in Data Register O Prototype PROCEDURE soft latchO pointr g26 pointr Procedure soft latch1 Stores a measured value in Data Register 1 Prototype PROCEDURE soft latch1 pointr g26 pointr Procedure read rego Reads a measured value from Data Register O Prototype PROCEDURE read reg0 pointr g26 pointr Procedure read regi Reads a measured value from Data Register 1 Prototype PROCEDURE read reg 1 pointr g26 pointr Artisan Technology Group Quality Instrumentation Guaranteed
6. A rtisan Artisan Technology Group is your source for quality TecmoogyGroup new and certified used pre owned equipment FAST SHIPPING AND SERVICE CENTER REPAIRS WE BUY USED EQUIPMENT DELIVERY Experienced engineers and technicians on staff Sell your excess underutilized and idle used equipment TENS OF THOUSANDS OF at our full service in house repair center We also offer credit for buy backs and trade ins IN STOCK ITEMS www artisantg com WeBuyEquipment EQUIPMENT DEMOS HUNDREDS OF InstraV ea REMOTE INSPECTION LOOKING FOR MORE INFORMATION MANUFACTURERS Remotely inspect equipment before purchasing with Visit us on the web at www artisantg com 7 for more our interactive website at www instraview com 7 information on price quotations drivers technical LEASING MONTHLY specifications manuals and documentation RENTALS ITAR CERTIFIED yop aed Contact us 888 88 SOURCE sales artisantg com www artisantg com HEIDENHAIN User s Manual IK 121 PC Counter Card for HEIDENHAIN Encoders 5 2000 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Contents Contents e inc LL 2 Items S upplled repre a eesti 6 MI DP 6 Note on the EMC Guideline 89 336 EWG sss 6 hYad uo me DD 6 js 0 7 Important Information
7. sssssssss e 106 IKSEOFG hooien eee tae ces trae dt tema ante te 106 IKDefault cs rte tt Rp creed etae 07 IKRomhRead ssseeR enne 07 IKRomwWrite sssssssseem ns 07 IKInputW ssssssssee mme 07 IKInputl accio rese eere eoa ra ed 07 IKOutput ssssse eee 08 WKS CU 2 o oerte teretes cesar erac estara x ttr nias 108 IK DEINE ana e a E e EE DIS 108 IK SETTIMO o aieeaa 108 Tet ae ce el m 109 IKEnableSync sssssseeeeee 109 IKI atChAI eee tert eee operiert ee rudes 109 SPOCihiCat ONS cs 110 Subject Index eddie ite ire See ete 112 Basic circuit diagram of the latch paths in the counters 114 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg 2om Items Supplied Items Supplied IK 121 counter card for PCs programming examples driver software and User s Manual Versions IK 121A 290 155 xx IK 121V 291 768 xx IK 121 counter card for PCs with encoder inputs for sinusoidal current signals 11 App IK 121 counter card for PCs with encoder inputs for sinusoidal voltage signals 1 Vpp Note on the EMC Guideline 89 336 EWG Compliance with EMC Guideline 89 336 EWG was tested with a COMPAQ DESKPRO 386 20e computer Accessories 257 818 01 309 781 xx 282 168 01 265 775 02 IK 121A 309 785 xx 9 9 pin 310 195 xx 9 9
8. www artisant eom The IK 121 in DOS Applications Function in TURBO PASCAL FUNCTION latched baseadr word axis reg byte boolean BEGIN case reg of 0 latched Read g26 baseadr axis 14 and 0001 0001 1 latched Read g26 baseadr axis 14 and 0002 0002 end END Function in BORLAND C unsigned char latched unsigned int baseadr unsigned char axis unsigned char reg unsigned char result switch reg case 0 result unsigned char read_g26 baseadr axis 14 amp 0x0001 break case 1 result unsigned char read g26 baseadr axis 14 amp 0x0002 break return result 60tisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com The IK 121 in DOS Applications Procedure for repeatedly polling whether the measured value was stored The following procedure continues to poll whether a measured value was stored until a measured value is stored Procedure poll latch Parameters baseadr Base address of the IK 121 that was set with DIP switches axis 1 axis 1 2 axis 2 reg 0 Data Register 0 1 Data Register 1 Function in TURBO PASCAL PROCEDURE poll latch baseadr word axis reg byte BEGIN case reg of 0 begin repeat until latched baseadr axis 0 end 1 begin repeat until latched baseadr axis 1 end end END Function in BORLAND C void poll latch unsigned int b
9. D10 D11 D12 D13 D14 D15 Logic level for reference mark 1 Reference mark traverse is active No function Logic level for 0 signal Logic level for 90 signal 30tisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Registers 10h Reference Mark Register write mode HEIDENHAIN linear and angle encoders can feature one or several reference marks HEIDENHAIN recommends in particular measuring systems with distance coded reference marks In the case of power interruption the link between the encoder position and the displayed position value is lost This reference can be reestablished after power on with the encoder reference marks When a reference mark is traversed a signal is generated which marks this position on the scale as reference point This reference point serves to restore the link between the axis positions and the display values last defined For linear encoders with distance coded reference marks a reference can be reestablished after max 20 mm traverse Bit Function while traversing reference mark DO D1 D2 1 Clear counter 1 Start counter 1 Stop counter D3 1 Latch measured value D4 1 Latch measured value when second reference mark is crossed over D5 1 Clear counter each time a reference mark is crossed over D6 D7 D8 D9 D10 D11 No function D12 D13 D14 D15 Artisan Technology Group Quality Inst
10. can be used to poll whether the measured value was stored in the data registers As long as bit DO or D1 is set no further measured value can be stored until the most significant word of the measured value is read Exception via Control Register 2 bit D6 or D7 the latch is enabled without the measured value having been read out In 48 bit mode these are the Data Registers 04h or OAh and in 32 bit mode the Data Registers 02h or 08h When the measured value has been read bit DO or D1 in Status Register 1 OEh is reset um If the counter is stopped or stored through crossing over the reference marks bits DO to D9 will contain the fixed value 256 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisant eom Registers OCh Bit DO D1 D2 Initializing Register 1 write mode Function Operation with without interpolation 0 Operation as period counter w o interpolation data bits DO to D9 are not defined 1 Measured value is formed from the value of the period counter and the interpolation value Timer 0 Reset and stop timer 1 2 Start timer D3 D4 D6 D7 No function Latch enable 0 Mode 32 bit Register Reading bits D24 to D31 resets status bit DO or D1 in Status Register 1 OEh 1 Mode 48 bit Register Reading bits D40 to D47 resets status bit DO or D1 in Status Register 1 OEh Counting direction The counting direction deter
11. pData WINUSERAPI BOOL WINAPI IKInputL USHORT Axis USHORT Adr ULONG pData WINUSERAPI BOOL WINAPI IKOutput USHORT Axis USHORT Adr USHORT Data WINUSERAPI BOOL WINAPI IKSetl2C USHORT Card BOOL SCL BOOL SDA WINUSERAPI BOOL WINAPI IKDefine ULONG pBuffer8 WINUSERAPI BOOL WINAPI IKSetTimer USHORT Axis USHORT SetVal WINUSERAPI BOOL WINAPI IKSetEnableLatch USHORT Axis USHORT Latch USHORT Source WINUSERAPI BOOL WINAPI IKSetEnableSync USHORT Card USHORT Source WINUSERAPI BOOL WINAPI IKLatchAll USHORT Axis ifdef cplusplus endif Then you can use the functions like normal C functions MICROSOFT VISUAL BASIC In VISUAL BASIC you can define the functions in a module as follows Public Declare Function IKFind Lib K121DLL DLL ByRef pBuffer8 As Long As Boolean Public Declare Function IKInit Lib K121DLL DLL ByVal Axis As Integer ByVal M ode As Integer As Boolean Public Declare Function IKVersion Lib IK121DLL DLL ByVal Axis As Integer ByRef pVersCard As Byte ByRef pVersDrv As Byte ByRef pVersDII As Byte As Boolean 9e tisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Public Declare Function IKReset Public Declare Function IKStart Public Declare Function IKStop Public Declare Function IKClear Public Declare Function IKLatch Public Declare Function IKResetREF Public Declare Function IKStartREF Public Declare Function IKStopREF
12. pData Pointer to a byte variable 8 bits in which the amplitude compensation is saved Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisanl Pom The IK 121 in WINDOWS Applications IKReadOffset This function reports the instantaneous setting of the offset compensation Prototype BOOL IKReadOffset USHORT Axis SHORT Ofs0 SHORT Ofs90 Axis Number of the axis 0 to 15 OfsO0 Pointer to a short variable 16 bits in which the offset compensation of the 0 signal is saved Ofs90 Pointer to a short variable 16 bits in which the offset compensation of the 90 signal is saved IKWriteOffset This function changes the instantaneous setting of the offset compensation Prototype BOOL IKWriteOffset USHORT Axis SHORT Ofs0 SHORT Ofs90 Axis Number of the axis 0 to 15 Ofs0 New value of the offset compensation of the 0 signal 63 to 63 Ofs90 New value of the offset compensation of the 90 signal 63 to 63 IKLoadOffset This function reports the nonvolatile saved value of the offset compensation Prototype BOOL IKLoadOffset USHORT Axis SHORT Ofs0 SHORT Ofs90 Axis Number of the axis 0 to 15 Ofs0 Pointer to a short variable 16 bits in which the offset compensation of the 0 signal is saved Ofs90 Pointer to a short variable 16 bits in which the offset compensation of the 90 signal is saved IKStore This function tr
13. 0 to Ox1E pBuffer Pointer to a word 16 bits in which the read value is filed IKinputL This function reads the long word of a register Prototype BOOL IKInputL USHORT Axis USHORT Adr ULONG pBuffer Axis Number of the axis 0 to 15 Adr Address of the register 0 to 28 or 0 to Ox1C pBuffer Pointer to a long word 32 bits in which the read value is saved Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisanlf bom The IK 121 in WINDOWS Applications IKOutput This function writes a word in a register Prototype BOOL IKOutput USHORT Axis USHORT Adr USHORT Data Axis Number of the axis 0 to 15 Adr Address of the register 0 to 30 or 0 to Ox1E Data Value 16 bits that is written into the register IKSeti2C This function sets the lines of the lC bus i e one can set or reset the DATA and CLOCK lines This makes it possible to directly address the potentiometer and the EEPROM Prototype BOOL IKSetI2C USHORT Card BOOL SCL BOOL SDA Card Number of the IK 121 0 to 7 SCL Status of the CLOCK line FALSE 0 Low TRUE lt gt 0 High SDA Status of the DATA line FALSE 0 Low TRUE lt gt 0 High IKDefine This function defines the port addresses of the installed IK 121 For every IK 121 the port address must be saved at the corresponding position in pBuffer8 The unused entries must be set to 0 This applies only to Win32s under Windows 3 1 3 11
14. As Byte As Boolean Lib IK121DLL DLL ByVal Axis As Integer ByRef pData As Byte As Boolean Lib K121DLL DLL ByVal Axis As Integer ByRef Ofs0 As Integer ByRef Ofs90 As Integer As Boolean Lib 1K121DLL DLL ByVal Axis As Integer ByVal OfsO As Integer ByVal Ofs90 As Integer As Boolean Lib K121DLL DLL ByVal Axis As Integer ByRef Ofs0 As Integer ByRef Ofs90 As Integer As Boolean Lib IK121DLL DLL ByVal Axis As Boolean Lib K121DLL DLL ByVal Axis As Boolean Lib 1K121DLL DLL ByVal Card As Integer ByVal Adr As Byte ByRef Data As Byte As Boolean Lib K121DLL DLL ByVal Card As Integer ByVal Adr As Byte ByVal Data As Byte As Boolean Lib IK121DLL DLL ByVal Axis As Integer ByVal Adr As Integer ByRef pData As Long As Boolean Lib IK121DLL DLL ByVal Axis As Integer ByVal Adr As Integer ByRef pData As Long As Boolean Lib 1K121DLL DLL ByVal Axis As Integer ByVal Adr As Integer ByVal Data As Long As Boolean Lib 1K121DLL DLL ByVal Card As Integer ByVal SCL As Boolean ByVal SDA As Boolean As Boolean Lib IK121DLL DLL ByRef pBuffer8 As Long As Boolean Hhisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com The IK 121 in WINDOWS Applications Public Declare Function IKSetTimer Lib IK121DLL DLL ByVal Axis As Integer ByVal SetVal As Integer As Boolean Public Declare Function IKEnableLatch Lib IK121DLL DLL ByVal Axis A
15. Byte Timer Register LSB No function High Byte Timer Register M SB No function 1C Low Byte Control Register 2 Status Register 3 High Byte No function Code Register 1E Low Byte Control Register 3 Status Register 4 High Byte No function No function Zttisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Registers Data registers for the counters The measured values are stored in 48 bit registers Two data registers are available for each axis Data Register O 00h to 04h and Data Register 1 06h to OAh The measured values are composed of the 10 bit interpolation value and the 32 bit value of the period counter Only 42 bits of the 48 bit registers are thus used for the measured value The upper 6 bits are expanded with sign in two s complement form The data width of 48 bits can be shortened to 32 bits via Initializing Register 1 OCh bit D6 Initializing Register 1 OCh bit D7 can also be used to define whether the measured value is formed only from the value of the period counter DO to D9 are not defined or from the value of the period counter and the interpolation value The counter values can be stored in the data registers in the following ways e Software latch e Extermal inputs e Timers e Reference marks The circuit diagram of the counters see last fold out page illustrates the action of the various latch signals Bit DO or D1 in Status Register 1 OEh
16. DLL functions 97 Reference of the DLL functions sssssesssee 99 algo ME 99 lem 99 IKVersiOl tecta re eec Bici tea 99 l4 ET 99 IKStart ssssssssssssseeeen Renee 99 sci m 00 IKClear ssssssseeee eee 00 Ik Eee vl a Mr C REN 00 IKResetREF 000 0 ccc cece cece ceceeeecneeeeseeesteeeenteeeneaes 00 IKStartREF iiec ceteras detur Tene Hi oa 100 IKStopREF ett t eh ai Fo one 100 IKLatChREF oir tesa threat 100 IKLatchad masters eiie 101 IKWaitLatch sssssssee ee 101 IKStrtCodRef ssssssssssseeeeeneeee 101 IKCodRef ssssssssssssemeeeennmeee 02 Prototype BOOL IKCodRef USHORT Axis BOOL pStatus double pData ssssss 02 IKWaitCodR f iecit ts eps cate 02 IKStopCodRef ssssssssssssssseeeene 02 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Contents szirag M ES 102 IKR ad32 iiine aeaaaee ose tri tecre reset 104 IKRead4S ccce teet stp eR dere N 04 IKReadPhase sssssemR ms 04 IKWritePhase sssssssseemR es 05 Teo ye 0 od a ro c ene 05 IKRe adAmp tech Ani ani eee oe 05 IKWriteAmp am ccs es ede iode Rte bei 105 IKLoadAmp erc ctr tee eoe te tui ds 105 IKReadOffset sssssssssss ees 106 IKWriteOffset ssssssssss aat 106 IKLoadOffset
17. Public Declare Function IKLatchREF Public Declare Function IKLatched Public Declare Function IKWaitLatch Public Declare Function IKStrtCodRef Public Declare Function IKCodRef Public Declare Function IKW aitCodRef Public Declare Function IKStopCodRef Public Declare Function IKStatus Public Declare Function IKRead32 Public Declare Function IKRead48 Public Declare Function IKReadPhase The IK 121 in WINDOWS Applications Lib K121DLL DLL ByVal Axis As Integer As Boolean Lib K121DLL DLL ByVal Axis As Integer As Boolean Lib 1K121DLL DLL ByVal Axis As Integer As Boolean Lib IK121DLL DLL ByVal Axis As Integer As Boolean Lib K121DLL DLL ByVal Axis As Integer ByVal Latch As Integer As Boolean Lib K121DLL DLL ByVal Axis As Integer As Boolean Lib 1K121DLL DLL ByVal Axis As Integer As Boolean Lib IK121DLL DLL ByVal Axis As Integer As Boolean Lib K121DLL DLL ByVal Axis As Integer ByVal Latch As Integer As Boolean Lib K121DLL DLL ByVal Axis As Integer ByVal Latch As Integer ByRef pStatus As Boolean As Boolean Lib IK121DLL DLL ByVal Axis As Integer ByVal Latch As Integer As Boolean Lib K121DLL DLL ByVal Axis As Integer ByVal Latch As Integer ByVal RefDist As Long As Boolean Lib K121DLL DLL ByVal Axis As Integer ByRef pStatus As Boolean ByRef pData As Double As Boolean Lib K121DLL DLL ByVal Axis As Integer ByRef pData As Double As Boole
18. axis 2 poll latch base address 2 0 Read axis 2 Cc value 1 2 read count value32 base address 2 0 Display measured values gotoxy 1 10 write c value 0 0 02 1024 16 4 c value 1 0 02 1024 16 4 UNTIL KEYPRESSED END program sample48 DR JOHANNES HEIDENHAIN GmbH Traunreut Germany A simple program for the IK 121 to display two axes Measured value with 48 bits V 1 01 April 1995 SN E v SR Si O ES crt ik121 0 NST base address 330 VAR Cc value 0 c value 1 comp BEGIN clrscr Initialise the board in interpolation mode axis 1 write g26 base address 1 0c 0041 Initialise the board in interpolation mode axis 2 write g26 base address 2 0c 0041 Reset error bit start counter axis 1 write g26 base address 1 0e 0048 Reset error bit start counter axis 2 write g26 base address 2 0e 0048 Write to control register 2 axis 1 write g26 base address 1 1c 0008 Write to control register 2 axis 2 write g26 base address 2 1c 0008 Q dee REPEA Software latch in register 0 axis 1 soft 10 base address 1 Software latch in register 0 axis 2 soft 10 base address 2 Poll whether latched in axis 1 poll latch base address 1 0 Read axis 1 Cc value 0 2 read count value48 base address 1 0 Poll whether latched in
19. because it has no registry Prototype BOOL IKDefine ULONG pBuffer8 pBuffer8 Pointer to 8 long words 8 4 bytes IKSetTimer This function defines the time interval of the timer Prototype BOOL IKSetTimer USHORT Axis USHORT SetVal Axis Number of the axis 0 to 15 SetVal 0 Timer is stopped 1to8192 Timer value in micro seconds WE san Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com The IK 121 in WINDOWS Applications IKEnableLatch This function defines which latch signal stores the position value Prototype BOOL IKEnableLatch USHORT Axis USHORT Latch USHORT Source Axis Number of the axis 0 to 15 Latch 0 Enable latch signal for register O 1 Enable latch signal for register 1 Source 0 All latch signals are disabled 1 Enable external signal without delay slave 2 Enable extemal signal with delay master 3 Enable software latch 4 Enable timer IKEnableSync This function defines which latch signal is being transmitted to the 2nd axis Prototype BOOL IKEnableSync USHORT Card USHORT Source Card Number of the IK 121 0 to 7 Source 0 No cascading 1 Cascading extemal signal 2 Cascading software latch 3 Cascading timer IKLatchall This function enables a software latch which makes it possible to save the position values of several axes Prototype BOOL IKLatchAll USHORT Axis Axis Number of the axis 0 to 15 Artisan Tec
20. e mail service heidenhain de Measuring systems 49 8669 31 3104 e mail service ms support heidenhain de TNC support _ 49 8669 31 3101 e mail service nc support heidenhain de NC programming 49 8669 31 3103 e mail service nc pgm heidenhain de PLC programming 49 8669 31 3102 e mail service plc heidenhain de Lathe controls 49 711 952803 0 e mail service hsf heidenhain de www heidenhain de Ve 00 291 019 25 4 5 2004 F amp W Printed in Germany Subject to change without notice Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com A rtisan Artisan Technology Group is your source for quality TecmoogyGroup new and certified used pre owned equipment FAST SHIPPING AND SERVICE CENTER REPAIRS WE BUY USED EQUIPMENT DELIVERY Experienced engineers and technicians on staff Sell your excess underutilized and idle used equipment TENS OF THOUSANDS OF at our full service in house repair center We also offer credit for buy backs and trade ins IN STOCK ITEMS www artisantg com WeBuyEquipment EQUIPMENT DEMOS HUNDREDS OF InstraV ea REMOTE INSPECTION LOOKING FOR MORE INFORMATION MANUFACTURERS Remotely inspect equipment before purchasing with Visit us on the web at www artisantg com 7 for more our interactive website at www instraview com 7 information on price quotations drivers technical LEASING MONTHLY sp
21. eet 2 IKStrtCodRef sssssse 01 KIZI EXE noiiire 53 84 IKVersion o e 99 IK121 0C corner ceo 54 IKWaitCodRef 0 0 cece 02 IKT21 0 Hi iau eden tret nets 54 IKWaitLatch n 01 IK121 Q PAS ees 54 IKWriteAmp 05 IKI21_1 PAS sse 72 IKWriteOffset ssssss 06 iKL2T pointr ireens 76 IKWritePhase ssssess 05 iK121 record 76 init handler oo eee eee ees 76 IKClear cene teres 100 ING L2 rne 76 Initializing Register 1 26 W4san Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Initializing Register 2 27 ININE oiiaii aiios ieies 74 WMC CH eR ER OERA 73 initmain o n 74 INITS YING cpi qmd 73 NN 50 Interrupt Enable Register 37 Interrupt Status Register 1 38 Interrupt Status Register 2 39 Iritermupts dee rentes 21 aS iseia ernes 75 Items Supplied 6 Latching mete 11 Latching measured values external X3 L0 X3 L1 18 from multiple IK 121s 21 Output X3 Out sss 19 load offset as 78 look for IK121 sss 76 Offset Register for 0 signal 40 Offset Register for 90 signal 42 Overview of registers 24 pOll ateina insa 61 pOll regO rt 78 poll PE ie 7
22. error boolean Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantd Bom The IK 121 in DOS Applications Procedure tum sympoti Adjusts the potentiometer for the symmetry pe PROCEDURE tum sympoti pointr ik121_pointr axis turns byte updown boolean var error boolean Procedure tum offsetdgoO Changes the compensation value for the offset register for the 0 signal Prototype PROCEDURE tum offsetdgOO pointrik121 pointr axis tums byte updown boolean Procedure tum offsetdg90 Changes the compensation value for the offset register for the 90 signal Prototype PROCEDURE tum offsetdg90 pointrik121 pointr axis tums byte updown boolean Procedure store potis Stores the potentiometer settings Prototype PROCEDURE store potis pointr ik121_pointr var error boolean Procedure rom write Writes to the vacant EEPROM memory Prototype PROCEDURE rom write pointr ik121_pointr adr data byte var error boolean Function rom_read Reads the vacant EEPROM memory Prototype FUNCTION rom_read pointr ik121_pointr adr byte var error boolean byte 890isan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com The IK 121 in DOS Applications Applications programs with the RAM memory map in TURBO PASCAL The executable EXE files in the following examples are located in the root directory of the supplied floppy disk 1 The source files are in subd
23. interface a xou A R5 pinto r IRQ 9 Correction value Jumpers H IRQ 10 EEPROM Int 1 p IRO 11 X2 0ut Ld r gt L IRQ12 Y t Lo t Ras Ph ti Edi ase correction x H gt i i gt Counter Pointer Amplitude correction axis X1 register gt X3 L0 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg Bom Technical Description of the IK 121 Circuit diagram of the counter IC h n Period counter A 32 bits L B Edge 4B evaluation lo R Reference pulse lg R logic Interp I A 10 bits l B 1024 fold PC Bus Interface Interrupt Control Register Status Register Init Register logic a Timer o g gt Storage logic 13 bits Wiisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Technical Description of the IK 121 The IK 121 s interpolation circuitry subdivides the signal period of the input signal 1024 fold The 42 bit measured value is formed from the interpolation value 10 bits and the value of the period counter 32 bits The measured values are stored in 48 bit registers whereby the upper bits are expanded in two s complement representation with sign The measured values are called and latched either through external latch inputs or with software or timers as well as by crossing over the reference m
24. read_g26 baseadr axis 2 j buffer fieldl 2 read_g26 baseadr axis 4 j if buffer field1 2 and 8000 8000 then buffer fieldl 3 SFFFF else buffer fieldl1 3 0 end 1 begin buffer fieldl 0 read_g26 baseadr axis 6 buffer fieldl 1 read_g26 baseadr axis 8 buffer fieldl 2 read_g26 baseadr axis 10 if buffer field1 2 and 8000 8000 then buffer fieldl 3 SFFFF else buffer fieldl1 3 0 end end read_count_value48 buffer field0 END 6 tisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com The IK 121 in DOS Applications Function in BORLAND C double read count value48 unsigned int baseadr unsigned char axis unsigned char reg unsigned int field 3 double count_value48 switch reg case 0 field 0 read g26 baseadr axis 0 field 1 read g26 baseadr axis 2 field 2 read g26 baseadr axis 4 break case 1 field 0 read g26 baseadr axis 6 field 1 read g26 baseadr axis 8 field 2 read g26 baseadr axis 10 break if field 2 amp amp 0x8000 count value48 double field 0 65535 65536 0 field 1 65535 4294967296 0 ield 2 65535 1 else count value48 double field 0 65536 0 field 1 4294967296 0 field 2 return count value48 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisant eom The IK 1
25. run with distance coded reference marks this function ascertains whether the second reference mark has been traversed and reports the offset value The offset value must be added to the counter value in order to obtain the absolute position The application program must call this function cyclically after starting the reference mark run It can also however wait for the end The function for waiting is IKWaitCodRef Prototype BOOL IKCodRef USHORT Axis BOOL pStatus double pData Axis Number of the axis 0 to 15 pStatus Pointer to a Boolean variable 16 bits False 0 reference run not completed True lt gt 0 reference run completed pData Pointer to a double variable 64 bits in which the offset value is saved only if pStatus TRUE IKWaitCodRef This function waits until the reference run with distance coded reference marks is completed After the second reference mark has been traversed the offset value is returned Prototype BOOL IKWaitCodRef USHORT Axis double pData Axis Number of the axis 0 to 15 pData Pointer to a double variable 64 bits in which the offset value is filed IKStopCodRef This function interrupts a reference run over distance coded reference marks Prototype BOOL IKStopCodRef USHORT Axis Axis Number of the axis 0 to 15 IKStatus This function reports the status of the IK 121 Prototype BOOL IKStatus USHORT Axis ULONG pStatus Axis Number of t
26. 003 Type 0x00000001 Parameters IK Base 10x00000330 IK Base 2 0x00000000 IK Base 3 0x00000000 IK Base 4 0x00000000 IK Base 5 0x00000000 IK Base 6 0x00000000 IK Base 7 0x00000000 IK Base 8 0x00000000 In the directory Install on disk 2 are the files IK121Drv Reg and SetReg Bat The file IK121Drv Reg contains the data specified above which you add to the registry with Install Bat In the file IKI21Drv Reg you can change the base address of the IK 121 and or add more base addresses The driver supports up to eight IK 121 The entry in the registry must be updated with SetReg Bat Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisant eom The IK 121 in WINDOWS Applications The Windows DLLs IK121DII DII This DLL enables applications programs to address the IK 121 There is one DLL each for Windows NT and for Windows 95 The DLL for Windows NT accesses the IK 121 indirectly through the device driver for Windows NT The DLL for Windows 95 accesses the registry of the IK 121 directly Frequently required functions are directly available start stop read out counter value REF functions etc Additional programming of the IK 121 is enabled through the access to its registry IKInputW IKInputL IKOutput etc To enable Windows NT application programs to load the DLL the file IK121DIl Release IK121DII DIl on disk 2 must be placed in the system directory under Sys
27. 2 ofojoooo OOOOOO cero DO0000 In the above setting axis 1 is set to IRQ15 and axis 2 to IRQ12 Assignment of the PC interrupts intern irkerupt address IRQ5 oD 034 to 037 IRQ9 71 1C4 to 1C7 IRQ10 72 1C8 to 1CB IRQ11 1CC to 1CF IRQ12 1D0 to 1D3 IRQ15 1D7 to 1DF Addressing The IK 121 and the computer communicate over port addresses O range with a 16 bit data width Since the vacant address space in the port address range is severely limited the addresses of the counters were superimposed on each other An Address Pointer Register is used to differentiate Each counter has five address lines BO to B4 BO and B1 are connected directly to the system bus B2 B3 and B4 are generated in the Address Pointer Register A2 and A3 of the system bus decode the counters for axes 1 or 2 or for the Address Pointer Register 24tisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Hardware A4 to A9 of the system bus base address are set with the DIP switch on the circuit board The on setting corresponds to logical zero Examples of switch settings Address Switch setting Hex A9 2 A7 A6 A5 A o on E 00 Axis 1 01 Axis 2 10 Address Pointer Register Comparison of base address Counters Address Pointer Register DERE DIP switches DO RO D1 R1 D2 pe R2 Artisan Tec
28. 2 1024 Cursor on _setcursortype NORMALCURSOR return 0 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantd om The IK 121 in DOS Applications IK121 LPAS Functions for a RAM memory map in TURBO PASCAL The data structures and functions for TURBO PASCAL described below are on the supplied floppy disk 1 under the directory TP in the files IK121 1 PAS and IIC PAS IIC PAS is included in IK121 1 PAS while compiling The command uses includes these files as a unit in further applications In IK121 1 PAS a RAM memory map of the registers of the IK 121 is created with the help of data structures in TURBO PASCAL record The data of the RAM memory map are written to the port addresses of the IK 121 using the procedures init_handler and comm handler In addition useful functions are available for initializing the card reading the measured values interrupt programming and for adjustment of the encoder signals Definition of the data structures Record softcommand This structure is the RAM memory image of Control Register 1 write access to OEh Data fields start Start counter stop Stop counter clear Clear counter latchO Software latch M easured value in Data Register O latch1 Software latch M easured value in Data Register 1 latch2 Software latch with special functions clrfrg Clear encoder error frequency exceeded clrstat Clear Amplitude Value Re
29. 21 in DOS Applications Simple program for measured value latching via software The following examples employ the previously defined functions The examples are included on the supplied floppy disk 1 For TURBO PASCAL they are located under the directory TP in the files SAMPLE32 PAS and SAMPLE48 PAS For BORLAND C the examples are located in the directory BC in the file SAMPLE32 C and SAMPLE48 C In this example the counter is displayed on the screen in millimeters The IK 121 can of course also display angular degrees The conversion is shown by the following two formulas Converting the count into millimeters Grating period mm 1024 Value mm Count Example Grating period 20 um 0 020 mm Value mm Count e 1024 Converting the count into degrees Count 360 Value 1024 e Lines rev Example Lines rev 36 000 Count e 360 Value s 1024 36 000 68iisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com The IK 121 in DOS Applications Examples in TURBO PASCAL Measured value latch via software The following examples SAM PLE32 PAS and SAMPLE48 PAS illustrate the use of the previously described procedures and functions These are declared and defined in the file IK121 O TPU all files are on the supplied floppy disk 1 Before compiling SAM PLEO PAS it is necessary to compile IK121 O PAS to unit IK121 O TPU Si
30. 3 LO for Data Register 0 Axis 2 0 Enable software latch in all data registers for Data Register O D3 1 2 Enable software latch via timers for Data Register 0 Enable L1 for Data Register 1 Axis 1 1 Enable extemal latch signal X3 LO for Data Register 1 Axis 2 1 Enable extemal latch signal X3 L1 for Data Register 1 D4 D5 Enable L1 via delay circuit 125 ns for Data Register 1 0 1 2 Enable software latch in all data registers for Data Register 1 D7 1 Enable software latch via timers for Data Register 1 The circuit diagram of the counters on the last foldout page shows the functions of the individual bits Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisant eom Registers 12h Register for axis cascading and for PC bus control write mode Function Axis 1 1 Enable the external latch signal X3 LO to 2nd axis LO X3 OUT Axis 2 0 Axis 1 1 Enable software latch in all data registers to second axis LO X3 OUT Axis 2 0 Axis 1 1 Enable timer strobe to second axis LO X3 0OUT Axis 2 0 Axis 1 0 Axis 2 IC bus line SDA data signals must be programmed inverted D9 D13 No function D14 D15 Axis 1 0 Axis 2 IC bus line SCL clock signals must be programmed inverted The circuit diagram of the counters on the last foldout page shows the functions of the indiv
31. 8 poti default ssssssss 79 POTISIEXE eee etel 83 Power consumption 12 Power supply sssssss 12 RDROM EXE sssss 86 87 ead adr neg 77 read count status oe 77 read count value32 62 read count value48 64 read int status 00 0 77 read phasepoti ssssss 79 read EGO iecit dedere 77 read regl eceseu feet 77 read signal status 77 read sympoti 0 2 0 79 refcommand sssssssssss 73 Reference Mark Register 31 Subject Index Reference marks ssss 12 Register for axis cascading and for IC bus control 36 rom read cecene 80 rom Write sss 80 SAMPLET EXE sssssss 81 SAMPEE2 EXE itte 81 SAMPLE3 EXE sssssss 81 SAMPLE32 PAS sssss 67 SAMPLEA EXE ssesssss 82 SAMPLEABS PAS ssssss 67 SAMPLES EXE ssssssss 82 SAMPLES EXE sssssss 82 SCOPE EXE ieiunii 83 signalstate sssssssssss 75 Slot type rr 12 soft IO 58 SOfE 1 5 Le ttt 58 soft latchO ssssssss 77 SOFE ICN eiii iieiea 77 softcommand s 72 Status Register 1 s 29 Status Register 2 sss 30 Status Register 3 46 Status Register 4 49 storage 76 store offset 78 store potis
32. 80 tum phasepoti ssssss 79 tum sympoti ssssssssss 80 WINDOWS Installation ssss 90 Registry sssssssssssss 89 Windows DLL 90 WINDOWS NT Device driver sss 89 Write ad eot re ean detent baat 77 write offset 78 write phasepoti sssss 79 write sympoti ssssssss 79 WRROM EXE sssss 86 87 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisanld Som Basic circuit diagram of the latch paths in the counters The circuit diagram on the following page shows e The effect of the latch signals on the data registers e The function of the individual bits of the enable register for measured value latching e The axis cascading with the associated bits of the register with the same name e Formation of the interrupts e The register for I C bus control The delay circuits with 125 nanoseconds delay time are used with synchronous latching of both axes to balance the signal transit times between axes 1 and 2 With synchronous latching therefore the signal for axis 1 should be routed through a delay circuit while for axis 2 it should not Since the same counter is used for axes 1 and 2 delay circuits are present in each axis i e not all signal path combinations will result in a proper latch WM san Technology Group Quality Instrumentation Guaranteed 888
33. 82 168 01 is available from HEIDENHAIN Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantd om Hardware Assembling the connector for the extemal functions fay Rear view y o female male Tensioning nut e 7 2 Colle Connection X3 for extemal functions Flange socket with male female insert 4 pin Insulator Connector housing Connection no Assignment 1 Input measured value latch X1 X3 L0 2 Input measured value latch X2 X3 L1 3 Output measured value latch X3 Out 4 OV Latching measured values via extemal inputs The IK 121 has two external inputs on flange socket X3 for latching and storing measured values WBiisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Hardware These inputs can also be used for interrupts Inputs X3 LO and X3 L1 are active low they are kept at high level by a 10 kO internal pull up resistor They can be connected to TTL LS or CM OS components Simplest way to activate the inputs bridge from 0 volts connection 4 to the input for latching Latching output X3 OUT The output signal X3 OUT can be sent over flange socket X3 to further IK 121s inputs X3 LO X3 L1 for example to latch the measured values of multiple IKs X3 OUT is an open collector output that switches to Zero Latching inputs X3 LO X3 L1 and latching output X3 OUT Time diag
34. 88 SOURCE www artisantg com Y Software latch via timer Inter Enable Reg D2 i f y Inte t2 Y Software latch in all Data Software latch Control Reg 1 D1 nterrup registers Control Reg 1 D2 Sotware latch Control Reg 1 DO Y Latch via 1st reference mark Enable Register for Reference Mark Register D3 measured value latch Y Latch via 2nd reference mark 0 D3 Reference Mark Register D4 X3 L0 LO DO Inter Enable gt o Ce i gt Reg DO t BL gt 1 _ Data _ Into 125ns L H l 1 L Status _ Int Contr x 5 D2 Register 0 Interrupt O p2ons D3 X Status Reg 1 DO 1 r25ns f J Init Reg 2 D14 V Inter Enable Reg D3 Enable Register for measured value latch Init Reg 2 D15 4 D7 L1 D4 Inter Enable DS 1 Reg D1 125ns l gt 1 Data f
35. 888 88 SOURCE www artisantd Fom The IK 121 in DOS Applications Procedure poll rego Polls status bit DO in register OEh until a measured value is stored in Data Register O Prototype PROCEDURE poll regO pointr g26 pointr Procedure poll reg1 Polls status bit D1 in register OEh until a measured value is stored in Data Register 1 Prototype PROCEDURE poll regi pointr g26_pointr Procedure en int Enables an interrupt Prototype PROCEDURE en int Intrpt byte Procedure dis int Inhibits an interrupt Prototype PROCEDURE dis int Intrpt byte Procedure clear int Resets an interrupt Prototype PROCEDURE clear int Procedure write offset Writes offset values to the offset registers of the counters volatile Use store offset and load offset for nonvolatile storage of the offset values and for storing them back in the offset registers Prototype PROCEDURE write offset baseadr word axis byte offx offy integer The following functions are defined in the file IIC PAS When compiling to a unit this file is included in IK121 LPAS Procedure load offset Reads the offset from the offset registers Prototype PROCEDURE load offset board IK121_pointr var error boolean Procedure store offset Stores a compensation value in the offset registers Prototype PROCEDURE store offset board IK121 pointr var error boolean T amp tisan Technology Group Quality Instrumentation Guaranteed
36. 888 88 SOURCE www artisantg com The IK 121 in DOS Applications Procedure poti default Sets the potentiometers to the zero position Prototype PROCEDURE poti default pointr ik121_pointr var error boolean Function read phasepoti Reads the setting of the potentiometer for the phase position Prototype FUNCTION read phasepoti pointr ik121_pointr axis byte var error boolean byte Function read_sympoti Reads the setting of the potentiometer for the symmetry Prototype FUNCTION read_sympoti pointr ik121_pointr axis byte var error boolean byte Procedure write_phasepoti Sets the phase position potentiometer to a specific value Prototype PROCEDURE write_phasepoti pointr ik121_pointr axis wert byte var error boolean Procedure write_sympoti Sets the potentiometer for the symmetry to a preset value Prototype PROCEDURE write_sympoti pointr ik121_pointr axis wert byte var error boolean Procedure write_offset0O Writes a compensation value to the offset register for the 0 signal Prototype PROCEDURE wnite_offset00 pointr ik121_pointr axis value integer Procedure write_offset90 Writes a compensation value to the offset register for the 90 signal Prototype PROCEDURE wnite_offset90 pointr ik121_pointr axis value integer Procedure tum_phasepoti Adjusts the potentiometer for the phase position pe PROCEDURE turn_phasepoti pointr ik121_pointr axis turns byte updown boolean var
37. App 3 5 pA to 8 pA lt 2 5 Upp 100 kHz Max 10m TE tisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Hardware Inputs X1 and X2 for encoders D sub connection with female insert 9 pin Connection no Assignment 7 T e 2 0 V UN 3 l2 4 Internal shield 5 lo 6 l1 7 5 V Up 8 l2 9 lo Housing Extemal shield Encoder inputs IK 121 V The IK 121 V is connected with HEIDENHAIN linear or angle encoders with sinusoidal voltage signals A and B plus the reference mark signal R Signal amplitudes A B 0 90 0 6 Vpr to 1 2 Vpp R reference mark 0 2 V to 0 85 V Signal levels for error lt 0 22 Vpp messages Maximum input frequency 400 kHz Cable length Max 30m 1 Cable lengths up to 150 m are possible if it can be guaranteed that the encoder will be supplied by 5 V from an external power source In this case the max input frequency is reduced to 250 kHz Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantd Bom Hardware Encoder outputs Inputs X1 and X2 for encoders D sub connection with female insert 15 pin Pin Assignment 1 A 2 OV UN 3 B 4 5 V Up 5 Do not use 6 Do not use 7 R 8 Do not use 9 A 10 O V sensor line 11 B 12 5 V sensor line 13 Do not use 14 R 15 Do not use Housing Extemal shield The IK 121 als
38. Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisant eom The IK 121 in WINDOWS Applications IKStop This function stops the counter Prototype BOOL IKStop USHORT Axis Axis Number of the axis 0 to 15 IKClear This function deletes the error status Prototype BOOL IKClear USHORT Axis Axis Number of the axis 0 to 15 IKLatch This function saves the counter value Prototype BOOL IKLatch USHORT Axis USHORT Latch Axis Number of the axis 0 to 15 Latch O counter value is saved in register 0 1 counter value is saved in register 1 IKResetREF This function sets the counter to zero at the next reference mark Prototype BOOL IKResetREF USHORT Axis Axis Number of the axis 0 to 15 IKStartREF This function starts the counter with the next reference mark Prototype BOOL IKStartREF USHORT Axis Axis Number of the axis 0 to 15 IKStopREF This function stops the counter with the next reference mark Prototype BOOL IKStopREF USHORT Axis Axis Number of the axis 0 to 15 IKLatchREF This function saves the counter value when the reference mark is passed over Prototype BOOL IKLatchREF USHORT Axis USHORT Latch Axis Number of the axis 0 to 15 Wasan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com The IK 121 in WINDOWS Applications IKLatched This function determines whether the counter value was
39. D6 EM Register 1 y Interrupt 1 pril25ns D7 Status Reg 1 D1 H125ns Axis cascading D8 VU D9 gt 1 m L 1 D10 i D11 Ar D12 4 D13 c j D14 not connected D15 n i Axis 1 Y Software latch via timer Inter Enable Reg D2 i Y Inte t2 Y Software latch in all Data Software latch Control Reg 1 D1 nterrupi registers Control Reg 1 D2 Software latch Control Reg 1 DO Latch via 1st reference mark Enable Register for Reference M ark Register D3 measured value latch Y Latch via 2nd reference mark ne 0 D3 Reference Mark Register D4 i Lor Do Inter Enable ai I D1 gt 1 Reg DO Int 1 L T25ns 3 j Data Stati Int Contr 71 D2 HF Register Interrupt O Vica 125ns i 3 D3 Status Reg 1 DO 4 125ns Init Reg 2 D14 Inter Enable Reg D3 Enable Register for measured value latch Init Reg 2 D15 T D4 D7 X3 L1 o L1 D4 Inter Enable D5 gt 1 Reg D1 125ns p Data Status l D6 Register 1 Interrupt 1 pril25ns D7 Status Reg 1 D1 771125ns i I C bus evaluation D8 D9 s 1 L D10 SDA e i D11 ob D13 j D14 gt SCL D15 Axis 2 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com HEIDENHAIN DR JOHANNES HEIDENHAIN GmbH Dr Johannes Heidenhain Stra f e 5 83301 Traunreut Germany 49 8669 31 0 FAX 49 8669 5061 e mail info heidenhain de Technical support Ax 49 8669 31 1000
40. K 121 in DOS Applications Function in BORLAND C long read count value32 unsigned int baseadr unsigned char axis unsigned char reg union mapper long field0 unsigned int field1 2 bouffer switch reg case 0 buffer field1 0 read_g26 baseadr axis 0 buffer fieldl 1 read_g26 baseadr axis 2 break case 1 buffer field1 0 buffer fieldl 1 break return buffer field0 read_g26 baseadr axis 6 read_g26 baseadr axis 8 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisant eom The IK 121 in DOS Applications Function for reading a 48 bit measured value The following function reads a 48 bit measured value from a counter Function read count value48 Parameters baseadr Base address of the IK 121 that was set with DIP switches axis 1 axis 1 2 axis 2 reg 0 Data Register 0 1 Data Register 1 Result TURBO PASCAL Value from the data register given under axis and reg as an integer variable of the comp type BORLAND C As a floating point variable of the double type Function in TURBO PASCAL FUNCTION read count value48 baseadr word axis reg byte comp TYPE vartype li by mapper record case wert vartype of li field0 comp by fieldl array 0 3 of word end VAR buffer mapper BEGIN case reg of 0 begin buffer field1 0 read g26 baseadr axis 0 buffer fieldl 1
41. PLE48 C Include file TKL21 Os f include lt stdio h gt include lt conio h gt include ik121_0 h define base_address 0x0330 int main double c value 0 c value 1 cls Initialise the board in interpolation mode axis 1 write g26 base address 1 0x0c 0x0041 Initialise the board in interpolation mode axis 2 write g26 base address 2 Ox0c 0x0041 Reset error bit start counter axis 1 write g26 base address 1 0x0e 0x0048 Reset error bit start counter axis 2 write g26 base address 2 0x0e 0x0048 Write to control register 2 axis 1 write g26 base address 1 Oxlc 0x0008 Write to control register 2 axis 2 write g26 base address 2 Oxlc 0x0008 Cursor off Setcursortype _NOCURSOR while kbhit WBiisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com The IK 121 in DOS Applications Software latch in register 0 axis 1 soft 10 base address 1 Software latch in register 0 axis 2 soft 10 base address 2 Poll whether latched in axis 1 poll latch base address 1 0 Read axis 1 Cc value 0 read count value48 base address 1 0 Poll whether latched in axis 2 poll latch base address 2 0 Read axis 2 C value 1 read count value48 base address 2 0 Display measured values printf r t 16 4f t 16 4 c_value_0 0 02 1024 c value 1 0 0
42. Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Registers 1Ch Code Register read access Bit Function D8 D9 D10 D11 D12 D13 D14 D15 IC code 8 counter chip G26 2 1 Chip designation from HEIDENHAIN Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantd fom Registers 1Eh Control Register 3 write access Bit Function DO Fixed value 0 D1 D2 D3 D4 D5 D6 D7 D8 D9 _ No function D10 D11 D12 D13 D14 D15 4Riisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Registers 1Eh Status Register 4 read mode Bit Function DO D1 D2 Logic level on pin L1 D3 D4 D5 D6 D7 D8 D9 No function D10 D11 D12 D13 D14 D15 No function Logic level on pin LO Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantd tom The IK 121 in DOS Applications The IK 121 in DOS Applications Quick Start di Do not yet install the IK 121 Insert the floppy disk with the driver software into drive A of your PC Enter the following DOS commands gt A gt INSTALL After the initial screen the following information appears on your PC screen INSTALL IK 121 The IK 121 Interface Card should not be in your PC Continue y n gt Enter y The INSTALL program now shows an overview of the port ad
43. RefDist WINUSERAPI BOOL WINAPI IKCodRef USHORT Axis BOOL pStatus double pData WINUSERAPI BOOL WINAPI IKWaitCodRef USHORT Axis double pData WINUSERAPI BOOL WINAPI IKStopCodRef USHORT Axis Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantd dom The IK 121 in WINDOWS Applications WINUSERAPI BOOL WINAPI IKStatus USHORT Axis ULONG pStatus WINUSERAPI BOOL WINAPI IKRead32 USHORT Axis USHORT Latch LONG pData WINUSERAPI BOOL WINAPI IKRead48 USHORT Axis USHORT Latch double pData WINUSERAPI BOOL WINAPI IKReadPhase USHORT Axis BYTE pData WINUSERAPI BOOL WINAPI IKWritePhase USHORT Axis BYTE Data WINUSERAPI BOOL WINAPI IKLoadPhase USHORT Axis BYTE pData WINUSERAPI BOOL WINAPI IKReadAmp USHORT Axis BYTE pData WINUSERAPI BOOL WINAPI IKWriteAmp USHORT Axis BYTE Data WINUSERAPI BOOL WINAPI IKLoadAmp USHORT Axis BYTE pData WINUSERAPI BOOL WINAPI IKReadOffset USHORT Axis SHORT Ofs0 SHORT Ofs90 WINUSERAPI BOOL WINAPI IKWriteOffset USHORT Axis SHORT Ofs0 SHORT Ofs90 WINUSERAPI BOOL WINAPI IKLoadOffset USHORT Axis SHORT Ofs0 SHORT Ofs90 WINUSERAPI BOOL WINAPI IKStore USHORT Axis WINUSERAPI BOOL WINAPI IKDefault USHORT Axis WINUSERAPI BOOL WINAPI IKRomRead USHORT Card BYTE Adr BYTE Data WINUSERAPI BOOL WINAPI IKRomWrite USHORT Card BYTE Adr BYTE Data WINUSERAPI BOOL WINAPI IKInputW USHORT Axis USHORT Adr USHORT
44. T and WINDOWS 95 Disk 2 On floppy disk 2 you will find the following directory structure Install Installation files IK121Drv Device driver source for WINDOWS NT Release Release Version IK121DII Windows DLL source Release Release Version for Windows NT Release95 Release Version for Windows 95 IK121Con Example source for DOS applications Release Release Version for DOS applications IK121App Example source for VISUAL CH Res Resources for Windows example Release Release version for Windows example IK121VB5 Example source for VISUAL BASIC Include Include files Install Installation files Disk 3 Floppy disk 3 contains examples for BORLAND DELPHI 88 san Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com The IK 121 in WINDOWS Applications Device driver for Windows NT IK121DRV SYS On disk 2 in directory IK121Drv you will find the kernel mode device driver for WINDOWS NT Versions 3 51 and 4 0 It enables access to the IK 121 To enable Windows NT to load the driver you must first copy it into the Windows NT system directory under System32 Drivers e g CWWINNTASYSTEM 32 DRIVERS The batch file Install Bat will copy the driver for you Registry entry In the registry the driver finds the port address at which the IK 121 is installed The following registry entry is required HKEY LOCAL MACHINE System CurrentControlSet Services IK121DRV ErrorControl 0x00000001 Start 0x00000
45. WIN IK121 CNT IK121 HLP Basic functions Functions for a RAM memory map Functions for ADJ UST EXE POTIS EXE and SCOPE EXE Window functions Position display Counter program Functions for SCOPE EXE Functions for ADJ UST EXE Initial screen after program start Window definitions Initializing file File with help texts 8tisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com The IK 121 in DOS Applications A pull down menu can be opened by clicking with the mouse or by using the horizontal arrow keys and pressing the enter key The following functions are then available File Change and store settings for the card the axes and the printer Adjust Display and adjust sinusoidal encoder signals Counters Set or reset axes or start reference mark traverse Sorting Enter upper and lower limit values for sorting mode Datum Select reference plane For both axes four datum points available datum 1 to datum 4 Min Max Display minimum or maximum measured values of a measuring series Print Output measured value to the printer selected under File setupIK121 printer If File on is selected as the printer the measured value will be output to the file IK121 DAT The display fields next to the position displays have the following meanings signal An encoder error has occurred Ref Reference mark traverse is active Measured value is smaller than the lower limit value select
46. an Lib K121DLL DLL ByVal Axis As Integer As Boolean Lib K121DLL DLL ByVal Axis As Integer ByRef pStatus As Long As Boolean Lib K121DLL DLL ByVal Axis As Integer ByVal Latch As Integer ByRef pData As Long As Boolean Lib IK121DLL DLL ByVal Axis As Integer ByVal Latch As Integer ByRef pData As Double As Boolean Lib K121DLL DLL Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisant eom The IK 121 in WINDOWS Applications Public Declare Function IKW ritePhase Public Declare Function IKLoadPhase Public Declare Function IKReadAmp Public Declare Function IKW riteAmp Public Declare Function IKLoadAmp Public Declare Function IKReadOffset Public Declare Function IKWriteOffset Public Declare Function IKLoadOffset Public Declare Function IKStore Public Declare Function IKDefault Public Declare Function IKRomRead Public Declare Function IKRomWrite Public Declare Function IKInputW Public Declare Function IKInputL Public Declare Function IKOutput Public Declare Function IKSetl2C Public Declare Function IKDefine ByVal Axis As Integer ByRef pData As Byte As Boolean Lib K121DLL DLL ByVal Axis As Integer ByVal Data As Byte As Boolean Lib K121DLL DLL ByVal Axis As Integer ByRef pData As Byte As Boolean Lib K121DLL DLL ByVal Axis As Integer ByRef pData As Byte As Boolean Lib K121DLL DLL ByVal Axis As Integer ByVal Data
47. ansfers all instantaneous compensation values into a nonvolatile memory The IK 121 activates the phase and amplitude compensation values automatically when the PC is switched on The offset compensation values are activated when the IK 121 is initialized function IKInit Prototype BOOL IKStore USHORT Axis Axis Number of the axis 0 to 15 108 45 Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com The IK 121 in WINDOWS Applications IKDefault This function sets all compensation to neutral values phase 31 Amplitude 31 and offset 0 This state is taken into the nonvolatile memory Prototype BOOL IKDefault USHORT Axis Axis Number of the axis 0 to 15 IKRomRead This function reads an 8 bit value from the EEPROM Prototype BOOL IKRomRead USHORT Card BYTE Adr BYTE pData Card Number of the IK 121 0 to 7 Adr Address in the EEPROM 0 to 255 pData Pointer to a byte variable 8 bit in which the value is filed IKRomWrite This function writes an 8 bit value into the EEPROM Prototype BOOL IKRomWrite USHORT Card BYTE Adr BYTE Data Card Number of the IK 121 0 to 7 Adr Address in the EEPROM 0 to 255 Data Value 8 bits that is saved in the EEPROM IKinputW This function reads a word in a register Prototype BOOL IKinputW USHORT Axis USHORT Adr USHORT pBuffer Axis Number of the axis 0 to 15 Adr Address of the register 0 to 30 or
48. arks with port addressing ait Latching as used in this manual means that the count in Register O or 1 is retained held The count must then be read by the program and stored in the PC or displayed on the screen The phase and amplitude of the sinusoidal encoder signals can be adjusted with the software and electronic potentiometers the offset can be adjusted with data registers in the counter Time to access measured values The time required to access the measured values is approximately 35 ys Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantd lom Hardware The IK 121 can be installed in all IBM AT and 100 compatible PCs HEIDENHAIN cannot guarantee proper functioning of the IK 121 with non 10096 compatible PCs The IK 121 conforms to the international IEEE P996 standard which specifies the AT 16 bits 5 V 45 12 V 5 12 V 5 Approx 1 watt without encoders AT compatible short 16 bit slot Hardware PC bus specification and ISA bus industry standard Bus width Power supply Power consumption Slot specification Encoder inputs IK 121A The IK 121 A accepts HEIDENHAIN linear or angle encoders that generate sinusoidal current signals 11 and I2 These encoders also generate a reference mark signal lo Signal amplitudes l1 12 0 90 lo reference mark Signal levels for error messages Maximum input frequency Cable length 7 UApp to 16 p
49. aseadr unsigned char axis unsigned char reg switch reg case 0 while latched baseadr axis 0 0 break case 1 while latched baseadr axis 1 0 P break Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisant lom The IK 121 in DOS Applications Function for reading a 32 bit measured value The following function reads a 32 bit measured value from a counter Function read count value32 Parameters baseadr Base address of the IK 121 that was set with DIP switches axis 1 axis 1 2 axis 2 reg 0 Data Register 0 1 Data Register 1 Result TURBO PASCAL Value from the data register given under axis and reg as integer variable of the comp type BORLAND C as an integer variable of the long type Function in TURBO PASCAL FUNCTION read count value32 baseadr word axis reg byte comp TYPE vartype li by mapper record case wert vartype of li field0 longint by fieldl array 0 1 of word end VAR buffer mapper BEGIN case reg of 0 begin buffer fieldl1 0 read g26 baseadr axis 0 buffer fieldl 1 read g26 baseadr axis 2 end 1 begin buffer fieldl1 0 read g26 baseadr axis 60 buffer fieldl 1 read_g26 baseadr axis 8 end end read count value32 buffer field0 END Gtisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com The I
50. atching via Data Register 1 timer Enable interrupt 2 for timer strobe port Interrupt is generated Tisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com The IK 121 in DOS Applications Record intstate This structure is the RAM memory image of Interrupt Status Registers 1 and 2 read access to 14h and 15h Data fields LO Interrupt O is active there was a measured value latch via Data Register O L1 Interrupt 1 is active there was a measured value latch via Data Register 1 timer Interrupt 2 is active there was a measured value latch via the timer strobe pendio Interrupt O is pending but not yet executed pendi1 Interrupt 1 is pending but not yet executed pendtimer Interrupt 2 is pending but not yet executed Record countstate This structure is the RAM memory image of Status Registers 1 and 2 read access to OEh and OFh Data fields latchO Measured value in Data Register 0 is ready latch1 Measured value in Data Register 1 is ready stop Counter is stopped sda PC bus line SDA input error frq Encoder error frequency exceeded ref activ Reference mark traversing is active Record signalstate This structure is the RAM memory image of the Amplitude Value Register read access to 11h of the Amplitude Register for the 0 signal read access to 16h and 17h and of the Amplitude Register for the 90 signal read access to 18h and 19h Data fields adoo Am
51. atus Register 3 has the value O Functional principle Offset values are added to the digital values of the 0 signal 0 to 1023 and the 90 signal In case of overflow the value is limited to 1023 or 0 Bit Function DO D1 D2 D3 D4 D5 D6 D7 D8 D9 D10 D11 No function D12 D13 D14 D15 Offset value for the 0 signal in two s complement form The offset register in the counters is volatile For this reason the offset values are stored in an EEPROM in the IC for the electronic potentiometers After switch on the offset values must be loaded from the EEPROM into the offset registers of the counters see procedures store offset and load offset Whisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Registers 16h Amplitude for O signal read mode After each analog digital conversion the result is stored Before reading the values should be frozen by bit D4 in Control Register 2 Bit Function DO D1 D2 D3 D4 D5 D6 D7 D8 D9 D10 D11 D12 D13 D14 D15 Amplitude for the 0 signal No function Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantd lom Registers 18h Offset Register for 90 signal write access This register contains the 7 bit offset value for the 90 signal For a description of the function see 16h Offset register for 0 signal E TR
52. axis 2 poll latch base address 2 0 Read axis 2 C value 1 2 read count value48 base address 2 0 G8isan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com The IK 121 in DOS Applications Display measured values gotoxy 1 10 write c value 0 0 02 1024 16 4 c value 1 0 02 1024 16 4 UNTIL KEYPRESSE END D Examples in BORLAND C Measured value latch via software The following examples SAM PLE32 C and SAMPLE48 C illustrate the use of the previously described functions These are declared and defined in the files IK121 0 H and IK121 0 C all files are on the supplied floppy disk 1 For compiling a project must be created with IK121 0 C and SAMPLE32 C or SAMPLEA8 C Since this example does not read the address of the IK 121 from IK121 INI the address is defined as the constant base address SAMPLE32 C DR JOHANNES H A simple program for the IK IDENHAIN GmbH Traunreut 121 to display Germany two axes asured value with 32 bits V 1 01 April 1995 Project files IK121_0 C SAMPLE32 C Include file IK121 D H include lt stdio h gt include lt conio h gt include ik121_0 h define base_address 0x0330 int main double c value 0 c value 1 cls Initialise the board in interpolation mode axis 1 write g26 base address 1 0x0c 0x0001 Initialis
53. coded ref marks Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisant eom Registers Bit DO D1 D2 D3 D4 D5 D6 D7 D8 D9 D10 D11 D12 D13 D14 D15 Amplitude Value Register read mode Function No function Current amplitude A new amplitude value is determined with each measured value latch DI D8 IK121A IK 121 V O 0 Normal amplitude 5 uA le 15 pA 0 47 Vpp Ue lt 1 41 Vpp O 1 Low amplitude 2 5 pA le 5 pA 0 23 Vpp Ue lt 0 47 Vpp 1 0 Highamplitude le gt 15 pA Ue gt 141 Vpp 1 1 Erroneously low amplitude le lt 2 5 pA Ue 0 23 Vpp Before being read the amplitude value should be frozen by bit D4 in Control Register 2 The Amplitude Value Register is reset by bit D7 in Control Register 1 Minimum value of the amplitude Coding and read mode see bits D8 and D9 If the current amplitude value is lower than the stored minimum value more than four times in a row the IK will replace the old minimum value with the current amplitude value No function SHtisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Registers 12h Enable Register for measured value latch write mode Function Enable LO for Data Register O Axis 1 0 Axis 2 1 Enable cascading with axis 1 D1 Enable LO via delay circuit 125 ns for Data Register O Axis 1 1 Enable extemal latch signal X
54. ction IKLatched Axis Word Latch Word pStatus BoolPtr Boolean StdCall External IK121DLL DLL Function IKWaitLatch Axis Word Latch Word Boolean StdCall External IKL21DLL DLL Function IKStrtCodRef Axis Word Latch Word RefDist Longlnt Boolean StaCall Extemal IK121DLL DLL Function IKCodRef Axis Word pStatus BoolPtr pData DoublePtr Boolean StdCall External IK121DLL DLL Function IKWaitCodRef Axis Word pData DoublePtr Boolean StdCall External IK121DLL DLL Function IKStopCodRef Axis Word Boolean StdCall External IK121DLL DLL Function IKStatus Axis Word pStatus LongPtr Boolean StdCall External IKL21DLL DLL Function IKRead32 Axis Word Latch Word pData LongPtr Boolean StdCall Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisant eom The IK 121 in WINDOWS Applications Function IKRead48 Function IKReadPhase Function IKW ritePhase Function IKLoadPhase Function IKReadAmp Function IKWriteAmp Function IKLoadAmp Function IKReadOffset Function IKWriteOffset Function IKLoadOffset Function IKStore Function IKDefault Function IKRomRead Function IKRomWrite Function IKInputW Function IKInputL Function IKOutput Function IKSetl 2C Func Func Func Func Func ion ion ion ion ion Define SetTimer EnableLatch EnableSync Latc
55. d Base address and enter the desired address decimal Save the address with Save setup Remove the floppy disk from drive A unplug the power cord of your PC and open the housing Refer to the user s manual of your PC for information on how to install additional cards Insert the IK 121 into your PC a short slot is sufficient secure the card and reinstall the PC housing Connect one or two linear encoders to input X1 or X2 using HEIDENHAIN adapter cable Id Nr 309 785 The encoders must have sinusoidal output signals Plug the PC s power cord back in Switch on the PC Insert the floppy disk with the driver software into drive A again Enter the following DOS commands gt A gt IK121 VV 34 tisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com The IK 121 in DOS Applications After the initial screen the PC displays the following DR JOHANNES HEIDENHAIN GmbH File Adjust Counters Sorting Datun Min Max Print x 20 74 9 7 NN v 165151 _ ESC Close window IK 121 EXE displays the position values of the encoders The example program is dialog driven You can use either the mouse or the keyboard You can call up additional explanations for the menu options by pressing F1 The programming of the IK 121 in DOS applications is shown in this manual with examples in TURBO PASCAL and BORLAND C The IK 121 uses port address
56. de BOOL IKWriteAmp USHORT Axis BYTE Data compensation value Read latched amplitude BOOL IKLoadAmp USHORT Axis BYTE pData compensation values Read offset compensation BOOL IKReadOffset USHORT Axis SHORT Ofs0 SHORT value Ofs90 Change offset compensation BOOL IKWriteOffset USHORT Axis SHORT Ofs0 SHORT value Ofs90 Read offset compensation BOOL IKLoadOffset USHORT Axis SHORT Ofs0 SHORT value Ofs90 Save compensation values BOOL IKStore USHORT Axis Load and save neutral values BOOL IKDefault USHORT Axis Read values from EEPROM BOOL IKRomRead USHORT Card BYTE Adr BYTE Datay Write values to EEPROM BOOL IKRomWrite USHORT Card BYTE Adr BYTE Data Read IK121 register 16 bits BOOL IKInputW USHORT Axis USHORT Adr USHORT pData Read IK121 register 32 bits BOOL IKInputL USHORT Axis USHORT Adr ULONG pData Write IK121 register BOOL IKOutput USHORT Axis USHORT Adr USHORT Data 16 bits Set I C lines BOOL IKSetl2C USHORT Card BOOL SCL BOOL SDA Define port addresses of BOOL IKDefine ULONG pBuffer8 the IK 121 Set timer value BOOL IKSetTimer USHORT Axis USHORT SetVal BOOL IKEnableLatch USHORT Axis USHORT Latch USHORT Source Define cascading BOOL IKEnableSync USHORT Card USHORT Source Latch position value of all BOOL IKLatchAIl USHORT Axis axes 98isan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www art
57. dresses Vacant port addresses are indicated as free occupied port addresses as not free Choose a vacant port address and enter the corresponding number for example 4 INSTALL now shows you how to set the DIP switches on the IK 121 Wisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com The IK 121 in DOS Applications Chosen address Nr 4 fidr 0330 free The DIP switch position on your interface card is fi4 of f fib of f A6 on A on A8 of f AI of f Press Return Set the DIP switches on the IK 121 Inanuun pnanun Inanunun nnanun IBI usas BE EIS SETS Press Return on the PC to store the selected port address in the file IK 121 INI The address is available to all supplied example programs except SAM PLE32 PAS SAM PLE48 PAS SAMPLE32 C and SAM PLE48 C gt Press Retum This ends the installation program Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantd dom The IK 121 in DOS Applications If INSTALL does not run on your PC use the standard setting address 0330h This is the factory setting of the IK 121 as well as the default setting for the software If this address is already occupied on your PC use a text editor to write the address you selected decimal into IK121 INI Or start IK121 EXE and select File Setup IK121 Setup boar
58. e the board in interpolation mode axis 2 write g26 base address 2 0x0c 0x0001 Reset error bit start counter axis 1 write g26 base address 1 0x0e 0x0048 Reset error bit start counter axis 2 write g26 base address 2 Ox0e 0x0048 Write to control register 2 axis 1 write g26 base address 1 Oxlc 0x0008 Write to control register 2 axis 2 write g26 base address 2 Oxlc 0x0008 Cursor off setcursortype NOCURSOR while kbhit Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisant om The IK 121 in DOS Applications Software latch in register 0 axis 1 soft 10 base address 1 Software latch in register 0 axis 2 soft 10 base address 2 Poll whether latched in axis 1 poll latch base address 1 0 Read axis 1 c value 0 double read_count_value32 base address 1 0 Poll whether latched in axis 2 poll latch base address 2 0 Read axis 2 c value 1 double read_count_value32 base address 2 0 Display measured values printf r t 16 4f t 16 4 c_value_0 0 02 1024 c value 1 0 02 1024 Cursor on _setcursortype NORMALCURSOR return 0 SAMPLE48 C DR JOHANNES HEIDENHAIN GmbH Traunreut Germany A simple program for the IK 121 to display two axes Measured value with 48 bits V 1 01 April 1995 Project files IK121_0 C SAM
59. echnology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com 1Ch Bit Registers Control Register 2 write access Function D1 D2 D3 Program a fixed value gt 8 D4 D5 D6 D7 1 Freeze amplitude for 0 signal 16h and 90 signal 18h as well as Amplitude Value Register 10h High Byte This bit must be set to prevent the register values from being changed during readout Whether the register values are frozen can be read in bit D4 in Status Register 3 1 New latch possible via Data Register 0 without having to fetch the measured value beforehand In this mode it is possible to change the measured value while reading 1 New latch possible via Data Register 1 without having to fetch the measured value beforehand In this mode it is possible to change the measured value while reading D8 D9 D10 D11 D12 D13 D14 D15 No function Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantd Bom Registers 1Ch Status Register 3 read access Bit Function D1 Cannot be read D2 D3 D4 1 Amplitude for 0 signal 16h and 90 signal 18h as well as Amplitude Value Register 10h High Byte are frozen and can be read D5 0 Offset Register for the 0 signal has been written D6 0 Offset Register for the 90 signal has been written D7 Nofunction 4Stisan Technology Group
60. ecifications manuals and documentation RENTALS ITAR CERTIFIED yop aed Contact us 888 88 SOURCE sales artisantg com www artisantg com
61. ed under Sorting gt Measured value is larger than the upper limit value entered under Sorting um If you re not sure how to proceed when using the IK 121 program press F1 to display an explanation of the function Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisant eom The IK 121 in DOS Applications Vacant EEPROM The IK 121 board contains an EEPROM with 512 bytes of memory which is addressed via the I C bus The following programs are included on the supplied floppy disk 1 for writing and reading the EEPROM RDROM EXE Reads the contents of the EEPROM Source code RDROM PAS Units IK121_1 TPU Functions for a RAM memory map WRROM EXE Copies the file IK121 TXT into the EEPROM Source code RDROM PAS Units IK121 LTPU Functions for a RAM memory map Applications examples with the RAM memory map in BORLAND C Examples with the RAM memory map in BORLAND C can be found on the provided floppy disk 1 in the directory BCPP The data structures and functions used are given and defined in the following files IK121 H You can set the addresses for up to 16 IK 121s in this header file IK121 l H Data structures for a RAM memory map for the IK 121 registers and explanations of the functions in the files IK121 1 CPP IIC CPP and POTI 1 CPP IK121 1 CPP Basic functions for the IK 121 IIC CPP Functions for data transfer via the I C bus POTI_1 CPP Functions
62. egister 1 28 IKLatchREF aiie 00 Control Register 2 45 IKLoadAmp ssssssss 05 Control Register 3 48 IKLoadOffset ssssssss 06 Converting the count IKLoadPhase ssssssse 05 into degrees sssss 66 IKOutput n 08 Into Enlmy eo peres 66 IKRead32 n e 04 countstate sssssssssssee 75 IKRead48 o oo ee eee teeters 04 Data registers 00 0 0 cece 25 IKReadAmp sssssssss 05 ea pr 78 IKReadOffset sss 06 DISPLAY EXE rere 87 IKReadPhase ssssse 04 DLL Funktionen 97 IKReset ss ete tes 99 EGAUGA BGI ssssss 81 IKResetREF niasin 00 08 s NEU 78 IKRomRead sees 07 Enable Register for measured value IKRomWrite ssssssss 07 E re na ee eet 35 IKSetl 2C ei tete 08 Encoder inputs sss 2 IKSetTimer ssssssss 08 Encoder outputs ssss 4 IKStart inane det edere 99 Encoder signals IKStartREF n i 00 adjustment sssssss 6 IKStatus edet ned 02 subdivision sssssss 1 XS 0 o 00 External functions 7 IKStopCodRef sssse 02 926 polntr ees 75 IKStopREF niisiis 00 926 record 76 IKSEOTG isso rcc ev etl 06 IEEE P996 ine
63. es and can be programmed with any programming language that can address port addresses Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisant om The IK 121 in DOS Applications IK121 0 files Basic functions for writing and reading the registers The functions described in the following are on the supplied floppy disk For TURBO PASCAL they are located under the directory TP in the file IKI21 O PAS For BORLAND C they are located under the directory BC in the file IK121 0 C and the associated header file IK121 O H The counters of the IK 121 are addressed through address registers see Addressing The address register must be set before a counter can be addressed The function write g26 writes the data register while read g26 reads it These are the two basic functions for working with the IK 121 Differences between TURBO PASCAL and BORLAND C TURBO PASCAL understands procedures functions without a return value and functions with a retum value while BORLAND C only understands functions with or without a return value This manual will use the TURBO PASCAL terms procedure and function Procedure for writing to the registers The following procedure writes a value to the 16 bit register of a counter Procedure write g26 Parameters baseadr Base address of the IK 121 that was set with DIP switches axis 1 axis 1 2 axis 2 address Addresses BO to B4 of the register of the co
64. esr ee ever 83 ADJUST EXE itstecie enge aa 84 IKI2 LEXE cai mre etr e cei c eee eg Yers 84 Vacant EEPROM rietan ean aaa aa aia 86 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg om Contents RDROM EXE scr etate eS 86 WRROM ENE tte ae reae ire tie ta ta 86 Applications examples with the RAM memory map in BORLAND C4 eene eene eene 86 POTIS EXE troieni a eresges gebe Pacsba begin 87 RDROM EXE sssssssseneeeeeeeenem nenne 87 WRROM LEXE eri teer d adiit Rod vean n d 87 DISPLAY EXE ce lae ena sad scit n ree nadd 87 The IK 121 in WINDOWS Applications sess 88 Device driver for Windows NT IK121DRV SYS 89 Registty Enty ninong bee nen ree tette aante 89 The Windows DLLs IK121DII DII sseeeeese 90 Example for console application sssssssssss 90 Example for VISUAL C4 90 Example for VISUAL BASIC ssssssssseeee 90 Example for BORLAND DELPHI 90 Installation of the driver and the DLL under WINDOWS NT and WINDOWS 95 sse 90 Calling DLL functions from your own application programs 91 MICROSOFT VISUAL C44 91 MICROSOFT VISUAL BASIC ssssssse 92 Public Declare Function IKLatchAIl Lib IK121DLL DLL ByVal Card As Integer As Boolean sssss 95 BORLAND DELPHI sssem 95 Overview of
65. for setting the electronic potentiometer In the file IK121 1 H a RAM memory map for the registers of the IK 121 is set up with the help of data structures The data for the map is written to the registers of the IK 121 with the help of the procedures InitHandler and CommHandler 98isan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com The IK 121 in DOS Applications POTIS EXE The program POTIS EXE shows how to set the electronic potentiometer of the IK 121 via the I C bus using software Source codes POTIS CPP IK121 1 CPP IIC CPP POTI 1 CPP Header files IK 121 H IK121 1 H RDROM EXE The program RDROM EXE reads the contents of the EEPROM Source codes RDROM CPP IK121 1 CPP IIC CPP Headerfiles IK121 H IK 121 1 H WRROM EXE The program WRROM EXE copies the file IK121 TXT into the EEPROM Source codes WRROM CPP IK121 1 CPP IIC CPP Header files IK121 H IK 121 1 H DISPLAY EXE the program DISPLAY EXE displays the contents of all the IK 121 registers Source codes DISPLAY CPP IK121 1 CPP IIC CPP Header files IK121 H IK 121 1 H Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantB bom The IK 121 in WINDOWS Applications The IK 121 in WINDOWS Applications Floppy disks 2 and 3 contain the driver software Dynamic Link Libraries DLL and application examples in VISUAL C VISUAL BASIC and BORLAND DELPHI for WINDOWS N
66. gister T tisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com The IK 121 in DOS Applications Record refcommand This structure is the RAM memory image of the Reference Mark Register write access to 10h When the reference mark is traversed the following functions can be executed Data fields ristart Start counter ristop Stop counter riclear Clear counter riclear2 Clear counter when each reference mark is traversed rilatch Latch measured value rilatch2 Latch measured value when the second reference mark is traversed Record initlatch This structure is the RAM memory image of the Enable Register for the measured value latch write access to 12h Data fields en LO regO Enable LO for Data Register O en latch2 reg0 Enable software latch in all data registers for Data Register 0 en timer regO Enable software latch via timers for Data Register 0 en L1 regi Enable L1 for Data Register 1 en latch2 regl Enable software latch in all data registers for Data Register 1 en timer reg1 Enable software latch via timers for Data Register 1 Record initsync This structure is the RAM memory image of the Enable Register for axis cascading write access to 13h The following data fields apply only to axis 1 Data fields en LO axis2 Enable external latch signal X3 L0 to the second axis en_latch2_axis2 Enable software latch with special functions to the sec
67. hAll External IKI21DLL DLL Axis Word Latch Word pData DoublePtr Boolean StdCall External IKI21DLL DLL Axis Word pData BytePtr Boolean StdCall External IK121DLL DLL Axis Word Data Byte Boolean StdCall Extemal IK121DLL DLL Axis Word pData BytePtr Boolean StdCall External IK121DLL DLL Axis Word pData BytePtr Boolean StdCall External IK121DLL DLL Axis Word Data Byte Boolean StdCall External IK121DLL DLL Axis Word pData BytePtr Boolean StdCall External IK121DLL DLL Axis Word OfsO IntPtr Ofs90 IntPtr Boolean StdCall Extemal IK121DLL DLL Axis Word Ofs0 Integer Ofs90 Integer Boolean StdCall External IKI21DLL DLL Axis Word OfsO IntPtr Ofs90 IntPtr Boolean StdCall External IK121DLL DLL Axis Word Boolean StdCall External IK121DLL DLL Axis Word Boolean StdCall External IKI21DLL DLL Card Word Adr Byte Data BytePtr Boolean StdCall External IKL21DLL DLL Card Word Adr Byte Data Byte Boolean StdCall External IKL21DLL DLL Axis Word Adr Word pData WordPtr Boolean StdCall Extemal IK121DLL DLL Axis Word Adr Word pData LongPtr Boolean StdCall External IK121DLL DLL Axis Word Adr Word Data Longlnt Boolean StdCall Extemal IK121DLL DLL Card Word SCL Boolean SDA Boolean Boolean StdCal
68. hREF USHORT Axis USHORT Latch BOOL IKLatched USHORT Axis USHORT Latch BOOL pStatus Wait until the counter value has been saved BOOL IKWaitLatch USHORT Axis USHORT Latch Start a reference run with distance coded reference marks Inquiry whether the reference run with distance coded reference mark has ended BOOL IKStrtCodRef USHORT Axis USHORT Latch ULONG RefDist BOOL IKCodRef USHORT Axis BOOL pStatus double pData Wait until the reference run with distance coded reference marks has ended Stop the reference run with distance coded reference marks Status inquiry Read latched counter values 32 bits BOOL IKWaitCodRef USHORT Axis double pData BOOL IKStopCodRef USHORT Axis BOOL IKStatus USHORT Axis ULONG pStatus BOOL IKRead32 USHORT Axis USHORT Latch LONG pData Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantd bom The IK 121 in WINDOWS Applications Short Reference BOOL IKRead48 USHORT Axis USHORT Latch double pData Read latched counter values 48 bits Read phase compensation BOOL IKReadPhase USHORT Axis BYTE pData value Change phase BOOL IKWritePhase USHORT Axis BYTE Data compensation value Read latched phase BOOL IKLoadPhase USHORT Axis BYTE pData compensation value Read amplitude BOOL IKReadAmp USHORT Axis BYTE pData compensation value Change amplitu
69. he axis 0 to 15 pStatus Pointer to a long word 32 bits TM2san Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com The IK 121 in WINDOWS Applications Bit Function DO 1 counter value saved in register O D1 1 counter value saved in register 1 No function D3 No function D4 1 counter stopped D5 No function 1 maximum frequency exceeded No function D8 1 REF function active 1 counter is started with next reference mark D10 1 counter is stopped with next reference mark D11 1 counter is reset to 0 with next reference mark D12 1 counter is saved with next reference mark D13 1 counter is saved with the reference mark after the next one D14 1 counter is reset to 0 with every reference mark D15 Nofunction D16 Nofunction D17 Present amplitude D18 00 normal amplitude 4 5 pA lt U lt 15 pA 01 low amplitude U lt 4 5 A 10 high amplitude U gt 15 pA 11 unacceptably low amplitude U lt 2 5 pA D19 Minimum amplitude D20 00 normal amplitude 4 5 pA lt U 15 pA 01 low amplitude U lt 4 5 uA 10 high amplitude U gt 15 pA 11 unacceptably low amplitude U 2 5 pA Maximum amplitude 00 normal amplitude 4 5 uA lt U 15 pA 01 small amplitude U lt 4 5 YA 10 high amplitude U gt 15 pA 11 unacceptably low amplitude U 2 5 uA D21 D22 D23 No functio
70. he axis 0 to 15 pData Pointer to a byte variable 8 bits in which the phase compensation is saved T0fsan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com The IK 121 in WINDOWS Applications IKWritePhase This function changes the instantaneous setting of the phase compensation Prototype BOOL IKWritePhase USHORT Axis BYTE Data Axis Number of the axis 0 to 15 Data New value of the phase compensation 0 to 63 IKLoadPhase This function reports the nonvolatile saved value of the phase compensation Prototype BOOL IKLoadPhase USHORT Axis BYTE pData Axis Number of the axis 0 to 15 pData Pointer to a byte variable 8 bits in which the phase compensation is saved IKReadAmp This function reports the instantaneous setting of the amplitude compensation Prototype BOOL IKReadAmp USHORT Axis BYTE pData Axis Number of the axis 0 to 15 pData Pointer to a byte variable 8 bits in which the amplitude compensation is saved IKWriteAmp This function changes the instantaneous setting of the amplitude compensation Prototype BOOL IKWriteAmp USHORT Axis BYTE Data Axis Number of the axis 0 to 15 Data New value of the amplitude compensation 0 to 63 IKLoadAmp This function reports the nonvolatile saved value of the amplitude compensation Prototype BOOL IKLoadAmp USHORT Axis BYTE pData Axis Number of the axis 0 to 15
71. hnology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisanl Rom Specifications Specifications Mechanical Data Dimensions Operating temp Storage temp Electrical Data Inputs Outputs External latch signals 2 inputs 1 output Encoder outputs IK 121A Encoder inputs Input frequency Cable length IK 121V Encoder inputs Input frequency Cable length 158 mm x 107 mm 0 C to 45 C 32 F to 113 F 30 C to 70 C 22 F to 158 F X3 4 pin flange socket Un 3 15 V to 30V UL 3 0 V to 0 9 V Un 4 0 V to 32V UL OVtol0V Sinusoidal current signals 11 App via additional assembly for each axis X1 Axis 1 9 pin D sub connection sinusoidal signals 7 UApp to 16 pApp X2 Axis 2 9 pin D sub connection sinusoidal signals 7 UApp to 16 App Max 100 kHz Max 10 meters X1 Axis 1 15 pin D sub connection sinusoidal signals 0 6 Vpp to 1 2 Vpp X2 Axis 2 15 pin D sub connection sinusoidal signals 0 6 UVpp to Max 400 kHz Max 30 meters Cables lengths of up to 150 m are possible if it can be guaranteed that the encoder will be supplied by 5 V from an extemal power source In this case the input frequency is reduced to 250 kHz Signal interpolation 1024 fold Wasan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Specifications Adjustment of Phase and amplitude adjusted with encoder signa
72. hnology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisant eom Registers Registers The circuit diagram of the counters on the last fold out page will help you in the following description Important note for programmers The IK 121 is accessed by reading and writing data words stored in registers For this reason only even port addresses may be addressed with word write and word read commands Overview of registers Address hex Write mode Read mode BO to B4 00 Data Register 0 LS Word 02 No function Data Register 0 04 Data Register 0 MS Word 06 Data Register 1 LS Word 08 No function Data Register 1 OA Data Register 1 M S Word OCLow Byte Initializing Register 1 Initializing Register 1 High Byte Initializing Register 2 Initializing Register 2 OE Low Byte Control Register 1 Status Register 1 High Byte No function Status Register 2 10Low Byte Reference Mark Register No function High Byte No function Amplitude Register 12 Low Byte Enable Register for Measured No function Value Latching High Byte Axis Cascading No function 14 Low Byte Interrupt Enable Register Interrupt Status Register 1 High Byte No function Interrupt Status Register 2 16 Low Byte Offset Register for 0 Signal Amplitude for O signal High Byte No function Amplitude for 0 signal 18 Low Byte Offset Register for 90 Signal Amplitude for 90 signal High Byte No function Amplitude for 90 signal 1A Low
73. ic potentiometers e Symmetry offset can be adjusted in the counters with offset registers The potentiometer is I2 C bus controlled Since generation of the control sequences is complicated the program POTIS EXE or ADJ UST EXE should be used for adjustment If an application does have to control the potentiometers the functions and procedures in TURBO PASCAL from IIC PAS can be used or they can serve as a basic orientation for your own functions Wtisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Hardware qt The compensation values for phase and amplitude are stored in the ICs of the electronic potentiometers in nonvolatile memory The offset registers in the counter ICs however are volatile the information will be lost when the power is removed For this reason the offset compen sation values are stored in an EEPROM in the IC for the electronic potentiometers After switch on the offset compensation values must be loaded from the EEPROM into the offset registers of the counters Two procedures in IIC PAS fulfill these tasks The store offset procedure stores the offset compensation values in the EEPROM The load_offset procedure copies the offset compensation values from the EEPROM into the offset register of the counters Load_offset is also used by init_IK121 Extemal functions A 4 pin flange socket is available for external functions The required connector Id Nr 2
74. idual bits 12h Read mode has no function 36iisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Registers 14h Interrupt Enable Register write mode The interrupt logic is programmed through the Interrupt Enable Register The interrupt can be caused by the measured value latch in Register O Register 1 or the Timer strobe Each interrupt source can be programmed independently of the others If several interrupts are received at the same time the following priorities are used e Highest priority measured value latch via Register O e Second highest priority measured value latch via Register 1 Lowest priority measured value latch via timer strobe After an interrupt no further interrupts can follow until Interrupt Status Register 2 has been read Bit Function DO Enable interrupt 0 with measured value latch via Register 0 D1 1 Enable interrupt 1 with measured value latch via Register 1 D2 1 Enable interrupt 2 for timer strobe D3 1 Interrupt is generated DO D1 D2 0 D4 D5 D6 D7 D8 D9 D10 D11 No function D12 D13 D14 D15 The circuit diagram of the counters on the last foldout page shows the functions of the individual bits Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg bom Registers 14h Interrupt Status Register 1 read mode The currently active interrupt is displayed in thi
75. ing the registers sssss 57 Simple functions for measured value latch via software 58 Procedures for latching a measured value 58 Function for checking whether the measured value was Storedi recia 59 Procedure for repeatedly polling whether the measured value was stored 61 Function for reading a 32 bit measured value 62 Function for reading a 48 bit measured value 64 Simple program for measured value latching via software 66 Converting the count into millimeters 66 Converting the count into degrees sssss 66 Examples in TURBO PASCAL Measured value latch via software sss 67 Examples in BORLAND C Measured value latch via software sss 69 IK121 1 PAS Functions for a RAM memory map in TURBO PASCAL tr teet ient e ee T RENE 72 Definition of the data structures 72 Procedures and functions ssssssssssssssss 76 Applications programs with the RAM memory map in TURBO PASCAL tret rect ete teer nde esit cade s 81 SAMPEEZLEXE im eer eng eec re terere 81 SAMPEE2 EXE ierat siete eee Dare ru 81 SAMPLES EXE esent ete te desea esa eter tetur eee 81 SAMPLEA EXE sssssssssse eee 82 SAMPLES EXE ertet N Dea 82 SAMPLE6 EXE ssssssssseeeeeeeen ns 82 SCOPE EXE 5er deste bera E 83 POTIS EXE rd ies coca tome rra
76. irectory TP The programs require a BORLAND graphics interface BORLAND Graphics Interface BGI The IK 121 includes the graphics interface EGAVGA BGI This interface must be located in the same directory as the example programs SAMPLE1 EXE This is a simple application program for displaying the contents of Data Register 0 of axes 1 and 2 Source code SAMPLE1 PAS Units IK121 O TPU Basic functions IK121 LTPU Functions for a RAM memory map SAMPLE2 EXE This program illustrates the use of interrupt programming IRQ14 is used for Int1 and IRQ15 for IntO An interrupt is triggered by a falling edge at X3 LO or X3 L 1 Source code SAMPLE2 PAS Units IK121 O TPU Basic functions IK121 L TPU Functions for a RAM memory map SAMPLE3 EXE This program shows how the IK 121 can be used to measure speed The speed and acceleration of axis 1 are displayed The acceleration is calculated from speeds ds 1 and ds 2 Source code SAMPLE3 PAS Units IK121 O TPU Basic functions IK121 L TPU Functions for a RAM memory map Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisant lom The IK 121 in DOS Applications SAMPLEA EXE Shows how the electronic potentiometers for phase position and amplitude as well as the offset registers can be read Source code SAMPLE4 PAS Units IK121 O TPU Basic functions IK121 LTPU Functions for a RAM memory map SAMPLES5 EXE This program shows the contents of Registe
77. isantg com Enable latch signal The IK 121 in WINDOWS Applications Reference of the DLL functions All DLL functions return a Boolean variable true lt gt 0 if the function was successfully completed false 0 if an error occurred IKFind This function supplies the port address of the installed IK 121 Unused entries are set to 0 Prototype BOOL IKFind ULONG pBuffer 8 pBuffer Pointer to 8 long words 4 bytes IKInit This function initializes the IK 121 Prototype BOOL IKInit USHORT Axis USHORT Mode Axis Number of the axis 0 to 15 Mode 0232 bit counter value 1 48 bit counter value IKVersion This function reads the program versions of the NT device driver and the DLL The program versions are saved as ASCII characters There must be room reserved for at least 20 characters The character strings are concluded with a zero byte Prototype BOOL IKVersion USHORT Axis char pVersCard char pVersDrv char pVersDIl Axis Number of the axis 0 to 15 pVersCard Pointer to the version of the IK 121 pVersDrv Pointer to the program version of the Windows NT device drivers only under Windows NT pVersDIl Pointer to the program version of the DLL IKReset This function sets the counter to zero Prototype BOOL IKReset USHORT Axis Axis Number of the axis 0 to 15 IKStart This function starts the counter Prototype BOOL IKStart USHORT Axis Axis Number of the axis 0 to 15
78. ition in the drawing and the 1st reference mark crossed over must be determined 4tisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Registers There are four possible cases 1 Positive traverse direction and DIFF gt 500 OFFSET DIFF 501 1000 2 Positive traverse direction and DIFF 500 OFFSET 500 DIFF e 1000 DIFF 3 Negative traverse direction and DIFF 500 OFFSET DIFF 501 e 1000 DIFF 4 Negative traverse direction and DIFF 500 OFFSET 500 DIFF e 1000 The absolute position in increments can be calculated as follows ABS POS INCR ACT POS PRESET DISTANCE ACT POS Distance in increments between the current position and the 1st reference mark crossed over PRESET Position in increments assigned to the 1st reference mark of the scale on datum setting O position in the drawing DISTANCE Distance in increments between the first reference mark on the scale and the first traversed reference mark DISTANCE OFFSET e 1024 The absolute position is calculated as follows e g when using a scale with a signal period of 0 02 mm ABS POS INCRe 360 1024 ABS POS MM With angle encoders ABS POS_INCRe360 1024eLINES PER REV ABS POS DEGREE You will find an application example in TURBO PASCAL for evaluating reference marks in the source code of TNC EXE in the file CNT_2 PAS under Distance
79. l External IK121DLL DLL pBuffer8 Long8Ptr Boolean StdCall External IK121DLL DLL Axis Word SetVal Word Boolean StdCall External IK121DLL DLL Axis Word Latch Word Source Word Boolean StdCall External IK121DLL DLL Card Word Source Word Boolean StdCall External IK121DLL DLL Axis Word Boolean StdCall External IK121DLL DLL 96iisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com The IK 121 in WINDOWS Applications Overview of DLL functions Function Find the installed IK 121 Initialize the IK 121 Read program version Reset the counter Start the counter Stop the counter Erase the frequency and amplitude errors Short Reference BOOL IKFind ULONG pBuffer8 BOOL IKInit USHORT Axis USHORT Mode BOOL IKVersion USHORT Axis char pVersCard char pVersDrv char pVersDIl BOOL IKReset USHORT Axis BOOL IKStart USHORT Axis BOOL IKStop USHORT Axis BOOL IKClear USHORT Axis Save the counter value Reset the counter with next reference mark Start the counter with next reference mark Stop the counter with the next reference mark Save the counter value with the next reference mark Inquiry whether the counter value has been saved BOOL IKLatch USHORT Axis USHORT Latch BOOL IKResetREF USHORT Axis BOOL IKStartREF USHORT Axis BOOL IKStopREF USHORT Axis BOOL IKLatc
80. ls electronic potentiometers Offset adjusted with registers in the counters Data register for 48 bits measured values Port addresses Selected with DIP switches the IK 121 occupies 16 addresses Interrupts IRQ5 IRQ9 IRQ10 IRQ11 IRQ12 or IRQ15 Power consumption 1 W approx without encoders Software Driver software and As programming aid for demonstration programs DOS applications in TURBO PASCAL and BORLAND C WINDOWS NT 95 in VISUAL C VISUAL BASIC and BORLAND DELPHI Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisanld Aom Subject Index Subject Index Access time 11 IKCodRef eee 02 Accessories o n 7 IKDefault sssssssss 07 Addressing sss 22 IKDefine ssssssss 08 ADJUST EXE irrien 84 IKEnableLatch ssse 09 Amplitude for 0 signal 41 IKEnableSync sssse 09 Amplitude for 90 signal 43 IKFind ssse 99 Amplitude Value Register 34 IKI IG reed ceno 99 BUS anica re rte 12 IKInputL sssm 07 Bus width eere 12 IKInputW ssmm 07 Clear int 78 IKLatCh nn 00 Code Register ssss 47 IKLatchAll 0 cece eee 09 comm handler 76 IKLatched ssssess 01 Control R
81. mines whether the counters count positive normal or negative inverse when the traverse direction is positive 0 Normal counting direction 1 Inverse counting direction Inverse counting direction is permitted only in the period counter mode In operation with interpolation inverse counting direction will result in faulty gating of the interpolation value and the period counter value 26risan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com OCh Bit D8 D9 D10 D11 D12 D13 D14 D15 OCh Registers Initializing Register 2 write mode Function Only in operation as period counter edge evaluation The two incremental encoder signals 0 and 90 el provide a maximum of four edges for evaluation per signal period The counters can be programmed to count one two or four edges per signal period D9 D8 0 0 1fold 0 1 2fold 1 1 4fold In operation with interpolation value 1 fold evaluation is automatically set Only in operation as period counter Counting mode 0 Linear counting mode 2 1 to 241 1 1 Angle counting mode as defined below in D11 For angle encoders with 36 000 or 360 000 lines per revolution Only with angle display Counting mode 0 17 999 to 18 000 1 179 999 to 180 000 0 0 Measured value latch with reference pulse 0 1st reference mark stores in Data Register 0 1 Ist reference mark stores in Data Register 1 0 2nd
82. n D24 IC code of the counter chip 08 or 09 to D31 1 only when IC code 09 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisan Q8om The IK 121 in WINDOWS Applications IKRead32 This function supplies the 32 bit counter value Before the counter value can be read out it must be saved in register 0 or register 1 IKLatch IKLatchREF and the program must inquire whether the saving process has been completed IKLatched IKWaitLatch Prototype BOOL IKRead32 USHORT Axis USHORT Latch LONG pData Axis Number of the axis 0 to 15 Latch 0 read out from register 0 1 read out from register 1 pData Pointer to a long word 32 bits in which the counter value is saved IKRead48 This function supplies the 48 bit counter value Before the counter value can be read out it must be saved in register 0 or register 1 IKLatch IKLatchREF and the program must inquire whether the saving process has been completed IKLatched IKWaitLatch Prototype BOOL IKRead48 USHORT Axis USHORT Latch double pData Axis Number of the axis 0 to 15 Latch 0 read out from register 0 1 read out from register 1 pData Pointer to a double variable 64 bits in which the counter value is stored IKReadPhase This function reads the present setting of the phase compensation potentiometer Prototype BOOL IKReadPhase USHORT Axis BYTE pData Axis Number of t
83. nce this example does not read the address of the IK 121 from IK121 INI the address is defined as the constant base address program sample32 DR JOHANNES HEIDENHAIN GmbH Traunreut Germany A simple program for the IK 121 to display two axes asured value with 32 bits V 1 01 April 1995 e V R ES crt ik121 0 SIT base address 330 VAR c value 0 c value 1 comp BEGIN clrscr Initialise the board in interpolation mode axis 1 write g26 base address 1 0c 0001 Initialise the board in interpolation mode axis 2 write g26 base address 2 0c 0001 Reset error bit start counter axis 1 write g26 base address 1 0e 0048 Reset error bit start counter axis 2 write g26 base address 2 0e 0048 Write to control register 2 axis 1 write g26 base address 1 1c 0008 Write to control register 2 axis 2 write g26 base address 2 1c 0008 REPEAT Software latch in register 0 axis 1 soft 10 base address 1 Software latch in register 0 axis 2 soft 10 base address 2 Poll whether latched in axis 1 poll latch base address 1 0 Read axis 1 US CO Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisant bom The IK 121 in DOS Applications Cc value 0 2 read count value32 base address 1 0 Poll whether latched in
84. nter address address amp OxI1F Load address pointer into address register Address of the address register adr reg baseadr 0x0008 Value of the address register RO to R2 address of the counter without BO and B1 adr point address gt gt 2 Load address register outpw adr reg adr point Calculate port address switch axis case 1 adr gate baseadr address amp 0x03 break case 2 adr gate baseadr 0x0004 address amp 0x03 break Write lt datum gt to the counter outpw adr_gate datum 9 iisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com The IK 121 in DOS Applications Function for reading the registers The following function reads a value from a 16 bit register of a counter Function read g26 Parameters baseadr Base address of the IK 121 that was set with DIP switches axis 1 axis 1 2 axis 2 address Addresses BO to B4 of the register of the counter Result Value from the data register indicated under axis and address as a 16 bit variable Function in TURBO PASCAL FUNCTION read_g26 baseadr word axes address byte word VAR adr_reg adr_point adr_gate word BEGIN Discard the last four bits of the card address baseadr baseadr and SOFFO Address BO to B4 of the counter address address and 001F Load address pointer into address register
85. nter return inpw adr gate Simple functions for measured value latch via software Procedures for latching a measured value The following procedures store the counter content of the desired axis in Data Register O soft l0 or Data Register 1 soft I1 Procedure soft IO soft I1 Parameters baseadr Base address of the IK 121 that was set with DIP switches axis 1 axis 1 2 axis 2 FRiisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com PROCEDURE BEGIN END PROCEDURE BEGIN END void soft write_g26 void soft_ write_g26 The IK 121 in DOS Applications Procedures in TURBO PASCAL soft_10 baseadr word axis byte write_g26 baseadr axis 14 0001 soft ll baseadr word axis byte write g26 baseadr axis 14 0002 Procedure in BORLAND C 10 unsigned int baseadr unsigned char axis baseadr axis Ox0e 0x0001 11 unsigned int baseadr unsigned char axis baseadr axis Ox0e 0x0002 Function for checking whether the measured value was stored Function latched Parameter baseadr Base address of the IK 121 that was set with DIP switches axis 1 axis 1 2 axis 2 reg 0 Data Register 0 1 Data Register 1 Result False no measured value was stored True a measured value was stored Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE
86. o feeds the encoder signals from inputs X1 and X2 as sinusoidal current signals 11 App to two 10 pin AMP connectors These connections can be routed to 9 pin D sub connections by means of additional cable assemblies with a PC slot cover Id Nr 257 818 01 Adapter cables Id Nr 309 78 xx for connection to HEIDENHAIN position display units or interpolation electronics are available see Items Supplied Accessories Wisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Hardware The maximum cable length depends on the input circuitry of the subsequent electronics Encoder outputs Id Nr 257 818 01 D sub connection with male insert 9 pin 5 Assignment l1 0 V Un l2 Not connected lo l1 Not connected l2 lo Housing Extemal shield Ooi NI DD Om AJ WN Fr Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantd Bom Hardware PCB connector for encoder outputs AMP with male insert 10 pin Pin Signal la Not connected 1b Not connected 2a Not connected 2b OV UN 3a lo 3b lo 4a l2 4b b 5a l1 5b l1 The side with the locking pins is indicated as b Connections 1a and 1b are on the side with the notch 12345 Encoder signal adjustment Encoder signals can be adjusted as follows e Phase and amplitude can be adjusted with electron
87. ond axis en_timer_axis2 Enable timer strobe to the second axis Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantd Bom The IK 121 in DOS Applications Record initmain This structure is the RAM memory image of Initializing Registers 1 and 2 write access to OCh and ODh Data fields mode1024 0 Operation as period counter without interpolation data bits DO to D9 are not defined 1 Measured value is calculated from the value of the period counter the interpolation value en timer 0 Reset and stop timer 1 Start timer en 48Bit 0 Op mode 32 bit counter 1 Op mode 48 bit counter onefold Counters count 1 edge per signal period twofold Counters count 2 edges per signal period fourfold Counters count 4 edges per signal period arcmode 0 Linear counting mode 1 Angle counting mode arc180000 0 Angle counting mode 17 999 to 18 000 1 Angle counting mode 179 999 to 180 000 sel ri 1st 0 First reference mark stored in Data Register 0 1 First reference mark stored in Data Register 1 sel ri 2nd 0 Second reference mark stored in Data Register 0 1 Second reference mark stored in Data Register 1 Record initintrpt This structure is the RAM memory image of the Interrupt Enable Register write access to 14h Data fields rego Enable interrupt O with measured value latching via Data Register 0 regi Enable interrupt 1 with measured value l
88. otentiometers can be set with key commands that are explained on the screen POTIS PAS IK121 0 TPU IK121 LTPU Source code Units IK121 2 TPU POTI 0 TPU CNT 0 TPU LOGO TPU Basic functions Functions for a RAM memory map Functions for ADJ UST EXE POTIS EXE and SCOPE EXE Functions for POTIS EXE Window functions Initial image after program start Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisant eom The IK 121 in DOS Applications ADJ UST EXE ADJ UST EXE automatically adjusts axis 1 selection 1 or axis 2 selection 2 for phase position selection p amplitude selection a and offset selection o of the sinusoidal encoder signals The compensation values are calculated by slow movement of the encoder After 30 signal periods a tone signals that a compensation value is ready and can be stored by pressing the S key Source code Units IK121 EXE ADJ UST PAS IK121 0 TPU IK121_1 TPU IK121 2 TPU ADJ _0 TPU CNT_0 TPU LOGO TPU Basic functions Functions for a RAM memory map Functions for ADJ UST EXE POTIS EXE and SCOPE EXE Functions for ADJ UST EXE Window functions Initial image after program start This is an example of a position display program in TURBO PASCAL Source code Units Include files Help texts IK121 PAS IK121 0 TPU IK121 LTPU IK121 2 TPU CNT 0 TPU CNT LTPU CNT 2 TPU SCOPE O TPU ADJ _0 TPU LOGO TPU IK121
89. pin IK 121V 309 784 xx 15 12 pin 310 196 xx 15 12 pin Additional D sub connection for sending the encoder signals of input X1 or X2 to another display unit or control Connecting cables from additional D sub connection to another display unit or control Connectors for the extemal functions on input input X3 two female two male Adapter cables with coupling for HEIDENHAIN encoders standard length 0 5 meters Adapter cables with connector for HEIDENHAIN encoders with flange socket standard length 0 5 meters Adapter cables with coupling for HEIDENHAIN encoders standard length 0 5 meters Adapter cables with connector for HEIDENHAIN encoders with flange socket standard length 0 5 meters irtisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Accessories max 10m gt 310 195 xx a x1 IK 121A x2 309 785 xx 77 282 168 01 265 775 02 n Varies according to input circuitry of subsequent electronics Adapter 257 818 01 gt 309 781 xx max 30 m1 310 196 xx ROD x1 IK 121V 309 784 xx JLS X3 lt max 10m gt 310 132 xx APE x1 IK 121V 309 132 x oS VM 182 x2 X3 APE 77 282 168 01 IK 121V 1 Cable lengths up to 150 m are possible if it can be guaranteed that the encoder will be supplied by 5 V from an external
90. plitude for the 0 signal ad90 Amplitude for the 90 signal amp act Current amplitude amp min Minimum value of the amplitude Pointer g26 pointr Pointer to a structure g26 record Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantd Bom The IK 121 in DOS Applications Record g26 record This structure contains the complete data set of the RAM memory image of the registers for one axis Pointer ik121 pointr Pointer to a structure ikK121 record Record ik121 record Array of pointers g26 pointr Record storage Array of structures g26 record for the file IK121 INI for storing the initializing values Procedures and functions Function look for IK121 Tests whether the hardware of the IK 121 is present Result True if IK121 is present False if IK 121 is not present Prototype FUNCTION look for IK121 board IK121 pointr boolean Procedure init IK121 Initializes the IK 121 Prototype PROCEDURE init ik121 board IK121 pointr Procedure init handler Writes the initializing data from the RAM memory map to the port addresses of the IK 121 with the following functions 926 main g26 latch 926 sync and g26 int Prototype PROCEDURE init handler pointr g26 pointr Procedure comm handler Writes the commands from the RAM memory map to the port addresses of the IK 121 using the following functions g26 soft 926 ref Prototype PROCEDURE comm handler pointr g26 pointr
91. power source Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg om Important Information Important Information Danger to intemal components When handling components that can be damaged by electrostatic discharge ESD follow the safety recommendations in DIN EN 100 015 Use only antistatic packaging material Be sure that the work station and the technician are properly grounded during installation READ ME The READ ME file contains important information on installation of the IK 121 and the supplied software The program READM E EXE displays this file on the screen B rtisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Technical Description of the IK 121 Technical Description of the IK 121 The IK 121 counter card is plugged directly into an expansion slot of an AT compatible PC The IK 121 accepts the signals from one or two HEIDENHAIN encoders with sinusoidal current signals IK 121 A or voltage signals IK 121 V The positions of the encoders are displayed on the PC screen and stored in the PC for further processing The IK 121 is ideal for applications in high speed data acquisition requiring high resolution of the encoder signals Circuit diagram of the IK 121 gt Phase correction Counter ISA bus PC Slot xa Amplitude correction axis X1
92. r 0 and Register 1 for axis 1 In addition for Register 0 the contents of the period counter and the interpolation value are displayed separately Various commands that you can enter on the keyboard are explained on the screen Source code SAMPLE5 PAS Units IK121 O TPU Basic functions IK121 LTPU Functions fora RAM memory map SAMPLEG EXE SAM PLEG EXE shows how the IK121 can be used as a period counter for axes 1 and 2 i e the interpolated value is not evaluated Various commands that you can enter on the keyboard are explained on the screen Source code SAMPLE6 PAS Units IK121 O TPU Basic functions IK121 LTPU Functions fora RAM memory map 84tisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com The IK 121 in DOS Applications SCOPE EXE This program displays the sinusoidal encoder signals either as in amplitude time diagram or in XY representation The potentiometers can be set with key commands that are explained on the screen Source code SCOPE PAS Units IK121 O TPU IK121 1 TPU IK121 2 TPU SCOPE 0 TPU CNT 0 TPU LOGO TPU POTIS EXE Basic functions Functions for a RAM memory map Functions for ADJ UST EXE POTIS EXE and SCOPE EXE Functions for SCOPE EXE Window functions Initial image after program start This program shows the settings of the electronic potentiometers for phase position and amplitude as well as the values of the offset registers The p
93. ram and voltage level X3 LO X3 L1 Data register a td2 tsync Uon X3 0UT Vor Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantd Bom Hardware Designation MIN MAX Ui V 3 0 0 9 Uin V 3 15 30 td1 us td2 ns tw ns tsync Us 1 Uo V 0 8 UoH 4V 12V 1 0 UoH 12V 32V Uon V 4 32 lot mA E 40 Miisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Hardware Latching measured values from multiple IK 121s Latching output X3 OUT can be used to latch the measured value from multiple IK 121 cards This is done by connecting the latching output X3 OUT of one IK 121 to the latching inputs of further IK 121s IK121 3 Pin 1 X3 LO Pin 2 X3 L1 Pin 3 X3 Out Pin 4 OV x3 Pin 1 X3 LO Pin 2 X3 L1 Pin 3 X3 0ut Pin 4 OV X3 Pin 1 X3 LO Pin 2 X3 L1 Pin 3 X3 0ut Pin 4 OV Interrupts The IK 121 can use one of the following PC interrupts IRQ5 IRQY IRQ10 IRQ11 IRQ12 or IRQ15 The desired interrupt is selected with jumpers on the circuit board Axis 1 generates the internal signal IntO and axis 2 generates Intl The arrangement of the pin connectors prevents IntO and Int1 from being connected to the same IRQ line Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisant tom Hardware Axis1 00000 qa ooo Axis
94. reference mark stores in Data Register 0 1 2nd reference mark stores in Data Register 1 Read mode Bits DO to D15 Read back of Initializing Registers 1 and 2 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisant om Registers OEh Control Register 1 write mode Bit Function DO D1 D2 1 Software latch measured value in Data Register 0 1 Software latch measured value in Data Register 1 1 Software latch in all data registers must be enabled in Latch Enable Register D3 D4 D5 D6 1 Clear encoder error frequency exceeded 1 Start counter 1 Stop counter 1 Delete counter D7 Delete amplitude value register D8 D9 D10 D11 D12 D13 D14 D15 No function Z8isan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Registers OEh Status Register 1 read mode Bit Function DO Status for software latch in Register O 1 Measured value ready D1 Status for software latch in Register 1 1 Measured value ready D2 No function D3 D4 D5 No function 1 Counter is stopped Counter 1 No function Counter 2 C bus line SDA input D6 1 Encoder error frequency exceeded D7 No function Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisant eom Registers OEh Status Register 2 read mode Bit Function D8 D9
95. rom your own application programs To be able to use the functions of the DLL you must identify them to the application program MICROSOFT VISUAL C If you write the application program in VISUAL C then the file IK121DIl Release IK121DIl Lib from floppy disk 2 must be copied into the library directory of VISUAL C e g C Msdev lib and linked into the project To link the file make an entry in VISUAL C under Build Settings Link Object Library modules In a header file you must also define the following prototypes ifdef cplusplus extern C 1 endif WINUSERAPI BOOL WINAPI IKFind ULONG pBuffer8 WINUSERAPI BOOL WINAPI IKInit USHORT Axis USHORT Mode WINUSERAPI BOOL WINAPI IKVersion USHORT Axis char pVersCard char pVersDrv char pVersDIl WINUSERAPI BOOL WINAPI IKReset USHORT Axis WINUSERAPI BOOL WINAPI IKStart USHORT Axis WINUSERAPI BOOL WINAPI IKStop USHORT Axis WINUSERAPI BOOL WINAPI IKClear USHORT Axis WINUSERAPI BOOL WINAPI IKLatch USHORT Axis USHORT Latch WINUSERAPI BOOL WINAPI IKResetREF USHORT Axis WINUSERAPI BOOL WINAPI IKStartREF USHORT Axis WINUSERAPI BOOL WINAPI IKStopREF USHORT Axis WINUSERAPI BOOL WINAPI IKLatchREF USHORT Axis USHORT Latch WINUSERAPI BOOL WINAPI IKLatched USHORT Axis USHORT Latch BOOL pStatus WINUSERAPI BOOL WINAPI IKWaitLatch USHORT Axis USHORT Latch WINUSERAPI BOOL WINAPI IKStrtCodRef USHORT Axis USHORT Latch ULONG
96. rumentation Guaranteed 888 88 SOURCE www artisantg dom Registers Evaluating distance coded reference marks Measuring systems with distance coded reference marks have reference marks spaced at a regular interval over the entire length of the measuring range Between each two reference marks is another whose distance to each of the first two changes with each interval see below Each of these distances is a multiple of the grating period and each is unique Thus only two consecutive reference marks need to be traversed following a power interruption for the link between axis positions and display values to be reestablished The example below illustrates how these distance coded reference marks are evaluated If the nominal increment is 1000 signal periods the reference marks are arranged in the following pattern 0 501 1000 1502 2000 2503 3000 First you need to initialize the reference mark register 10h as follows e Cancel and start counter with traverse of the first reference mark Bit DO 1 and D2 1 e Latch counter with traverse of the second reference mark Bit D4 1 To calculate the absolute position only the distance between the reference marks in signal periods is required This distance in increments called DIFF in the description below must be divided by 1024 DIFF DISTANCE IN INCR 1024 To calculate the absolute position the distance OFFSET between the 1st reference mark on the scale 0 pos
97. s Integer ByVal Latch As Integer ByVal Source As Integer As Boolean Public Declare Function IKEnableSync Lib IK121DLL DLL ByVal Card As Integer ByVal Source As Integer As Boolean Public Declare Function IKLatchAIl Lib IK121DLL DLL ByVal Card As Integer As Boolean BORLAND DELPHI In BORLAND DELPHI you can link the functions into your program as follows Function IKFind pBuffer8 Long8Ptr Boolean StdCall External IK121DLL DLL Function IKInit Axis Word Mode Word Boolean StdCall External IKI21DLL DLL Function IKVersion Axis Word pVersCard CharPtr pVersDrv CharPtr pVersDIl CharPtr Boolean StdCall External IK121DLL DLL Function IKReset Axis Word Boolean StdCall External IKI21DLL DLL Function IKStart Axis Word Boolean StdCall External IKI21DLL DLL Function IKStop Axis Word Boolean StdCall External IK121DLL DLL Function IKClear Axis Word Boolean StdCall External IKI21DLL DLL Function IKLatch Axis Word Latch Word Boolean StdCall External IK121DLL DLL Function IKResetREF Function IKStartREF Function IKStopREF Function IKLatchREF Axis Word Boolean StdCall External IKI21DLL DLL Axis Word Boolean StdCall External IKI21DLL DLL Axis Word Boolean StdCall External IKI21DLL DLL Axis Word Latch Word Boolean StdCall External IKI21DLL DLL Fun
98. s register only one bit can be set Reading this register resets the currently active interrupt and deletes the associated status bit so that the next interrupt can be triggered by a negative edge Bit Function DO 1 Interrupt O is active there was a measured value latch via Data Register O D1 1 Interrupt 1 is active there was a measured value latch via Register 1 D2 1 Interrupt 2 is active there was a measured value latch via the timer strobe D3 D4 D5 No function D6 D7 Btisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com Registers 14h Interrupt Status Register 2 read mode In this register all pending interrupts are shown i e the active interrupt and the interrupts still to be executed Several bits may therefore be set at the same time Bit Function D8 1 Interrupt 0 is pending but not yet executed D9 1 Interrupt 1 is pending but not yet executed D10 1 Interrupt 2 is pending but not yet executed D11 D12 D13 No function D14 D15 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisant eom Registers 16h Offset Register for O signal write mode This register contains the 7 bit offset value for the 0 signal in two s complement form From this there results a maximum compensation of 63 The offset values can only be written if one of the status bits D5 or D6 in St
99. saved Application Before a counter value can be read out the application program must inquire whether the counter value has been saved Prototype BOOL IKLatched USHORT Axis USHORT Latch BOOL pStatus Axis Number of the axis 0 to 15 Latch 0 inquiry for register O 1 inquiry for register 1 pStatus Pointer to a Boolean variable 16 bits false 0 value not saved true lt gt 0 value saved IKWaitLatch This function waits until the counter value was saved Application Before a counter value can be read out the application program must inquire whether the counter value has been saved Prototype BOOL IKWaitLatch USHORT Axis USHORT Latch Axis Number of the axis 0 to 15 Latch 0 inquiry for register O 1 inquiry for register 1 IKStrtCodRef This function initializes the reference run with distance coded reference marks After initialization the application program must cyclically scan function IKCodRef or wait function IKWaitCodRef until the distance coded reference mark run is completed Prototype BOOL IKStrtCodRef USHORT Axis USHORT Latch ULONG RefDist Axis Number of the axis 0 to 15 Latch 0 with register O 1 with register 1 RefDist fixed spacing of reference marks e g 500 1000 2000 5000 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisanld lom The IK 121 in WINDOWS Applications IKCodRef During a reference
100. tem 32 e g C Winnt System32 For Windows 95 the file IK121DII Release95 IK121DII DIl on disk 2 must be placed in the System directory e g C Windows System The batch file Install Bat copies the required file into its respective directory Example for console application In the directory IK121Con Release of floppy disk 2 you will find a simple console application Example for VISUAL C In the directory IK121App Release of floppy disk 2 you will find an application in VISUAL C Example for VISUAL BASIC In the directory IK121VB5 Release of floppy disk 2 you will find an application in VISUAL BASIC Example for BORLAND DELPHI On floppy disk 3 you will find an application in BORLAND DELPHI Installation of the driver and the DLL under WINDOWS NT and WINDOWS 95 Select the directory Install on the provided floppy disk 2 Enter the port addresses of the installed IK 121 in the file IK121Drv Reg gt Call Install Bat Install bat generates the entry in the registry copies the driver for WINDOWS NT from the directory IK121Drv Release into the system directory e g CAWinntSystem32 Drivers and copies the DLL for WINDOWS NT or WINDOWS 95 from the directory IK121DIl Release or VK121DINRelease95 into the system directory e g C Winnt System32 90iisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com The IK 121 in WINDOWS Applications Calling DLL functions f
101. unter datum Value to be written to the address 1 g26 is the HEIDENHAIN designation of the counter Whisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com The IK 121 in DOS Applications Procedure in TURBO PASCAL PROCEDURE write g26 baseadr word axes address byte datum word VAR adr reg adr point adr gate word BEGIN Discard the last four bits of card address baseadr baseadr and SOFFO Address BO to B4 of the counter address address and 001F Load address pointer into address register Address of the address register adr reg baseadr or 0008 Value of the address register RO to R2 address of the counter without BO and B1 adr point address shr 2 Load address register portw adr reg adr point Calculate port address if axes 1 then adr gate baseadr or address and 03 else adr gate baseadr or 0004 or address and 03 Write datum to the counter portw adr gate datum END Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantd tom The IK 121 in DOS Applications Procedure in BORLAND C void write g26 unsigned int baseadr unsigned char axis unsigned int address unsigned int datum unsigned int adr_reg adr_point adr_gate Discard the last four bits of the card address baseadr baseadr amp OxOFFO0 Address BO to B4 of the cou
Download Pdf Manuals
Related Search
Related Contents
Samsung GT-M7603 คู่มือการใช้งาน iPodをワイヤレスでいい音・快適に MediSense Blood Glucose Meter 133-224 User's Manual Cash Management Department OM, Rider 16, 2002-04 プリンター確認用ソフト 取扱説明書 KitchenAid KHMS147H User's Manual Bakers Pride Oven Y-600 User's Manual Copyright © All rights reserved.
Failed to retrieve file