Home
User`s Manual - ICP DAS USA`s I
Contents
1. Figure 2 5 The hardware setting for board ID 2 4 2 Firmware Update The ICP DAS USB series I O modules provide firmware updateable functionality Users can update firmware if latest firmware released The switch setting is shown in figure 2 16 The INIT side of the switch means firmware update mode run side means normal operation 25 Document version 1 09 Hardware Information Hardware Configuration E ani Figure 2 6 The hardware setting for enabling firmware update functionality 2 4 3 USB 2019 2 4 3 1 Hardware Watchdog The USB 2019 has a build in hardware watchdog It is recommended to enable this functionality The hardware watchdog can be set by jumper JP1 The watchdog setting is enabled by default Setting Enable 2 4 4 USB 2045 2 4 4 1 Hardware Watchdog The USB 2045 has a build in hardware watchdog It is recommended to enable this functionality The hardware watchdog can be set by jumper JP1 The watchdog setting is enabled by default Setting Enable e e Disable ee 26 Document version 1 09 Hardware Information Hardware Configuration 2 4 5 USB 2051 2 4 5 1 Hardware Watchdog The USB 2051 has a build in hardware watchdog It is recommended to enable this functionality The hardware watchdog can be set by jumper JP1 The watchdog setting is enabled by default Setting soin O
2. p DI_GetDigitalFilterWidth Digital Input function Get DI Digital Filter Width DI_GetDigitalValuelnverse Digital Input function Get DI Value Inverse DI_GetCntEdgeTrigger Digital Input function Get DI Counter Edge Trigger DI_ReadValue Digital Input function Read DI Value DI_ReadCounterValue Digital Input function Read DI Counter Value DI_SetDigitalFilterWidth Digital Input function Set DI Digital Filter Width DI_SetDigitalValuelnverse Digital Input function Set DI Value Inverse DI_SetCntEdgeTrigger Digital Input function Set DI Counter Edge Trigger DI_WriteClearCounter Digital Input function Clear Specified Channel of DI 49 Document version 1 09 ICP DAS USB Class Members Table of Public Methods Counter Value Digital Input function Clear DI Counter Value with DI WriteClearCounters Clear Mask 5 3 4 Digital Output Meme Bescon DO_GetPowerOnEnable Digital Output function Get Power On Enable DO_GetSafetyEnable Digital Output function Get Safety Enable DO_GetSafetyValue Digital Output function Get Safety Value DO_ReadValue Digital Output function Read DO Value DO_SetPowerOnEnable Digital Output function Set Power On Enable DO_SetSafetyEnable Digital Output function Set Safety Enable DO_SetSafetyValue Digital Output function Set Safety Value DO_WriteValue Digital Output function Write DO Value 5 3 5 Analog Input Meme pessipion Analog input function Get total supported AI Get
3. 93 Document version 1 09 ICP DAS USB Class Members Public Methods 5 6 3 8 DI SetCntEdgeTrigger Digital input function Set DI Counter Edge Trigger Falling 0 Rising 1 Syntax public int DI SetCntEdgeTrigger DWORD i_dwEdgeTrig Parameters i_dwEdgeTrig IN The counter edge trigger setting Return Value Error code Example Int iErrCode ICPDAS USBIO m_usbIO m_usbIO new ICPDAS USBIO if ERR NO ERR iErrCode m_usbIO OpenDevice USB2051 1 if ERR NO ERR l iErrCode m_usbIO DI SetCntEdgeTrigger 1 printf d iErrCode m_usbIO CloseDevice 94 Document version 1 09 ICP DAS USB Class Members Public Methods 5 6 3 9 DI WriteClearCounter Digital input function Clear specified channel of DI Counter Value Syntax public int DI WriteClearCounter BYTE i_byChToClr Parameters xi bvChToclr IN The counter channel for clearing Return Value Error code Example Int iErrCode ICPDAS USBIO m usblO m_usbIO new ICPDAS USBIO if ERR NO ERR iErrCode m_usbIO OpenDevice USB2051 1 if ERR NO ERR iErrCode m usblO DI WriteClearCounter 1 printf d iErrCode m_usbIO CloseDevice 95 Document version 1 09 ICP DAS USB Class Members Public Methods 5 6 3 10 DI WriteClearCounters Digital input function Clear DI Counter Value with Clear Mask Syntax public int DI WriteClearCounters DWORD i_dwCntClrMask P
4. memset i bvSafetvEnable OxFF USBIO DO MAX CHANNEL 7 8 if ERR NO ERR l iErrCode m usbIO DO SetSafetvEnable i bvSafetvEnable printf d iErrCode m_usbIO CloseDevice 111 Document version 1 09 ICP DAS USB Class Members Public Methods 5 6 4 7 DO_SetSafetyValue Digital Output function Set Safety Value Each bit represents safety value The value of the safety is shown below Syntax public int DO_SetSafetyValue BYTE i_bySafetyValue Parameters i_bySafetyValue IN The safety value Each bit represents the safety value of each channel Return Value Error code 112 Document version 1 09 ICP DAS USB Class Members Public Methods Example Int ErrCode ICPDAS USBIO m_usbIO Byte i bvSafetvValuej USBIO DO MAX CHANNEL 7 8 Int ildx Bool bRet true m_usbIO new ICPDAS USBIO if ERR NO ERR iErrCode m_usbIO OpenDevice USB2064 1 memset i_bySafetyValue OxFF USBIO DO MAX CHANNEL 7 8 if ERR NO ERR l iErrCode m_usbIO DO_SetSafetyValue i_bySafetyValue printf d iErrCode m_usbIO CloseDevice 113 Document version 1 09 ICP DAS USB Class Members Public Methods 5 6 4 8 DO WriteValue The class has two overload methods for writing DO value One provides specifying channel to write another for all channel These two overload methods are listed as following table and described in following section Name of Met
5. 21 Document version 1 09 Hardware Information Wiring Relay Contact 1 DI COM 1 DI COM L O T O Wet Relay Close nel DIx Relay Open 018 DIX NPN Output IH08 DI COM IH DS DI COM m ovu ele ao 2 3 4 USB 2055 Digital Input Relay Contact Relay a 06 DIX Dry Close Lell GND Open Collector Dry Relay Contact 1 DI COM 1 mi DI COM L O La O Wet Relay Close cisl lata Relay Open Epa NPN Output Wet Digital Output Resistance Load 22 Document version 1 09 Hardware Information Wiring 2 3 5 USB 2060 Digital Input Relay Contact Dry Open Collector Dry Relay Contact I DI COM Wet o u i Relav Close app NPN Output lHoejji DI COM ON kl Wet 018 DIX Relay Output ON State LED ON OFF State LED OFF Output Type E a Relay Load RLx NO Load RLx NO AC DC AC DC Contact ca al RLx COM af S RLx COM 2 3 6 USB 2064 ON State LED ON OFF State LED OFF Output Type Readback as 1 Readback as 0 Relay L Load RLx NO Load RLx NO AC DC AC DC Contact a al RLx COM zah RLx COM 23 Document version 1 09 Hardware Information Wiring 2 3 7 USB 2084 Input Mode Isolated Non isolated Dir Pulse Up Down A B Phase Quadrant Vin Pulse Vin Pulse Vin Dir Vin Dir Vin Up Vin Up DE Vin Down Vin Down Vin Up0 Vin U
6. Byte m_byChTypeCode USBIO_AL MAX CHANNEL Int ildx m_usbIO new ICPDAS USBIO if ERR NO ERR iErrCode m_usbIO OpenDevice USB2019 1 For ildx 0 ildx lt USBIO AI MAX CHANNEL ildx m_byChTypeCodelildx 0x10 if ERR_NO_ERR l iErrCode m_usbIO AI SetTypeCode m_byChTypeCode printf d ErrCode iErrCode m_usblO CloseDevice 148 Document version 1 09 ICP DAS USB Class Members Public Methods 5 6 5 15 AI SetChCJCOffset The class has two overload methods for setting channel CJC offset One provides specifying channel to set another for all channel The valid range of offset is 40 96 40 95 These two overload methods are listed as following table and described in following section Name of Methods AI SetChCJCOffset BYTE i_byChToSet float i_fChCJCOffset AI SetChCICOffset float i_fChCJCOffsets 149 Document version 1 09 ICP DAS USB Class Members Public Methods 5 6 5 15 1 AI_SetChCJCOffset BYTE float Analog input function Set channel CJC offset for specific channel Syntax public int AI SetTypeCode BYTE i byChToSet float i fChCJCOffset Parameters i byChToSet IN The specific channel to set i fChCJCOffset IN The CJC offset for the specific channel Return Value Error code Example Int ErrCode ICPDAS_USBIO m_usbIO m_usbIO new ICPDAS_USBIO if ERR NO ERR iErrCode m_usbIO OpenDevice USB2019 1 if ERR NO ERR iEr
7. by the rotary switch Note The valid range of this ID is from 16 to 127 e Software WDT The software watch dog timer of the opened device The value enables the functionality to monitor module still alive or not When enable the watch dog timer computer and module will send SYNC packet each other When communication is failure software WDT also provides functionality to output safety value if the module has output capability Note The valid range of this value is 100 ms 30 minute Description The description of the opened device This item helps user to identify module Note The maximum characters of the description are 32 e Load Default This function is used to restore module to default setting factory setting 34 Document version 1 09 Installation Software 3 2 1 2 Digital Output In the 1 O page of the digital output the digital output value and module configuration can be read or written in this page The detail of all items in this form will be introduced in this section uman Pisi Cupa 1 Output Region 3 Message Region e Output Region The output region is used to wirte the output value to the module The output value can be writen by the LED to each channel or the hex to all channels Users can also readback the output value in this region NOTE The readback value is the current output value in the module if the module does not support diagnostic functionality If the module does
8. disable when open device Syntax public int SetAutoResetWDT BOOL _bEnable Parameters i_bEnable IN To enable disable the library to automatically handle watchdog Return Value Error code Example Int iErrCode ICPDAS_USBIO m_usbIO m_usbIO new ICPDAS_USBIO if ERR_NO_ERR iErrCode m_usbIO OpenDevice USB2019 1 If ERR_NO_ERR iErrCode m_usbIO SetAutoResetWDT FALSE printf d iErrCode 60 Document version 1 09 ICP DAS USB Class Members Public Methods 5 6 2 Device 5 6 2 1 RefreshDevicelnfo Refresh all information of this device Note 1 The RefreshDevicelnfo will be called automatically when open device Note 2 This function will take time to refresh information Syntax public int RefreshDevicelnfo void Parameters none Return Value Error code Example Int ErrCode ICPDAS_USBIO m_usbIO m_usbIO new ICPDAS USBIO if ERR NO ERR iErrCode m_usbIO OpenDevice USB2019 1 if ERR_NO_ERR iErrCode m usblO RefreshDevicelnfo printf d iErrCode iErrCode m_usbIO CloseDevice 61 Document version 1 09 ICP DAS USB Class Members Public Methods 5 6 2 2 GetSoftWDTTimeout Get the software WDT timeout of I O module Syntax public int GetSoftWDTTimeout DWORD o_dwSoftWDTTimeout Parameters xo dwSoftWDTTimeout OUT The software WDT timeout in millisecond ms Return Value Error code Example
9. iErrCode m_usbIO OpenDevice USB2019 1 For ildx 0 ildx lt USBIO_AI MAX_CHANNEL 7 8 ildx m_byChEnable ildx 0x5A if ERR_NO_ERR l iErrCode m_usbIO AI SetChEnable m bvChEnable printf d iErrCode iErrCode m_usbIO CloseDevice 152 Document version 1 09 ICP DAS USB Class Members Public Methods 5 6 5 17 AI SetFilterRejection Analog input function Set filter rejection 60Hz 0 50Hz 1 Syntax public int AI SetFilterRejection BYTE _byFilterRejection Parameters i_byFilterRejection IN The filter rejection Return Value Error code Example Int ErrCode ICPDAS USBIO m_usbIO m_usbIO new ICPDAS USBIO if ERR NO ERR iErrCode m_usbIO OpenDevice USB2019 1 if ERR NO ERR l iErrCode m usblO AI SetFilterRejection 0 printf d iErrCode iErrCode m_usblO CloseDevice 153 Document version 1 09 ICP DAS USB Class Members Public Methods 5 6 5 18 AI SetCJCOffset Analog input function Set CJC offset The valid range of offset is 40 96 40 95 Syntax public int AI SetCJCOffset float i fCJCOffset Parameters i fCJCOffset IN The CJC offset Return Value Error code Example Int ErrCode ICPDAS USBIO m_usbIO m_usbIO new ICPDAS USBIO if ERR NO ERR iErrCode m_usbIO OpenDevice USB2019 1 if ERR NO ERR iErrCode m usblO AI SetCJCOffset 20 81 printf d ErrCode iErrCode
10. Byte o bvSupportTvpeCodejUSBIO MAX SUPPORT TVPEJ Int ildx Bool bRet true m_usbIO new ICPDAS_USBIO if ERR_NO_ERR iErrCode m_usbIO OpenDevice USB2084 1 if ERR_NO_ERR l iErrCode m usblO PI GetTotalSupportType amp o_ byTotalSupportType printf d ErrCode bRet false if ERR_NO_ERR l ErrCode m usblO PI GetSupportTypeCode o bySupportTypeCode printf d iErrCode bRet false If bRet printf d n o_byTotalSupportType for ildx 0 ildx lt o_byTotalSupportType ildx printf 02x n o_bySupportTypeCodelildx 160 Document version 1 09 ICP DAS USB Class Members Public Methods 5 6 6 3 PI GetTypeCode Pulse input function Get type code Please refer to user s manual to map PI channels input type The type code can reference to Appendix A 3 Syntax public int PI GetTypeCode BYTE o_byTypeCode Parameters o_byTypeCode OUT The byte array of type code Return Value Error code 161 Document version 1 09 ICP DAS USB Class Members Public Methods Example Int ErrCode ICPDAS USBIO m_usbIO Byte o_byTypeCode USBIO PI MAX CHANNEL Int ildx m_usbIO new ICPDAS USBIO ifiERR NO ERR iErrCode m_usbIO OpenDevice USB2084 1 if ERR NO ERR l iErrCode m usblO PI GetTvpeCode o bvTvpeCode printf d iErrCode else for ildx 0 ildx lt USBIO PI MAX CHANNEL ildx printf
11. OnBulkValueFinishEvent i_CBFunc Parameters i_byStartCh IN The starting acquire channel i_byChTotal IN The total channels to acquire i_dwSampleWidth IN The sampling width ms i_fSampleRate IN The sampling rate Hz 10KHz maximum i_dwBufferWidth IN The width of the buffer for single channel o_dwDataBuffer OUT The 2 dimension buffer array to store i CBFunc IN Block operation NULL IN Non block operation The address of callback function Return Value Error code 178 Document version 1 09 ICP DAS USB Class Members Public Methods Example Int ErrCode ICPDAS_USBIO m usblO To read 0 1 channel for 100ms in 5 KHz sample rate each channel in non block operation So we have the following variable declaration define SampleRate 5000 define BufferWidth 500 5000 Hz 0 1 100ms DWORD m_dwBuffer 2 BufferWidth Void BulkFinishCallback DWORD dwCount Callback function to handle data Int main m_usbIO new ICPDAS_USBIO if ERR_NO_ERR iErrCode m_usblO OpenDevice USB2084 1 if ERR_NO_ERR iErrCode m usblO PI ReadBulkValue 0 2 100 SampleRate BufferWidth m_dwBuffer BulkFinishCallback printf d ErrCode while 1 Sleep 1 179 Document version 1 09 ICP DAS USB Class Members Public Methods 5 6 6 12 PI_SetTypeCode The class has two overload methods for setting type code One provides specifying channel
12. for ildx 0 ildx lt USBIO PI MAX CHANNEL ildx printf f n o_fFreqValuelildx 176 Document version 1 09 ICP DAS USB Class Members Public Methods 5 6 6 11 PI_ReadBulkValue Analog input function Trigger reading bulk PI value Fast acquire functionality When in callback operation it will cause the performance in your callback function Please reduce execute time in this callback function The detail of operation is described as follow When call this API the PI module operation will be changed from normal to fast acquire mode In fast acquire mode PI module follow the parameter of API setting to acquire data The API has block and non block operation In block operation user s application needs to wait until API finishing all procedure In contrast with block mode non block provides a flexible way for user In non block operation user s application can proceed to own other code To enable non block operation it is important to declare a callback function and pass it through last parameter For block operation just pass a NULL definition in last parameter Due to the USB 2 0 Full speed transfer rate capability the maximum sample rate is 10 KHz 177 Document version 1 09 ICP DAS USB Class Members Public Methods Syntax public int PI ReadBulkValue BYTE i_byStartCh BYTE i_byChTotal DWORD i_dwSampleWidth Float i_fSampleRate DWORD i_dwBufferWidth DWORD o_dwDataBuffer
13. printf d ErrCode else printf 9od o_byDITotal iErrCode m_usbIO CloseDevice 69 Document version 1 09 ICP DAS USB Class Members Public Methods 5 6 2 9 GetDOTotal Get DO total number of channels of the device Syntax public int GetDOTotal BYTE o_byDOTotal Parameters o_byDOTotal OUT The DO total number of channels Return Value Error code Example Int iErrCode ICPDAS USBIO m usblO Bvte o bvDOTotal m usblO new ICPDAS USBIO ifiERR NO ERR iErrCode m_usbIO OpenDevice USB20xx 1 if ERR NO ERR l iErrCode m_usbIO GetDOTotal amp o_byDOTotal printf d iErrCode else printf d o_byDOTotal iErrCode m_usbIO CloseDevice 70 Document version 1 09 ICP DAS USB Class Members Public Methods 5 6 2 10 GetAlTotal Get Al total number of channels of the device Syntax public int GetAlTotal BYTE o_byAITotal Parameters o_byAlTotal OUT The AI total number of channels Return Value Error code Example Int ErrCode ICPDAS USBIO m usblO Byte o bvAITotal m usblO new ICPDAS USBIO if ERR NO ERR iErrCode m_usbIO OpenDevice USB20xx 1 if ERR NO ERR l iErrCode m usblO GetAlTotal amp o_byAITotal printf d ErrCode else printf d o_byAlTotal iErrCode m_usbIO CloseDevice 71 Document version 1 09 ICP DAS USB Class Members Public Methods 5 6 2 11 Ge
14. third parties resulting from its use Copyright Copyright 2011 by ICP DAS CO LTD All rights are reserved Trademark The names used for identification only may be registered trademarks of their respective companies Document version 1 09 Content Overview Content Revision History ares sare Ada i Preface saae A A OOC ii ASCII evden lee aio lii lim FOGG onirica mmen 1 LOVE VENE ca ae a E O ise Nadia blah aise tN EN Mobley 1 T2 E 1 A a R SIE 2 DAS SCI sse A 2 ME BUR Ta L 10 IE 2 LA PSB 2 a ii A i ae 3 PA A A 4 AASB 205 O tali 5 LAS USB Dd a a a ala isla 6 LADISLAO aa lengua 8 DP ISB 2 1 a I 10 E RA a Mn 11 KS Prod ct Cc eo ur el 12 2 Harawareinfermalnoni o aag td 13 2 MOQUS OM O E O DAL ROKA 13 2 PI 14 2 1 2 USB 2045 amp USB 2051 amp USB 2055 amp USB 2060 15 AL BIVSBE2004 gt nasali A tka 15 ZAS e ae aa 16 215 AU ori li i aaa 16 22 GonnectorPin AsSsignmenta sedia doit 17 CORE O JK RR E RE AE I 17 A O E eee acre ee 17 22 3 JS BZ OS Doo e E E RE en ce a o e 18 224 USB 2055 ani iie o E III 18 225 A A 19 PAPA MOE AA ee E ee 19 AS A la el a 20 A mm m m m 21 A 9 i e ed ob A 21 mi Document version 1 09 Content Overview IS A a al e ti 21 29 aA A EE E o E 21 UR BES o PAI ONE T e 22 ID U SB 2000 ita ia 23 A tp ti ato fa a AA 23 2 9 PUSB 2084 AA fr Di tenia ta g ana lento i 24 2 4 Hardware Configuration salendo 25 A A i DI IR 25 242 Firmw
15. 5 6 5 11 4 AI ReadValue float BYTE Analog input function Read the real Al value with channel status Syntax public int AI ReadValue float o_fAlValue BYTE o_byAIChStatus Parameters xo fAlValue OUT The true value of Al value o_byAIChStatus OUT The byte array of channel status Return Value Error code 140 Document version 1 09 ICP DAS USB Class Members Public Methods Example Int ErrCode ICPDAS_USBIO m_usblO float o_fAIValue USBIO_AI MAX_CHANNEL Byte o_byAIChStatus USBIO_AI MAX CHANNEL Int ildx m_usbIO new ICPDAS USBIO if ERR NO ERR iErrCode m_usbIO OpenDevice USB2019 1 if ERR_NO_ERR iErrCode m_usbIO Al_ReadValue o_fAlValue o bvAIChStatus printf d iErrCode else For ildx 0 ildx lt USBIO_AI MAX_CHANNEL ildx printf 5f 0x 02x n o_fAlValue ildx o_byAIChStatus 141 Document version 1 09 ICP DAS USB Class Members Public Methods 5 6 5 12 AI ReadBulkValue Analog input function Trigger reading bulk AI value Fast acquire functionality When in callback operation it will cause the performance in your callback function Please reduce execute time in this callback function The detail of operation is described as follow When call this API the AI module operation will be changed from normal to fast acquire mode In fast acquire mode AI module follow the parameter of API setting to acquire data The
16. O_O jee Disable 2 4 6 USB 2055 2 4 6 1 Hardware Watchdog The USB 2055 has a build in hardware watchdog It is recommended to enable this functionality The hardware watchdog can be set by jumper JP1 The watchdog setting is enabled by default Setting soin O O_O Disable 2 4 7 USB 2060 2 4 7 1 Hardware Watchdog The USB 2060 has a build in hardware watchdog It is recommended to enable this functionality The hardware watchdog can be set by jumper JP1 The watchdog setting is enabled by default 27 Document version 1 09 Hardware Information Hardware Configuration Setting soi olo o jee Disable 2 4 8 USB 2064 2 4 8 1 Hardware Watchdog The USB 2064 has a build in hardware watchdog It is recommended to enable this functionality The hardware watchdog can be set by jumper JP1 The watchdog setting is enabled by default Setting emi jee Disable 28 Document version 1 09 Hardware Information Hardware Configuration 2 4 9 USB 2084 2 4 9 1 Hardware Watchdog The USB 2084 has build in hardware watchdog It is recommended to enable this functionality The hardware watchdog can be set by jumper JP1 The watchdog setting is enabled by default Setting Enable Sali isable 2 4 9 2 Isolated Non isolated TTL The USB 2084 has two kind of inputs isolated and non isolated TTL for different input signals Users can switch jumper setting on the USB 2084 board for appropriate
17. m_usbIO OpenDevice USB20xx 1 sprintf byNickName Station 1 1 3 if ERR NO ERR l iErrCode m usblO SetDeviceNickName byNickName printf d iErrCode iErrCode m_usbIO CloseDevice 76 Document version 1 09 ICP DAS USB Class Members Public Methods 5 6 2 16 SetSoftWDTTimeout Set the software WDT timeout The minimum value of timeout is 100ms and maximum is 30 minutes Syntax public int SetSoftWDTTimeout DWORD _dwSoftWDTTimeout Parameters i dwSoftWDTTimeout IN The software WDT timeout in millisecond ms Return Value Error code Example Int ErrCode ICPDAS USBIO m_usbIO m_usbIO new ICPDAS USBIO if ERR NO ERR iErrCode m_usbIO OpenDevice USB20xx 1 if ERR NO ERR l iErrCode m usblO SetSoftWDTTimeout 1000 printf d iErrCode iErrCode m_usblO CloseDevice 77 Document version 1 09 ICP DAS USB Class Members Public Methods 5 6 2 17 LoadDefault Load default setting Syntax public int LoadDefault void Parameters none Return Value Error code Example Int ErrCode ICPDAS USBIO m_usbIO m_usbIO new ICPDAS USBIO if ERR NO ERR iErrCode m_usbIO OpenDevice USB20xx 1 I ERR NO ERR l iErrCode m_usbIO LoadDefault printf d ErrCode iErrCode m usblO CloseDevicel 78 Document version 1 09 ICP DAS USB Class Members Public Methods 5 6 2 18 StopBulk St
18. m_usblO CloseDevice 154 Document version 1 09 ICP DAS USB Class Members Public Methods 5 6 5 19 AI SetCJCEnable Analog input function Set CJC enable Disable 0 Enable 1 Syntax public int AI SetCJCOffset BYTE i_byCJCEnable Parameters i bvCICEnable IN The CJC enable Return Value Error code Example Int ErrCode ICPDAS USBIO m_usbIO m_usbIO new ICPDAS USBIO if ERR NO ERR iErrCode m_usbIO OpenDevice USB2019 1 if ERR NO ERR iErrCode m usblO AI SetCJCEnable 1 printf d iErrCode iErrCode m_usbIO CloseDevice 155 Document version 1 09 ICP DAS USB Class Members Public Methods 5 6 5 20 AI SetWireDetectEnable Analog input function Set wire detect enable Disable 0 Enable 1 Syntax public int AI SetCJCOffset BYTE i_byWireDetectEnable Parameters i_byWireDetectEnable IN The wire detect enable Return Value Error code Example Int ErrCode ICPDAS USBIO m usblO m_usbIO new ICPDAS USBIO if ERR NO ERR iErrCode m_usbIO OpenDevice USB2019 1 if ERR NO ERR iErrCode m usblO AI SetWireDetectEnable 0 printf d iErrCode iErrCode m_usbIO CloseDevice 156 Document version 1 09 ICP DAS USB Class Members Public Methods 5 6 6 Pulse Input 5 6 6 1 PI GetTotalSupportType Pulse input function Get total supported amount Syntax public int PI GetTotalSupportType BYTE o_byT
19. v2 0 50727 CAWINDOWSMiorosof Ming ISS dotNE IEHost 0 0 v2 0 50727 CAWINDOWS Microsof 5 System IIEHost 0 04 v20 50727 CAWINDOWS Microsof O System Data ISymWrapper 0 0 v2 0 50727 CAWINDOWS Microsof l Microsoft Build Conversi 20 04 v2 0 50727 CAWINDOWSMierosot System Deployment Microsoft Build Engine 0 04 v2 0 50727 CAWINDOWSiMicrosof 5 System Drawing Microsoft Build Framew 2 0 0 v2 0 50727 CAWINDOWS Microsof os Wind Fi Microsoft Build Tasks 9 0 v2 0 50727 CAWINDOWSMierosot ia System Windows Forms Microsoft Build Utilities 0 0 v2 0 50727 CAWINDOWSIMierosof System Xml Microsoft Build Visual 2 0 0 v2 0 50727 CAWINDOWS Microsof a E Formi es ci Program cs 42 Document version 1 09 Installation Software 3 2 2 2 VC Edit View Insert Project Build Tools Window Help Be Ja gugl pel A Visual Component Manager A Register Control I gt 2 Error Lookup 2l 2 ActiveX Control Test Container gt 2 OLE COM Object Viewer Aso A MFC Tracer iles in W 8 Symbols in Workspace Customize Ti Macro Record Quick Macro Ctrl Shift R Play Quick Macro Ctr Shift P Editor Tabs Debug Compatibility Build Directories Source Platform Show directories for Win32 Include files Di Microsoft Yisual C Editor Tabs Debug Compatibility Build Directories Source Platform Show directories for X
20. 02x n o_byTypeCodelildx 162 Document version 1 09 ICP DAS USB Class Members Public Methods 5 6 6 4 PI_GetTriggerMode Pulse input function Get trigger mode Falling edge 0 Rising edge 1 Both edge 2 amp 3 Syntax public int PI GetTriggerMode BYTE o_byTriggerMode Parameters o_byTriggerMode OUT The byte array of trigger mode Return Value Error code 163 Document version 1 09 ICP DAS USB Class Members Public Methods Example Int ErrCode ICPDAS USBIO m_usblO Byte o bvTriggerMode USBIO PL MAX CHANNELJ Int ildx m usblO new ICPDAS_USBIO if ERR NO ERR iErrCode m usblO OpenDevice USB2084 1 if ERR NO ERR l iErrCode m usblO PI GetTriggerMode o bvTriggerMode printf d ErrCode else for ildx 0 ildx lt USBIO PI MAX CHANNEL ildx printf 02x1n o_byTriggerMode ildx 164 Document version 1 09 ICP DAS USB Class Members Public Methods 5 6 6 5 PI GetChisolatedFlag Pulse input function Get channel isolated flag Each byte indicates 8 channels flag EX Byte0 gt Channel0 7 Syntax public int PI GetChisolatedFlag BYTE o bvChisolatedFlag Parameters xo bvChisolatedFlag OUT The byte arrays of channel isolated flag Return Value Error code 165 Document version 1 09 ICP DAS USB Class Members Public Methods Example Int ErrCode ICPDAS_USBIO m_usbIO Byte o bvChisolatedFlag USBIO_PI M
21. 2 5V 0x06 20 mA 20 mA 0x07 4 mA 20 mA 0x08 10V 10V 0x09 5V 5V OxOA 1V 1V 0x0B 500 mV 500 mV OxOC 150 mV 150 mV 0x0D 20 mA 20 mA Ox0E Type JTC 210 760 C OxOF Type K TC 210 1372 C 0x10 Type T TC 270 400 C 0x11 Type ETC 270 1000 C 0x12 TypeR TC 0 1768 C 0x13 Type S TC 0 1768 C 0x14 Type B TC 0 1820 C 0x15 Type N TC 270 1300 C 0x16 Type C TC 0 2320 C Document version 1 09 0x17 0x18 0x19 Ox1A Ox1B Ox1C 0x20 0x21 0x22 0x23 0x24 0x25 0x26 0x27 0x28 0x29 Ox2A 0x2B Ox2C 0x2D Ox2E Ox2F 200 Type LTC 200 800 C Type MTC 200 100 C Type Loma710 TC 200 900 C 0 20 mA 150 V 150 V 50 V 50 V Pt 100 a 00385 100 100 C Pt 100 a 00385 0 100 C Pt 100 a 00385 0 200 C Pt 100 a 00385 0 600 C Pt 100 a 003916 100 100 C Pt 100 a 003916 0 100 C Pt 100 a 003916 0 200 C Pt 100 a 003916 0 600 C Nickel 120 80 100 C Nickel 120 0 100 C Pt 1000 a 00392 200 600 C Cu 100 a 00421 20 150 C Cu 100 a 00427 0 200 C Cu 1000 a 00421 20 150 C Pt 100 a 00385 200 200 C Pt 100 a 003916 200 200 C Appendix A A 2 Analog Output Type Code A 2 Analog Output Type Code Code InputTvpe 1 0x30 0 20mA 0x31 4 20mA 0x32 OV 10V 0x33 10V 10V 0x34 OV 45V 0x35 5V 5V A 3 Pulse Input Type Code Code InputTyp
22. C ICPDAS USB IO USB IO Utility USB IO Utility exe When users open USB IO Utility the all ICP DAS USB series I O modules connected to PC are listed in Device List as figure 3 5 The utility will scan the ICP DAS USB series 32 Document version 1 09 Installation Software I O modules automatically The module in the Device List will be removed when pull off from PC and added when plug in to PC r Y USB IO Utility Device List SA Computer P USB Board USB E Board To access the ICP DAS USB I O module user can double click the module listed in Device List and then you will see another form come out There are several function pages information and I O pages in the device form In the information page of the device form it is used to configure basic system parameters And in the I O page it is used to access I O data and configure parameters There will be a data log page if module supports this functionality 33 Document version 1 09 Installation Software 3 2 1 1 Information Page Device Name Firmware Version Setting User defined Board ID Set Software WDT Enable 100 ms set Description Set Load Default e Device Name The name of the opened device e Firmware Version The firmware version of the opened device e User Defined Board ID The board ID of the opened device The value can configure when switched the board ID to 0
23. Directories C Program Files Microsoft Visual Studio YC98 INCLUDE C Program Files Microsoft Visual Studio WC98 MFC INCLUDE C Program Files Microsoft Visual Studio YC98 ATLWINCLUDE CAWINDDK 7600 16385 1 INC 3 2 2 3 BCB This section is left blank intentionally Document version 1 09 43 wins a Library files Directories l TOT CAProgram Files Microsoft Visual Studio VC98 LIB C Program Files Microsoft Visual Studio WC98 MFC LIB C WINDDK 7600 16385 1 LIB WXP 1386 Installation Software 3 2 2 4 VB sx AI API Test Microsoft Visual Basic design File Edit View Project Format Debug Run Query Diagram Tools Add Ins Window Hel ps gt TE Add Fom 5 Add MDI Form TT st Add Module x 78 Add Class Module Bf Add User Control TE Add Property Page ab A abi Ye Add User Document EI Add WebClass Add Data Report doo Add DHTML Page El Add Data Environment 4 More ActiveX Designers JU y Add File Ctrl D DO Remove AL API Testfrm ta g Components Cti T AI API Test Properties References AI API Test ybp Available References Visual Basic For Applications Visual Basic runtime objects and procedures Visual Basic objects and procedures OLE Automation Browse ICPDAS USBIO YB IAS Helper COM Component 1 0 Type Library el TAS RADIUS Protocol 1 0 Type Library Acrobat Access 3 0 Type Library Priority AcroBrokerLib Help Ac
24. The Digital Output for Channel N ESITI me Power ource putin The Ground of Power Source Input Pin 18 Document version 1 09 Hardware Information Connector Pin Assignment 2 2 5 USB 2060 DI TheDigtalinutforchamelN DI GND The Ground of Current Path of Dry Contact DI COM RL N NO The NO pin of relay N RL N COM 2 2 6 USB 2064 MONTENE menopnotryy NES ee The COM pin of relay N Document version 1 09 Hardware Information Connector Pin Assignment 2 2 7 USB 2084 Terminal No Pin Assignment A HI 02 a i 2 3 cc a L jmw al fel 05 CIAR MEN E IESO ui Sl 2 __ Ce DOS CA ln MO mt CBR Co zn re Lejn nA C i AA Le S Ce e DC AA AAA Rao AAA Ce zona NC Counter positive signal channel for pair A ISSN Counter negative sgnalchomelforpakA O Counter positive signal channel for pair B ISIN Counter negative signal channel for paire No connection on this pin 20 Document version 1 09 Hardware Information Wiring 2 3 Wiring 2 3 1 USB 2019 Thermocouple Input Voltage Input Current Input 1252 Note When connecting to current source an external 1250 resistor is required 2 3 2 USB 2045 Ext PWR DOx DOx Ext GND Ext GND Resistance Ext PWR Ext PWR 05 1S DOx Ext GND DOx Load Ext GND Relay Contact Relay 19 DIx Dry Close L gt nelll GND Open Collector Dry
25. current mode is not in large transfer mode The large transfer packet is lost 202 Appendix B B 1 Error Codes 0x0000000C 12 ERR_ DEV_LTINDEXNOTMACH 0x0000000D 13 ERR_ DEV_LTNOTFINISH 0x0000000E 14 ERR_DEV_DO_RELATED_ERR 0x00004000 0x000047FFF ERR_DEV_DI_RELATED_ERR 0x00004800 0x00004FFF ERR_DEV_AO_RELATED_ERR 0x00005000 0x000057FF ERR_DEV_AI_RELATED_ERR 0x00005800 0x00005FFF ERR_DEV_PO_RELATED_ERR 0x00006000 0x000067FF ERR_DEV_PI_RELATED_ERR 0x00006800 0x00006FFF ERR_USBDEV_INVALID_DEV 0x00010000 65536 ERR_USBDEV_DEV_OPENED 0x00010001 65537 ERR_USBDEV_DEVNOTEXISTS 0x00010002 65538 ERR_USBDEV_GETDEVINFO 0x00010003 65539 ERR_USBDEV_ERROR_PKTSIZE 0x00010004 65540 ERR_USBDEV_ERROR_WRITEFILE 0x00010004 65541 ERR_USBIO_COMM_TIMEOUT 0x00010100 65792 ERR_USBIO_DEV_OPENED 0x00010101 65793 ERR_USBIO_DEV_NOTOPEN 0x00010102 65794 ERR_USBIO_INVALID_RESP 0x00010103 65795 Document version 1 09 The offset index is not match while operating in large transfer Another large transfer is operating The digital output related error in this region The digital input related error in this region The analog output related error in this region The analog input related error in this region The pulse output related error in this region The pulse input related error in this region The handle of device is invalid The device has been opened by class library The class library cannot find the
26. ildx lt USBIO PI MAX CHANNEL 7 8 ildx m_byChlsolatedFlag ildx 0x5a if ERR_NO_ERR l iErrCode m usblO PI SetChisolatedFlag m bvChisolatedFlag printf d iErrCode iErrCode m_usbIO CloseDevice 192 Document version 1 09 ICP DAS USB Class Members Public Methods 5 6 6 19 PI_SetLPFilterEnable The class has two overload methods for setting trigger mode One provides specifying channel to set another for all channels Set 1 to enable low pass filter The parameter of the method for all channels is a byte array for all channel enable mask ex Byte0 gt Channel0 7 These two overload methods are listed as following table and described in following section Name of Methods PI_SetLPFilterEnable BYTE i_byChToSet BOOL i_bLPFilterEnable PI_SetLPFilterEnable BYTE i_byLPFilterEnable 193 Document version 1 09 ICP DAS USB Class Members Public Methods 5 6 6 19 1 PI_SetLPFilterEnable BYTE BOOL Pulse input function Set low pass filter enable to specific channel Syntax public int PI_SetLPFilterEnable BYTE i byChToSet BOOL i_bLPFilterEnable Parameters i byChToSet IN The specific channel to set i_bLPFilterEnable IN The enable flag for the specific channel Return Value Error code Example Int iErrCode ICPDAS_USBIO m usblO m_usbIO new ICPDAS USBIO if ERR NO ERR iErrCode m_usbIO OpenDevice USB2084 1 if ERR_NO_ERR l iErrCode m_u
27. loop If m_ bEmcyPktArrive Handle emcy packet iErrCode m_usbIO CloseDevice 81 Document version 1 09 ICP DAS USB Class Members Public Methods 5 6 3 Digital Input 5 6 3 1 DI_GetDigitalFilterWidth Digital input function Get DI Digital Filter Width The digital filter width is used for filtering the noise or the glitch The unit of the filter is 0 1 milli second Syntax public int DI GetDigitalFilterWidth WORD o_wFilterWidth Parameters o_wFilterWidth OUT The digital filter width The unit is 0 1 ms Return Value Error code 82 Document version 1 09 ICP DAS USB Class Members Public Methods Example Int ErrCode ICPDAS USBIO m_usbIO WORD o_wFilterWidth Int ildx Bool bRet true m_usbIO new ICPDAS_USBIO if ERR NO ERR iErrCode m_usbIO OpenDevice USB2051 1 if ERR_NO_ERR iErrCode m usblO DI GetDigitalFilterWidth amp o_wFilterWidth printf d ErrCode bRet false If bRet printf d n o_wFilterWidth 83 Document version 1 09 ICP DAS USB Class Members Public Methods 5 6 3 2 DI GetDigitalValueInverse Digital input function Get DI Value Inverse No 0 Yes 1 Syntax public int DI GetDigitalValueInverse DWORD o dwinverse Parameters xo dwinverse OUT The inverse setting Return Value Error code 84 Document version 1 09 ICP DAS USB Class Members Public Methods Examp
28. public int AI GetTypeCode BYTE o_byTypeCode Parameters o_byTypeCode OUT The byte array of type code Return Value Error code Example Int iErrCode ICPDAS_USBIO m_usbIO Byte o_byTypeCode USBIO_AI MAX_CHANNEL Int ildx m_usbIO new ICPDAS USBIO if ERR NO ERR iErrCode m_usbIO OpenDevice USB2019 1 if ERR_NO_ERR l iErrCode m usblO AI GetTvpeCode o_byTypeCode printf d iErrCode else for ildx 0 ildx lt USBIO_AI MAX_CHANNEL ildx printf 02x n o_byTypeCodelildx 123 Document version 1 09 ICP DAS USB Class Members Public Methods 5 6 5 4 AI GetChCJCOffset Analog input function Get channel CJC offset The valid range of offset is 40 96 40 95 Syntax public int AI GetChCJCOffset float o_fChCJCOffset Parameters xo fChCJCOffset OUT The float array of channel CJC offset Return Value Error code 124 Document version 1 09 ICP DAS USB Class Members Public Methods Example Int ErrCode ICPDAS_USBIO m_usblO float o_fChCJCOffset USBIO_AI MAX CHANNEL Int ildx m_usbIO new ICPDAS USBIO if ERR_NO_ERR iErrCode m_usbIO OpenDevice USB2019 1 if ERR NO ERR l iErrCode m usblO Al_GetChCJCOffset o fChCICOffset printf d ErrCode else for ildx 0 ildx lt USBIO AI MAX CHANNEL ildx printf 5An 0 fChCICOffset ildx 125 Document version 1 09 ICP DAS USB Class Membe
29. resistor is required Thermocouple J K T E R S B N C L M and Lpima3710 Resolution 16 bit Accuracy 0 1 FSR Sampling Rate 10 Hz Total Zero Drift 20 uvje Span Drift 25 ppm C Voltage Input Type i E Current Common Mode Rejection 86 dB Normal Mode Rejection 100 dB Voltage gt 400 kQ Current 1250 External resistor is required Input Impedance Intra Module Isolation 2 3000 Voc Field to Logic Overvoltage protection 240 Vms Individual Channel Configuration Yes Open Wire Detection Yes Software programmable Power Power Consumption 1 45W maximum Mechanical Dimensions WxLxH 33mm x 119mm x 107mm Document version 1 09 Introduction Specifications 1 4 3 USB 2045 The USB 2045 is a full speed USB device with 16 digital l output channels module The USB 2045 supports source tvpe output and equips with short circuit protection There are 16 LED indicators that can be used to monitor the status of the digital output channels The 4 kV ESD protection 4 kV EFT protection 3 kV surge protection for power input and 3750 mira e VDC Intra module isolation are standard Digital Output Channels Type Open Collector Sink NPN Load Voltage 3 5 50VDC Max Load Current 650 mA Channel Overvoltage Protection 60 VDC m Overload Protection 1 4A with short circuit protection Power on Value Yes Safe Value Yes Power Power Consumption 1 0 W max Mechanic
30. software Counter 4 channel counter type Up Down 4 channel counter type Dir Pulse Channels 4 channel counter type A B Phase 8 channels for counter type Up and Frequency Input Type Up Frequency Up Down Dir Pulse A B Phase Resolution 32 bit Input Frequency 500kHz maximum Digital Noise Filter 1 32767uS Software programmable Frequency Accuracy 0 4 On Voltage Level 4 5Vpc 30Vpc Isolated Input Level i Off Voltage Level 1Vpc maximum On Voltage Level 9 2Vpc 5Vpc Non isolated Input Level Off Voltage Level OVpc 0 8Vpc Intra Module Isolation f 2500 Voc Field to Logic vee ii Yes Power Consumption 1 11W maximum Mechanical Dimensions WxLxH 33mm x 102mm x 107mm Document version 1 09 Introduction Product Check List 1 5 Product Check List The package includes the following items e OnelCP DAS USB I O module e One Quick Start Guide e One USB cable with lockable kit CA USB15 It is highly recommended to read the Quick Start Guide first before using ICP DAS USB I O modules There is some useful information in the Quick Start Guide e How to install hardware and use utility 12 Document version 1 09 Hardware Information Module Overview 2 Hardware Information 2 1 Module Overview ee amp I Os Terminal Frame Ground G gt Board ID Rotary Switch E qo USB Type B connector 4 Normal Firmware di gt update Mode Switch lt ae IET Mem DIN R
31. API has block and non block operation In block operation user s application needs to wait until API finishing all procedure In contrast with block mode non block provides a flexible way for user In non block operation user s application can proceed to own other code To enable non block operation it is important to declare a callback function and pass it through last parameter For block operation just pass a NULL definition in last parameter Due to the USB 2 0 Full speed transfer rate capability the maximum sample rate is 10 KHz 142 Document version 1 09 ICP DAS USB Class Members Public Methods Syntax public int AI ReadBulkValue BYTE i bvStartCh BYTE i_byChTotal DWORD i_dwSampleWidth Float i_fSampleRate DWORD i_dwBufferWidth DWORD o_dwDataBuffer OnBulkValueFinishEvent i_CBFunc Parameters i_byStartCh IN The starting acquire channel i_byChTotal IN The total channels to acquire i_dwSampleWidth IN The sampling width ms i_fSampleRate IN The sampling rate Hz 10KHz maximum i_dwBufferWidth IN The width of the buffer for single channel o_dwDataBuffer OUT The 2 dimension buffer array to store i CBFunc IN Block operation NULL IN Non block operation The address of callback function Return Value Error code 143 Document version 1 09 ICP DAS USB Class Members Public Methods Example Int ErrCode ICPDAS_USBIO m usblO To read 0 1 chann
32. AX CHANNEL 7 8 Int ildx m_usbIO new ICPDAS USBIO ifiERR NO ERR iErrCode m_usbIO OpenDevice USB2084 1 if ERR NO ERR l iErrCode m usblO PI GetChisolatedFlag o bvChisolatedFlag printf d ErrCode else for ildx 0 ildx lt USBIO PI MAX CHANNEL 7 8 ildx printf 02x n 0 bvChisolatedFlaglildx 166 Document version 1 09 ICP DAS USB Class Members Public Methods 5 6 6 6 PI_GetLPFilterEnable Pulse input function Get low pass filter enable Each byte indicates 8 channels enable disable mask EX Byte0 gt Channel0 7 Syntax public int PI_GetLPFilterEnable BYTE o_byLPFilterEnable Parameters o_byLPFilterEnable OUT The byte array of the low pass filter enable mask Return Value Error code 167 Document version 1 09 ICP DAS USB Class Members Public Methods Example Int ErrCode ICPDAS_USBIO m_usblO Byte o_byLPFilterEnable USBIO PI MAX CHANNEL 7 8 Int ildx m_usbIO new ICPDAS_USBIO if ERR_NO_ERR iErrCode m_usbIO OpenDevice USB2084 1 if ERR_NO_ERR ErrCode m_usblO PI_GetLPFilterEnable o_byLPFilterEnable printf d iErrCode else for ildx 0 ildx lt USBIO_PI MAX_CHANNEL 7 8 ildx printf 02x n o_byLPFilterEnable ildx 168 Document version 1 09 ICP DAS USB Class Members Public Methods 5 6 6 7 PI GetLPFilterWidth Pulse input function Get lo
33. DI ReadValue BYTE o_byDIValue Parameters o_byDIValue OUT The byte arrays of the DI value Return Value Error code 88 Document version 1 09 ICP DAS USB Class Members Public Methods Example Int ErrCode ICPDAS_USBIO m_usbIO BYTE o_byDIValue USBIO_DI MAX CHANNEL Int ildx Bool bRet true m_usbIO new ICPDAS_USBIO if ERR NO ERR iErrCode m_usbIO OpenDevice USB2051 1 if ERR_NO_ERR l iErrCode m_usbIO DI ReadValue o bvDiValue printf d iErrCode bRet false If bRet for ildx 0 ildx lt USBIO_DI MAX CHANNEL gt gt 3 ildx printf d n o_byDIValue ildx 89 Document version 1 09 ICP DAS USB Class Members Public Methods 5 6 3 5 DI ReadCounterValue Digital Input function Read DI Counter Value The counting value of the digital input counter in word array format Syntax public int DI ReadCounterValue WORD o_wDICntValue Parameters o_wDICntValue OUT The word arrays of the DI counter value Return Value Error code 90 Document version 1 09 ICP DAS USB Class Members Public Methods Example Int ErrCode ICPDAS USBIO m_usbIO WORD o wDICntValuejUSBIO DI MAX CHANNEL Int ildx Bool bRet true m_usbIO new ICPDAS USBIO if ERR NO ERR iErrCode m_usbIO OpenDevice USB2051 1 if ERR NO ERR l iErrCode m_usbIO DI ReadCounterValue o wDICntValue printf d Er
34. Device 56 Document version 1 09 ICP DAS USB Class Members Public Methods 5 6 1 3 SYNCDevice Send synchronization packet to I O module Note 1 The synchronization will be handled by library automatically after calling OpenDevice the synchronization will be closed after calling CloseDevice User can call this API to send synchronization packet manually and it will not stop the original synchronization Syntax public int SYNCDevice void Parameters none Return Value Error code Example Int ErrCode ICPDAS USBIO m usblO m_usbIO new ICPDAS USBIO if ERR_NO_ERR iErrCode m_usbIO OpenDevice USB2019 1 If ERR_NO_ERR iErrCode m_usblO SYNCDevice printf d iErrCode iErrCode m_usbIO CloseDevice 57 Document version 1 09 ICP DAS USB Class Members Public Methods 5 6 1 4 SetCommTimeout Set the communication timeout between packet send and receive Note 1 The timeout value will affect communication If the timeout is small it means the communication is timeout after the value passed Note 2 The default value when first initial an ICP DAS USBI O is 100ms Syntax public int SetCommTimeout DWORD i_dwCommTimeout Parameters i dCommTimeout IN The communication timeout in millisecond ms Return Value Error code Example Int ErrCode ICPDAS USBIO m usblO m usblO new ICPDAS USBIO if ERR NO ERR iErrCode m_usbIO SetCom
35. Int ErrCode ICPDAS USBIO m usblO DWORD o dwSoftWDTTimeout m usblO new ICPDAS_USBIO if ERR NO ERR iErrCode m_usbIO OpenDevice USB2019 1 if ERR NO ERR l iErrCode m usblO GetSoftWDTTimeout 80_dwSoftWDTTimeout printf d iErrCode else printf d n o_dwCommTimeout iErrCode m_usbIO CloseDevice 62 Document version 1 09 ICP DAS USB Class Members Public Methods 5 6 2 3 GetDevicelD Get ID of the device Syntax public int GetDevicelD DWORD o_dwDeviceID Parameters o_dwDeviceID OUT The device ID Return Value Error code Example Int iErrCode ICPDAS USBIO m_usbIO DWORD o dwDevicelD m usblO new ICPDAS USBIO if ERR NO ERR iErrCode m_usbIO OpenDevice USB2019 1 if ERR NO ERR l iErrCode m usblO GetDevicelD 80_dwDevicelD printf d ErrCode else printf d o_dwDevicelD iErrCode m_usbIO CloseDevice 63 Document version 1 09 ICP DAS USB Class Members Public Methods 5 6 2 4 GetFwVer Get firmware version of the device Syntax public int GetDevicelD WORD to wFwVer Parameters o_wFwVer OUT The firmware version Return Value Error code Example Int iErrCode ICPDAS USBIO m usblO WORD o_wFwVer m_usbIO new ICPDAS USBIO if ERR_NO_ERR iErrCode m_usbIO OpenDevice USB2019 1 if ERR_NO_ERR iErrCode m usblO GetFwVer amp o_wFwvVer printf d iErrC
36. NNEL Byte o_byAIChStatus USBIO_AI MAX CHANNEL Int ildx m_usbIO new ICPDAS USBIO if ERR NO ERR iErrCode m_usblO OpenDevice USB2019 1 if ERR NO ERR l iErrCode m usblO AI ReadValue o dwAlIValue o bvAIChStatus printf d iErrCode else For ildx 0 ildx lt USBIO AI MAX CHANNEL ildx printf Ox 08x 0x 02x1n o_dwAlValue ildx o bvAIChStatus 137 Document version 1 09 ICP DAS USB Class Members Public Methods 5 6 5 11 3 AI ReadValue float Analog input function Read the real AI value without channel status The reading value is calculated users no need to convert it to real value for current input type Ex The reading value is 1 316 in 2 5 2 5V the input signal is 1 316V Syntax public int AI ReadValue float o_fAlValue Parameters xo fAlValue OUT The true value of Al value Return Value Error code 138 Document version 1 09 ICP DAS USB Class Members Public Methods Example Int ErrCode ICPDAS_USBIO m_usblO float o_fAIValue USBIO_AI MAX CHANNEL Int ildx m_usbIO new ICPDAS_USBIO if ERR_NO_ERR iErrCode m_usbIO OpenDevice USB2019 1 if ERR_NO_ERR iErrCode m usblO AI ReadValue o fAlValue printf d iErrCode else For ildx 0 ildx lt USBIO AI MAX CHANNEL ildx printf 5f n 0 dwAlValuejildx 139 Document version 1 09 ICP DAS USB Class Members Public Methods
37. PI ClearSingleChCount BYTE i_byChToClr Parameters i_byChToClr IN The channel index for clearing Return Value Error code Example Int ErrCode ICPDAS USBIO m_usbIO m_usbIO new ICPDAS USBIO if ERR NO ERR iErrCode m_usbIO OpenDevice USB2084 1 if ERR NO ERR l iErrCode m usblO PI ClearSingleChCount 7 printf d ErrCode iErrCode m_usblO CloseDevice 184 Document version 1 09 ICP DAS USB Class Members Public Methods 5 6 6 15 PI_ClearChStatus Pulse input function Clear channel status with clear mask Each byte indicates 8 channels clear mask set for channel clear Ex Byte0 gt Channel0 7 Syntax public int PI ClearChStatus BYTE i_byClrMask Parameters i_byClrMask IN The byte array of channel status clear mask Return Value Error code Example Int iErrCode ICPDAS_USBIO m_usblO Byte m_byChCIrMask USBIO_PI MAX CHANNEL 7 8 Int ildx m_usbIO new ICPDAS_USBIO if ERR NO ERR iErrCode m_usbIO OpenDevice USB2084 1 For ildx 0 ildx lt USBIO PI MAX CHANNEL 7 8 ildx m_byChClrMasklildx 0x5A if ERR_NO_ERR l iErrCode m usblO PI ClearChStatus m bvChClrMask printf d iErrCode iErrCode m_usbIO CloseDevice 185 Document version 1 09 ICP DAS USB Class Members Public Methods 5 6 6 16 PI_ClearSingleChStatus Pulse input function Clear specific channel status Syntax public
38. SB I O Class Library USB Device Library Access I O Class ion OpenDevice I CloseDevice ICPDAS_USBIO m_USBIO Class ICPDAS_USBIO m_USBIO new ICPDAS_USBIO Initialization Dim m_USBIO As ICPDAS_USBIO Set m_USBIO New ICPDAS_USBIO 46 Document version 1 09 Operation Software structure C m_USBIO OpenDevice CH m_USBIO OpenDevice OpenDevice 4 VB Call m_USBIO OpenDevice Access I O y C m_USBIO AI ReadValue C m_USBIO AI_ReadValue VB Call m_USBIO AI ReadValue C m_USBIO CloseDevice CH m_USBIO CloseDevice CloseDevice lt VB Call m_USBIO CloseDevice 47 Document version 1 09 ICP DAS USB Class Members Table of Constructors 5 ICP DAS USB Class Members The members of the ICPDAS_USBIO class are divided into constructors static and public methods The constructors initialize and create the instance of the ICPDAS_USBIO Static methods are the ways to identify or scan what USB modules are connected Public methods are used to access USB modules The following tables list the members of ICPDAS_USBIO class The detail of these will be described in the following section 5 1 Table of Constructors Mame Description ICPDAS_USBIO Initializes a new instance of the ICPDAS_USBIO class 5 2 Table of Static Methods Name Description OO ListDevice List all devices connected with local PC ScanDevice Scan devices conne
39. SB15 16 Document version 1 09 Hardware Information Connector Pin Assignment 2 2 Connector Pin Assignment 2 2 1 USB 2019 j j Pin Assignment Name Pin Terminal e No Pin si Assignment Assignment CH 0 ES E s cre CHOE 03 15 CH 0 CE 16 CHi ne CH 1 04 2 05 17 CH 2 CH 2 oH _ 0 18 CH 3 CH 3 al bl bi 19 CH 4 CH 3 HS 08 20 CH 5 CH 4 CH 6 09 omnes 22 CH 7 CH 7 10 CH 5 23 N C CH6 N C 11 i 24 N C CH 6 N C 12 NC 13 25 N C CH 7 Shield F G CH 7 25 pin Female AGND D Sub Connector REND Analog input ground Analog input channel N positive reference Analog input channel N negative reference 2 2 2 USB 2045 Ext GND il Ext GND DOO 2 DO8 DO1 3 DO9 DO2 4 DO10 DO3 5 DO11 DO4 6 DO12 DOS 7 DO13 DO6 8 DO14 DO7 9 DO15 Ext PWR 10 Ext PWR The Digital Output for Channel N The Power Source Input Pin The Ground of Power Source Input Pin 17 Document version 1 09 Hardware Information Connector Pin Assignment 2 2 3 USB 2051 Ext GND il Ext GND DOO 2 DO8 DO1 3 DO9 DO2 4 DO10 DO3 El DO11 DO4 6 DO12 DOS 7 DO13 DO6 8 DO14 DO7 9 DO15 Ext PWR 10 20 Ext PWR DOM TheDigtalinuttorchamelN DI GND The Ground of Current Path of Dry Contact 2 2 4 USB 2055 DI1 DI3 DI4 DI5 DI6 DI7 DI COM STI Te Digitainputfor channel DI GND The Ground of Current Path of Dry Contact Bo osamu awWnN EM the common infor Contact
40. The detail of all items in this form will be introduced in this section Poll Interval 1000 Hide setting panel Show hex 2 Configuration Region 1 Monitor Region 3 Message Region e Polling Interval This value is the period to poll data to the USB I O module Note The valid value is 100 5000ms e Hide Setting Panel Hiding the I O configuration panel Show Hex Converting the I O value from decimal to hexadecimal e Monitor Region The 1 O related data and configurations will be listed here Users can select the channel to configure in the I O Monitor Region The setting of this selected channel will show in I O configuration region e Configuration Region 38 Document version 1 09 Installation Software All T O related configurations can be set in this region This region is divided into two parts channel and module related setting The channel related setting is in the Selected Channel The rest are module related settings E Set All All channels related setting will follow current selection m Type The ICP DAS USB series I O modules provide programmable input type for pulse input Users can set different type for each pulse input channel For more detail for type of pulse input modules please refer to Appendix A 3 m Clr Count Clear counter value for specified channel m Ch Isolated The USB 2084 has isolated and non isolated TTL inputs To switch different inp
41. TotalSupportType amount AI GetSupportTypeCode Analog input function Get supported type code AI GetTypeCode Analog input function Get type code AI GetChCJCOffset Analog input function Get channel CJC offset AI GetChEnable Analog input function Get channel enable disable AI GetFilterRejection Analog input function Get filter rejection AI GetCJCOffset Analog input function Get CJC offset Al_GetCJCEnable Analog input function Get CJC enable AI GetWireDetectEnable Analog input function Get wire detect enable AI GetResolution Analog input function Get resolution Analog input function Read Al value in double AI ReadValue word format Overload Analog input function Read bulk AI value Fast AI ReadBulkValue A L acquire functionalitv AI ReadCJCValue Analog input function Get CJC value Analog input function Set type code for specific AI SetTypeCode channel Overload 50 Document version 1 09 ICP DAS USB Class Members Table of Public Methods AI SetChCICOffset AI SetChEnable AI SetFilterRejection AI SetCJCOffset AI SetCJCEnable AI SetWireDetectEnable 5 3 6 Pulse Input Analog input function Set channel CJC offset for specific channel Overload Analog input function Set channel enable disable Analog input function Set filter rejection Analog input function Set CJC offset Analog input function Set CJC enable Analog input function Set wire detect enable CN pe
42. USB Class Members Constructors Overload PI SetLPFilterWidth Pulse input function Set low pass filter width Overload 5 3 7 Other Name E GetCurrentAccessObj INTERNAL USE DO NOT USE THIS METHOD SetNormalPktByteArray INTERNAL USE DO NOT USE THIS METHOD SetActivePktByteArray INTERNAL USE DO NOT USE THIS METHOD ClearActivePktBuffer INTERNAL USE DO NOT USE THIS METHOD GetActivePktByteArray INTERNAL USE DO NOT USE THIS METHOD SetNormalPktEvent INTERNAL USE DO NOT USE THIS METHOD IsDevMonitorThreadStop INTERNAL USE DO NOT USE THIS METHOD IsCommWithDevice INTERNAL USE DO NOT USE THIS METHOD GetLastCmdTime INTERNAL USE DO NOT USE THIS METHOD 5 4 Constructors 5 4 1 ICPDAS_USBIO Initialize a new instance of the ICPDAS_USBIO class Syntax public ICPDAS_USBIO void Example ICPDAS USBIO m usblO m_usbIO new ICPDAS USBIO 52 Document version 1 09 ICP DAS USB Class Members Static Methods 5 5 Static Methods 5 5 1 ListDevice List all devices connected to local PC Syntax public byte ListDevice WORD o_wDID BYTE o_byBID Parameters o_wDID OUT An array of device ID for all devices o byBID OUT An array of board ID for all devices Return Value Number of devices connected with PC Example BYTE byNumDevice byBIDs 127 WORD wDIDs 127 byNumDevice ICPDAS_USBIO ListDevice amp wDIDs amp byBIDs 53 Document version 1 09 ICP DAS USB Class Members Static M
43. USBIO_PI MAX CHANNEL Int ildx m_usbIO new ICPDAS USBIO if ERR NO ERR iErrCode m usblO OpenDevice USB208A 1 if ERR NO ERR l iErrCode m usblO PI ReadCntValue o dwCntValue o_byChStatus printf d iErrCode else for ildx 0 ildx lt USBIO PI MAX CHANNEL ildx printf d n o_dwCntValuelildx 174 Document version 1 09 ICP DAS USB Class Members Public Methods 5 6 6 10 PI ReadFreqValue Pulse input function Read the frequency value This method reads the all frequency value of channels NOTE If the channel is not in the type of frequency The value of the related channel of the o_dwCntValue will be 1 and the value of the related channels of o_byChStatus will indicate the type not support Syntax public int PI ReadValue float o_fFreqValue BYTE o_byChStatus Parameters o_fFreqValue OUT The float array of the PI channel frequency value o_byChStatus OUT The byte array of the channel status Return Value Error code 175 Document version 1 09 ICP DAS USB Class Members Public Methods Example Int ErrCode ICPDAS USBIO m_usbIO float o_fFreqValue USBIO_PI MAX CHANNEL BYTE o_byChStatus USBIO_PI MAX CHANNEL Int ildx m usblO new ICPDAS USBIO if ERR NO ERR iErrCode m usblO OpenDevice USB208A 1 if ERR NO ERR iErrCode m usblO PI ReadValue o fFreqValue o bvChStatus printf d iErrCode else
44. V 10V the value 0x0 indicates 10V and OxFFFF 16bit resolution indicates 10V Please note that when channel was not in good status the reading value no longer represents zero to full scale Different channel status follows the following rule Channel Over The reading value represents a sign value X indicates how many value over full scale range This value can be calculated by following formula Assume current type is 10V 10V with 16 bit resolution and reading value is 0X13E OxFFFF 0x13E then we can get the actual value Y is Y 1 x 10 10 10 Channel Under The reading value represents a sign value X indicates how many value under zero scale range This value can be calculated by following formula Assume current type is 5V 5V with 16 bit resolution and reading value is Ox53E 0X53E OxFFFF then we can get the actual value Y is Y 0 x S 5 5 Channel Open amp Channel Close The reading value of these two statuses will be the full scale for channel open and zero scale for channel close 136 Document version 1 09 ICP DAS USB Class Members Public Methods Syntax public int AI ReadValue DWORD o_dwAlValue BYTE o_byAIChStatus Parameters o_dWAlValue OUT The raw value of AI value o_byAIChStatus OUT The byte array of channel status Return Value Error code Example Int ErrCode ICPDAS_USBIO m_usbIO DWORD o_dwAlValue USBIO_AI MAX CHA
45. _GetSafetyEnable Digital Output function Get Safety Enable Each channel takes one bit Disable 0 Enable 1 Syntax public int DO_GetSafetyEnable BYTE o_bySafetyEnables Parameters o_bySafetyEnables OUT The safety enable mask Each bit of the mask represents the safety enable disable configuration of each channel Return Value Error code 99 Document version 1 09 ICP DAS USB Class Members Public Methods Example Int ErrCode ICPDAS USBIO m_usbIO Byte o bvSafetvEnablej USBIO DO MAX CHANNEL 7 8 Int ildx Bool bRet true m_usbIO new ICPDAS USBIO if ERR NO ERR iErrCode m_usbIO OpenDevice USB2064 1 if ERR NO ERR l iErrCode m_usbIO DO_GetSafetyEnable amp o_bySafetyEnables printf d iErrCode bRet false If bRet for ildx 0 ildx lt USBIO_DO_MAX_CHANNEL 7 8 ildx printf 02x n o_bySafetyEnables ildx 100 Document version 1 09 ICP DAS USB Class Members Public Methods 5 6 4 3 DO_GetSafetyValue Digital Output function Get Safety Value Each channel takes one bit Off 0 On 1 Syntax public int DO_GetSafetyValue BYTE o_bySafetyValue Parameters o_bySafetyValue OUT The safety value Each bit represents the safety value of each channel Return Value Error code 101 Document version 1 09 ICP DAS USB Class Members Public Methods Example Int ErrCode ICPDAS USBIO m_usbIO B
46. a 201 AS Pulse Input Type Code ie A 201 f t BT 201 PO DENG IX o o Ae 202 AN an tj o RE E S 202 V Document version 1 09 Introduction Overview 1 Introduction 1 1 Overview The ICP DAS USB series I O modules are highly flexible solution for data acquisition It provides easy USB plug and play operation and equips accurate measurement for all kinds of applications of automations Compared with the traditional PC based cards like PCI PC 104 and ISA cards users can achieve data acquisition easier and quicker via ICP DAS USB series I O modules Besides through ICP DAS USB I O utility users can configure and test modules directly and easily without any coding The friendly API library is also provided for users to develop own USB application 1 2 Feature e Maximum 10KS s sampling rate e Wide operating temperature range e RoHS compliant e USB 2 0 Full Speed compliant e Noexternal power supply Powered by USB e Plug and Play without driver installation e Lockable USB cable e Support firmware update via USB e Utility tool for module configuration and I O testing easily and quickly e PWR RUN ERR LED indicator e Built in dual watchdog hardware software Providing API Library VC VB BCB NET e Module supported for Win2000 XP and Win7 32 64 bit Document version 1 09 Introduction Applications 1 3 Applications e Building automation e Factory automation e Machine automation e Data acquisition and c
47. ail Mount sij DIN Rail Lock Board ID Rotary Switch 0 User defined Software Programmable l 15 Fixboard ID Normal Firmware Update Mode Switch INIT Firmware update mode RUN Normal mode 13 Document version 1 09 Hardware Information Module Overview 2 1 1 USB 2019 2 1 1 1 Body 119 9 Il i i oan Lam 2 1 1 2 CN 1824 The CN 1824 is a connector transfers DB 25 connector to 18 pin terminal block to help user to wire The dimension is shown as follow 42 4 83 3 81 2 Document version 1 09 Hardware Information Module Overview 2 1 2 USB 2045 amp USB 2051 amp USB 2055 amp USB 2060 77 5 is 110 105 0 99 0 107 0 oe Figure 2 1 Figure 2 2 The USB 2084 left and front side view 15 Document version 1 09 Hardware Information Module Overview 2 1 4 USB 2084 102 9 i 39 0 35 4 ro i U z Figure 2 3 Figure 2 4 The USB 2084 left and front side view 2 1 5 CA U
48. al Dimensions WxLxH 72mm x 123 mm x 35 mm Document version 1 09 Introduction Specifications 1 4 4 USB 2051 The USB 2051 is a full speed USB device with 16 digital input channels module The USB 2051 offers 16 channels for digital input catering for both dry and wet contact with an effective distance for dry contact of up to 500 meters All channels not only feature photocouple isolation but can also be used as 16 bit counters The USB 2051 has 16 LED indicators that can be used to monitor the status of the digital input channels 4 kV ESD protection and 3750 VDC intra module isolation are standard g RA Digital Input Channels 16 Type i Wet Contact Sink Source On Voltage Dry Contact Close to GND Level Wet Contact 10 VDC 50 VDC Off Voltage Dry Contact Open Level Wet Contact 4 VDC Max HANA TADA li a 500 meters Max Input Impedance 10 KO Overvoltage Protection 70 VDC Max Count 65535 16 bit Max Input Counter Frequency dacia Min Pulse Width Power Power Consumption 1 03 W max Mechanical Dimensions WxLxH 72 mm x 123 mm x 35 mm Document version 1 09 Introduction Specifications 1 4 5 USB 2055 The USB 2055 is a full speed USB device with 8 digital input and digital output channels module The USB 2055 offers 8 isolated channels for digital input and 8 isolated channels for digital output Either sink type or source type digital input can be
49. arameters i_dwCntClrMask IN The counter clear mask Return Value Error code Example Int ErrCode ICPDAS USBIO m usblO m_usbIO new ICPDAS USBIO if ERR NO ERR iErrCode m_usblO OpenDevice USB2051 1 if ERR NO ERR iErrCode m usblIO DI WriteClearCounters OxOOOOFFFF printf d iErrCode m_usbIO CloseDevice 96 Document version 1 09 ICP DAS USB Class Members Public Methods 5 6 4 Digital Output 5 6 4 1 DO_GetPowerOnEnable Digital Output function Get Power On Enable Disable amp Off 0 Enable amp On 1 Syntax public int DO_GetPowerOnEnable BYTE o_byPowerOnEnable Parameters o_byPowerOnEnable OUT The power on enable mask Each byte represents the power on enable disable configuration of each channel Return Value Error code 97 Document version 1 09 ICP DAS USB Class Members Public Methods Example Int ErrCode ICPDAS USBIO m_usbIO Byte o bvPowerOnEnablejUSBIO DO MAX CHANNEL Int ildx Bool bRet true m usblO new ICPDAS USBIO if ERR NO ERR iErrCode m_usbIO OpenDevice USB2064 1 if ERR NO ERR l iErrCode m_usbIO DO GetPowerOnEnable 80_byPowerOnEnable printf d iErrCode bRet false If bRet for ildx 0 ildx lt USBIO_DO_MAX_CHANNEL ildx printf 02x n 0 bvPowerOnEnablejildx 98 Document version 1 09 ICP DAS USB Class Members Public Methods 5 6 4 2 DO
50. are Update serale lee A 25 ZA 3 USB 201 lea AN 26 244 AD SB OG 5 proel A 26 A licia BN he ESSE a eet 27 A eri 27 DATA O tt ar te A 27 2 46 USB 206f a da es id a at 28 DAD US De Ka 29 2S LED ironia a nota a f crea di iO 30 2 5 1 Normal Operation dad 30 2 5 2 Firmware eL renee nae 30 A a e ee a A RE A ate ata 31 JL ta b anubias 31 3 1 1 Connecting to ICP DAS USB series I O MOduUle 31 SIETE E E O lai ata 31 A A 32 3 2 2 ICP DAS USB I O Software Integration luca 42 A A A neato i ina 44 A Ope rat A O A A iii 45 EA AA A ie 45 ES ll iii a ma Tu 45 D ICPDAS 5USB ClassiMemb rs oleole lolita 48 5 Table or CORSO lilla 48 52Jable of Static Methods aca 48 5 3 Tabl of P bli Methods sidi A 48 Do System UN 48 iro Wa Bi Av o vn ele 49 A SO koda ako dk E A Paid 49 IV Document version 1 09 Content Overview 5 3 4 Digital A E 50 A Sire A A A 50 SAER ABNA Uno a 51 IO As 52 E O A pasa 52 BA LEPDAS USO a a aka als 52 5 5 otati amp oMetliods O e i as Br eta tatu 2 53 SOL LISTDEVI E o o LA aii o Ok 53 5 5 2 CANE A aa 54 50 PUBIJEMETNOdS a gena ad 55 SOL Syste Ren o o m ej o vj 55 5 B2 DINIE A A RR E IR EE E E CRI 61 5 6 3 Di ta piani o 82 SA een E oni ne nner sasa 97 56 5 Analog IDU fis ius ebel Sa i E ERA EREA 119 56 6 Pulse Trib sen fi th a aga 15 7 G Iroublesnoo Nigeria 199 o e nec ON tart 200 A 1 Analog Input Type Code iaa 200 A 2 Analog Output Type Codey iia dad
51. channels can be used as 16 bit counters In addition the digital input channels can be selected either as sink or source type via wire connections The USB 2060 also provides 12 LED indicators that can be used to monitor the status of the digital input and relay output There are also options for configuring power on and safe values 4 kV ESD protection and 3750 VDC intra module isolation are also provided to enhance noise protection capabilities in industrial environments Digital Input Channels 6 Dry Contact Source Type Wet Contact Sink Source On Voltage Dry Contact Level Off Voltage Level Wet Contact Dry Contact Wet Contact Effective Distance For Dry Contact Input Impedance Overvoltage Protection Max Count Max Input Counter Frequency Min Pulse Width Relay Output Close to GND 10 VDC 50 VDC Open 4 VDC Max 500 meters Max 10 KQ 70 VDC 65535 16 bit 500 Hz 1 ms Channels Output Type 6 Form A SPST NO Contact Rating SA 30Vpc Resistive Load AC 5A 250Vac 47 63HZ Operate Time Release Time Document version 1 09 10ms max 5ms max Introduction Specifications Insulation Resistance 1 000 MQ at 500Vpc Between Open 1000V ac 1 min Dielectric Contact Strength Between Coil and 3000Vac 1 min Contact Mechanical 2x10 ops Endurance 5 Electrical 1x 10 ops Power on Value Yes Safe Value Yes Power P
52. cted with local PC 5 3 Table of Public Methods 5 3 1 System Name fpeseripion OOO OpenDevice List all devices connected with local PC CloseDevice Scan devices connected with local PC Sn Send a synchronization packet to clear software WDT SetCommTimeout Set communication timeout GetCommTimeout Get communication timeout SetAutoResetWDT Enable disable automatic reset of the WDT 48 Document version 1 09 ICP DAS USB Class Members Table of Public Methods 5 3 2 Device Mame Description O RefreshDevicelnfo Refresh device information GetSoftWDTTimeout Get software WDT timeout GetDeviceID Get ID of the device GetFwVer Get firmware version of the device GetDeviceNickName Get nick name of the device GetDeviceSN Get serial number of the device GetSupportIOMask Get the mask of this device IO distribution GetDITotal Get DI total channel of the device GetDOTotal Get DO total channel of the device GetAlTotal Get Al total channel of the device GetAOTotal Get AO total channel of the device GetPITotal Get PI total channel of the device GetPOTotal Get PO total channel of the device SetUserDefinedBoardID Set board ID of this device SetDeviceNickName Set nick name of this device SetSoftWDTTimeout Set software WDT timeout LoadDefault Load default setting StopBulk Stop current bulk process Register the callback function for emergency event RegisterEmergencyPktEventHandle sent from USBIO 5 3 3 Digital Input
53. device An error was made to scan device The packet size is invalid An error occurs while writing packet to module The communication between computer and device has been timeout The device has been opened by class library The device has not opened for operating The data returned by device is invalid 203 Appendix B B 1 Error Codes ERR_USBIO_IO_NOTSUPPORT 0x00010104 65796 ERR_USBIO_PARA_ERROR 0x00010105 65797 ERR_USBIO_BULKVALUE_ERR 0x00010106 65798 The method is not supported The parameter of method is invalid An error occurs while getting bulk value ERR_USBIO_GETDEVINFO An error occur while getting device information 0x00010107 65799 while device opening procedure 204 Document version 1 09
54. dth WORD i_wLPFilterWidths 196 Document version 1 09 ICP DAS USB Class Members Public Methods 5 6 6 20 1 PI_SetLPFilterEnable BYTE WORD Pulse input function Set low pass filter width Syntax public int PI_SetLPFilterWidth BYTE i byChToSet BOOL i_wLPFilterWidth Parameters i byChToSet IN The specific channel to set i_wLPFilterWidth IN The low pass filter width uS Return Value Error code Example Int ErrCode ICPDAS_USBIO m_usbIO m_usbIO new ICPDAS_USBIO if ERR NO ERR iErrCode m_usbIO OpenDevice USB2084 1 if ERR NO ERR iErrCode m usblO PI SetLPFilterWidth 5 10000 printf d ErrCode iErrCode m_usbIO CloseDevice 197 Document version 1 09 ICP DAS USB Class Members Public Methods 5 6 6 20 2 PI_SetLPFilterEnable BYTE Pulse input function Set low pass filter enable to all channel Syntax public int PI_SetLPFilterEnable BYTE i_byLPFilterEnable Parameters i_byLPFilterEnable IN The byte array of low pass filter enable mask Return Value Error code Example Int iErrCode ICPDAS USBIO m_usbIO Byte m bvLPFilterWidthIUSBIO PI MAX CHANNEL Int ildx m_usbIO new ICPDAS USBIO if ERR NO ERR iErrCode m_usbIO OpenDevice USB2084 1 For ildx 0 ildx lt USBIO PI MAX CHANNEL ildx m_byLPFilterEnable ildx 20000 if ERR_NO_ERR l iErrCode m_usbIO PI_SetLPFilterWidth m_byLPFilterWidth prin
55. dule related settings m Set All All channels related setting will follow current selection m Type The ICP DAS USB series I O modules provide programmable input type for analog input Users can set different type for each analog input channel For more detail for type of analog input modules please refer to Appendix A 1 m Channel Enable Enable Disable channel m Channel CJC Offset Setting the CJC offset for the specific channel The behavior of the setting is the same as the CJC Offset but it only affects specific channel Note The CJC offset can be any in the range of 40 96 to 40 95 C m Filter Rejection In order to remove the noise from the power supply some analog input modules feature build in noise filter Two filters 50Hz and 60Hz are provided to remove noise generated from power source m Wire Detection Enable Disable the open wire detection for thermocouple and 4 20 mA m CJC Enable Enable Disable the CJC Cold Junction Compensation m CIC Offset Setting the CJC offset value for all Al channels The offset value is used to add or subtract the reading value Changing of this value will not affect calibration but will affect the reading value of temperature type Note The CJC offset can be any in the range of 40 96 to 40 95 C 37 Document version 1 09 Installation Software 3 2 1 4 Pulse Input In the I O page of the PI the real time value and module configuration can be read or written in this page
56. e 0x50 Up counter 0x51 Frequency 0x52 Counter with battery backup 0x53 Encoder 0x54 Up Down counter 0x55 Pulse Direction counter 0x56 AB phase A 4 Channel Status 0x00 Good 0x01 Over Range Overflow 0x02 Under Range Underflow 0x03 Open 0x04 Close 0x05 Type Not Supported 201 Document version 1 09 Appendix B B 1 Error Codes Appendix B B 1 Error Codes The error codes are divided into three parts device DEV library and IO library Each part means different error code returned by device DEV library and IO library The error codes are described in the table ERR_NO_ERR 0x00000000 0 ERR_DEV_ILLEGAL_FUNC 0x00000001 1 ERR_ DEV_ILLEGAL_INDEX 0x00000002 2 ERR_DEV_ILLEGAL_LENGTH 0x00000003 3 ERR_DEV_ILLEGAL_PARAMETER 0x00000004 4 ERR_DEV_ILLEGAL_MAPTABSIZE 0x00000005 5 ERR_DEV_ILLEGAL_MAPTABINDEX 0x00000006 6 ERR_DEV_READONLY 0x00000007 7 ERR_ DEV_WRITEONLY 0x00000008 8 ERR_ DEV_BUFFERFULL 0x00000009 9 ERR_ DEV_LTTIMEOUT 0x0000000A 10 ERR_ DEV_LTMODEFAIL 0x0000000B 11 ERR_ DEV_LTPKGLOST Document version 1 09 The operation completed successfully The function is invalid The index is invalid The length is invalid The parameter is invalid The size of mapping table is invalid The index in mapping table is invalid The index is read only The index is written only The buffer in transceiver is full The operation of large transfer has timeout The
57. e The class library provides 4 overload methods to read AI value Two methods the parameter in float format will convert raw value to true inside the method Others will return raw value without having conversion The overview of these methods is as following table and will describe in the following section Name of Methods AI ReadValue DWORD o_dwAlValue AI ReadValue DWORD o_dwAlValue BYTE o_byAIChStatus AI ReadValue float o_fAlValue AI ReadValue float o_fAlValue BYTE o_byAIChStatus 133 Document version 1 09 ICP DAS USB Class Members Public Methods 5 6 5 11 1 AI ReadValue DWORD Analog input function Read Al value in double word digital format In the digital format the value represents the value from zero to full scale Ex For type 10V 10V the value 0x0 indicates 10V and OxFFFF 16bit resolution indicates 10V Please note that when channel was not in good status the reading value no longer represents zero to full scale Different channel status follows the following rule Channel Over The reading value represents a sign value X indicates how many value over full scale range This value can be calculated by following formula Assume current type is 10V 10V with 16 bit resolution and reading value is 0X13E OxFFFF 0x13E then we can get the actual value Y is Y 1 x 10 10 10 Channel Under The reading value represents a sign value X indicates h
58. e Int ErrCode ICPDAS_USBIO m_usblO Byte m_byChTypeCode USBIO_PI_MAX_CHANNEL Int ildx m_usbIO new ICPDAS USBIO if ERR NO ERR iErrCode m_usbIO OpenDevice USB2084 1 For ildx 0 ildx lt USBIO PI MAX CHANNEL ildx m_byChTypeCodelildx 0x50 if ERR_NO_ERR l iErrCode m_usbIO PI_SetTypeCode m_byChTypeCode printf d ErrCode iErrCode m_usblO CloseDevice 182 Document version 1 09 ICP DAS USB Class Members Public Methods 5 6 6 13 PI_ClearChCount Pulse input function Clear channel count with clear mask Each byte indicates 8 channels clear mask set for channel clear Ex Byte0 gt Channel0 7 Syntax public int PI ClearChCount BYTE i_byClrMask Parameters i_byClrMask IN The byte array of channel count clear mask Return Value Error code Example Int iErrCode ICPDAS_USBIO m_usblO Byte m_byChClrMask USBIO_PI MAX CHANNEL 7 8 Int ildx m_usbIO new ICPDAS_USBIO if ERR NO ERR iErrCode m_usbIO OpenDevice USB2084 1 For ildx 0 ildx lt USBIO PI MAX CHANNEL 7 8 ildx m_byChClrMasklildx 0x5A if ERR_NO_ERR l iErrCode m usblO PI ClearChCount m bvChClrMask printf d iErrCode iErrCode m_usbIO CloseDevice 183 Document version 1 09 ICP DAS USB Class Members Public Methods 5 6 6 14 PI ClearSingleChCount Pulse input function Clear specific channel count Syntax public int
59. efer to user s manual for analog input type code These two overload methods are listed as following table and described in following section The corresponding type code can be found in Appendix A 1 Name of Methods AI SetTypeCode BYTE i_byChToSet BYTE i_byTypeCode AI SetTypeCode BYTE i_byTypeCodes 146 Document version 1 09 ICP DAS USB Class Members Public Methods 5 6 5 14 1 AI SetTypeCode BYTE BYTE Analog input function Set type code for specific channel The type code can reference to Appendix A 1 Syntax public int AI SetTypeCode BYTE i byChToSet BYTE i_byTypeCode Parameters i_byChToSet IN The specific channel to set i_byTypeCode IN The type code for the specific channel Return Value Error code Example Int ErrCode ICPDAS_USBIO m_usbIO m_usbIO new ICPDAS_USBIO if ERR NO ERR iErrCode m_usbIO OpenDevice USB2019 1 if ERR_NO_ERR iErrCode m_usbIO AI SetTypeCode 0 0x10 printf d iErrCode iErrCode m_usbIO CloseDevice 147 Document version 1 09 ICP DAS USB Class Members Public Methods 5 6 5 14 2 Al_SetTypeCode BYTE Analog input function Set type code for all channels The type code can reference to Appendix A 1 Syntax public int AI SetTypeCode BYTE i_byTypeCodes Parameters i_byTypeCodes IN The byte array of type code to set Return Value Error code Example Int ErrCode ICPDAS USBIO m_usblO
60. el for 100ms in 5 KHz sample rate each channel in non block operation So we have the following variable declaration define SampleRate 5000 define BufferWidth 500 5000 Hz 0 1 100ms DWORD m_dwBuffer 2 BufferWidth Void BulkFinishCallback DWORD dwCount Callback function to handle data Int main m_usbIO new ICPDAS_USBIO if ERR_NO_ERR iErrCode m_usbIO OpenDevice USB2019 1 if ERR NO ERR iErrCode m_usbIO AI ReadBulkValue 0 2 100 SampleRate BufferWidth m_dwBuffer BulkFinishCallback printf d ErrCode while 1 Sleep 1 144 Document version 1 09 ICP DAS USB Class Members Public Methods 5 6 5 13 AI ReadCJCValue Analog input function Read the current CJC value on the module Syntax public int AI ReadCJCValue float o_fCJCValue Parameters o_fCJCValue OUT The CJC value Return Value Error code Example Int iErrCode ICPDAS USBIO m usblO float o_fCJCValue Int ildx m_usbIO new ICPDAS USBIO if ERR NO ERR iErrCode m_usbIO OpenDevice USB2019 1 if ERR NO ERR iErrCode m usblO AI ReadCJCValue o_fCJCValue printf d iErrCode else printf 96 5An o_fCJCValue 145 Document version 1 09 ICP DAS USB Class Members Public Methods 5 6 5 14 AI SetTypeCode The class has two overload methods for setting type code One provides specifying channel to set another for all channel Please r
61. ersion 1 09 ICP DAS USB Class Members Public Methods 5 6 2 7 GetSupportIOMask Get the mask of this device IO distribution Each bit of the mask indicates each supported IO type as shown in the following table N A N A PI PO VATI FAQ D This mask can help you to identify what types of IO are supported in the device Syntax public int GetSupportIOMask BYTE o_bySupportIOMask Parameters o_bySupportIOMask OUT The support IO mask of the device Return Value Error code 67 Document version 1 09 ICP DAS USB Class Members Public Methods Example Int ErrCode ICPDAS USBIO m_usbIO Byte o_bySupportIOMask m_usbIO new ICPDAS USBIO if ERR NO ERR iErrCode m_usbIO OpenDevice USB2019 1 if ERR NO ERR l iErrCode m usblO GetSupportIOMask amp o_bySupportIOMask printf d iErrCode else printf Ox 02x 0 bvSupportlOMask iErrCode m_usblO CloseDevice 68 Document version 1 09 ICP DAS USB Class Members Public Methods 5 6 2 8 GetDITotal Get DI total number of channels of the device Syntax public int GetDITotal BYTE o_byDITotal Parameters o_byDITotal OUT The DI total number of channels Return Value Error code Example Int iErrCode ICPDAS USBIO m usblO Byte o_byDITotal m_usbIO new ICPDAS_USBIO if ERR_NO_ERR iErrCode m_usbIO OpenDevice USB20xx 1 if ERR NO ERR l iErrCode m usblO GetDITotal amp o_byDITotal
62. ethods 5 5 2 ScanDevice Scanning device connected to PC This static method just refreshes the list of the ICP DAS USB series I O modules it is necessary to call ListDevice to refresh new list Syntax public int ScanDevice void Parameters none Return Value Error code Example ICPDAS_USBIO ScanDevice 54 Document version 1 09 ICP DAS USB Class Members Public Methods 5 6 Public Methods 5 6 1 System 5 6 1 1 OpenDevice Open USBIO with device ID and board ID The device ID is defined by the header ICPDAS_USBIO h or the enumeration in ICPDAS_USBIO Syntax public int OpenDevice WORD i wUSBIO DID BYTE i bvUSBIO BID Parameters i wUSBIO DID IN Device ID for the specific device to open Defined in ICPDAS USBIO h i bvUSBIO BID IN Board ID for the specific device to open Return Value Error code Example Int ErrCode ICPDAS_USBIO m_usbIO m_usbIO new ICPDAS_USBIO iErrCode m_usbIO OpenDevice USB2019 1 iErrCode m_usblO CloseDevice 55 Document version 1 09 ICP DAS USB Class Members Public Methods 5 6 1 2 CloseDevice Close device and release resource Syntax public int CloseDevice void Parameters none Return Value Error code Example Int ErrCode ICPDAS USBIO m_usbIO m_usbIO new ICPDAS USBIO if ERR NO ERR iErrCode m usblO OpenDevice USB2019 1 Some code accessing USB I O iErrCode m_usbIO Close
63. he input signal will be filtered The time chart is shown as follow Input Signal Filter Sample we T Filtered Signal Counter will not operate b If the high width of the input signal is grater then T the counter will operate The time chart is shown as follow Input Signal m TL o Filter Sample fe RO Filtered Signal m Counter operate 41 Document version 1 09 Installation Software 3 2 2 ICP DAS USB I O Software Integration The USB I O libraries are the way to access ICP DAS USB series I O modules It supports various IDE like C VB NET VB VC BCB Users can choose any IDE you familiar with Before starting up project you need to do some configuration to integrate the SDK into your IDE The following section will indicate you how to integrate the SDK into your IDE 3 2 2 1 NET slaga Add Reference Add Web Reference System Data System Deployment 43 System Drawing 3 System Windows Forms 3 System Xml amp E Forml cs ci Program cs Add Reference NET COM Projects Browse Recent Filtered to NET Framework 2 0 Component Name Version Runtime Path f ien MT Accessibility DO v2 0 50727 CAWINDOWSMicroso oq Solution WindowsFormsApplicetion AspNetMMCExt 00 v2 0 50727 CAWINDOWS Mierosof E WindowsFormsApplication escompmed 0 04 v2 0 50727 CAWINDOWS Microsof H Sa Properties End AZIZ o f E B References te 00
64. hods DO_WriteValue BYTE i_byChannel BYTE i_byValue DO_WriteValue BYTE i_byDOValue 114 Document version 1 09 ICP DAS USB Class Members Public Methods 5 6 4 8 1 DO_WriteValue BYTE BYTE Digital Output function Write DO Value to specific channel The value of the digital output is shown below Off 0 On 1 Syntax public int DO_WriteValue BYTE i_byChannel BYTE i_byValue Parameters i bvChannel IN The specific DO channel to be set i_byValue IN The DO on off bit Return Value Error code Document version 1 09 ICP DAS USB Class Members Public Methods Example Int ErrCode ICPDAS_USBIO m_usbIO Int ildx Bool bRet true m_usbIO new ICPDAS_USBIO if ERR_NO_ERR iErrCode m_usbIO OpenDevice USB2064 1 if ERR_NO_ERR iErrCode m_usbIO DO_WriteValue 5 1 printf d iErrCode m_usbIO CloseDevice 116 Document version 1 09 ICP DAS USB Class Members Public Methods 5 6 4 8 2 DO WriteValue BYTE Digital Output function Write DO Value Each bit represents channel value The value of the digital output is shown below Syntax public int DO_WriteValue BYTE i_byDOValue Parameters xi bvDOValue IN The DO value Each bit represents the digital output value of each channel Return Value Error code Document version 1 09 ICP DAS USB Class Members Public Methods Example Int ErrCode ICPDAS USBIO m_usbIO Bvte
65. i bvDOValue USBIO DO MAX CHANNEL 7 8 Int ildx Bool bRet true m_usbIO new ICPDAS_USBIO if ERR NO ERR iErrCode m_usbIO OpenDevice USB2064 1 memset i_byDOValue OxFF USBIO_DO_MAX_CHANNEL 7 8 if ERR_NO_ERR iErrCode m_usbIO DO_WriteValue i_byDOValue printf d iErrCode m_usbIO CloseDevice 118 Document version 1 09 ICP DAS USB Class Members Public Methods 5 6 5 Analog Input 5 6 5 1 AI GetTotalSupportType Analog input function Get total supported amount Syntax public int AI GetTotalSupportType BYTE o_byTotalSupportType Parameters o_byTotalSupportType OUT The number of total support type Return Value Error code 119 Document version 1 09 ICP DAS USB Class Members Public Methods Example Int ErrCode ICPDAS_USBIO m usblO Byte o bvTotalSupportTvpe Byte o bvSupportTvpeCodejUSBIO MAX SUPPORT TVPEJ Int ildx Bool bRet true m_usbIO new ICPDAS_USBIO if ERR_NO_ERR iErrCode m_usbIO OpenDevice USB2019 1 if ERR_NO_ERR iErrCode m usblO AI GetTotalSupportType amp o_ byTotalSupportType printf d ErrCode bRet false if ERR_NO_ERR iErrCode m_usbIO AI GetSupportTypeCode o bySupportTypeCode printf d iErrCode bRet false If bRet printf d n o_byTotalSupportType for ildx 0 ildx lt o_byTotalSupportType ildx printf 02x n o_bySupportTy
66. if ERR NO ERR iErrCode m_usbIO OpenDevice USB2084 1 if ERR NO ERR l iErrCode m usblO PI SetTriggerMode Q 0x1 printf d ErrCode iErrCode m usblO CloseDevicel 188 Document version 1 09 ICP DAS USB Class Members Public Methods 5 6 6 17 2 PI_SetTriggerMode BYTE Pulse input function Set trigger mode to all channel Syntax public int PI SetTriggerMode BYTE i_byTriggerMode Parameters i_byTriggerMode IN The byte array of trigger mode to set Return Value Error code Example Int iErrCode ICPDAS USBIO m usblO Byte m bvChTriggerModejUSBIO PI MAX CHANNELI Int ildx m usblO new ICPDAS USBIO if ERR NO ERR iErrCode m_usbIO OpenDevice USB2084 1 For ildx 0 ildx lt USBIO PI MAX CHANNEL ildx m bvChTriggerModejildx 0x2 if ERR NO ERR l iErrCode m usblO PI SetTriggerMode m bvChTriggerMode printf d iErrCode iErrCode m_usbIO CloseDevice 189 Document version 1 09 ICP DAS USB Class Members Public Methods 5 6 6 18 PI SetChisolatedFlag The class has two overload methods for setting channel isolated flag One provides specifving channel to set the other for all channels Set 1 for setting channel to isolated The parameter of the method for all channels is constructed in bvte arrav for all channel isolated flag ex Byte0 gt Channel0 7 These two overload methods are listed as following table and described i
67. int PI ClearSingleChStatus BYTE i_byChToClr Parameters i_byChToClr IN The channel index for clearing Return Value Error code Example Int ErrCode ICPDAS USBIO m_usbIO m_usbIO new ICPDAS USBIO if ERR NO ERR iErrCode m_usbIO OpenDevice USB2084 1 if ERR NO ERR l iErrCode m usblO PI ClearSingleChStatus 7 printf d ErrCode iErrCode m_usblO CloseDevice 186 Document version 1 09 ICP DAS USB Class Members Public Methods 5 6 6 17 PI_SetTriggerMode The class has two overload methods for setting trigger mode One provides specifying channel to set another for all channels The trigger mode is shown as following table Falling edge 0 Rising edge 1 Both edge 2 amp 3 These two overload methods are listed as following table and described in following section Name of Methods PI_SetTriggerMode BYTE i_byChToSet BYTE i_byTypeCode PI_SetTriggerMode BYTE i_byTypeCodes 187 Document version 1 09 ICP DAS USB Class Members Public Methods 5 6 6 17 1 PI SetTriggerMode BYTE BYTE Pulse input function Set trigger mode to specific channel Syntax public int PI SetTriggerMode BYTE i byChToSet BYTE i_byTriggerMode Parameters i byChToSet IN The specific channel to set i_byTriggerMode IN The type code for the specific channel Return Value Error code Example Int iErrCode ICPDAS_USBIO m usblO m_usbIO new ICPDAS USBIO
68. le Int ErrCode ICPDAS_USBIO m_usbIO DWORD o_dwlnverse Int ildx Bool bRet true m_usbIO new ICPDAS_USBIO if ERR NO ERR iErrCode m_usbIO OpenDevice USB2051 1 if ERR_NO_ERR iErrCode m_usbIO DI GetDigitalValuelnverse amp o_dwInverse printf d iErrCode bRet false If bRet printf d n o_dwinverse 85 Document version 1 09 ICP DAS USB Class Members Public Methods 5 6 3 3 DI_GetCntEdgeTrigger Digital input function Get DI Counter Edge Trigger This edge trigger is used for the counting operation of the counter Falling 0 Rising 1 Syntax public int DI GetCntEdgeTrigger DWORD o_dwEdgeTrig Parameters o_dwEdgeTrig OUT The counter edge trigger setting Return Value Error code 86 Document version 1 09 ICP DAS USB Class Members Public Methods Example Int ErrCode ICPDAS_USBIO m usblO DWORD o dwEdgerrig Int ildx Bool bRet true m usblO new ICPDAS USBIO if ERR NO ERR iErrCode m_usbIO OpenDevice USB2051 1 if ERR NO ERR l iErrCode m_usbIO DI GetCntEdgeTrigger amp o_dwEdgeTrig printf d iErrCode bRet false If bRet printf d n o_dwEdgeTrig 87 Document version 1 09 ICP DAS USB Class Members Public Methods 5 6 3 4 DI ReadValue Digital Input function Read DI Value The values of digital input channels in byte array format Syntax public int
69. mTimeout 1000 printf d iErrCode 58 Document version 1 09 ICP DAS USB Class Members Public Methods 5 6 1 5 GetCommTimeout Get the communication timeout between packet send and receive Note 1 The timeout value will affect communication If the timeout is small it means the communication is timeout after the value passed Note 2 The default value when first initial an ICP DAS USBI O is 100ms Syntax public int GetCommTimeout DWORD o_dwCommTimeout Parameters o_dCommTimeout OUT The communication timeout in millisecond ms Return Value Error code Example Int ErrCode ICPDAS USBIO m_usbIO DWORD o_dwCommTimeout m_usbIO new ICPDAS_USBIO if ERR NO ERR iErrCode m_usbIO SetCommTimeout 1000 if ERR_NO_ERR iErrCode m_usbIO GetCommTimeout amp o_dwCommTimeout printf d iErrCode else printf d n o_dwCommTimeout 59 Document version 1 09 ICP DAS USB Class Members Public Methods 5 6 1 6 SetAutoResetWDT Enable disable the handle of watchdog by library The library takes care of the watchdog automatically when first loaded This advantage brings an easy way to access with USB modules But in other side sometimes users want to handle watchdog themselves This API offers this functionality to disable the library to automatically handle watchdog NOTE1 The library will return to automatic when open device This means users have to
70. n following section Name of Methods PI SetChisolatedFlag BYTE i_byChToSet BOOL i_bChlsolatedFlag PI SetChisolatedFlag BYTE i_byChIsolatedFlags 190 Document version 1 09 ICP DAS USB Class Members Public Methods 5 6 6 18 1 PI SetChIsolatedFlag BYTE BOOL Pulse input function Set channel isolated flag Syntax public int PI SetChisolatedFlag BYTE i_byChToSet BOOL i_bChlsolatedFlag Parameters i_byChToSet IN The specific channel to set i bChIsolatedFlag IN The isolated flag for the specific channel Return Value Error code Example Int ErrCode ICPDAS_USBIO m_usbIO m_usbIO new ICPDAS_USBIO if ERR NO ERR iErrCode m_usbIO OpenDevice USB2084 1 if ERR NO ERR iErrCode m usblO PI SetChisolatedFlag 5 0x1 printf d ErrCode iErrCode m usblO CloseDevicel 191 Document version 1 09 ICP DAS USB Class Members Public Methods 5 6 6 18 2 PI SetChisolatedFlag BYTE Pulse input function Set channel isolated flag to all channels Syntax public int PI SetChisolatedFlag BYTE i_byChIsolatedFlags Parameters Xi bvChisolatedFlags IN The byte arrays of channel isolated flag Return Value Error code Example Int ErrCode ICPDAS USBIO m_usbIO Byte m bvChisolatedFlagsI USBIO PI MAX CHANNEL 7 8 Int ildx m_usbIO new ICPDAS USBIO if ERR NO ERR iErrCode m_usbIO OpenDevice USB2084 1 For ildx 0
71. nalog input function Get wire detect enable Disable 0 Enable 1 Syntax public int AI GetWireDetectEnable BYTE o_byWireDetectEnable Parameters o_byWireDetectEnable OUT The wire detect enable Return Value Error code Example Int iErrCode ICPDAS USBIO m usblO Bvte o bvWireDetectEnable m_usbIO new ICPDAS USBIO if ERR NO ERR iErrCode m_usbIO OpenDevice USB2019 1 if ERR NO ERR l iErrCode m_usbIO AI GetWireDetectEnable amp o_byWireDetectEnable printf d ErrCode else printf d n o_byWireDetectEnable 131 Document version 1 09 ICP DAS USB Class Members Public Methods 5 6 5 10 AI GetResolution Analog input function Get resolution Each byte indicates each channel real resolution Syntax public int AI GetResolution BYTE o_byResolution Parameters o_byResolution OUT The byte array of resolution for each channel Return Value Error code Example Int iErrCode ICPDAS USBIO m usblO Byte o bvResolutionjUSBIO AI MAX CHANNEL Int ildx m_usbIO new ICPDAS USBIO if ERR NO ERR iErrCode m_usbIO OpenDevice USB2019 1 if ERR NO ERR l iErrCode m usblO AI GetResolution o bvResolution printf d ErrCode else For ildx 0 ildx lt USBIO AI MAX CHANNEL ildx printf d n o bvResolutioniildx 132 Document version 1 09 ICP DAS USB Class Members Public Methods 5 6 5 11 AI ReadValu
72. ntax public int DO_SetPowerOnEnable BYTE i_byPowerOnEnables Parameters xi bvPowerOnEnables IN The byte array of the power on enable Return Value Error code 108 Document version 1 09 ICP DAS USB Class Members Public Methods Example Int ErrCode ICPDAS_USBIO m usblO Byte i bvChPwrOnjUSBIO DO MAX CHANNEL Int ildx m usblO new ICPDAS USBIO if ERR_NO_ERR iErrCode m_usbIO OpenDevice USB2064 1 For ildx 0 ildx lt USBIO DO MAX CHANNEL ildx i bvChPwroOnjildx 0x1 if ERR NO ERR l iErrCode m_usbIO DO_SetPowerOnEnable i_byChPwrOn printf d iErrCode iErrCode m_usbIO CloseDevice 109 Document version 1 09 ICP DAS USB Class Members Public Methods 5 6 4 6 DO_SetSafetyEnable Digital Output function Set Safety Enable Each bit represents channel safety enable The value of the safety enable is shown below Disable 0 Enable 1 Syntax public int DO_SetSafetyEnable BYTE _bySafetyEnable Parameters i_bySafetyEnable IN The safety enable mask Each bit represents the safety configuration of each channel Return Value Error code 110 Document version 1 09 ICP DAS USB Class Members Public Methods Example Int ErrCode ICPDAS USBIO m_usbIO Byte i bvSafetvEnablej 0 USBIO DO MAX CHANNEL 7 8 Int ildx Bool bRet true m_usbIO new ICPDAS USBIO if ERR NO ERR iErrCode m_usbIO OpenDevice USB2064 1
73. ntf d ErrCode else printf d n o_byFilterRejection 128 Document version 1 09 ICP DAS USB Class Members Public Methods 5 6 5 7 AI GetCJCOffset Analog input function Get CJC offset The valid range of offset is 40 96 40 95 Syntax public int AI GetCJCOffset float o_fCJCOffset Parameters o_fCJCOffset OUT The CJC offset Return Value Error code Example Int iErrCode ICPDAS USBIO m_usbIO float o fCJCOffset m_usbIO new ICPDAS USBIO if ERR NO ERR iErrCode m_usbIO OpenDevice USB2019 1 if ERR NO ERR iErrCode m usblO AI GetCJCOffset amp o_fCJCOffset printf d iErrCode else printf 5An o_fCJCOffset 129 Document version 1 09 ICP DAS USB Class Members Public Methods 5 6 5 8 AI GetCJCEnable Analog input function Get CJC enable Disable 0 Enable 1 Syntax public int AI GetCJCEnable BYTE o_byCJCEnable Parameters o_byCJCEnable OUT The CJC enable Return Value Error code Example Int iErrCode ICPDAS USBIO m usblO Byte o_byCJCEnable m_usbIO new ICPDAS USBIO if ERR NO ERR iErrCode m_usbIO OpenDevice USB2019 1 if ERR_NO_ERR iErrCode m_usbIO AI GetCJCEnable amp o_byCJCEnable printf d iErrCode else printf d n o_byCJCEnable 130 Document version 1 09 ICP DAS USB Class Members Public Methods 5 6 5 9 AI GetWireDetectEnable A
74. ode else printf d o_wDwVen iErrCode m_usbIO CloseDevice 64 Document version 1 09 ICP DAS USB Class Members Public Methods 5 6 2 5 GetDeviceNickName Get nick name of the device Syntax public int GetDeviceNickName BYTE o_byDeviceNickName Parameters o_byDeviceNickName OUT The byte array of the nick name of the device Return Value Error code Example Int ErrCode ICPDAS USBIO m_usbIO Byte o bvDeviceNickName USBIO NICKNAME LENGTH m_usbIO new ICPDAS USBIO if ERR NO ERR iErrCode m_usbIO OpenDevice USB2019 1 if ERR NO ERR l iErrCode m_usbIO GetDeviceNickName o bvDeviceNickName printf d ErrCode else printf s o_byDeviceNickName iErrCode m_usbIO CloseDevice 65 Document version 1 09 ICP DAS USB Class Members Public Methods 5 6 2 6 GetDeviceSN Get serial number of the device Syntax public int GetDeviceSN BYTE o_byDeviceSN Parameters o_byDeviceSN OUT The byte array of the serial number of the device Return Value Error code Example Int ErrCode ICPDAS USBIO m usblO Byte o bvDeviceSN USBIO SN LENGTH m_usbIO new ICPDAS USBIO if ERR NO ERR iErrCode m_usbIO OpenDevice USB2019 1 if ERR NO ERR l iErrCode m usblO GetDeviceSN o byDeviceSN printf d iErrCode else printf 9os o_ byDeviceSN iErrCode m_usbIO CloseDevice 66 Document v
75. of the channel status Return Value Error code 171 Document version 1 09 ICP DAS USB Class Members Public Methods Example Int ErrCode ICPDAS_USBIO m_usbIO DWORD o_dwPIValue USBIO_PI MAX CHANNEL BYTE o_byChStatus USBIO_PI MAX_CHANNEL Int ildx m_usbIO new ICPDAS_USBIO if ERR_NO_ERR iErrCode m_usbIO OpenDevice USB2084 1 if ERR_NO_ERR l iErrCode m usblO PI_ReadValue o_dwPlValue o_byChStatus printf d iErrCode else for ildx 0 ildx lt USBIO PI MAX CHANNEL ildx printf d n o_dwPIValuelildx 172 Document version 1 09 ICP DAS USB Class Members Public Methods 5 6 6 9 PI ReadCntValue Pulse input function Read PI value in double word format This method reads the all counter value of channels NOTE If the channel is in the type of frequency The value of the related channel of the o_dwCntValue will be 0 and the value of the related channels of o_byChStatus will indicate the type not support Syntax public int PI ReadValue DWORD o_dwCntValue BYTE o_byChStatus Parameters o_dwCntValue OUT The unsigned long array of the PI channel counter value o_byChStatus OUT The byte array of the channel status Return Value Error code 173 Document version 1 09 ICP DAS USB Class Members Public Methods Example Int ErrCode ICPDAS USBIO m_usbIO DWORD o dwCntValuejUSBIO PI MAX CHANNEL BYTE o_byChStatus
76. ontrol e Environment monitor e Laboratory equipment and research 1 4 Specifications 1 4 1 General Communication Interface USB 2 0 Full Speed 1 Hardware watchdog 1 6 second Watchdog 1 Software watchdog Programmable LED Indicators Display System LED Indicators 3 LED as Power Run and Error I O LED Indicators 1 LED channel as I O status for Digital and Pulse I O 4 kV contact for each terminal ESD IEC 61000 4 2 a 8 kV air for random point 0 5kV for USB cable EFT IEC 61000 4 4 l 0 5kV for I O terminal m Hi i Environment TA EUA Ta 25 75 C Storage Temperature Range 40 85 C Humidity 10 95 RH non condensing Document version 1 09 Introduction Specifications 1 4 2 USB 2019 The USB 2019 is an 8 channel universal analog input module It supports the over voltage protection of up to ar 240Vrms In addition it has voltage and current input tvpes It EA SA Dai rp also widely supports thermocouple devices with J K T E R S B N C L M and Lpima3710 types Moreover it provides extremely accurate thermocouple measurement and automatically cold junction compensation for each channel Finally it features open wire detection for thermocouple and 4 20 mA inputs for each channel Analog Input Channels 8 differential 15 mV 50 mV 100 mV 150 mV 500 mV 1V 425 V 5V 10 V 20 mA 0 20 mA 4 20 mA Note An external
77. op current bulk process Syntax public int LoadDefault void Parameters none Return Value Error code Example Int ErrCode ICPDAS USBIO m_usbIO m_usbIO new ICPDAS USBIO if ERR NO ERR iErrCode m_usbIO OpenDevice USB20xx 1 If ERR NO ERR iErrCode m usblO StopBulk printf d iErrCode iErrCode m_usblO CloseDevice 79 Document version 1 09 ICP DAS USB Class Members Public Methods 5 6 2 19 RegisterEmergencyPktEventHandle Register the callback function for emergency event sent from USBIO When in callback operation it will cause the performance in your callback function Please reduce execute time in this callback function Syntax public int RegisteremergencyPktEventHandle OnEmergencyPktArriveEvent i_evtHandle Parameters i_evtHandle IN The callback function for emergency event Return Value Error code 80 Document version 1 09 ICP DAS USB Class Members Public Methods Example Int ErrCode ICPDAS USBIO m usblO Bool m_bEmcyPktArrive Byte bvEmevPktIUSBIO MAX PACKET LENGTHI Void emcypkeEvt Byte byData Byte byLen m_ bEmcyPktArrive true memcpy byEmcyPkt byData byLen m_usbIO new ICPDAS_USBIO if ERR NO ERR iErrCode m_usbIO OpenDevice USB20xx 1 If ERR_NO_ERR iErrCode m_usbIO RegisteremergencyPktEventHandle emcypkeEvt printf d ErrCode while 1 User s application
78. otalSupportType Parameters o byTotalSupportType OUT The number of total support type Return Value Error code 157 Document version 1 09 ICP DAS USB Class Members Public Methods Example Int ErrCode ICPDAS_USBIO m usblO Byte o bvTotalSupportTvpe Byte o bvSupportTvpeCodejUSBIO MAX SUPPORT TVPEJ Int ildx Bool bRet true m_usbIO new ICPDAS_USBIO if ERR_NO_ERR iErrCode m_usbIO OpenDevice USB2084 1 if ERR_NO_ERR l iErrCode m usblO PI GetTotalSupportType amp o_ byTotalSupportType printf d ErrCode bRet false if ERR_NO_ERR l ErrCode m usblO PI GetSupportTypeCode o bySupportTypeCode printf d iErrCode bRet false If bRet printf d n o_byTotalSupportType for ildx 0 ildx lt o_byTotalSupportType ildx printf 02x n o_bySupportTypeCodelildx 158 Document version 1 09 ICP DAS USB Class Members Public Methods 5 6 6 2 PI GetSupportTypeCode Pulse input function Get supported type code Please refer to Appendix A 3 of user s manual to map PI channels input type Syntax public int PI GetTotalSupportType BYTE o_bySupportTypeCode Parameters o_byTotalSupportType OUT The number of total support type Return Value Error code 159 Document version 1 09 ICP DAS USB Class Members Public Methods Example Int ErrCode ICPDAS_USBIO m usblO Byte o bvTotalSupportTvpe
79. ow many value under zero scale range This value can be calculated by following formula Assume current type is 5V 5V with 16 bit resolution and reading value is Ox53E 0X53E OxFFFF then we can get the actual value Y is Y 0 x S 5 5 Channel Open amp Channel Close The reading value of these two statuses will be the full scale for channel open and zero scale for channel close The overload API for only reading Al value cannot detect the channel status It only read the Al value but has the most efficiency 134 Document version 1 09 ICP DAS USB Class Members Public Methods Syntax public int AI ReadValue DWORD o_dwAlValue Parameters o_dwAlValue OUT The raw value of AI value Return Value Error code Example Int iErrCode ICPDAS USBIO m usblO DWORD o_dwAlValue USBIO_Al MAX CHANNEL Int ildx m usblO new ICPDAS_USBIO if ERR NO ERR iErrCode m_usbIO OpenDevice USB2019 1 if ERR NO ERR iErrCode m usblO Al_ReadValue o_dwAlValue printf d ErrCode else For ildx 0 ildx lt USBIO AI MAX CHANNEL ildx printf Ox 08x n o_dwAlValue ildx 135 Document version 1 09 ICP DAS USB Class Members Public Methods 5 6 5 11 2 AI ReadValue DWORD BYTE Analog input function Read AI value in double word digital format In the digital format the value represents the value from zero to full scale Ex For type 10
80. ower Consumption 1 3W max Mechanical Dimensions WxLxH 33mm x 87mm x 107mm Document version 1 09 Introduction Specifications 1 4 7 USB 2064 The USB 2064 is an 8 channel power relay output iy module with the USB interface It provides a maximum 5A i i driving load current for variety applications In addition This il module also provides the safetv functionalitv to secure Ti i devices in the field Besides it also supports power on configuration to customize initial state 4 wm Relay Output 00 Channels Output Type Form A SPST NO 5A 250Vac 47 63Hz 5A 30Vpc Operate Time 10ms max Contact Rating Resistive Load Release Time 5ms max Insulation Resistance 1 000 MQ at 500Vpc Between Open Contact 1000Vac 1 min Between Coil and Contact 3000Vac 1 min Mechanical 20 000 000 times min Electrical 100 000 times min Dielectric Strength Endurance Power Consumption 1 235W max Mechanical Dimensions WxLxH 33mm x 87mm x 107mm Document version 1 09 Introduction Specifications 1 4 8 USB 2084 The USB 2084 is an 8 channel counters module with the USB interface It provides a variety of measurement applications such as measuring a number of time related quantities counting events or totalizing and monitoring position with quadrature encoders In addition a digital filter is used to eliminate the effects of noise and the filter s parameters are adjustable by
81. ower on functionality One provides specifying channel to set another for all channel These two overload methods are listed as following table and described in following section Name of Methods DO_SetPowerOnEnable BYTE i_byChToSet BYTE i_byPowerOnEnable DO_SetPowerOnEnable BYTE _byPowerOnEnables 105 Document version 1 09 ICP DAS USB Class Members Public Methods 5 6 4 5 1 DO_SetPowerOnEnable BYTE BYTE Digital Output function Set Power On enable for specific channel The value of the enable byte is listed below Disable amp Off 0 Enable amp On 1 Syntax public int DO_SetPowerOnEnable BYTE i byChToSet BYTE i_byPowerOnEnable Parameters i byChToSet IN The specific channel to set i byTypeCode IN The power on enable for the specific channel Return Value Error code 106 Document version 1 09 ICP DAS USB Class Members Public Methods Example Int ErrCode ICPDAS_USBIO m_usbIO m_usbIO new ICPDAS USBIO if ERR NO ERR iErrCode m_usbIO OpenDevice USB2064 1 if ERR NO ERR l iErrCode m_usbIO DO_SetPowerOnEnable 0 0x1 printf d iErrCode iErrCode m_usbIO CloseDevice 107 Document version 1 09 ICP DAS USB Class Members Public Methods 5 6 4 5 2 DO_SetPowerOnEnable BYTE Digital Output function Set Power On enable for all channel The value of the enable byte is listed below Disable amp Off 0 Enable amp On 1 Sy
82. p0 Vin Up1 Vin Upi Vin A0 Vin A0 Vin BO Vin BO Vin Freq0 Vin Freq0 Vin Freql lt Vin Freq1 Document version 1 09 24 Vin Pulse Vin Dir Vin Pulse and Vin Dir Vin Up Vin Down Vin Up and Vin Down Vin Up0 Vin Upi Vin Up0 and Vin Up1 Vin A0 Vin B0 Vin A0 and Vin B0 Vin Freq0 vin Freq DE Vin Freq0 and Vin Freqi Hardware Information Hardware Configuration 2 4 Hardware Configuration The ICP DAS USB series I O modules provide two basic configurations of hardware to configure board ID and enable firmware update functionality 2 4 1 Board ID The board ID is used to identify two modules with same product number connected to computer When two more modules with same product number are connected each of them must be set to different board ID to prevent conflict and unexpected errors The board ID can be configured by the rotary switch The location of the rotary switch is shown in figure 2 15 The value of board ID can be configured from 1 15 by hardware and can be configured from 16 127 by software when switched to 0
83. peCodelildx 120 Document version 1 09 ICP DAS USB Class Members Public Methods 5 6 5 2 AI GetSupportTypeCode Analog input function Get supported type code Please refer to Appendix A 1 of user s manual to map Al channels input type Syntax public int AI GetTotalSupportType BYTE o_bySupportTypeCode Parameters o_byTotalSupportType OUT The number of total support type Return Value Error code 121 Document version 1 09 ICP DAS USB Class Members Public Methods Example Int ErrCode ICPDAS_USBIO m usblO Bvte o bvTotalSupportTvpe Byte o bvSupportTvpeCodejUSBIO MAX SUPPORT TVPEJ Int ildx Bool bRet true m_usbIO new ICPDAS_USBIO if ERR_NO_ERR iErrCode m_usbIO OpenDevice USB2019 1 if ERR_NO_ERR iErrCode m usblO AI GetTotalSupportType amp o_ byTotalSupportType printf d ErrCode bRet false if ERR_NO_ERR iErrCode m_usbIO AI GetSupportTypeCode o bySupportTypeCode printf d iErrCode bRet false If bRet printf d n o_byTotalSupportType for ildx 0 ildx lt o_byTotalSupportType ildx printf 02x n o_bySupportTypeCodelildx 122 Document version 1 09 ICP DAS USB Class Members Public Methods 5 6 5 3 AI GetTypeCode Analog input function Get type code Please refer to user s manual to map AI channels input type The type code can reference to Appendix A 1 Syntax
84. r code Example Int iErrCode ICPDAS USBIO m usblO Bvte o bvPOTotal m usblO new ICPDAS USBIO if ERR_NO_ERR iErrCode m_usbIO OpenDevice USB20xx 1 if ERR NO ERR l iErrCode m_usbIO GetPOTotal amp o_byPOTotal printf d iErrCode else printf d o_byPOTotal iErrCode m_usbIO CloseDevice 74 Document version 1 09 ICP DAS USB Class Members Public Methods 5 6 2 14 SetUserDefinedBoardID Set board ID of this device The valid value of the ID is from 16 to 127 Syntax public int SetUserDefinedBoardiD BYTE i_byBID Parameters i_byBID IN The board ID to set Return Value Error code Example Int ErrCode ICPDAS USBIO m usblO m usblO new ICPDAS_USBIO if ERR_NO_ERR iErrCode m_usbIO OpenDevice USB20xx 1 if ERR NO ERR iErrCode m usblO SetUserDefinedBoardID 123 printf d iErrCode iErrCode m_usblO CloseDevice 75 Document version 1 09 ICP DAS USB Class Members Public Methods 5 6 2 15 SetDeviceNickName Set nick name of this device The maximum number of the character of this device is 32 Syntax public int SetDeviceNickName BYTE i_byDeviceNickName Parameters i_byDeviceNickName IN The byte array of the nick name to set Return Value Error code Example Int iErrCode ICPDAS USBIO m usblO Byte bvNickNamejUSBIO NICKNAME LENGTHI m usblO new ICPDAS USBIO if ERR_NO_ERR iErrCode
85. rCode bRet false If bRet for ildx 0 ildx lt USBIO_DI MAX CHANNEL gt gt 3 ildx printf d n o_wDICntValue ildx 91 Document version 1 09 ICP DAS USB Class Members Public Methods 5 6 3 6 DI_SetDigitalFilterWidth Digital input function Set DI Digital Filter Width Used for setting the filter width for the digital input The unit of the filter width is 0 1 milli second Syntax public int DI_SetDigitalFilterWidth WORD i_wFilterWidth Parameters i_wFilterWidth IN The digital filter width The unit is 0 1 ms Return Value Error code Example Int iErrCode ICPDAS USBIO m usblO m_usbIO new ICPDAS USBIO if ERR NO ERR iErrCode m_usbIO OpenDevice USB2051 1 if ERR NO ERR l iErrCode m usblO DI SetDigitalFilterWidth 10 printf d iErrCode m_usbIO CloseDevice 92 Document version 1 09 ICP DAS USB Class Members Public Methods 5 6 3 7 DI SetDigitalValueInverse Digital input function Set DI Value Inverse No 0 Yes 1 Syntax public int DI SetDigitalValueInverse DWORD i dwinverse Parameters xi dwinverse IN The inverse setting Return Value Error code Example Int iErrCode ICPDAS USBIO m usblO m_usbIO new ICPDAS USBIO if ERR NO ERR iErrCode m_usbIO OpenDevice USB2051 1 if ERR NO ERR l iErrCode m usblO DI SetDigitalValuelnverse 1 printf d iErrCode m_usbIO CloseDevice
86. rCode m usblO AI SetChCJCOffset 0 1 354 printf d iErrCode iErrCode m_usbIO CloseDevice 150 Document version 1 09 ICP DAS USB Class Members Public Methods 5 6 5 15 2 AI SetChCJCOffset float Analog input function Set channel CJC offset for specific channel Syntax public int AI SetTypeCode float i fChCJCOffset Parameters xi fChCJCOffset IN The float array of channel CJC offset to set Return Value Error code Example Int iErrCode ICPDAS USBIO m usblO float m fChCICOffsetlUSBIO AI MAX CHANNEL Int ildx m_usbIO new ICPDAS USBIO if ERR NO ERR iErrCode m_usbIO OpenDevice USB2019 1 For ildx 0 ildx lt USBIO AI MAX CHANNEL ildx m_fChCJCOffsetlildx 1 358 if ERR NO ERR iErrCode m usblO AI SetChC COffset m fChCICOffset printf d iErrCode iErrCode m_usbIO CloseDevice 151 Document version 1 09 ICP DAS USB Class Members Public Methods 5 6 5 16 AI SetChEnable Analog input function Set channel enable disable Each byte indicates 8 channels enable disable mask Ex Byte0 gt Channel0 7 Syntax public int AI SetChEnable BYTE fi bvChEnable Parameters xi bvChEnable IN The byte array of channel enable disable mask Return Value Error code Example Int ErrCode ICPDAS_USBIO m_usblO Byte m_byChEnable USBIO_AI MAX CHANNEL 7 8 Int ildx m_usbIO new ICPDAS_USBIO if ERR NO ERR
87. rdware i Found New Hardware ICPDAS USE FBI Your new hardware is installed and ready to use NOTE It is strongly recommended that users use the cable we provided to connect to USB I O 3 2 Software The software installer includes libraries samples and Utility and can be found in web site You can install the package by double clicking the file ICPDAS USB IO X X X exe Then follow the instruction during installation 31 Document version 1 09 Installation Software E 15 Setup ICP DAS USBIO Welcome to the ICP DAS USB IO Setup Wizard This will install ICP DAS USB IO version 1 0 0 4 on your computer Itis recommended that you close all other applications before Click Next to continue or Cancel to exit Setup After the installation the window will indicate the installation has completed as the figure below Users can check or ignore the patch note in this step mi 15 Setup ICP DAS USBI Completing the ICP DAS USB IO Setup Wizard Setup has finished installing ICP DAS USB IO on your computer The application may be launched by selecting the installed icons Click Finish to exit Setup 3 2 1 Utility The USB IO Utility provides a simple way to test and acquire data easily and instantly for all ICP DAS USB series I O modules without programming You will find this program in Start Programs ICPDAS USB IO USB IO Utility or the path
88. rolEHelper 1 0 Type Library AcrolEHelperShim 1 0 Type Library Active DS Type Library Active Setup Control Library ArtiveMovie control bene library li di JOOOOORORERE z je 006 A ICPDAS USBIO VB Location CAWINDOWSisvstem3zjICPDAS USBIO VB dil Language Standard 3 2 3 Samples There are several samples to help user to develop project smoothiv The samples can be found in Start Programs ICPDAS USB IO Samples or the path C ICPDAS USB IO Samples 44 Document version 1 09 Operation Hardware structure 4 Operation 4 1 Hardware structure The ICP DAS USB I O provides various types of input and output The I O is handled by embedded controller The hardware structure is shown in figure 4 1 below ICP DAS USB IO www gt FPGA lt gt Embedded controller Eternal Memory 5 O bs ct no mar gt EEPROM n UJ SE e un e fa e 3 no mr D mo e 4 2 Software structure In the programmer point of view the ICP DAS provides a class library to user to develop project quickly and easily The structure of the software is shown in figure 4 2 The methods of USB classes are divided into 4 groups base digital I O analog I O and pulse I O The figures 4 3 4 7 show an overview to use ICP DAS USB I O class library 45 Document version 1 09 Operation Software structure User s Application y U
89. rs Public Methods 5 6 5 5 AI GetChEnable Analog input function Get channel enable disable Each byte indicates 8 channels enable disable mask EX Byte0 gt Channel0 7 Syntax public int AI GetChCJCOffset BYTE o_byChEnable Parameters o_byChEnable OUT The byte array of channel enable disable mask Return Value Error code 126 Document version 1 09 ICP DAS USB Class Members Public Methods Example Int ErrCode ICPDAS_USBIO m usblO Byte o bvChEnable USBIO AI MAX CHANNEL 7 8 Int ildx m usblO new ICPDAS USBIO if ERR_NO_ERR iErrCode m_usbIO OpenDevice USB2019 1 if ERR NO ERR l iErrCode m_usbIO AI GetChEnable o bvChEnable printf d ErrCode else for ildx 0 ildx lt USBIO AI MAX CHANNEL 7 8 ildx printf 02x1n o_byChEnable ildx 127 Document version 1 09 ICP DAS USB Class Members Public Methods 5 6 5 6 AI GetFilterRejection Analog input function Get filter rejection 60Hz 0 50Hz 1 Syntax public int AI GetFilterRejection BYTE o_byFilterRejection Parameters o_byFilterRejection OUT The filter rejection Return Value Error code Example Int ErrCode ICPDAS USBIO m usblO Byte o bvFilterRejection m_usbIO new ICPDAS USBIO if ERR NO ERR iErrCode m_usbIO OpenDevice USB2019 1 if ERR NO ERR l iErrCode m usblO AI GetFilterRejection amp o_byFilterRejection pri
90. sbIO PI_SetLPFilterEnable 5 0x1 printf d iErrCode iErrCode m_usbIO CloseDevice 194 Document version 1 09 ICP DAS USB Class Members Public Methods 5 6 6 19 2 PI_SetLPFilterEnable BYTE Pulse input function Set low pass filter enable to all channel Syntax public int PI_SetLPFilterEnable BYTE i_byLPFilterEnable Parameters i_byLPFilterEnable IN The byte array of low pass filter enable mask Return Value Error code Example Int iErrCode ICPDAS USBIO m_usbIO Byte m_byLPFilterEnable USBIO_PI MAX CHANNEL 7 8 Int ildx m_usbIO new ICPDAS USBIO if ERR_NO_ERR iErrCode m_usbIO OpenDevice USB2084 1 For ildx 0 ildx lt USBIO PI MAX CHANNEL 7 8 ildx m_byLPFilterEnable ildx 0x5a if ERR_NO_ERR l iErrCode m usblO PI SetLPFilterenable m_byLPFilterEnable printf d iErrCode iErrCode m_usblO CloseDevice 195 Document version 1 09 ICP DAS USB Class Members Public Methods 5 6 6 20 PI_SetLPFilterWidth The class has two overload methods for setting trigger mode One provides specifying channel to set another for all channels The low pass filter width is for filtering noise or bouncing The unit of the filter width is uS These two overload methods are listed as following table and described in following section Name of Methods PI_SetLPFilterWidth BYTE i_byChToSet WORD _wLPFilterWidth PI_SetLPFilterWi
91. selected via wire connections All digital input channels are also able to be used as 16 bit counters The USB 2055 supports source type output with short circuit protection There are options to enable both power on and safety values The USB 2055 has 16 LED indicators that can be used to monitor the status of the digital input and digital output channels 4 kV ESD protection and 3750 VDC intra module isolation are standard Digital Input Channels 8 Type Wet Contact Sink Source On Voltage Dry Contact Close to GND Level Wet Contact 10 VDC 50 VDC Off Voltage Dry Contact Open Level Wet Contact 4 VDC Max HAN ADA li 500 meters Max Input Impedance 10 KO Overvoltage Protection 70 VDC Max Count 65535 16 bit Max Input Counter Frequency iio Min Pulse Width uo Digital Output Channels 8 Type Open Collector Sink NPN Load Voltage 3 5 50VDC Max Load Current 650 mA Channel Overvoltage Protection 60 VDC Overload Protection 1 4A with short circuit protection 6 Document version 1 09 Introduction Specifications Power on Value Safe Value Power Power Consumption Mechanical Dimensions WxLxH 33mm x 87mm x 107mm Document version 1 09 Introduction Specifications 1 4 6 USB 2060 The USB 2060 is a full speed USB device with 8 digital input and digital output channels module The USB 2060 provides 6 digital input channels 6 Form A signal relay output channels All digital input
92. signal These jumpers are located within JP4 JP11 The jumper settings are listed in the following table The isolated input is set by default Jumper Counter Jumper setting Isolated input Non isolated input Default TTL input 29 Document version 1 09 Hardware Information LED Indicators 2 5 LED Indicators The ICP DAS USB series I O modules have two modes normal and firmware update are described in previous section Each mode has own LED way of indication The LED indications for two modes are shown below 2 5 1 Normal Operation LED Indicators LED Status Causes PWR Red Solid Normal Operation Blink USB Bus Communicating A o usesusie Blink Less frequent Warning Does not affect the operation N p ee EMO Major Error Does affect the operation 2 5 2 Firmware update LA eine ating orrimvaretoupdate 30 Document version 1 09 Installation Hardware 3 Installation 3 1 Hardware 3 1 1 Connecting to ICP DAS USB series I O module 1 Turning on the PC you are preparing to configure ICP DAS USB I O modules 2 Connecting the ICP DAS USB series I O modules to USB port on the PC 3 Once you first time connect the USB I O module to PC There will be few messages in system bar in bottom right side to inform new hardware is detected and installed successfully After the message is shown as figure 3 2 then the ICP DAS USB series I O modules are ready to use i Found New Ha
93. srition PI GetTotalSupportType PI GetSupportTypeCode PI GetTypeCode PI GetTriggerMode PI_GetLPFilterEnable PI GetChisolatedFlag PI_GetLPFilterWidth PI_ReadValue PI_ReadCntValue PI_ReadFreqValue PI_ReadBulkValue PI_SetTypeCode PI_ClearChCount PI_ClearSinglelChCount PI_ClearChStatus PI_ClearSinglelChStatus PI_SetTriggerMode PI SetChisolatedFlag PI SetL PFilterEnable Document version 1 09 Pulse input function Get total supported amount Pulse input function Get supported type code Pulse input function Get type code Pulse input function Get trigger mode Pulse input function Get low pass filter enable Pulse input function Get channel isolated flag Pulse input function Get low pass filter width Pulse input function Read PI value Pulse input function Read the count value of counters Pulse input function Read the frequency value of counters Pulse input function Get bulk PI value Fast acquire functionality Pulse input function Set type code for specific channel Overload Pulse input function Clear channel count with clear mask Pulse input function Clear single channel count Pulse input function Clear channel status with clear mask Pulse input function Clear single channel status Pulse input function Set trigger mode Overload Pulse input function Set channel isolated flag Overload Pulse input function Set low pass filter enable 51 ICP DAS
94. support diagnostic the value for readback will be the actual output value in this module e Configuration Region All I O related configurations can be set in this region m Power On The power on configuration 35 Document version 1 09 Installation Software m Safety Enable The safety enable configuration m Safety Value The safety value 3 2 1 3 Analog Input In the I O page of the Al the real time value and module configuration can be read or written in this page The detail of all items in this form will be introduced in this section Poll Interval ms Hide setting panel Show hex 2 Configuration Region 1 Monitor Region 3 Message Region e Polling Interval This value is the period to poll data to the USB I O module Note The valid value is 100 5000ms e Hide Setting Panel Hiding the I O configuration panel e Show Hex Converting the 1 O value from decimal to hexadecimal 36 Document version 1 09 Installation Software e Monitor Region The 1 O related data and configurations will be listed here Users can select the channel to configure in the I O Monitor Region The setting of this selected channel will showin I O configuration region e Configuration Region All I O related configurations can be set in this region This region is divided into two parts channel and module related setting The channel related setting is in the Selected Channel The rest are mo
95. tAOTotal Get AO total number of channels of the device Syntax public int GetAOTotal BYTE o_byAOTotal Parameters o_byAOTotal OUT The AO total number of channels Return Value Error code Example Int iErrCode ICPDAS USBIO m usblO Byte o bvAOTotal m usblO new ICPDAS USBIO if ERR NO ERR iErrCode m_usbIO OpenDevice USB20xx 1 if ERR NO ERR l iErrCode m_usbIO GetAOTotal amp o_byAOTotal printf d iErrCode else printf d o_byAOTotal iErrCode m_usblO CloseDevice 72 Document version 1 09 ICP DAS USB Class Members Public Methods 5 6 2 12 GetPITotal Get PI total number of channels of the device Syntax public int GetPITotal BYTE o_byPITotal Parameters o_byPlTotal OUT The PI total number of channels Return Value Error code Example Int ErrCode ICPDAS USBIO m_usbIO Bvte o bvPITotal m usblO new ICPDAS_USBIO if ERR NO ERR iErrCode m_usbIO OpenDevice USB20xx 1 if ERR NO ERR l iErrCode m usblO GetPITotal amp o_byPITotal printf d iErrCode else printf d 0 bvPITotal iErrCode m_usbIO CloseDevice 73 Document version 1 09 ICP DAS USB Class Members Public Methods 5 6 2 13 GetPOTotal Get PO total number of channels of the device Syntax public int GetPOTotal BYTE o_byPOTotal Parameters o_byPOTotal OUT The PO total number of channels Return Value Erro
96. tf d iErrCode iErrCode m_usblO CloseDevice 198 Document version 1 09 Troubleshooting Public Methods 6 Troubleshooting 1 Cannot install ICP DAS USB I O package with the message like the following figure 2 y NET Framework v2 0 required Do you want to download the framework now Because the ICP DAS USB 1 O requires NET Framework v2 0 the package will automatically detect the NET Framework v2 0 installed as well or not Users can click Yes to download and install the INET Framework v2 0 via internet If users can not access internet the other way is install NET Framework v2 0 in the folder net_framework in the root path of the CD 2 Returning timeout error code 65792 when access USB I O There are some possible reasons e The USB module connected to USB hub not local USB port on computer This will cause the time for communication increased To prevent this error users can increase the time of communication timeout Note We strongly recommended connecting USB modules to local USB port on computer to prevent unexpected problem e Module is failure caused by unknown reason You can refer to LED indicators section 199 Document version 1 09 Appendix A A 1 Analog Input Type Code Appendix A A 1 Analog Input Type Code Code InputType Code Inputivpe 0x00 15 mV 15 mV 0x01 50 mV 50 mV 0x02 100 mV 100 mV 0x03 500 mV 500 mV 0x04 1V 1V 0x05 2 5V
97. to set another for all channels Please refer to user s manual for pulse input type code These two overload methods are listed as following table and described in following section The corresponding type code can be found in Appendix A 3 Name of Methods PI_SetTypeCode BYTE i_byChToSet BYTE i_byTypeCode PI_SetTypeCode BYTE i_byTypeCodes 180 Document version 1 09 ICP DAS USB Class Members Public Methods 5 6 6 12 1 PI_SetTypeCode BYTE BYTE Pulse input function Set type code for specific channel The type code can reference to Appendix A 3 Syntax public int PI SetTypeCode BYTE i byChToSet BYTE i_byTypeCode Parameters i_byChToSet IN The specific channel to set i_byTypeCode IN The type code for the specific channel Return Value Error code Example Int ErrCode ICPDAS_USBIO m_usbIO m_usbIO new ICPDAS_USBIO if ERR NO ERR iErrCode m_usbIO OpenDevice USB2084 1 if ERR_NO_ERR l iErrCode m_usbIO PI_SetTypeCode 0 0x10 printf d iErrCode iErrCode m_usbIO CloseDevice 181 Document version 1 09 ICP DAS USB Class Members Public Methods 5 6 6 12 2 PI SetTypeCode BYTE Analog input function Set type code for all channels The type code can reference to Appendix A 3 Syntax public int PI SetTypeCode BYTE i_byTypeCodes Parameters i_byTypeCodes IN The byte array of type code to set Return Value Error code Exampl
98. ut two parts have to set as well One is jumper JP4 JP10 described in 2 5 4 2 and the other is Ch Isolated in Utility m Trig Mode The USB 2084 has rising and falling edge trigger modes The difference between rising and falling is the timing of counter operation In rising edge trigger mode counter will operate when the input signal from low to high level In contrast counter will operate when the input signal from high to low level in the falling edge trigger mode Rising edge Counter operate Input Signal Falling edge Counter operate Input Signal 39 Document version 1 09 Installation Software m Enable LP Filter To enable build in digital low pass filter The detail of this setting will be introduced in LP Width section m LP Width The USB 2084 has three independent digital noise filters LPO LP1 and LP2 to remove noise 8 counters share these three filters The following table shows the relationship between filters and counters Low Pass Filter AO LPO BO LPO A2 LP2 B2 LP2 A3 LP2 B3 LP2 The low pass filter width can be either disable or enable and the width can be programmed from 1 to 32767 us The basic operation of filter is shown in following figure The counter will operate when input signal hold on the same level during filter width 40 Document version 1 09 Installation Software a Ifthe high width of the input signal is shorter then T the counter will not operate T
99. w pass filter width The unit of the width is uS The maximum value of width is 32767uS Note Each channel does not use own low pass filter width Please refer to following table to see what low pass filter width is referred to 081 0 2 amp 3 1 4 5 6 7 2 Syntax public int PI_GetLPFilterWidth WORD o_wLPFilterWidth Parameters o_wLPFilterWidth OUT The byte array of the low pass filter width in uS Return Value Error code 169 Document version 1 09 ICP DAS USB Class Members Public Methods Example Int ErrCode ICPDAS_USBIO m_usblO WORD o_wLPFilterWidth USBIO_PI MAX CHANNEL Int ildx m_usbIO new ICPDAS USBIO if ERR_NO_ERR iErrCode m_usbIO OpenDevice USB2084 1 if ERR_NO_ERR iErrCode m_usbIO PI_GetLPFilterWidth o_wLPFilterWidth printf d iErrCode else for ildx 0 ildx lt USBIO PI MAX CHANNEL ildx printf d n o_wLPFilterWidth ildx 170 Document version 1 09 ICP DAS USB Class Members Public Methods 5 6 6 8 PI ReadValue Pulse input function Get PI value in double word format This method provides two formats in a function call NOTE If the type of the channel is frequency users have to convert these 4 bytes into float format Syntax public int PI ReadValue DWORD o_dwPIValue BYTE o_byChStatus Parameters o_dwPIValue OUT The byte array of the PI channel counter value o_byChStatus OUT The byte array
100. ys USB 2000 Series USB 2 0 Full Speed High Performance DAQ module User s Manual Revision History Overview Revision History Revision Date Description of Change Adding USB 2045 Module Information Adding USB 2051 Module Information May 8 2014 Adding USB 2055 Module Information Adding USB 2060 Module Information Adding DI API 1 08 Jan 29 2013 6 Adding System API SetAutoResetWDT 1 07 Sep 20 2012 7 Adding DO API DO WriteValue 1 Adding DO API 1 06 Jul 6 2012 Mall l 2 Adding information for USB 2064 1 05 Jun 21 2012 1 Modifving analog output tvpe code 1 04 Apr 23 2012 1 Changing the color of LED indicators 1 Adding information for USB 2084 1 03 Dec 29 2011 2 Adding PI API 3 Adding PI related error codes Dec 20 2011 Adding ERR_USBDEV_ERROR_WRITEFILE error code Dec 15 2011 Modify specification of USB 2019 Document version 1 09 Preface Overview Preface Warranty All products manufactured by ICP DAS are under warranty regarding defective materials for a period of one year from the date of delivery to the original purchaser Warning ICP DAS assumes no liability for damages resulting from the use of this product ICP DAS reserves the right to change this manual at any time without notice The information furnished by ICP DAS is believed to be accurate and reliable However no responsibility is assumed by ICP DAS for its use or for any infringements of patents or other rights of
101. yte o bvSafetvValuej USBIO DO MAX CHANNEL 7 8 Int ildx Bool bRet true m_usbIO new ICPDAS USBIO if ERR NO ERR iErrCode m_usbIO OpenDevice USB2064 1 if ERR NO ERR l iErrCode m_usbIO DO_GetSafetyValue amp o_bySafetyValue printf d iErrCode bRet false If bRet for ildx 0 ildx lt USBIO_DO_MAX_CHANNEL 7 8 ildx printf 02x n o_bySafetyValuel ildx 102 Document version 1 09 ICP DAS USB Class Members Public Methods 5 6 4 4 DO_ReadValue Digital Output function Read DO Value Syntax public int DO_ReadValue BYTE o_byDOValue Parameters o_byDOValue OUT The DO value Each bit represents the DO value of each channel Return Value Error code 103 Document version 1 09 ICP DAS USB Class Members Public Methods Example Int ErrCode ICPDAS USBIO m_usbIO Byte o bvDOValuej USBIO DO MAX CHANNEL 7 8 Int ildx Bool bRet true m_usbIO new ICPDAS USBIO if ERR NO ERR iErrCode m_usbIO OpenDevice USB2064 1 if ERR NO ERR l iErrCode m_usbIO DO_ReadValue amp o_byDOValue printf d iErrCode bRet false If bRet for ildx 0 ildx lt USBIO_DO_MAX_CHANNEL 7 8 ildx printf 02x n 0 bvDOValuelildx 104 Document version 1 09 ICP DAS USB Class Members Public Methods 5 6 4 5 DO_SetPowerOnEnable The class has two overload methods for configuring p
Download Pdf Manuals
Related Search
Related Contents
México, D.F., a 15 de noviembre de 2012. Asómate a ventanilla… es 菫謹居夏雪景慕遠望~こて零零蓋貨雲霧喜重曹帯主嘉亭覆管して(ださぃ 4A20 ANALOG INPUT CARD MANUAL Acomdata E5 FireWire 400 External Hard Drive !Trak-It Applicant Manual - Infotrends Research Group 究極×進化 究極×進化 「アルファコンテナーシリーズ」 ご使用上の注意 Samsung HT-DM555 Наръчник за потребителя Copyright © All rights reserved.
Failed to retrieve file