ICP DAS USA I-8088W Api Reference Manual

ICP DAS USA I-8088W Api Reference Manual

I/o module

Advertisement

Quick Links

I-8088W
API Reference Manual
Version 1.0.0, Aug. 2010
Service and usage information for
MiniOS7, CE and XPE Platform
----------------------------------------
Written by Martin Hsu
Edited by Janice Hong
I-8088W API Reference Manual, Version 1.0.0, Aug. 2010
--- 1

Advertisement

Table of Contents
loading

Summary of Contents for ICP DAS USA I-8088W

  • Page 1 I-8088W API Reference Manual Version 1.0.0, Aug. 2010 Service and usage information for MiniOS7, CE and XPE Platform ---------------------------------------- Written by Martin Hsu Edited by Janice Hong I-8088W API Reference Manual, Version 1.0.0, Aug. 2010 --- 1...
  • Page 2 Copyright Copyright @ 2010 by ICP DAS Co., Ltd.All rights are reserved. Trademark The names used for identification only may be registered trademarks of their respective companies. I-8088W API Reference Manual, Version 1.0.0, Aug. 2010 --- 2...
  • Page 3: Table Of Contents

    3.13. i8088W_SetSyncChannel ..................38 3.14. i8088W_GetSyncChannel ..................39 3.15. i8088W_Sync_Start ....................40 3.16. i8088W_Sync_Stop ....................41 3.17. i8088W_SetHardwareTrigChannel ............... 42 3.18. i8088W_GetHardwareTrigChannel ............... 44 3.19. i8088W_GetPWMActiveState ................46 3.20. i8088W_GetDI ....................... 47 I-8088W API Reference Manual, Version 1.0.0, Aug. 2010 --- 3...
  • Page 4 4.15. pac_i8088W_Sync_Start ..................74 4.16. pac_i8088W_Sync_Stop ..................75 4.17. pac_i8088W_SetHardwareTrigChannel ..............76 4.18. pac_i8088W_GetHardwareTrigChannel ............... 78 4.19. pac_i8088W_GetPWMActiveState ............... 80 4.20. pac_i8088W_GetDI ....................82 Appendix A. Error Code ................84 I-8088W API Reference Manual, Version 1.0.0, Aug. 2010 --- 4...
  • Page 5: Introduction

    PWM (Pulse width modulation) is a powerful technique for controlling analog circuits. It uses digital outputs to generate a waveform with variant duty cycle and frequency to control analog circuits. I-8088W has 8 PWM output channels and 8 digital inputs. It can be used to develop powerful and cost effective analog control system.
  • Page 6: Specification

    40 mA @ 5 V, 2 W ±5% Environment Operating Temperature -25 ~ 75°C Storage Temperature -30 ~ 85°C Humidity 5 to 95% RH, Non-condensing Dimensions 30mm x 102mm x 115mm (W x L x H) Detail I-8088W API Reference Manual, Version 1.0.0, Aug. 2010 --- 6...
  • Page 7: Pin Assignment

    DI0 ~ DI7 are designed for digital input that also capable of setting as an external trigger signal to start or stop its PWM pulse.  Pin 19 ~ 20: DI.COM is isolated ground. I-8088W API Reference Manual, Version 1.0.0, Aug. 2010 --- 7...
  • Page 8: Block Diagram

    1.3. Block Diagram I-8088W API Reference Manual, Version 1.0.0, Aug. 2010 --- 8...
  • Page 9: Wiring Connection

    1.4. Wiring Connection I-8088W API Reference Manual, Version 1.0.0, Aug. 2010 --- 9...
  • Page 10: Software And Getting Started

    Document: ftp://ftp.icpdas.com/pub/cd/winpac/napdos/wp-8x4x_ce50/document/sdk_document eVC SDK: ftp://ftp.icpdas.com/pub/cd/winpac/napdos/wp-8x4x_ce50/sdk/io_modules/evc/ .Net SDK: ftp://ftp.icpdas.com/pub/cd/winpac/napdos/wp-8x4x_ce50/sdk/io_modules/dotnet/ eVC Demo: ftp://ftp.icpdas.com/pub/cd/winpac/napdos/wp-8x4x_ce50/demo/winpac/evc/pac_io/ local/ .Net Demo: ftp://ftp.icpdas.com/pub/cd/winpac/napdos/wp-8x4x_ce50/demo/winpac/dotnet/c%2 3.net/pac_io/local/ iPAC-8000 Document: ftp://ftp.icpdas.com/pub/cd/8000cd/napdos/minios7/document/ Libray: ftp://ftp.icpdas.com/pub/cd/8000cd/napdos/ipac8000/demo/basic/lib/ Demo: ftp://ftp.icpdas.com/pub/cd/8000cd/napdos/ipac8000/demo/basic/io_in_slot/8088w/ I-8000 Document: ftp://ftp.icpdas.com/pub/cd/8000cd/napdos/minios7/document/ Library: ftp://ftp.icpdas.com/pub/cd/8000cd/napdos/8000/841x881x/demo/lib/ Demo: ftp://ftp.icpdas.com/pub/cd/8000cd/napdos/8000/841x881x/demo/io_in_slot/8088w/ I-8088W API Reference Manual, Version 1.0.0, Aug. 2010 --- 10...
  • Page 11: Simple Pwm Operation

    Select 2: 0.1 ~ 500000.0 Hz Start PWM Stop PWM Each time you change the settings of “PWM Duty", you have to Note: re-send the “Start PWM” command to ensure the operation properly. I-8088W API Reference Manual, Version 1.0.0, Aug. 2010 --- 11...
  • Page 12 Description of the demo: In this example, we will use the demo to set I-8088W as “Continuous” mode and its frequency is 10 Hz, PWM duty is 50%. When we send the “Start Normal PWM” commend, the DI0 will blinking per 0.5s.
  • Page 13 When you run the program, it will initialize the i-8088W module and obtain the related information as shown below. I In below table, we will list some instructions associated with above information. You can also refer to chapter 3 (for miniOS7 PAC) or...
  • Page 14  “2” means you can enter a one decimal place value. (ex. input 99.9 to set it as 99.9%)  In this example, please enter "0" to set it as “Normal integer Duty” I-8088W API Reference Manual, Version 1.0.0, Aug. 2010 --- 14...
  • Page 15 You will see three modes in below picture, please enter “0” to set it as “Normal PWM” Then enter “0” to start the PWM. API : Refer to section 3.11, section 3.12, section 4.11, section 4.12 I-8088W API Reference Manual, Version 1.0.0, Aug. 2010 --- 15...
  • Page 16 “start PWM“ command to channel 0 ~ 7, the condition is 10 Hz with 50% duty, and we has connected the PWM0 to DI0, so the DI0 will blink per 0.5 seconds. I-8088W API Reference Manual, Version 1.0.0, Aug. 2010 --- 16...
  • Page 17: Use Di To Trigger Pwm

    DI signal to Start PWM Set DI as Normal PWM DI signal to Stop PWM Wait DI signal to start PWM Start PWM Stop PWM Wait DI signal to stop PWM I-8088W API Reference Manual, Version 1.0.0, Aug. 2010 --- 17...
  • Page 18 2.3.2. How to Setup the Trigger PWM There are 8 DI pins on I-8088W, normally these DI pin just acts as digital input channels. We can also configure them as external trigger signal pins to start or stop the PWM output.
  • Page 19 Rising edge to Start PWM “Rising edge” to trigger +5 ~ 30 V the PWM to START. Rising edge to Stop PWM +5 ~ 30 V “Rising edge” to trigger the PWM to STOP. I-8088W API Reference Manual, Version 1.0.0, Aug. 2010 --- 19...
  • Page 20 The other is falling edge to trigger the PWM to start or stop, the wiring like below two pictures. Falling edge to Start PWM “Falling edge” to trigger the PWM to START. Falling edge to Stop PWM “Falling edge” to trigger the PWM to STOP. I-8088W API Reference Manual, Version 1.0.0, Aug. 2010 --- 20...
  • Page 21 3.12) or pac_ i8088W_PWM_Stop ( section 4.12) function. In Normal PWM mode, the signal will continue transfer until you go back to enter “2” to stop the PWM output. I-8088W API Reference Manual, Version 1.0.0, Aug. 2010 --- 21...
  • Page 22: Synchronize Pwm

    Select 0: 1 ~ 99 % Select 1: 1 ~ 99 % Input Duty Select 2: 0.1 ~ 99.9 % Enable Synchronous PWM for each channel Start PWM Synchronous Start PWM Stop PWM I-8088W API Reference Manual, Version 1.0.0, Aug. 2010 --- 22...
  • Page 23 2.4.2. How to Setup the Synchronous PWM I-8088W can configure each PWM output channel as synchronous mode. Step 1: Follow the same way in section 2.2.2 to configure PWM output mode and set PWM duty and frequency. Step 2: Enter “2” to set “Synchronous PWM”, and then enter “1” to enable it.
  • Page 24 Non-synchronous Start Synchronous PWM: So, we can call i8088W_Sync_Start or pac_i8088W_Sync_Start to start the PWM output and synchronize the rising edge for each synchronous PWM pulse. Synchronous I-8088W API Reference Manual, Version 1.0.0, Aug. 2010 --- 24...
  • Page 25: Api For Ipac-8000

    The function can initialize the I-8088W and then check the hardware ID for each slot. If the return value is “0” that means there is an I-8088W module in that slot. If return “-1” that means there is no I-8088W module.
  • Page 26: I8088W_Getfirmwareversion

    3.2. i8088W_GetFirmwareVersion The function is used to get the firmware version of I-8088W. Syntax short i8088W_GetFirmwareVersion(int slot); Parameter slot: 0 ~ 7 Return Values The firmware version of I-8088W hardware Examples short firmware_version; firmware_version = i8088W_GetFirmwareVersion(int slot); I-8088W API Reference Manual, Version 1.0.0, Aug. 2010...
  • Page 27: I8088W_Getlibversion

    3.3. i8088W_GetLibVersion The function is used to get the version of library file. Syntax short i8088W_GetLibVersion(void); Parameter None Return Values The versions of library file. Examples short version; version = i8088W_GetLibVersion(); I-8088W API Reference Manual, Version 1.0.0, Aug. 2010 --- 27...
  • Page 28: I8088W_Getlibdate

    The function is used to get the built date of library file. Syntax short i8088W_GetLibDate(char *LibDate); Parameter LibDate the string buffer of library built date Return Values The built dates of library file. Examples char lib_date[32]; i8088W_GetLibDate(lib_date); I-8088W API Reference Manual, Version 1.0.0, Aug. 2010 --- 28...
  • Page 29: I8088W_Setpwmduty

    4. duty High part 0 ~ 99 5. Low part 100 - High part Return Values Please refer to Error Code Table. Examples int slot,ch; slot = 0; for(ch=0;ch<8;ch++) i8088W_ SetPWMDuty (slot,ch,50); I-8088W API Reference Manual, Version 1.0.0, Aug. 2010 --- 29...
  • Page 30: I8088W_Setpwmduty_Deci

    4. deci_duty 0~999, for example: 503 deci_duty = 50.3% High Part 5. Low Part=1000 - 503= 497 => 49.7% Low Duty cycle Return Values Please refer to Error Code Table. Examples int slot,ch; slot = 0; for(ch=0;ch<8;ch++) i8088W_ SetPWMDuty_Deci(slot,ch,50.3); I-8088W API Reference Manual, Version 1.0.0, Aug. 2010 --- 30...
  • Page 31: I8088W_Setpwmduty_Float

    4. f_Duty 0.0~99.9, for example: 50.3 means 50.3% High Part 5. Low Part =100.0- f_Duty = 49.7 means = 49.7% Return Values Please refer to Error Code Table. Examples [C++] int slot,ch; slot = 0; for(ch=0;ch<8;ch++) i8088W_ SetPWMDuty_Float (slot,ch,50.3); I-8088W API Reference Manual, Version 1.0.0, Aug. 2010 --- 31...
  • Page 32: I8088W_Getrealpwmduty_Deci

    2. ch 0 ~ 7 3. deci_hz: the real frequency produced by 8088W unit (x10Hz) 4. deci_duty: the real duty produced by 8088W (x10 %) Return Values Please refer to Error Code Table. I-8088W API Reference Manual, Version 1.0.0, Aug. 2010 --- 32...
  • Page 33 Examples unsigned long deci_hz; unsigned int deci_duty slot = 0; for(ch=0;ch<8;ch++) i8088W_GetRealPWMDuty_Deci(slot,ch,& deci_hz, & deci_duty); Print(“CH[%d] PWM Hz = %lu ; Duty = %u\n”, ch, deci_hz, deci_duty); I-8088W API Reference Manual, Version 1.0.0, Aug. 2010 --- 33...
  • Page 34: I8088W_Setpwmcountmode

    3.9. i8088W_SetPWMCountMode The function is used to set the count mode of I-8088W. Syntax short i8088W_SetPWMCountMode(int slot,int ch,unsigned char countMode); Parameter 1. slot 0 ~ 7 2. ch 0 ~ 7 3. count Mode 1: Continuos ; 0: Burst count Return Values Please refer to Error Code Table.
  • Page 35: I8088W_Setburstcount

    3.10. i8088W_SetBurstCount The function is used to set the BurstCount of I-8088W. Syntax short i8088W_SetBurstCount(int slot,int ch,unsigned int burstCount); Parameter 1. slot 0 ~ 7 2. ch 0 ~ 7 3. burstCount 0~65536 Return Values Please refer to Error Code Table.
  • Page 36: I8088W_Pwm_Start

    Parameter slot: 0 ~ 7 ch: 0 ~ 7 Return Values Please refer to Error Code Table. Examples int slot,ch; slot = 0; for(ch=0;ch<8;ch++) i8088W_PWM_Start (slot,ch); I-8088W API Reference Manual, Version 1.0.0, Aug. 2010 --- 36...
  • Page 37: I8088W_Pwm_Stop

    Parameter slot: 0 ~ 7 ch: 0 ~ 7 Return Values Please refer to Error Code Table. Examples int slot,ch; slot = 0; for(ch=0;ch<8;ch++) i8088W_PWM_Stop (slot,ch); I-8088W API Reference Manual, Version 1.0.0, Aug. 2010 --- 37...
  • Page 38: I8088W_Setsyncchannel

    3. enBit 1: define channel as synchronous mode, 0: not synchronous mode Return Values Please refer to Error Code Table. Examples int slot,ch, enBit; slot = 0; enBit=1; for(ch=0;ch<8;ch++) i8088W_ SetSyncChannel(slot,ch, enBit); I-8088W API Reference Manual, Version 1.0.0, Aug. 2010 --- 38...
  • Page 39: I8088W_Getsyncchannel

    2. syncArr[] is an 8 bit array 3. syncArr[i]=1 means channel[i] is set as synchronous Return Values Please refer to Error Code Table. Examples int slot, syncArr[]; slot = 0; i8088W_ GetSyncChannel (slot, syncArr); I-8088W API Reference Manual, Version 1.0.0, Aug. 2010 --- 39...
  • Page 40: I8088W_Sync_Start

    The function is used to start the synchronization of PWM pulse. Syntax short i8088W_Sync_Start(int slot); Parameter 1. slot 0 ~ 7 Return Values Please refer to Error Code Table. Examples int slot; slot = 0; i8088W_Sync_Start (slot); I-8088W API Reference Manual, Version 1.0.0, Aug. 2010 --- 40...
  • Page 41: I8088W_Sync_Stop

    The function is used to stop the synchronization of PWM pulse. Syntax short i8088W_Sync_Stop(int slot); Parameter 1. slot 0 ~ 7 Return Values Please refer to Error Code Table. Examples int slot; slot = 0; i8088W_ Sync_Stop (slot); I-8088W API Reference Manual, Version 1.0.0, Aug. 2010 --- 41...
  • Page 42: I8088W_Sethardwaretrigchannel

    3.17. i8088W_SetHardwareTrigChannel The "DI" pin of I-8088W can be set as hardware trigger pin or simply DI pin. The user can call this function to specify the status of channels. Syntax short i8088W_SetHardwareTrigChannel(int slot,int ch,int triggerState) Parameter 1. slot 0 ~ 7 2.
  • Page 43 Examples int slot,ch, triggerState; slot = 0; triggerState=0; for(ch=0;ch<8;ch++) i8088W_ SetHardwareTrigChannel (slot,ch, triggerState); I-8088W API Reference Manual, Version 1.0.0, Aug. 2010 --- 43...
  • Page 44: I8088W_Gethardwaretrigchannel

    3.18. i8088W_GetHardwareTrigChannel The "DI" pin of I-8088W can be set as hardware trigger pin or simply DI pin. The user can call this function to know the status of channels. Syntax i8088W_GetHardwareTrigChannel(int slot,int ch,int* triggerState); Parameter 1. slot 0 ~ 7 2.
  • Page 45 Examples int slot,ch, triggerState; slot = 0; triggerState=0; for(ch=0;ch<8;ch++) i8088W_ GetHardwareTrigChannel(slot,ch,& triggerState); I-8088W API Reference Manual, Version 1.0.0, Aug. 2010 --- 45...
  • Page 46: I8088W_Getpwmactivestate

    1000 pulse) by using this function, we can know the actural PWM output state. Return Values Please refer to Error Code Table. Examples int slot=0,ch,activatedBit[8]; unsigned int activatedState=0; i8088W_GetPWMActiveState (slot,& activatedState, activatedBit); for(ch=0;ch<8;ch++) if(activatedBit[ch]) Print(“PWM CH[%d] is activated\n”,ch); I-8088W API Reference Manual, Version 1.0.0, Aug. 2010 --- 46...
  • Page 47: I8088W_Getdi

    1. slot 0 ~ 7 2. *diVal: the DI status of i-8088 value 0~0xff 3. diArr[]: the *DI value will be parse into Bit Array Return Values Please refer to Error Code Table. I-8088W API Reference Manual, Version 1.0.0, Aug. 2010 --- 47...
  • Page 48 Examples int slot,ch,enBit[8]; Slot=0; unsigned int dival=0; i8088W_GetDI(slot, &diVal,enBit); Print ("DI Vaule = %02X\n",diVal); for (ch=0; ch< 8; ch++) Print ("DI[%d]= %d\n",ch, enBit[ch]);...
  • Page 49: Api For Winpac-8000

    The function can initialize the I-8088W and then check the hardware ID for each slot. If the return value is “0” that means there is an I-8088W module in that slot. If return “-1” that means there is no I-8088W module.
  • Page 50 I-8088W at slot %d\n”,slotIndex); [C#] using pac8088WNet; int slotIndex,err; err= pac8088W.Init(slotIndex); if(err==0) Console.WriteLine(“There is an I-8088W at slot {0}”,slotIndex); else Console.WriteLine(“There is no I-8088W at slot {0}”,slotIndex); I-8088W API Reference Manual, Version 1.0.0, Aug. 2010 --- 50...
  • Page 51: Pac_I8088W_Getfirmwareversion

    4.2. pac_i8088W_GetFirmwareVersion The function is used to get the firmware version of I-8088W. Syntax short pac_i8088W_GetFirmwareVersion(int slot); Parameter slot: 0 ~ 7 Return Values The firmware version of I-8088W hardware Examples [C++] short firmware_version; firmware_version = pac_i8088W_GetFirmwareVersion (slot); [C#] using pac8088WNet;...
  • Page 52: Pac_I8088W_Getlibversion

    (); Parameter none Return Values The versions of library file (i8088W.dll). Examples [C++] short version; version = pac_i8088W_GetLibVersion (); [C#] using pac8088WNet; short version; version = pac8088W.GetLibVersion ( ); I-8088W API Reference Manual, Version 1.0.0, Aug. 2010 --- 52...
  • Page 53: Pac_I8088W_Getlibdate

    LibDate the string buffer of library built date Return Values The built dates of library file. Examples [C++] char lib_date[32]; pac_i8088W_GetLibDate(lib_date); [C#] using pac8088WNet; string lib_date; lib_date = pac8088W.GetLibDate( ); I-8088W API Reference Manual, Version 1.0.0, Aug. 2010 --- 53...
  • Page 54: Pac_I8088W_Setpwmduty

    2. ch 0 ~ 7 3. hz 0 ~ 450K 4. duty High part 0 ~ 99 5. Low part 100 - High part Return Values Please refer to Error Code Table. I-8088W API Reference Manual, Version 1.0.0, Aug. 2010 --- 54...
  • Page 55 Examples int slot,ch; slot = 0; for(ch=0;ch<8;ch++) pac_i8088W_SetPWMDuty (slot,ch,50); [C#] using pac8088WNet; int slot,ch; slot = 0; for(ch=0;ch<8;ch++) pac8088W.SetPWMDuty (slot,ch,50); I-8088W API Reference Manual, Version 1.0.0, Aug. 2010 --- 55...
  • Page 56: Pac_I8088W_Setpwmduty_Deci

    4. deci_duty 0~999, for example: 503 deci_duty = 50.3% High Part 5. Low Part=1000 - 503= 497 => 49.7% Low Duty cycle Return Values Please refer to Error Code Table. I-8088W API Reference Manual, Version 1.0.0, Aug. 2010 --- 56...
  • Page 57 Examples int slot,ch; slot = 0; for(ch=0;ch<8;ch++) pac_i8088W_ SetPWMDuty_Deci(slot,ch,50.3); [C#] using pac8088WNet; int slot,ch; slot = 0; for(ch=0;ch<8;ch++) pac8088W.SetPWMDuty_Deci (slot,ch,50.3); I-8088W API Reference Manual, Version 1.0.0, Aug. 2010 --- 57...
  • Page 58: Pac_I8088W_Setpwmduty_Float

    3. f_Hz 100 means f_Hz = 10 Hz 4. f_Duty 0.0~99.9, for example: 50.3 means 50.3% High Part 5. Low Part =100.0- f_Duty = 49.7 means = 49.7% Return Values Please refer to Error Code Table. I-8088W API Reference Manual, Version 1.0.0, Aug. 2010 --- 58...
  • Page 59 Examples [C++] int slot,ch; slot = 0; for(ch=0;ch<8;ch++) pac_i8088W_ SetPWMDuty_Float (slot,ch,50.3); [C#] using pac8088WNet; int slot,ch; slot = 0; for(ch=0;ch<8;ch++) pac8088W.SetPWMDuty_Float (slot,ch,50.3); I-8088W API Reference Manual, Version 1.0.0, Aug. 2010 --- 59...
  • Page 60: Pac_I8088W_Getrealpwmduty_Deci

    8088W can produce. Parameter 1. slot 0 ~ 7 2. ch 0 ~ 7 3. deci_hz: 10 ~ 5000000 4. deci_duty: 1~999 Return Values Please refer to Error Code Table. I-8088W API Reference Manual, Version 1.0.0, Aug. 2010 --- 60...
  • Page 61 UInt32 deci_hz=0; Uint16 deci_duty=0 slot = 0; for(ch=0;ch<8;ch++) pac8088W .GetRealPWMDuty_Deci (slot,ch,ref deci_hz, ref deci_duty); Console.WriteLine(“CH[{0}] PWM Hz = {1} ; Duty = {2}”, ch, deci_hz, deci_duty); I-8088W API Reference Manual, Version 1.0.0, Aug. 2010 --- 61...
  • Page 62: Pac_I8088W_Setpwmcountmode

    4.9. pac_i8088W_SetPWMCountMode The function is used to set the count mode of I-8088W. Syntax short pac_i8088W_SetPWMCountMode (int slot,int ch, unsigned char countMode); Parameter 1. slot 0 ~ 7 2. ch 0 ~ 7 3. count Mode 1: Continuos ; 0: Burst count Return Values Please refer to Error Code Table.
  • Page 63 Examples int slot,ch; slot = 0; mode=0; //burst mode for(ch=0;ch<8;ch++) pac_i8088W_ SetPWMCountMode(slot,ch,mode); [C#] using pac8088WNet; int slot,ch; slot = 0; mode=0; //burst mode for(ch=0;ch<8;ch++) pac8088W.SetPWMCountMode(slot,ch,mode); I-8088W API Reference Manual, Version 1.0.0, Aug. 2010 --- 63...
  • Page 64: Pac_I8088W_Setburstcount

    4.10. pac_i8088W_SetBurstCount The function is used to set the BurstCount of I-8088W. Syntax short pac_i8088W_SetBurstCount(int slot,int ch,unsigned int burstCount); Parameter 1. slot 0 ~ 7 2. ch 0 ~ 7 3. burstCount 0~65536 Return Values Please refer to Error Code Table.
  • Page 65 Examples int slot,ch, burstCount; slot = 0; burstCount=10000; for(ch=0;ch<8;ch++) pac_i8088W_SetBurstCount (slot,ch, burstCount); [C#] using pac8088WNet; int slot,ch, burstCount; slot = 0; burstCount=10000; for(ch=0;ch<8;ch++) pac8088W.SetBurstCount (slot,ch, burstCount); I-8088W API Reference Manual, Version 1.0.0, Aug. 2010 --- 65...
  • Page 66: Pac_I8088W_Pwm_Start

    The function is used to start the PWM pulse. Syntax short pac_i8088W_PWM_Start(int slot,int ch); Parameter slot: 0 ~ 7 ch: 0 ~ 7 Return Values Please refer to Error Code Table. I-8088W API Reference Manual, Version 1.0.0, Aug. 2010 --- 66...
  • Page 67 Examples int slot,ch; slot = 0; for(ch=0;ch<8;ch++) pac_i8088W_PWM_Start(slot,ch); [C#] using pac8088WNet; int slot,ch; slot = 0; for(ch=0;ch<8;ch++) pac8088W.PWM_Start(slot,ch); I-8088W API Reference Manual, Version 1.0.0, Aug. 2010 --- 67...
  • Page 68: Pac_I8088W_Pwm_Stop

    The function is used to stop the PWM pulse. Syntax short pac_i8088W_PWM_Stop(int slot,int ch); Parameter slot: 0 ~ 7 ch: 0 ~ 7 Return Values Please refer to Error Code Table. I-8088W API Reference Manual, Version 1.0.0, Aug. 2010 --- 68...
  • Page 69 Examples int slot,ch; slot = 0; for(ch=0;ch<8;ch++) pac_i8088W_PWM_Stop (slot,ch); [C#] using pac8088WNet; int slot,ch; slot = 0; for(ch=0;ch<8;ch++) pac8088W.PWM_Stop (slot,ch); I-8088W API Reference Manual, Version 1.0.0, Aug. 2010 --- 69...
  • Page 70: Pac_I8088W_Setsyncchannel

    1. slot 0 ~ 7 2. ch 0 ~ 7 3. enBit 1: define channel as synchronous mode, 0: not synchronous mode Return Values Please refer to Error Code Table. I-8088W API Reference Manual, Version 1.0.0, Aug. 2010 --- 70...
  • Page 71 Examples int slot,ch, enBit; slot = 0; enBit=1; for(ch=0;ch<8;ch++) pac_i8088W_ SetSyncChannel(slot,ch, enBit); [C#] using pac8088WNet; int slot,ch, enBit; slot = 0; enBit=1; for(ch=0;ch<8;ch++) pac8088W.SetSyncChannel (slot,ch, enBit); I-8088W API Reference Manual, Version 1.0.0, Aug. 2010 --- 71...
  • Page 72: Pac_I8088W_Getsyncchannel

    ; Parameter 1. slot 0 ~ 7 2. syncArr[] is an 8 bit array 3. syncArr[i]=1 means channel[i] is set as synchronous Return Values Please refer to Error Code Table. I-8088W API Reference Manual, Version 1.0.0, Aug. 2010 --- 72...
  • Page 73 Examples int slot, syncArr[]; slot = 0; pac_i8088W_ GetSyncChannel (slot, syncArr); [C#] using pac8088WNet; int slot, syncArr[]; slot = 0; pac8088W.GetSyncChannel (slot, syncArr); I-8088W API Reference Manual, Version 1.0.0, Aug. 2010 --- 73...
  • Page 74: Pac_I8088W_Sync_Start

    1. slot 0 ~ 7 Return Values Please refer to Error Code Table. Examples int slot; slot = 0; pac_i8088W_Sync_Start (slot); [C#] using pac8088WNet; int slot; slot = 0; pac8088W.Sync_Start(slot); I-8088W API Reference Manual, Version 1.0.0, Aug. 2010 --- 74...
  • Page 75: Pac_I8088W_Sync_Stop

    Parameter 1. slot 0 ~ 7 Return Values Please refer to Error Code Table. Examples int slot; slot = 0; pac_i8088W_Sync_Stop(slot); [C#] using pac8088WNet; int slot; slot = 0; pac8088W.Sync_Stop(slot); I-8088W API Reference Manual, Version 1.0.0, Aug. 2010 --- 75...
  • Page 76: Pac_I8088W_Sethardwaretrigchannel

    4.17. pac_i8088W_SetHardwareTrigChannel The "DI" pin of I-8088W can be set as hardware trigger pin or simply DI pin. The user can call this function to specify the status of channels. Syntax short pac_i8088W_SetHardwareTrigChannel(int slot,int ch,int triggerState) Parameter 1. slot 0 ~ 7 2.
  • Page 77 Examples int slot,ch, triggerState; slot = 0; triggerState=0; for(ch=0;ch<8;ch++) pac_i8088W_SetHardwareTrigChannel (slot,ch, triggerState); [C#] using pac8088WNet; int slot,ch, triggerState; slot = 0; triggerState=0; for(ch=0;ch<8;ch++) pac8088W.SetHardwareTrigChannel(slot,ch, triggerState); I-8088W API Reference Manual, Version 1.0.0, Aug. 2010 --- 77...
  • Page 78: Pac_I8088W_Gethardwaretrigchannel

    4.18. pac_i8088W_GetHardwareTrigChannel The "DI" pin of I-8088W can be set as hardware trigger pin or simply DI pin. The user can call this function to know the status of channels. Syntax short pac_i8088W_GetHardwareTrigChannel(int slot,int ch,int* triggerState); Parameter 4. slot 0 ~ 7 5.
  • Page 79 Examples int slot,ch, triggerState; slot = 0; triggerState=0; for(ch=0;ch<8;ch++) pac_i8088W_GetHardwareTrigChannel(slot,ch, &triggerState); [C#] using pac8088WNet; int slot,ch, triggerState; slot = 0; triggerState=0; for(ch=0;ch<8;ch++) pac8088W.GetHardwareTrigChannel(slot,ch,ref triggerState); I-8088W API Reference Manual, Version 1.0.0, Aug. 2010 --- 79...
  • Page 80: Pac_I8088W_Getpwmactivestate

    3. ActiveArr[]: the *State value will be parse into Bit Array Return Values Please refer to Error Code Table. Examples int slot=0,ch,activatedBit[8]; unsigned int activatedState=0; pac_i8088W_GetPWMActiveState (slot,& activatedState, activatedBit); for(ch=0;ch<8;ch++) if(activatedBit[ch]) printf(“PWM CH[%d] is activated\n”,ch); I-8088W API Reference Manual, Version 1.0.0, Aug. 2010 --- 80...
  • Page 81 [C#] using pac8088WNet; int slot=0,ch,activatedBit[8]; Uint16 activatedState=0; pac8088W. GetPWMActiveState (slot, ref activatedState, enBit); Console.WriteLine("PWM output state ={0:X2}", activatedState); for (ch=0; ch< 8; ch++) if(activatedBit[ch]==1) Console.WriteLine("PWM CH [{0}] is activated ",ch); I-8088W API Reference Manual, Version 1.0.0, Aug. 2010 --- 81...
  • Page 82: Pac_I8088W_Getdi

    4.20. pac_i8088W_GetDI The function is used to get DI status. The user can view which channels have received the signals. Syntax short pac_i8088W_GetDI(int slot,unsigned int *diVal,int diArr[]); Parameter 1. slot 0 ~ 7 2. *diVal: the DI status of i-8088 value 0~0xff 3.
  • Page 83 (ch=0; ch< 8; ch++) Print ("DI[%d]= %d\n",ch, enBit[ch]); [C#] using pac8088WNet; int slot=0,ch,enBit[8]; Uint16 dival=0; pac8088W.GetDI(slot, &diVal,enBit); Console.WriteLine("DI Vaule = {0:X2}",diVal); for (ch=0; ch< 8; ch++) Console.WriteLine("DI[{0}]= {1}",ch, enBit[ch]); I-8088W API Reference Manual, Version 1.0.0, Aug. 2010 --- 83...
  • Page 84: Appendix A. Error Code

    A. E PPENDIX RROR ID_ERROR SLOT_OUT_RANGE CHANNEL_OUT_RANGE SELECT_CHANNEL_ERROR HI_DUTY_OUT_RANGE LO_DUTY_OUT_RANGE...

Table of Contents