Page 1
I-8093W/I-9093 Linux API Reference Manual V2.0.0 July 2018 Written by Edward Ku Edited by Anna Huang...
Page 2
Names are used for identification purposes only and may be registered trademarks of their respective companies. Contact Us If you have any problems, please feel free to contact us. You can count on us for a quick response. Email: service@icpdas.com I-8093W/I-9093 I/O Module User Manual, v2.0.0 P. 2...
Preface I-8093W/I-9093 are 3-axis encoder counter board. I-8093W/I-9093 encoder card has 32 bits counter and high counting rate 10Mpps. The application of I-8093W/I-9093 board is position/distance measurement, velocity measurement, feedback for motor control, hard wheel input and so on. The information contained in this manual is divided into the following topics: ...
1. Introduction I-8093W is a 3-axis high speed encoder module. Its each axis can be independently configured as one of A/B Phase, Pulse/Direction and CW/CCW input mode. I-9093 is also a 3-axis encoder which included A/B Phase, Pulse/Direction and CW/CCW input mode with compare trigger output function.
Page 7
9 LED as Status Indicator 12 LED as Status Indicator Dimension (L x W x H) 102 mm x 30 mm x 115 mm 144 mm x 30.3 mm x 134 mm The difference between I-8093W and I-9093 Functions I-8093W I-9093 ...
LED Indicators System LED Indicator 1 LED as Power Indicator 1 LED as Power Indicator 9 LED as Status Indicator 12 LED as Status Indicator Isolation Intra-module Isolation, Field-to-Logic 2500 Vrms 3000 VDC I-8093W/I-9093 I/O Module User Manual, v2.0.0 P. 8...
Page 9
144 mm x 30.3 mm x 134 mm Environment Operating Temperature -25 °C ~ +75°C -30 ~ 85 °C Storage Temperature -40 ~ +85°C Humidity 5 ~ 95 % RH, Non-condensing 10 ~ 90% RH, non-condensing I-8093W/I-9093 I/O Module User Manual, v2.0.0 P. 9...
ICP DAS provides a range of demo programs for different platforms that can be used to verify the functions of the I-8093W/9093. The source code contained in these programs can also be reused in your own custom programs if needed. The executable file, can be used to retrieve the basic configuration information related to the module and to verify the functions.
2.1. Getting start on LinPAC Controllers This part will show the functions of I-8093W with 'demo8093' file. After execute 'demo8093W.exe' file you can see the functions as following picture: I-8093W/I-9093 I/O Module User Manual, v2.0.0 P. 18...
Page 19
InA0 and decreased by one for every falling edge of InB0. CountN the current counter value for channel N, 32 bits wide, from -2147483648 to 2147483647 OverflowN 0 = no overflow 1 = overflow This gives the following: I-8093W/I-9093 I/O Module User Manual, v2.0.0 P. 19...
Page 20
If InB0 is Low, counter_0 will be decreased by one for every falling edge of InA0. CountN the current counter value for channel N, 32 bits wide, from -2147483648 to 2147483647 OverflowN 0 = no overflow 1 = overflow This gives the following: I-8093W/I-9093 I/O Module User Manual, v2.0.0 P. 20...
Page 21
Counter_0 will be increased by one when the InA0 phase leads by 90 degrees to InB0. Counter_0 will be decreased by one when the InA0 phase lags by 90 degrees to InB0. I-8093W/I-9093 I/O Module User Manual, v2.0.0 P. 21...
Page 22
(3) Preset value is used to set the set the starting position of the count. (4) Read Frequency I-8093W can read frequency of input signal. *If there is no encoder input, the frequency will be 0.093 not 0 I-8093W/I-9093 I/O Module User Manual, v2.0.0...
All operations of position compare and trigger pulse output are automatically done by the hardware circuit. There is no software calculation effort when the system is operating. I-9093 makes the system design simpler, and significantly increases the system performance. I-8093W/I-9093 I/O Module User Manual, v2.0.0 P. 23...
4. API References ICPDAS supplies a range of C API functions for the I-8093W/I-9093 module. When developing a custom program, refer to either the i8093W.h header file, or the API functions described in the following sections for more detailed information.
Page 25
(For I-8093W only) i8093W_SetIndexLatchStatus This function use to enable/disable the index latch function of I-8093W. (For I-8093W only) i8093W_GetIndexLatchStatus This function use to get the index latch function status of I-8093W. (For I-8093W only) API for I-9093 Function for Windows Description i9093_SetExTrigMode This function use to set External latch mode of I-9093.
Page 26
(For I-9093 only) i9093_ReadIndexLatchedPosition This function use to get the index latched position of I-9093. (For I-9093 only) i9093_ReadExTrigLatchedPosition This function use to get the external trig latched position of I-9093. (For I-9093 only) I-8093W/I-9093 I/O Module User Manual, v2.0.0 P. 26...
Before executing any functions on the I-8093W/I-9093, the i8093W_Init function needs to be called once for I-8093W/I-9093. If there are two or more I-8093W/I-9093 modules, you need call the i8093W_Init function for each I-8093W/I-9093 module individually by passing the slot number that the I-8093W/I-9093 module is plugged into.
Syntax short i8093W_GetFirmwareVersion(int slot); Parameter slot: specifies the slot number (1 ~ 8). Return Values The version number of the primary FPGA firmware for the I-8093W/I-9093 module. Example int ver, slot; Open_Slot(slot); ver= i8093W_GetFirmwareVersion(slot); I-8093W/I-9093 I/O Module User Manual, v2.0.0...
4.3. i8093W_GetLibVersion This function use to get the library version of 8093W.lib/i8093W.dll. Syntax short i8093W_GetLibVersion(void); Parameter None Return Values The version number of the 8093W.lib/i8093W.dll. Example int ver, slot; Open_Slot(slot); ver = i8093W_GetLibVersion(void); I-8093W/I-9093 I/O Module User Manual, v2.0.0 P. 29...
4.4. i8093W_SetMode This function use to set the operation mode of I-8093W/I-9093. Syntax int i8093W_SetMode( int slot, int ch, int Mode For Windows (CE and WES) Parameter slot: specifies the slot number (1 ~ 8). specifies the channel (0 ~ 2).
4.5. i8093W_GetMode This function use to get the operation mode of I-8093W/I-9093. Syntax int i8093W_GetMode( int slot, int ch, int* Mode Parameter slot: specifies the slot number (1 ~ 8). specifies the channel (0 ~ 2). *Mode: [output] get encoder counting mode 1 ==>...
4.6. i8093W_SetXOR This function use to set the xor of I-8093W/I-9093 for each channel. Syntax int i8093W_SetXOR( int slot, int ch, int Xor Parameter slot: specifies the slot number (1 ~ 8). specifies the channel (0 ~ 2). Xor: to change the status of Z_index...
4.7. i8093W_GetXOR This function use to get the xor of I-8093W/I-9093 for each channel. Syntax int i8093W_GetXOR( int slot, int ch, int* Xor Parameter slot: specifies the slot number (1 ~ 8). specifies the channel (0 ~ 2). *Xor: [output] to change the status of Z_index...
4.8. i8093W_GetLineStatus This function use to get A,B and Z status of I-8093W/I-9093. Syntax int i8093W_GetLineStatus( int slot, int ch, int* A_Status, int* B_Status, int* C_Status Parameter slot: specifies the slot number (1 ~ 8). specifies the channel (0 ~ 2).
Page 35
Return Values Please refer the Error Code. Example int slot , ch , A_Status , B_Status , C_Status; Open_Slot(slot); i8093W_GetLineStatus(slot , ch , & A_Status , & B_Status , & C_Status); I-8093W/I-9093 I/O Module User Manual, v2.0.0 P. 35...
4.9. i8093W_GetIndex This function use to get Z index status of I-8093W/I-9093. Syntax int i8093W_GetIndex( int slot, int ch, int* index Parameter slot: specifies the slot number (1 ~ 8). specifies the channel (0 ~ 2). * index: [output] 0: not activated...
4.10. i8093W_Read32BitEncoder This function use to get 32-Bit Encoder value of I-8093W/I-9093. Syntax int i8093W_Read32BitEncoder( int slot , int ch , long* EnCode32); Parameter slot: specifies the slot number (1 ~ 8). specifies the channel (0 ~ 2). * EnCode32: [output] get encoder value.
4.12. i8093W_SetPresetValue This function use to set 32-Bit preset value of I-8093W/I-9093. Syntax int i8093W_SetPresetValue( int slot, int ch, long presetVal Parameter slot: specifies the slot number (1 ~ 8). specifies the channel (0 ~ 2). presetVal: Set preset value.
4.13. i8093W_GetPresetValue This function use to get 32-Bit preset value of I-8093W/I-9093. Syntax int i8093W_GetPresetValue( int slot, int ch, long* presetVal Parameter slot: specifies the slot number (1 ~ 8). specifies the channel (0 ~ 2). presetVal: [output] get preset value.
1: read frequency function supported by firmware version 3 or later version. 2: if there is no encoder input, the frequency will be 0.093 not 0 Example int slot , ch ; float freq; Open_Slot(slot); i8093W_ReadFreq(slot , ch , &freq); I-8093W/I-9093 I/O Module User Manual, v2.0.0 P. 41...
4.15. i8093W_SetIndexLatchStatus This function use to enable/disable the index latch function of I-8093W. Syntax (For I-8093W only) int i8093W_SetIndexLatchStatus( int slot, int ch, int ifEnableLatch Parameter slot: specifies the slot number (1 ~ 8). specifies the channel (0 - 2).
Page 43
Example int slot, ch ; int ifEnableLatch; Open_Slot(slot); i8093W_SetIndexLatchStatus(slot, ch , ifEnableLatch); I-8093W/I-9093 I/O Module User Manual, v2.0.0 P. 43...
4.16. i8093W_GetIndexLatchStatus This function use to get the index latch function status of I-8093W. Syntax (For i-8093W only) int i8093W_GetIndexLatchStatus( int slot, int ch, int* latchedStatus, int* ifEnableLatch Parameter slot: specifies the slot number (1 ~ 8). specifies the channel (0 - 2).
Parameter slot: specifies the slot number (1 ~ 8). specifies the channel (0 - 2). Return Values Please refer the Error Code. Example int slot , ch ; Open_Slot(slot); i8093W_ClearLatchedIndex(slot, ch); I-8093W/I-9093 I/O Module User Manual, v2.0.0 P. 45...
(0 ~ 2). Position: Set first trig position Return Values Please refer the Error Code. Example int slot , ch ; unsigned long position; Open_Slot(slot); i8093_SetFirstTrigPosition(slot, ch , position); I-8093W/I-9093 I/O Module User Manual, v2.0.0 P. 52...
(0 ~ 2). *Position: [output] get first trig position Return Values Please refer the Error Code. Example int slot , ch ; unsigned long position; Open_Slot(slot); i9093_GetFirstTrigPosition (slot , ch , &position); I-8093W/I-9093 I/O Module User Manual, v2.0.0 P. 53...
(0 ~ 2). dir: Direction count Distance: set Distance Return Values Please refer the Error Code. Example int slot , ch, dir; unsigned long distance; Open_Slot(slot); i9093_SetTrigDistance (slot , ch, dir, distance); I-8093W/I-9093 I/O Module User Manual, v2.0.0 P. 54...
(0 ~ 2). dir: Direction count *Distance: [output] get Distance Return Values Please refer the Error Code. Example int slot , ch, dir; long *distance; Open_Slot(slot); i9093_GetTrigDistance (slot, ch, dir, & distance); I-8093W/I-9093 I/O Module User Manual, v2.0.0 P. 55...
(0 ~ 2). * Data32: [output] get next position Return Values Please refer the Error Code. Example int slot , ch ; long Data32; Open_Slot(slot); i9093_ReadNextPosition (slot, ch, &Data32); I-8093W/I-9093 I/O Module User Manual, v2.0.0 P. 56...
Parameter slot: specifies the slot number (1 ~ 8). specifies the channel (0 ~ 2). Return Values Please refer the Error Code. Example int slot , ch ; Open_Slot(slot); i9093_ClearNextPosition (slot, ch); I-8093W/I-9093 I/O Module User Manual, v2.0.0 P. 57...
(0 ~ 2). *Data32: [output] get the index latched position. Return Values Please refer the Error Code. Example int slot , ch ; long Data32; Open_Slot(slot); i9093_ReadIndexLatchedPosition(slot, ch, *Data32); I-8093W/I-9093 I/O Module User Manual, v2.0.0 P. 64...
(0 ~ 2). *Data32: [output] get the external trig latched position. Return Values Please refer the Error Code. Example int slot , ch ; long Data32; Open_Slot(slot); i9093_ReadExTrigLatchedPosition(slot, ch,&Data32); I-8093W/I-9093 I/O Module User Manual, v2.0.0 P. 65...
There was a Slot index error (1 ~ 8) CHANNEL_OUT_RANGE There was a Channel index error (0 - 15) MODE_ERROR There was a Mode error(CW/CCW, DIR/Pulse, A/B Phase) FIRMWARENOTSUPPORT The Firmware is not support. I-8093W/I-9093 I/O Module User Manual, v2.0.0 P. 66...