Home

icpdas usbio users manual

image

Contents

1. 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 2026 2 4 4 1 Hardware Watchdog The USB 2026 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 lee Disable o 31 Document version 1 14 Hardware Information Hardware Configuration 2 4 5 USB 2045 2 4 5 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 Disable o o 2 4 6 USB 2051 2 4 6 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 Enable ee Disable ej 2 4 7 USB 2055 2 4 7 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 en
2. if ERR_NO_ERR iErrCode m_usbIO AO_GetTotalSupportType amp o_byTotalSupportType printf d iErrCode bRet false if ERR_NO_ERR iErrCode m_usbIO AO_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 return iErrCode 170 Document version 1 14 ICP DAS USB Class Members Public Methods 5 6 6 3 AO_GetTypeCode Analog output function Get type code Please refer to user s manual to map AO channels input type The type code can reference to Appendix A 2 Syntax public int AO_GetTypeCode BYTE o_byTypeCode Parameters o_byTypeCode OUT The byte array of type code Return Value Error code Example int iErrCode ICPDAS USBIO m usblO BYTE o bvTvpeCode JUSBIO AO MAX CHANNEL int ildx if ERR NO ERR iErrCode m_usbIO OpenDevice USB2026 1 if ERR NO ERR l iErrCode m usblO AO GetTvpeCode o bvTvpeCode printf d iErrCode else for ildx 0 ildx lt USBIO AO MAX CHANNEL ildx printf 0x 02x n o_byTypeCodelildx return iErrCode 171 Document version 1 14 ICP DAS USB Class Members Public Methods 5 6 6 4 AO_GetChEnable Analog output function Get channel enable disable Each byte indicates 8 channels enable disable mask
3. return iErrCode 215 Document version 1 14 ICP DAS USB Class Members Public Methods 5 6 6 17 2 AO_ SetPowerOnValue DWORD Analog output function Set AO Power On Value to all channels in double word digital format Syntax public int AO_ SetPowerOnValue DWORD i_ dwPowerOnValue Parameters i dwPowerOnValue IN The AO Power On Value Return Value Error code 216 Document version 1 14 ICP DAS USB Class Members Public Methods Example int iErrCode ICPDAS_USBIO m usblO DWORD o dwPowerOnvValue USBIO AO MAX CHANNEL DWORD dwSetPowerOnValuejUSBIO AO MAX CHANNEL int ildx if ERR NO ERR iErrCode m usblO OpenDevice USB2026 1 for ildx 0 ildx lt USBIO AO MAX CHANNEL ildx dwSetPowerOnValue ildx Oxff if ERR NO ERR iErrCode m_usbIO AO_SetPowerOnValue dwSetPowerOnValue printf d iErrCode if ERR_NO_ERR iErrCode m_usbIO AO_GetPowerOnValue o_dwPowerOnValue printf d iErrCode else for ildx 0 ildx lt USBIO_AO_MAX_CHANNEL ildx printf 0x 04x n o_dwPowerOnValuel ildx return iErrCode 217 Document version 1 14 ICP DAS USB Class Members Public Methods 5 6 6 17 3 AO_ SetPowerOnValue BYTE float Analog output function Set AO Power On Value to specifying channel in float analog format The writting value is calculated users write real value for current output type Ex The writting
4. 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 a XI IPA Digital Input Channels 16 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 i e VISE Ted ol di Dave 500 meters Max Input Impedance 10 KQ Overvoltage Protection 70 VDC Max Count 65535 16 bit Max Input Counter Frequency PE Min Pulse Width Power Power Consumption 1 03 W max Mechanical Dimensions WxLxH 72 mm x 123 mm x 35 mm Document version 1 14 Introduction Specifications 1 4 6 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 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
5. return iErrCode 184 Document version 1 14 ICP DAS USB Class Members Public Methods 5 6 6 10 AO_GetPowerOnValue The class library provides 2 overload methods to read AO Power On Value One method the parameter in float format will convert raw value to true inside the method The other 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 AO_ GetPowerOnValue DWORD o_ dwPwrOnValue AO_ GetPowerOnValue float o_ fPwrOnValue 185 Document version 1 14 ICP DAS USB Class Members Public Methods 5 6 6 10 1 AO_GetPowerOnValue DWORD Analog output function Get Power On Value Each channel takes one unit of DWORD array Syntax public int AO_GetPowerOnValue DWORD o_dwPwrOnValue Parameters o_ dwPwrOnValue OUT The DWORD array of Power On Value Return Value Error code Example int iErrCode ICPDAS USBIO m usblO DWORD o dwPwrOnvValue USBIO AO MAX CHANNEL int ildx if ERR NO ERR iErrCode m_usbIO OpenDevice USB2026 1 if ERR NO ERR l iErrCode m usbIO AO GetPowerOnvValue o_dwPwrOnValue printf d iErrCode else for ildx 0 ildx lt USBIO AO MAX CHANNEL ildx printf 0x 04x n o_dwPwrOnValuelildx return iErrCode 186 Document version 1 14 ICP DAS USB Class Members Public Methods 5 6 6 10 2 AO_GetPowerOnValue flo
6. Analog output function Set AO Safety Value to all channels in float analog format The writting value is calculated users write real value for current output type Ex The writting value is 1 316 in 2 5 2 5V the output signal is 1 316V Syntax public int AO_ SetSafetyValue float i_ fSafetyValue Parameters i fSafetyValue IN The AO Safety Value Return Value Error code 230 Document version 1 14 ICP DAS USB Class Members Public Methods Example int iErrCode ICPDAS_USBIO m usblO float o_fSafetyValue JUSBIO AO MAX CHANNEL float fSetSafetyValue JUSBIO AO MAX CHANNELI int ildx if ERR NO ERR iErrCode m usblO OpenDevice USB2026 1 for ildx 0 ildx lt USBIO AO MAX CHANNEL ildx fSetSafetyValue ildx 5 if ERR_NO_ERR iErrCode m_usbIO AO_SetPowerOnValue fSetSafetyValue printf d iErrCode if ERR_NO_ERR iErrCode m_usbIO AO_GetPowerOnValue o_fSafetyValue printf d iErrCode else for ildx 0 ildx lt USBIO_AO_MAX_CHANNEL ildx printf 04f n o_fSafetyValuelildx return iErrCode 231 Document version 1 14 ICP DAS USB Class Members Public Methods 5 6 7 Pulse Input 5 6 7 1 PI_GetTotalSupportType Pulse input function Get total supported amount Syntax public int PI GetTotalSupportType BYTE o_byTotalSupportType Parameters o_byTotalSupportType OUT The number of total support type Return
7. 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 0 bvPOTotal iErrCode m_usbIO CloseDevice 81 Document version 1 14 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 iErrCode 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 82 Document version 1 14 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 ifiERR NO ERR iErrCode m_usbIO OpenDevice USB20xx 1 sprintf bvNickName Station 1 1
8. Error code Example Int iErrCode ICPDAS_USBIO m usblO Byte o bvTvpeCode JUSBIO AI MAX CHANNEL Int ildx m_usblO new ICPDAS USBIO if ERR NO ERR iErrCode m_usbIO OpenDevice USB2019 1 if ERR NO ERR l iErrCode m usblO AI GetTvpeCode o bvTvpeCode printf d iErrCode else for ildx 0 ildx lt USBIO AI MAX CHANNEL ildx printf 02x n o_byTypeCodelildx 133 Document version 1 14 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 134 Document version 1 14 ICP DAS USB Class Members Public Methods Example Int iErrCode 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_usbIO AI GetChCJCOffset o_fChCJCOffset printf d iErrCode else for ildx 0 ildx lt USBIO_AI MAX CHANNEL ildx printf 5f n o_fChCJCOffset ildx 135 Document version 1 14 ICP DAS USB Class Members Public Methods 5 6 5 5 AI GetChEnable Analog input function Get channel enable disable Each byte indicates 8 channel
9. 5 6 7 20 1 PI_SetLPFilterEnable BYTE WORD Pulse input function Set low pass filter width Syntax public int PI SetL PFilterWidth 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 iErrCode ICPDAS_USBIO m usblO 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 iErrCode iErrCode m usblO CloseDevicel 272 Document version 1 14 ICP DAS USB Class Members Public Methods 5 6 7 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 iErrCode m_usbIO PI_SetLPFilterWidth m_byLPFilterWidth printf d iErrCode iErrCode m_usbIO CloseDevice 273 Document version 1 14 Troubleshootin
10. 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 14 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 device An error was made to scan device The packet size is invalid An error occurs while
11. 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_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_bySafetyValue ildx 109 Document version 1 14 ICP DAS USB Class Members Public Methods 5 6 4 4 DO_GetDigitalOutputInverse Digital output function Get DO Output Inverse No 0 Yes 1 Syntax public int DO GetDigitalOutputinverse DWORD o dwinverse Parameters xo dwinverse OUT The inverse setting Return Value Error code 110 Document version 1 14 ICP DAS USB Class Members Public Methods Example Int iErrCode ICPDAS USBIO m usblO DWORD o_dwlnverse Int ildx Bool bRet true m_usbIO new ICPDAS_USBIO if ERR NO ERR iErrCode m_usbIO OpenDevice USB2045 1 if ERR_NO_ERR iErrCode m_usbIO DO_GetDigitalOutputInverse amp o_dwInverse printf d iErrCode bRet false If bRet printf d n o_dwlnverse 111 Document version 1 14 ICP DAS USB Class Members Public Methods 5 6 4 5 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 Ret
12. DWORD dwSetSafetyValue Oxff int ildx if ERR_NO_ERR iErrCode m_usbIO OpenDevice USB2026 1 if ERR_NO_ERR iErrCode m_usbIO AO_SetPowerOnValue bvChannel dwSetSafetyValue printf d iErrCode if ERR_NO_ERR iErrCode m_usbIO AO_GetPowerOnValue o_dwSafetyValue printf d iErrCode else for ildx 0 ildx lt USBIO_AO_MAX_CHANNEL ildx printf 0x 04x n o dwSafetvValuejildx return iErrCode 225 Document version 1 14 ICP DAS USB Class Members Public Methods 5 6 6 18 2 AO_ SetSafetyValue DWORD Analog output function Set AO Safety Value to all channels in double word digital format Syntax public int AO_ SetSafetyValue DWORD i_ dwSafetyValue Parameters i_ dwSafetyValue IN The AO Safety Value Return Value Error code 226 Document version 1 14 ICP DAS USB Class Members Public Methods Example int iErrCode ICPDAS USBIO m usblO DWORD o_dwSafetyValue JUSBIO AO MAX CHANNEL DWORD dwSetSafetyValue JUSBIO AO MAX CHANNEL int ildx if ERR NO ERR iErrCode m usblO OpenDevice USB2026 1 for ildx 0 ildx lt USBIO AO MAX CHANNEL ildx dwSetSafetyValue ildx Oxff if ERR_NO_ERR iErrCode m_usbIO AO_SetPowerOnValue dwSetSafetyValue printf d iErrCode if ERR_NO_ERR iErrCode m_usbIO AO_GetPowerOnValue o_dwSafetyValue printf d iErrCode else for ildx 0 ildx lt USBIO_
13. PI SetChisolatedFlag BYTE i_byChIsolatedFlags 265 Document version 1 14 ICP DAS USB Class Members Public Methods 5 6 7 18 1 PI_SetChIsolatedFlag BYTE BOOL Pulse input function Set channel isolated flag Syntax public int PI SetChisolatedFlag BYTE i_byChToSet BOOL i bChisolatedFlag Parameters i bvChToSet IN The specific channel to set i bChIsolatedFlag IN The isolated flag for the specific channel Return Value Error code Example Int iErrCode 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 iErrCode iErrCode m usblO CloseDevicel 266 Document version 1 14 ICP DAS USB Class Members Public Methods 5 6 7 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 arravs of channel isolated flag Return Value Error code Example Int iErrCode ICPDAS USBIO m_usbIO Byte m bvChisolatedFlagsI USBIO PI MAX CHANNEL 7 8 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 7 8 ildx m_byChlsolatedFlaglildx 0x5a if ERR NO ERR l iErrCode
14. Public Methods 5 6 4 10 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_byChannel IN The specific DO channel to be set i_byValue IN The DO on off bit Return Value Error code 125 Document version 1 14 ICP DAS USB Class Members Public Methods Example Int iErrCode ICPDAS USBIO m usblO 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 126 Document version 1 14 ICP DAS USB Class Members Public Methods 5 6 4 10 2 DO_WriteValue BYTE Digital Output function Write DO Value Each bit represents channel value The value of the digital output is shown below off 0 On 1 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 127 Document version 1 14 ICP DAS USB Class Members Public Methods Example Int iErrCode ICPDAS USBIO m usblO Bvtei bvDOValuel USBIO DO MAX CHANNEL 7 8 Int ildx Bool bRet true m_usbIO new ICPDAS_USBIO if ERR NO ERR
15. d iErrCode if ERR_NO_ERR iErrCode m_usbIO AO_GetSafetyEnable o bvSafetvEnable printf d iErrCode else for ildx 0 ildx lt USBIO AO MAX CHANNEL 7 8 ildx printf 0x 02x n o_bySafetyEnable ildx return iErrCode 211 Document version 1 14 ICP DAS USB Class Members Public Methods 5 6 6 17 AO_ SetPowerOnValue The class library provides 4 overload methods to write AO Power On Value Two method provides specifying channel to write raw data and converted value The others write AO Power On Value for all channels The overview of these methods is as following table and will describe in the following section Name of Methods AO_ SetPowerOnValue BYTE i_byChToSet DWORD i_dwPowerOnValue AO_ SetPowerOnValue DWORD i_dwPowerOnValue AO_ SetPowerOnValue BYTE i_byChToSet float i_fPowerOnValue AO_ SetPowerOnValue float i fPowerOnValue 212 Document version 1 14 ICP DAS USB Class Members Public Methods 5 6 6 17 1 AO_ SetPowerOnValue BYTE DWORD Analog output function Set AO Power On Value to specifying channel 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 statu
16. 1 14 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 l iErrCode m usblO AI SetChC COffset m fChCICOffset printf d iErrCode iErrCode m_usblO CloseDevice 161 Document version 1 14 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 iErrCode ICPDAS USBIO m usblO Byte m_byChEnable USBIO_AI MAX CHANNEL 7 8 Int ildx m usblO new ICPDAS USBIO if ERR NO ERR iErrCode m_usbIO OpenDevice USB2019 1 For ildx 0 ildx lt USBIO AI MAX CHANNEL 7 8 ildx m_byChEnable ildx 0x5
17. 174 Document version 1 14 ICP DAS USB Class Members Public Methods 5 6 6 6 AO_ ReadExpValue The class library provides 2 overload methods to read AO expect value One method the parameter in float format will convert raw value to true inside the method The other 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 AO ReadExpValue DWORD o_dwAOExpValue AO_ReadExpValue float o_fAOExpValue 175 Document version 1 14 ICP DAS USB Class Members Public Methods 5 6 6 6 1 AO_ReadExpValue DWORD Analog output function Read AO expect 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
18. 2 2 2 USB 2026 AINO 1 E AINO AIN1 2 12 AIN1 AIN2 3 13 AIN2 AIN3 4 14 AIN3 AIN4 a 15 AIN4 AOUTO 6 16 AGND AOUTl 7 17 AGND DIO 8 18 DOO DIL 9 19 DO1 DGND 10 20 DGND 20 Document version 1 14 Hardware Information Connector Pin Assignment AI N Analog input channel N positive reference TO Analog input channel N negative reference AO N Analog output channel N positive reference TAI Analog output channel N negative reference DGND The Ground of Current Path of Digital input output JON me Dig nputforChameln ple The Digital Output for Channel N 2 2 3 USB 2045 bweoJuovuswnh 9 N TITTI me Digita OuipetforChameln The Power Source Input Pin EE The Ground of Power Source InputPin 0 21 Document version 1 14 Hardware Information Connector Pin Assignment 2 2 4 USB 2051 Ext GND il Ext GND DOO 2 DO8 DO1 3 DO9 DO2 4 DO10 DO3 E DO11 DO4 6 DO12 DOS 7 DO13 DO6 8 DO14 DO7 9 DO15 Ext PWR 10 20 Ext PWR JON TheDigtalinuttorchamelN DI GND The Ground of Current Path of Dry Contact 2 2 5 USB 2055 DI1 DI3 DI4 DI5 DI6 DI7 DI COM STO me Digital inputforchamnetN DI GND The Ground of Current Path of Dry Contact Bo osamu awnN DIEM the common infor Wet Conai EEE The Digital Output for Channel N ESITI me Power Source put The Ground of Power Source Input Pin 22 Document version 1 14 Hardware Information Connector Pin As
19. 20 MA 4 20 mA Normal Mode 14 bit Resolution FastMode FastMode 12 bit Normal Mode 10 Hz total Sampling Rate Fast FastMode 200 Hz total CI Mode 0 1 FSR Accuracy FastMode FastMode 0 5 FSR Span Drift 25 ppm C Input 20 MQ Impedance 135 Q Overvoltage 120 VDC Protection N A Overcurrent N A Protection Yes 50 mA at 110 VDC Analog Output Channels 2 Voltage 0 5 VDC 0 10 VDC 5 VDC 10 VDC Range Range Jumper Selectable Document version 1 14 Introduction Specifications Current 0 20 mA 4 20 mA Resolution 12 bit Accuracy 0 1 of FSR Output Capacity Voltage Output Ses i o 10 V 20 mA Open Wire Detection Yes for 4 20 mA only Power On Value Yes Safety Value Yes Digital Input N Channel Type Dry Contact Source On Voltage Level Close to GND Off Voltage Level Open Input Impedance 10 KQ 0 5 W Channels 4 294 967 285 32 bit 100 Hz N Counters Max Input Frequency Overvoltage Protection 57 VDC Digital Output N Channels Type Isolation Open Collector Sink Max Load Current 700mA Channel Load Voltage 3 5 50 VDC Overvoltage Protection 60 VDC Overload Protection 1 4 A with short circuit protection Short Circuit Protection Yes Power on Value Yes Programmable Safe Value Yes Programmable Communication Interface USB 2 0 Full Speed 1 Hardware watchdog 1 6 second Watchdog 1 Software wat
20. Dimensions WxLxH 33mm x 102mm x 107mm Document version 1 14 Introduction Product Check List 1 5 Product Check List The package includes the following items e OneICPDASUSBI 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 How to install hardware and use utility 15 Document version 1 14 Hardware Information Module Overview 2 Hardware Information 2 1 Module Overview Tr amp I Os Terminal Frame Ground G p Board ID Rotary Switch DIN Rail Mount etlf _ E lt m USB Type B connector KA Normal Firmware ra gt update Mode Switch pa o MM e DIN Rail Lock Board ID Rotarv Switch 0 User defined Software Programmable 1 15 FixboardID Normal Firmware Update Mode Switch INIT Firmware update mode RUN Normal mode 16 Document version 1 14 Hardware Information Module Overview 2 1 1 USB 2019 2 1 1 1 Body 119 9 li IT Ga pm u 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 812 Document version 1 14 Hardware Information Module
21. new ICPDAS USBIO if ERR NO ERR iErrCode m_usbIO OpenDevice USB2019 1 if ERR NO ERR l iErrCode m usblO GetSoftWDTTimeout amp o_dwSoftWDTTimeout printf d iErrCode else printf d n o_dwCommTimeout iErrCode m_usbIO CloseDevice 69 Document version 1 14 ICP DAS USB Class Members Public Methods 5 6 2 3 GetDeviceID 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 amp o_dwDeviceID printf d iErrCode else printf d o_dwDevicelD iErrCode m_usbIO CloseDevice 70 Document version 1 14 ICP DAS USB Class Members Public Methods 5 6 2 4 GetFwVer Get firmware version of the device Syntax public int GetDevicelD WORD o_ 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 iErrCode else printf d o_wDwVer iErrCode m_usbIO Cl
22. 02x n o_byTypeCodelildx return iErrCode 193 Document version 1 14 ICP DAS USB Class Members Public Methods 5 6 6 12 2 AO_SetTypeCode BYTE Analog output function Set type code for all channels The type code can reference to Appendix A 2 Syntax public int AO_SetTypeCode BYTE i_byTypeCodes Parameters i_byTypeCodes IN The byte array of type code to set Return Value Error code 194 Document version 1 14 ICP DAS USB Class Members Public Methods Example int iErrCode ICPDAS USBIO m_usbIO BYTE o bvTvpeCode USBIO AO MAX CHANNEL BYTE m bvChTvpeCodejUSBIO AO MAX CHANNEL int ildx if ERR_NO_ERR iErrCode m usblO OpenDevice USB2026 1 for ildx 0 ildx lt USBIO AO MAX CHANNEL ildx m_byChTypeCodelildx 0x30 if ERR_NO_ERR iErrCode m_usbIO AO_SetTypeCode m_byChTypeCode printf d iErrCode if ERR_NO_ERR iErrCode m_usbIO AO_GetTypeCode o_byTypeCode printf d iErrCode else for ildx 0 ildx lt USBIO AO MAX CHANNEL ildx printf 0x 02x n o_byTypeCodelildx iErrCode m_usbIO CloseDevice return iErrCode 195 Document version 1 14 ICP DAS USB Class Members Public Methods 5 6 6 13 AO_SetChEnable Analog output function Set channel enable disable Each byte indicates 8 channels enable disable mask Ex Byte0 gt Channel0 7 Syntax public int AO_SetChEnable BYTE i_byChEnabl
23. 14 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 USB I 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 iErrCode ICPDAS USBIO m usblO DWORD o_dwCommTimeout m_usblO new ICPDAS USBIO if ERR NO ERR iErrCode m_usbIO SetCommTimeout 1000 if ERR NO ERR iErrCode m usblO GetCommTimeout amp o_dwCommTimeout printf d iErrCode else printf d n o_dwCommTimeout 66 Document version 1 14 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 disable when open device Syntax public int SetAutoResetWDT BO
24. 2 1 2 USB 2026 amp USB 2045 amp USB 2051 amp USB 2055 amp USB 2060 18 213 USB 2004 eo use iena 18 Zb WIS BELO BA is isa aaa 19 24 5 CA USBS asina EO KN E e 19 2 2 CONDEGOFPIMASSIONMENE S ct ea ta dl aah ao rat nah 20 2220 i lilla 20 2 22 JSB 202 6 ie DI Jr 20 223 U5BEZ045 aaa Le 21 2 PMI SB ZO BL tail do ab bb Bari bala fat od ap 22 225 USB 2055 EA A A wae 22 220 A 8 A A 23 22 NY SBeZO 0 ose in a 23 22 MOS BE A ar tr 24 Il Document version 1 14 Content Overview DONO eee NR 25 Zo LUSBr2019 ra aa sta pasa a s ae 25 21520200 25 203 USB 2045 aloe 26 2 34 USB 205 i ecu MIEN aa l A ces teateicten 27 2 3 5 WSB 2065 ai KANA kN sind oto hina 27 ZAIN He OO eau a ia E 28 DED TN S BaD OO ie E E 29 Z3 GUSB 2084 alal SA DADE AD 29 2 4 Hardware Configuration desi tii taa ea rd GO E snares 30 24 1 Board B pm m e e nr re i 30 242Fimwere Update u saka Es ua hn A a 30 24 00 B22 VG ii a alana avant ET 31 ZA AUSB 2020r emigi kts redni N ead var A ie 31 245 USB 2045 leali 32 24 0 USB 205 Lai 32 A MWSB 2OB B lla 32 DA GUSB2060 sale nia ek i 33 2 MON SBe2062 lle E eaters 33 24 LO USB 20 Be g ela 34 ZE NETO WAC CANONS a ora god i i BA A Sen eet SD A ai E 35 25 1 Normal Operatio N sisien biki leer eee 35 2 B FiriM Wane upale ie tu dirai a i e Ao 35 SInstalldtoN cio ruba 36 SI THAN CW ANG Lelli 36 3 1 1 Connecting to ICP DAS USB series I O MOdule 36 32 SONWa Cac ci s
25. 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 AI AO DI 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 74 Document version 1 14 ICP DAS USB Class Members Public Methods Example Int iErrCode ICPDAS_USBIO m usblO Byte o_bySupportIOMask m_usbIO new ICPDAS_USBIO if ERR NO ERR iErrCode m_usbIO OpenDevice USB2019 1 if ERR NO ERR iErrCode m_usbIO GetSupportIOMask amp o_bySupportIOMask printf d iErrCode else printf 0x 02x 0 bvSupportlOMask iErrCode m_usbIO CloseDevice 75 Document version 1 14 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 printf d iErrCode else printf 9od o_byDITotal iE
26. Document version 1 14 ICP DAS USB Class Members Public Methods 5 6 7 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 bvLPFilterEnablej 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_usbIO PI_SetLPFilterEnable m_byLPFilterEnable printf d iErrCode iErrCode m usblO CloseDevicel 270 Document version 1 14 ICP DAS USB Class Members Public Methods 5 6 7 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 i_wLPFilterWidth PI_SetLPFilterWidth WORD i_wLPFilterWidths 271 Document version 1 14 ICP DAS USB Class Members Public Methods
27. ICPDAS_USBIO if ERR_NO_ERR iErrCode m_usbIO OpenDevice USB2084 1 if ERR NO ERR l iErrCode m usblO PI GetTotalSupportTvpe amp o_ byTotalSupportType printf d iErrCode bRet false if ERR NO ERR iErrCode m usblO PI GetSupportTvpeCode 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 235 Document version 1 14 ICP DAS USB Class Members Public Methods 5 6 7 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 236 Document version 1 14 ICP DAS USB Class Members Public Methods Example Int iErrCode ICPDAS USBIO m usblO Byte o_byTypeCode USBIO PI MAX CHANNEL Int ildx m usblO new ICPDAS_USBIO if ERR_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 02x n o_byTypeCodelildx 237 Document version 1 14 ICP DAS USB Class Members Public
28. Members Public Methods Example Int iErrCode ICPDAS USBIO m_usblO DWORD o dwPiValuejUSBIO PI MAX CHANNEL BYTE o bvChStatus USBIO PI MAX CHANNEL Int ildx m usblO new ICPDAS USBIO if ERR NO ERR iErrCode m_usbIO OpenDevice USB2084 1 if ERR NO ERR l iErrCode m usblO PI ReadValue o dwPiValue o_byChStatus printf d iErrCode else for ildx 0 ildx lt USBIO PI MAX CHANNEL ildx printf d n o_dwPIValue ildx 247 Document version 1 14 ICP DAS USB Class Members Public Methods 5 6 7 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 248 Document version 1 14 ICP DAS USB Class Members Public Methods Example Int iErrCode ICPDAS USBIO m_usblO DWORD o dwCntValue jUSBIO PI MAX CHANNEL BYTE o bvChStatus USBIO PI MAX CHANNEL Int ildx m_usblO new ICPDAS USBIO if ERR NO ERR iErrCode m_usbIO
29. Methods 5 6 7 4 PI_GetTriggerMode Pulse input function Get trigger mode Falling edge 0 Rising edge 1 Both edge 283 Syntax public int PI GetTriggerMode BYTE o_byTriggerMode Parameters o_byTriggerMode OUT The byte array of trigger mode Return Value Error code 238 Document version 1 14 ICP DAS USB Class Members Public Methods Example Int iErrCode ICPDAS USBIO m_usblO Byte o bvTriggerMode USBIO PI MAX CHANNELI 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 iErrCode else for ildx 0 ildx lt USBIO PI MAX CHANNEL ildx printf 02x n 0 bvTriggerMode ildx 239 Document version 1 14 ICP DAS USB Class Members Public Methods 5 6 7 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 to bvChisolatedFlag OUT The byte arravs of channel isolated flag Return Value Error code 240 Document version 1 14 ICP DAS USB Class Members Public Methods Example Int iErrCode ICPDAS USBIO m usblO Byte o bvChisolatedFlag USBIO PI MAX CHANNEL 7 8 Int ildx m_usblO new ICPDAS USBIO if ERR_NO_ERR iErrCode m_usbIO OpenD
30. OpenDevice USB2084 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 249 Document version 1 14 ICP DAS USB Class Members Public Methods 5 6 7 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 250 Document version 1 14 ICP DAS USB Class Members Public Methods Example Int iErrCode ICPDAS_USBIO m_usblO float o_fFreqValue 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 iErrCode m_usbIO PI ReadValue o fFreqValue o_byChStatus printf d iErrCode else for ildx 0 ildx lt USBIO PI MAX CHANNEL ildx printf f n o_fFreqValuelildx
31. Overview 2 1 2 USB 2026 amp USB 2045 amp USB 2051 amp USB 2055 amp USB 2060 110 105 0 99 0 107 0 rr Figure 2 1 Figure 2 2 The USB 2084 left and front side view 18 Document version 1 14 Hardware Information Module Overview 2 1 4 USB 2084 102 9 i 39 0 35 4 ro al z Figure 2 3 Figure 2 4 The USB 2084 left and front side view 2 1 5 CA USB15 19 Document version 1 14 Hardware Information Connector Pin Assignment 2 2 Connector Pin Assignment 2 2 1 USB 2019 H j Pin Assignment Name Pin Terminal e No Pin iii Assignment Assignment CH 0 naa ga eo CHOE 03 15 CH 0 CHE 16 CH 1 CH 2 CH 1 04 H2 05 17 CH 2 CH 2 oH _ 66 18 CH 3 CH 3 oh bl y 19 CH 4 CH 3 CHS 68 20 CH 5 CH 4 CH 6 09 aips 22 CH 7 hi CH 7 10 CH 5 23 N C N C 11 CH 6 24 N C CH 6 N C 12 NC 13 25 N C CH 7 Shield FG CH 7 25 pin Female AGND D Sub Connector RENO Analog input ground Analog input channel N positive reference Analog input channel N negative reference
32. 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 iErrCode ICPDAS USBIO m usblO m_usbIO new ICPDAS USBIO if ERR NO ERR iErrCode m_usbIO OpenDevice USB2019 1 ERR NO ERR l iErrCode m_usbIO SYNCDevice printf d iErrCode iErrCode m_usbIO CloseDevice 64 Document version 1 14 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 USB I 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 iErrCode ICPDAS USBIO m usblO m usblO new ICPDAS USBIO if ERR NO ERR iErrCode m_usbIO SetCommTimeout 1000 printf d iErrCode 65 Document version 1
33. Value Error code 232 Document version 1 14 ICP DAS USB Class Members Public Methods Example Int iErrCode 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 GetTotalSupportTvpe amp o_ byTotalSupportType printf d iErrCode bRet false if ERR NO ERR iErrCode m usblO PI GetSupportTvpeCode 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 233 Document version 1 14 ICP DAS USB Class Members Public Methods 5 6 7 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 234 Document version 1 14 ICP DAS USB Class Members Public Methods Example Int iErrCode ICPDAS_USBIO m usblO Byte o bvTotalSupportTvpe Byte o bvSupportTvpeCodejUSBIO MAX SUPPORT TVPEJ Int ildx Bool bRet true m_usbIO new
34. 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 0x53E 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 AO value cannot detect the channel status It only read the AO value but has the most efficiency 176 Document version 1 14 ICP DAS USB Class Members Public Methods Syntax public int AO_ReadExpValue DWORD o_dwAOExpValue Parameters o_dwAOExpValue OUT The raw value of AO expect value Return Value Error code Example int iErrCode ICPDAS USBIO m usblO DWORD o dwAOExpValuejUSBIO AO MAX CHANNEL int ildx if ERR NO ERR iErrCode m_usbIO OpenDevice USB2026 1 if ERR NO ERR l iErrCode m usblO AO_ReadExpValue o_dwAOExpValue printf d iErrCode else for ildx 0 ildx lt USBIO AO MAX CHANNEL ildx printf 0x 04x n o_dwAOExpValuelildx return iErrCode 177 Document version 1 14 ICP DAS USB Class Members Public Methods 5 6 6 6 2 AO_ReadExpValue float Analog output function Read the real AO expect value The reading value is calculated users no need to convert it to real value for
35. boic 1 Firmware File FNUSB 2000 Source Code Fimware 2KDIONUSB 2KDIO_1 06 hw Browser KE s fn ICPDAS USBIO FW Update Tool v1 00 W gt bobas 1 Firmware File s USB 2000 Source Code Fimware 2KD1O USB 2KDIO_11 05 hw Browser 2 Firmware Update 2 Firmware Update Firmware Update Success l Please Reboot Module l Firmware Update Firmware Downloading l 19 Step5 Switch USB I O module back to RUN mode After successfully update firmware users have to switch the mode back to RUN to normal operation Users also have to use the hardware switch to change the mode 281 Document version 1 14
36. code 220 Document version 1 14 ICP DAS USB Class Members Public Methods Example int iErrCode ICPDAS USBIO m usblO float o fPowerOnValue IUSBIO AO MAX CHANNEL float fSetPowerOnValuejUSBIO AO MAX CHANNELJ int ildx if ERR NO ERR iErrCode m usblO OpenDevice USB2026 1 for ildx 0 ildx lt USBIO AO MAX CHANNEL ildx fSetPowerOnValue ildx 5 if ERR NO ERR iErrCode m_usbIO AO_SetPowerOnValue fSetPowerOnValue printf d iErrCode if ERR_NO_ERR iErrCode m_usbIO AO_GetPowerOnValue o_fPowerOnValue printf d iErrCode else for ildx 0 ildx lt USBIO AO MAX CHANNEL ildx printf 04f n o_fPowerOnValuelildx return iErrCode 221 Document version 1 14 ICP DAS USB Class Members Public Methods 5 6 6 18 AO_ SetSafetyValue The class library provides 4 overload methods to write AO Safety Value Two method provides specifying channel to write raw data and converted value The others write AO Safety Value for all channels The overview of these methods is as following table and will describe in the following section Name of Methods AO_ SetSafetyValue BYTE i_byChToSet DWORD i_dwSafetyValue AO_ SetSafetyValue DWORD i_dwSafetyValue AO_ SetSafetyValue BYTE i_byChToSet float i_fSafetyValue AO_ SetSafetyValue float i_fSafetyValue 222 Document version 1 14 ICP DAS USB Class Members Public Methods 5 6 6 18 1 AO_ SetSafe
37. expect input type Ex The reading value is 1 316 in 2 5 2 5V the input signal is 1 316V Syntax public int AO_ReadExpValue float o_fAOExpValue Parameters o fAOExpValue OUT The true value of AO expect value Return Value Error code Example int iErrCode ICPDAS USBIO m usblO float o fAOExpValuejUSBIO AO MAX CHANNEL int ildx if ERR NO ERR iErrCode m_usbIO OpenDevice USB2026 1 if ERR NO ERR l iErrCode m usblO AO ReadExpValue o fAOExpValue printf d iErrCode else for ildx 0 ildx lt USBIO AO MAX CHANNEL ildx printf 04f n o_fAOExpValuelildx return iErrCode 178 Document version 1 14 ICP DAS USB Class Members Public Methods 5 6 6 7 AO_ ReadCurValue The class library provides 2 overload methods to read AO current value One method the parameter in float format will convert raw value to true inside the method The other 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 AO_ReadCurValue DWORD o_dwAOCurValue AO_ReadCurValue float o_fAOCurValue 179 Document version 1 14 ICP DAS USB Class Members Public Methods 5 6 6 7 1 AO_ReadCurValue DWORD Analog output function Read AO current value in double word digital format In the digital format the value represents the value from zero to full scale Ex
38. iErrCode ICPDAS USBIO m usblO BYTE o bvPwrOnEnable JUSBIO AO MAX CHANNEL BYTE i bvSetPwrOnEnablejUSBIO AO MAX CHANNEL int ildx if ERR NO ERR iErrCode m usblO OpenDevice USB2026 1 for ildx 0 ildx lt USBIO AO MAX CHANNEL ildx i bvSetPwrOnEnablejildx 0x01 if ERR_NO_ERR iErrCode m_usbIO AO_SetPowerOnEnable i_bySetPwrOnEnable printf d iErrCode if ERR_NO_ERR iErrCode m_usbIO AO_GetPowerOnEnable o_byPwrOnEnable printf d iErrCode else for ildx 0 ildx lt USBIO_AO_MAX_CHANNEL ildx printf 0x 02x n o_byPwrOnEnable ildx return iErrCode 209 Document version 1 14 ICP DAS USB Class Members Public Methods 5 6 6 16 AO_SetSafetyEnable Analog output function Set Safety Enable Each byte indicates 8 channels enable disable mask EX Byte0 gt Channel0 7 Syntax public int AO_SetSafetyEnable BYTE o_bySafetyEnable Parameters o_bySafetyEnable OUT The byte array of channel enable disable mask Return Value Error code 210 Document version 1 14 ICP DAS USB Class Members Public Methods Example int iErrCode ICPDAS USBIO m usblO BYTE o bvSafetvEnable USBIO AO MAX CHANNEL 7 8 BYTE i bvSetSafetvEnable USBIO AO MAX CHANNEL 7 8 0x03 int ildx if ERR_NO_ERR iErrCode m_usbIO OpenDevice USB2026 1 if ERR_NO_ERR iErrCode m_usbIO AO_SetSafetyEnable i_bySetSafetyEnable printf
39. m usblO PI SetChisolatedFlag m bvChisolatedFlag printf d iErrCode iErrCode m_usblO CloseDevice 267 Document version 1 14 ICP DAS USB Class Members Public Methods 5 6 7 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 268 Document version 1 14 ICP DAS USB Class Members Public Methods 5 6 7 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 iErrCode m usblO PI SetLPFilterEnable 5 0x1 printf d iErrCode iErrCode m_usbIO CloseDevice 269
40. mV 500 mV OxOC 150 mV 150 mV Ox0D 20 mA 20 mA UXOE Type JTC 210 760 C OxOF Type K TC 210 1372 C 0x10 Type T TC 270 400 C 0x11 Type E TC 270 1000 C 0x12 Type R 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 14 0x17 0x18 0x19 Ox1A Ox1B Ox1C 0x20 0x21 0x22 0x23 0x24 0x25 0x26 0x27 0x28 0x29 Ox2A 0x2B 0x2C 0x2D Ox2E Ox2F 275 Type LTC 200 800 C Type MTC 200 100 C Type Lpina3710 TC 200 900 C O 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 InputType 0x30 O 20mA 0x31 4 20 mA 0x32 OV 10V 0x33 10V 10V 0x34 OV 45V 0x35 5V 5V A 3 Pulse Input Type Code Code InputType 0x50 Up counter 0x51 Frequency Ox52 Counter with battery backup 0x53 Encoder 0x54 Up Dow
41. 251 Document version 1 14 ICP DAS USB Class Members Public Methods 5 6 7 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 252 Document version 1 14 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 OnBulkValueFinishEvent i CBFunc Parameters i bvStartCh IN The starting acquire channel i bvCh
42. 3 if ERR NO ERR l iErrCode m usblO SetDeviceNickName byNickName printf d iErrCode iErrCode m_usbIO CloseDevice 83 Document version 1 14 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 i_dwSoftWDTTimeout Parameters i_dwSoftWDTTimeout IN The software WDT timeout in millisecond 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 USB20xx 1 if ERR NO ERR l iErrCode m usblO SetSoftWDTTimeout 1000 printf d iErrCode iErrCode m_usblO CloseDevice 84 Document version 1 14 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 iErrCode 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_usbIO LoadDefault printf d iErrCode iErrCode m_usbIO CloseDevice 85 Document version 1 14 ICP DAS USB Class Members Public Methods 5 6 2 18 StopBulk Stop current bulk process Syntax public int LoadDefault void Par
43. 3710 Resolution 16 bit Accuracy 0 1 FSR Sampling Rate 10 Hz Total Zero Drift 20 vje Span Drift 25 ppm C Voltage Input Type p yP Current Common Mode Rejection 86 dB Normal Mode Rejection 100 dB Voltage gt 400 kQ Current 125Q External resistor is required Input Impedance Intra Module Isolation I 3000 Voc Field to Logic Overvoltage protection 240 Vims 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 14 Introduction Specifications 1 4 3 USB 2026 The USB 2026 is a multifunction module that includes 5 analog input channels 2 analog output channels 2 digital input channels 2 digital output channels and compatibles with USB 2 0 full speed It equips small size portable USB bus powered various input type features to help user build up GS USB 2026 own project easily and quickly The USB 2026 provides a programmable input range on all analog input 150 mV 500 mV 1 V 5 V 10 V 20 mA or 0 20 MA analog outputs are 12 bit at 5 V 10 V 0 20 MA or 4 20 mA Each analog input can be configured for an individual range and provides a high overvoltage protection of 240 Vrms Multifunction Analog Input Channels 5 Differential Voltage 1 V 2 5 V 5 V 10 V Current 20 mA 0
44. 6 4 7 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 i_bySafetyEnable Parameters i_bySafetyEnable IN The safety enable mask Each bit represents the safety configuration of each channel Return Value Error code 119 Document version 1 14 ICP DAS USB Class Members Public Methods Example Int iErrCode ICPDAS USBIO m usblO Byte i bvSafetvEnablej0 USBIO DO MAX CHANNEL 7 8 Int ildx Bool bRet true m_usblO new ICPDAS USBIO if ERR NO ERR iErrCode m_usbIO OpenDevice USB2064 1 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 120 Document version 1 14 ICP DAS USB Class Members Public Methods 5 6 4 8 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 121 Document version 1 14 ICP DAS USB Class Members Public Methods Example Int iErrCode ICPDAS USBIO m us
45. A if ERR NO ERR l iErrCode m_usbIO AI SetChEnable m bvChEnable printf d iErrCode iErrCode m_usblO CloseDevice 162 Document version 1 14 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 i_byFilterRejection Parameters i_byFilterRejection IN The filter rejection Return Value Error code Example Int iErrCode ICPDAS USBIO m_usbIO m_usblO 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 163 Document version 1 14 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 iErrCode ICPDAS USBIO m usblO m_usbIO new ICPDAS USBIO if ERR NO ERR iErrCode m_usbIO OpenDevice USB2019 1 if ERR NO ERR l iErrCode m usblO AI SetCJCOffset 20 81 printf d iErrCode iErrCode m_usblO CloseDevice 164 Document version 1 14 ICP DAS USB Class Members Public Methods 5 6 5 19 AI SetCJCEnable Anal
46. AO_MAX_CHANNEL ildx printf 0x 04x n o dwSafetvValuejildx return iErrCode 227 Document version 1 14 ICP DAS USB Class Members Public Methods 5 6 6 18 3 AO_ SetSafetyValue BYTE float Analog output function Set AO Safety Value to specifying channel in float analog format The writting value is calculated users write real value for current output type Ex The writting value is 1 316 in 2 5 2 5V the output signal is 1 316V Syntax public int AO_ SetSafetyValue BYTE i_byChToSet DWORD i_fSafetyValue Parameters i_byChToSet IN The specific AO channel to be set i fSafetyValue IN The AO Safety Value Return Value Error code 228 Document version 1 14 ICP DAS USB Class Members Public Methods Example int iErrCode ICPDAS_USBIO m usblO float o_fSafetyValue JUSBIO AO MAX CHANNEL BYTE bvChannel 0 float fSetSafetvValue 5 int ildx ifiERR NO ERR iErrCode m_usbIO OpenDevice USB2026 1 if ERR NO ERR iErrCode m_usbIO AO_SetPowerOnValue byChannel fSetSafetyValue printf d iErrCode if ERR_NO_ERR iErrCode m_usbIO AO_GetPowerOnValue o fSafetvValue printf d iErrCode else for ildx 0 ildx lt USBIO_AO_MAX_CHANNEL ildx printf 04f n o_fSafetyValuelildx return iErrCode 229 Document version 1 14 ICP DAS USB Class Members Public Methods 5 6 6 18 4 AO_ SetSafetyValue float
47. AS_USBIO m usblO DWORD o dwAOExpValuejUSBIO AO MAX CHANNEL BYTE bvChannel 0 DWORD dwAOValue Oxff int ildx if ERR_NO_ERR iErrCode m_usbIO OpenDevice USB2026 1 if ERR_NO_ERR iErrCode m_usbIO AO_WriteValue byChannel dwAOValue printf d iErrCode if ERR_NO_ERR iErrCode m_usblO AO_ReadExpValue o_dwAOExpValue printf d iErrCode else for ildx 0 ildx lt USBIO AO MAX CHANNEL ildx printf 0x 04x n o_dwAOExpValuelildx return iErrCode 201 Document version 1 14 ICP DAS USB Class Members Public Methods 5 6 6 14 2 AO_WriteValue DWORD Analog output function Write AO expect value to all channels in double word digital format Syntax public int AO_WriteValue DWORD i dwAOVal Parameters i dwAOVal IN The AO value Return Value Error code 202 Document version 1 14 ICP DAS USB Class Members Public Methods Example int iErrCode ICPDAS USBIO m usblO DWORD o dwAOExpValuejUSBIO AO MAX CHANNEL DWORD dwAOValuejUSBIO AO MAX CHANNEL int ildx if ERR NO ERR iErrCode m usblO OpenDevice USB2026 1 for ildx 0 ildx lt USBIO AO MAX CHANNEL ildx dwAOValue ildx Oxff if ERR_NO_ERR iErrCode m_usbIO AO_WriteValue dwAOValue printf d iErrCode if ERR_NO_ERR iErrCode m_usbIO AO_ReadExpValue o_dwAOExpValue printf d iErrCode else for ildx 0 ildx lt USBIO AO M
48. AS_USBIO m_USBIO Class ICPDAS_USBIO m_USBIO new ICPDAS_USBIO Initialization Dim m_USBIO As ICPDAS_USBIO Set m_USBIO New ICPDAS USBIO 51 Document version 1 14 Operation Software structure C m USBIO OpenDevicel C m_USBIO OpenDevice VB Call m_USBIO OpenDevice Crt m USBIO AI ReadValue C m_USBIO AI ReadValue Access I O 4 VB Call m USBIO AI ReadValue CloseDevice lt C m_USBIO CloseDevice C m_USBIO CloseDevice VB Call m_USBIO CloseDevice 52 Document version 1 14 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 E ICPDAS_USBIO Initializes a new instance of the ICPDAS_USBIO class 5 2 Table of Static Methods Name Description o ListDevice List all devices connected with local PC ScanDevice Scan devices connected with local PC 5 3 Table of Public Methods 5 3 1 System Mame Descr OOO OpenDevice List all devices connected with local PC C
49. AX CHANNEL ildx printf 0x 04x n o_dwAOExpValuelildx return iErrCode 203 Document version 1 14 ICP DAS USB Class Members Public Methods 5 6 6 14 3 AO_WriteValue BYTE float Analog output function Write AO expect value to specifying channel in float analog format The writting value is calculated users write real value for current output type Ex The writting value is 1 316 in 2 5 2 5V the output signal is 1 316V Syntax public int AO_WriteValue BYTE i_byChToSet DWORD i fAOVal Parameters i bvChToSet IN The specific AO channel to be set i fAOVal IN The AO value Return Value Error code 204 Document version 1 14 ICP DAS USB Class Members Public Methods Example int iErrCode ICPDAS USBIO m usblO float o fAOExpValuejUSBIO AO MAX CHANNEL BYTE bvChannel 0 float fAOValue 5 int ildx if ERR_NO_ERR iErrCode m_usbIO OpenDevice USB2026 1 if ERR NO ERR l iErrCode m_usbIO AO_WriteValue byChannel fAOValue printf d iErrCode if ERR_NO_ERR iErrCode m_usbIO AO_ReadExpValue o_fAOExpValue printf d iErrCode else for ildx 0 ildx lt USBIO_AO_MAX_CHANNEL ildx printf 04f n o_fAOExpValuelildx return iErrCode 205 Document version 1 14 ICP DAS USB Class Members Public Methods 5 6 6 14 4 AO_WriteValue float Analog output function Write AO expect value to all channel
50. DetectEnable Parameters o_byWireDetectEnable OUT The wire detect enable Return Value Error code Example Int iErrCode ICPDAS USBIO m usblO Bvte o bvWireDetectEnable m_usblO new ICPDAS USBIO if ERR NO ERR iErrCode m_usbIO OpenDevice USB2019 1 if ERR NO ERR l iErrCode m usblO AI GetWireDetectEnable amp o_byWireDetectEnable printf d iErrCode else printf d n o_byWireDetectEnable 141 Document version 1 14 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_usblO 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 iErrCode else For ildx 0 ildx lt USBIO AI MAX CHANNEL ildx printf d n o bvResolutioniildx 142 Document version 1 14 ICP DAS USB Class Members Public Methods 5 6 5 11 AI ReadValue The class library provides 4 overload methods to read AI value Two methods the parameter in float format will convert raw val
51. EHost 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 CAWINDOWS Microsof 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 CAWINDOWS Microsof ia System Windows Forms Microsoft Build Utilities 0 0 v2 0 50727 CAWINDOWSIMierosof System Xml Microsoft Build Visual 2 0 0 v20 50727 CAWINDOWS Microsof a E Formi es ci Program cs 47 Document version 1 14 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 z Enor Lookup 2l 7 ActiveX Control Test Container gt OLE COM Object Viewer gt A Sp 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 Directories C Program Files Microsoft Visual Studio YC98 INCLUDE C Program Files Microsoft Vis
52. EX Byte0 gt Channel0 7 Syntax public int AO_GetChEnable BYTE o_byChEnable Parameters o_byChEnable OUT The byte array of channel enable disable mask Return Value Error code 172 Document version 1 14 ICP DAS USB Class Members Public Methods Example int iErrCode ICPDAS USBIO m usblO BYTE o bvChEnable USBIO AO MAX CHANNEL 7 8 int ildx if ERR NO ERR iErrCode m_usbIO OpenDevice USB2026 1 if ERR NO ERR l iErrCode m_usbIO AO_GetChEnable o_byChEnable printf d iErrCode else for ildx 0 ildx lt USBIO_AO_MAX_CHANNEL 7 8 ildx printf 0x 02x n o_byChEnable ildx return iErrCode 173 Document version 1 14 ICP DAS USB Class Members Public Methods 5 6 6 5 AO_GetResolution Analog output function Get resolution Each byte indicates each channel real resolution Syntax public int AO_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 AO MAX CHANNEL int ildx if ERR NO ERR iErrCode m_usbIO OpenDevice USB2026 1 if ERR NO ERR l iErrCode m_usbIO AO GetResolution o bvResolution printf d iErrCode else for ildx 0 ildx lt USBIO AO MAX CHANNEL ildx printf d n o_byResolution ildx return iErrCode
53. 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 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 0x53E 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 AO value cannot detect the channel status It only read the AO value but has the most efficiencv 180 Document version 1 14 ICP DAS USB Class Members Public Methods Syntax public int AO_ReadCurValue DWORD o_dwAOCurValue Parameters o_dwAOCurValue OUT The raw value of AO current value Return Value Error c
54. I ReadValue float o_fAIValue BYTE o_byAIChStatus Parameters xo fAlValue OUT The true value of AI value o_byAIChStatus OUT The byte array of channel status Return Value Error code 150 Document version 1 14 ICP DAS USB Class Members Public Methods Example Int iErrCode 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 AI ReadValue o fAlValue o_byAIChStatus printf d iErrCode else For ildx 0 ildx lt USBIO_AI MAX_CHANNEL ildx printf 5f 0x 02x n o_fAlValue ildx o_byAIChStatus 151 Document version 1 14 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 API has block and non block operation In block operation user s application needs to wait until API finishing all procedure In con
55. O CloseDevice 88 Document version 1 14 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 89 Document version 1 14 ICP DAS USB Class Members Public Methods Example Int iErrCode ICPDAS USBIO m usblO WORD o_wrFilterWidth Int ildx Bool bRet true m_usbIO new ICPDAS USBIO if ERR NO ERR iErrCode m usblO OpenDevice USB2051 1 if ERR NO ERR l iErrCode m_usbIO DI GetDigitalFilterWidth amp o_wFilterWidth printf d iErrCode bRet false If bRet printf d n o_wFilterWidth 90 Document version 1 14 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 91 Document version 1 14 ICP DAS USB Class Members Public Methods Example Int iErrCode ICPDAS USBIO m usblO DWORD o_dwlnverse Int ildx Bool
56. O OpenDevice USB2019 1 if ERR NO ERR l iErrCode m_usbIO AI ReadValue o_dwAlValue o_byAIChStatus printf d iErrCode else For ildx 0 ildx lt USBIO_AI MAX CHANNEL ildx printf Ox 08x 0x 02x n o_dwAlValue ildx o_byAIChStatus 147 Document version 1 14 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_fAIValue Parameters xo fAlValue OUT The true value of AI value Return Value Error code 148 Document version 1 14 ICP DAS USB Class Members Public Methods Example Int iErrCode 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 149 Document version 1 14 ICP DAS USB Class Members Public Methods 5 6 5 11 4 AI ReadValue float BYTE Analog input function Read the real AI value with channel status Syntax public int A
57. OL i_bEnable Parameters i_bEnable IN To enable disable the library to automatically handle watchdog Return Value Error code Example Int iErrCode 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_usbIO SetAutoResetWDT FALSE printf d iErrCode 67 Document version 1 14 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 iErrCode ICPDAS_USBIO m usblO m_usblO new ICPDAS USBIO if ERR NO ERR iErrCode m_usbIO OpenDevice USB2019 1 if ERR NO ERR l iErrCode m usblO RefreshDevicelnfo printf d iErrCode iErrCode m_usbIO CloseDevice 68 Document version 1 14 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 o_dwSoftWDTTimeout OUT The software WDT timeout in millisecond ms Return Value Error code Example Int iErrCode ICPDAS USBIO m usblO DWORD o dwSoftWDTTimeout m usblO
58. Rate 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 usblO AI ReadBulkValue 0 2 100 SampleRate BufferWidth m_dwBuffer BulkFinishCallback printf d iErrCode while 1 Sleep 1 154 Document version 1 14 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_usblO 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 155 Document version 1 14 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 refer to user s manual for analog input type code These two overload methods are listed as following table and described in followi
59. Total 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 253 Document version 1 14 ICP DAS USB Class Members Public Methods Example Int iErrCode 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_usbIO OpenDevice USB2084 1 if ERR NO ERR iErrCode m usblO PI ReadBulkValue 0 2 100 SampleRate BufferWidth m_dwBuffer BulkFinishCallback printf d iErrCode while 1 Sleep 1 254 Document version 1 14 ICP DAS USB Class Members Public Methods 5 6 7 12 PI_SetTypeCode The class has two overload methods for setting type code One provides specifying channel to set another for all channels Please refer to user s manual for pulse input type code These two o
60. Value Parameters o_ dwSafetyValue OUT The DWORD array of Safety Value Return Value Error code Example int iErrCode ICPDAS USBIO m usblO DWORD o_dwSafetyValue JUSBIO AO MAX CHANNEL int ildx if ERR NO ERR iErrCode m_usbIO OpenDevice USB2026 1 if ERR NO ERR l iErrCode m_usbIO AO_GetSafetyValue o dwSafetvValue printf d iErrCode else for ildx 0 ildx lt USBIO AO MAX CHANNEL ildx printf 0x 04x n o_dwSafetyValue ildx return iErrCode 189 Document version 1 14 ICP DAS USB Class Members Public Methods 5 6 6 11 2 AO_ GetSafetyValue float Analog output function Get Safety value Each channel takes one unit of float array Syntax public int AO_ GetSafetyValue float o_ fSafetyValue Parameters o_ fSafetyValue OUT The float array of Safety Value Return Value Error code Example int iErrCode ICPDAS USBIO m usblO float o_fSafetyValue JUSBIO AO MAX CHANNEL int ildx if ERR NO ERR iErrCode m_usbIO OpenDevice USB2026 1 if ERR NO ERR iErrCode m_usbIO AO_GetSafetyValue o fSafetyValue printf d iErrCode else for ildx 0 ildx lt USBIO AO MAX CHANNEL ildx printf 04f n o_fSafetyValue ildx return iErrCode 190 Document version 1 14 ICP DAS USB Class Members Public Methods 5 6 6 12 AO_SetTypeCode The class has two overload methods for setting type code One provide
61. _DI MAX CHANNEL gt gt 3 ildx printf d n o_dwDICntValuel ildx 98 Document version 1 14 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_usblO 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 99 Document version 1 14 ICP DAS USB Class Members Public Methods 5 6 3 7 DI SetDigitalValuelnverse Digital input function Set DI Value Inverse No 0 Yes 1 Syntax public int DI SetDigitalValueInverse DWORD i dwinverse Parameters i dwinverse IN The inverse setting Return Value Error code Example Int iErrCode ICPDAS USBIO m usblO m_usblO 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 100 Document version 1 14 ICP DAS USB Class Members Pu
62. abled bv default Jumper Setting 32 Document version 1 14 Hardware Information Hardware Configuration Enable o Disable o 2 4 8 USB 2060 2 4 8 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 Setting Enable lee Disable o 2 4 9 USB 2064 2 4 9 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 Enable e e Disable o Default 33 Document version 1 14 Hardware Information Hardware Configuration 2 4 10 USB 2084 2 4 10 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 SE isable 2 4 10 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 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 inp
63. al supported AO_GetTotalSupportType amount Analog output function Get supported type AO_GetSupportTypeCode l IRAP PP yp code AO_GetTypeCode Analog output function Get type code Analog output function Get channel AO_GetChEnable enable disable AO_GetResolution Analog output function Get resolution Analog output function Read AO expect value in AO_ReadExpValue double word format Analog output function Read AO current value in AO_ReadCurValue double word format AO_GetPowerOnEnable Analog output function Get Power On Enable AO_GetSafetyEnable Analog output function Get Safety Enable AO_GetPowerOnValue Analog output function Get Power On value AO_GetSafetyValue Analog output function Get Safety value Analog output function Set type code for specific AO_SetTypeCode channel Analog output function Set channel AO_SetChEnable l enable disable f Analog output function Write AO value in AO_WriteValue double word format AO_SetPowerOnEnable Analog output function Set Power On Enable AO_SetSafetyEnable Analog output function Set Safety Enable AO_SetPowerOnValue Analog output function Set Power On Value AO_SetSafetyValue Analog output function Set Safety Value 5 3 7 Pulse Input Name oescription PI GetTotalSupportTvpe Pulse input function Get total supported amount PI GetSupportTypeCode Pulse input function Get supported type code PI_GetTypeCode Pul
64. ameters none Return Value Error code Example Int iErrCode ICPDAS USBIO m usblO 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_usbIO CloseDevice 86 Document version 1 14 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 87 Document version 1 14 ICP DAS USB Class Members Public Methods Example Int iErrCode ICPDAS_USBIO m usblO Bool m_bEmcyPktArrive Bvte 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 iErrCode while 1 User s application loop If m_ bEmcyPktArrive Handle emcy packet iErrCode m_usbI
65. aring Return Value Error code Example Int iErrCode ICPDAS USBIO m_usbIO m_usblO new ICPDAS USBIO if ERR NO ERR iErrCode m_usbIO OpenDevice USB2084 1 if ERR NO ERR l iErrCode m_usbIO PI_ClearSingleChStatus 7 printf d iErrCode iErrCode m_usbIO CloseDevice 261 Document version 1 14 ICP DAS USB Class Members Public Methods 5 6 7 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 262 Document version 1 14 ICP DAS USB Class Members Public Methods 5 6 7 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_usblO new ICPDAS USBIO if ERR NO ERR iErrCode m_usbIO OpenDevice USB2084 1 if ERR NO ERR l iErrCode m_usbIO PI_S
66. at Analog output function Get Power On Value Each channel takes one unit of float array Syntax public int AO_GetPowerOnValue float o_fPwrOnValue Parameters xo fPwrOnValue OUT The float array of Power On Value Return Value Error code Example int iErrCode ICPDAS USBIO m usblO float o fPwrOnValue JUSBIO AO MAX CHANNEL int ildx if ERR NO ERR iErrCode m_usbIO OpenDevice USB2026 1 if ERR_NO_ERR iErrCode m_usbIO AO_GetPowerOnValue o fPwrOnValue printf d iErrCode else for ildx 0 ildx lt USBIO_AO_MAX_CHANNEL ildx printf 04f n o_ fPwrOnValue ildx return iErrCode 187 Document version 1 14 ICP DAS USB Class Members Public Methods 5 6 6 11 AO_GetSafetyValue The class library provides 2 overload methods to read AO Safety Value One method the parameter in float format will convert raw value to true inside the method The other 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 AO_ GetSafetyValue DWORD o dwSafetyValue AO_ GetSafetyValue float o_ fSafetyValue 188 Document version 1 14 ICP DAS USB Class Members Public Methods 5 6 6 11 1 AO_ GetSafetyValue DWORD Analog output function Get Safety value Each channel takes one unit of DWORD array Syntax public int AO_ GetSafetyValue DWORD o_dwSafety
67. atic method just refreshes the list of the ICP DAS USB series 1 O modules itis necessary to call ListDevice to refresh new list Syntax public int ScanDevice void Parameters none Return Value Error code Example ICPDAS_USBIO ScanDevice 61 Document version 1 14 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_byUSBIO_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 iErrCode ICPDAS_USBIO m usblO m_usbIO new ICPDAS_USBIO iErrCode m_usbIO OpenDevice USB2019 1 iErrCode m_usblO CloseDevice 62 Document version 1 14 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 iErrCode ICPDAS USBIO m usblO m_usblO new ICPDAS USBIO if ERR NO ERR iErrCode m usblO OpenDevice USB2019 1 Some code accessing USB I O iErrCode m_usblO CloseDevice 63 Document version 1 14 ICP DAS USB Class Members
68. 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_dwlnverse 92 Document version 1 14 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 Svntax public int DI GetCntEdgeTrigger DWORD o_dwEdgeTrig Parameters o_dwEdgeTrig OUT The counter edge trigger setting Return Value Error code 93 Document version 1 14 ICP DAS USB Class Members Public Methods Example Int iErrCode ICPDAS_USBIO m usblO DWORD o dwEdgerrig 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 GetCntEdgeTrigger amp o_dwEdgeTrig printf d iErrCode bRet false If bRet printf d n o_dwEdgeTrig 94 Document version 1 14 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 DI ReadValue BYTE o_byDIValue Parameters o_byDIValue OUT The byt
69. blO Byte i bvSafetvValuej USBIO DO MAX CHANNEL 7 8 Int ildx Bool bRet true m_usblO 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 122 Document version 1 14 ICP DAS USB Class Members Public Methods 5 6 4 9 DO_SetDigitalOutputInverse Digital output function Set DO Output Inverse No 0 Yes 1 Syntax public int DO_SetDigitalOutputInverse DWORD i dwinverse Parameters i dwinverse IN The inverse setting Return Value Error code Example Int iErrCode ICPDAS USBIO m_usbIO m_usblO new ICPDAS USBIO if ERR NO ERR iErrCode m_usbIO OpenDevice USB2051 1 if ERR NO ERR l iErrCode m_usbIO DO SetDigitalOutputinverse 1 printf d iErrCode m_usbIO CloseDevice 123 Document version 1 14 ICP DAS USB Class Members Public Methods 5 6 4 10 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 Methods DO_WriteValue BYTE i_byChannel BYTE i_byValue DO_WriteValue BYTE i_byDOValue 124 Document version 1 14 ICP DAS USB Class Members
70. ble 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 106 Document version 1 14 ICP DAS USB Class Members Public Methods Example Int iErrCode ICPDAS USBIO m usblO Byte o bvSafetvEnablej USBIO DO MAX CHANNEL 7 8 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 GetSafetvEnable 8Lo bvSafetvEnables 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 107 Document version 1 14 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 108 Document version 1 14 ICP DAS USB Class Members Public Methods Example Int iErrCode ICPDAS_USBIO m usblO Byte o bvSafetvValuej USBIO DO MAX CHANNEL 7 8 Int ildx
71. blic 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_usblO 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 101 Document version 1 14 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_usblO 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 102 Document version 1 14 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 Parameters i_dwCntClrMask IN The counter clear mask Retu
72. c 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 ifiERR NO ERR iErrCode m_usbIO OpenDevice USB20xx 1 if ERR NO ERR l iErrCode m usblO GetAOTotal amp o_byAOTotal printf d iErrCode else printf d o_byAOTotal iErrCode m_usblO CloseDevice 79 Document version 1 14 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_byPITotal OUT The PI total number of channels Return Value Error code Example Int iErrCode 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 iErrCode m usblO GetPITotal amp o_byPITotal printf d iErrCode else printf d 0 bvPITotal iErrCode m_usbIO CloseDevice 80 Document version 1 14 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 Error code Example Int iErrCode ICPDAS USBIO m usblO Bvte o bvPOTotal
73. chdog Programmable LED Indicators System LED Indicators 3 LED as Power Run and Error 5 Document version 1 14 Introduction Specifications 4 kV contact for each terminal 8 kV air for random point 33mm x 78mm x 107mm 25 75 C f ure 40 85 C 10 95 RH non condensing Document version 1 14 Introduction Specifications 1 4 4 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 f VDC Intra module isolation are standard Digital Output m Channels 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 Power on Value Yes Safe Value Yes Power Power Consumption 1 0 W max Dimensions WxLxH 72mm x 123 mm x 35 mm 7 Document version 1 14 Introduction Specifications 1 4 5 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
74. cien ocean jej da cyan i as ct ici ra 36 SPANO S igla ORA ET I 37 3 2 2 ICP DAS USB I O Software Integration ui 47 325 Sapere a an a 49 A CSV ANION and a O ra Rea eae ri rental 50 4 1 Hardware Structure o at ratori 50 4 2 SOM ANE SEU CURIE Gc sai a olii RI rd 50 5 ICP DAS USB Glass Member trad 53 5 l IabpleoEConsiruetore vano ne nin SA 53 5 2 lable fstaleMettod lot 53 IV Document version 1 14 Content Overview 5 3 Table of Public Methods cc a ad a dd da 53 5 3 L SWOR ERA 53 58 DIVIT e lt s o ok ia 54 533 Digital Inpilrrea leleine 54 534 DIG tek OUtnut gt ni ke A ensiees 55 Bo 5 Analog API PU aiar 55 BoGAnalogOUtPut as ie cats e aag iS s le 57 537 PU e ln PU olo ii noe ia al 57 Serre 58 BELE OTIS IMUEIOKS coran ed cada darn ce choy dad em a a aa 59 SA VIEPDAS USBIQ alano aiar 59 55 Static Methods ana nei ai 60 5 2 4 LISTDevi e orione ali 60 5 5 2 SCAN DeVI E sorio lola 61 BG PUBIC IVS NOUS tix b een ta aaa A a 62 5 0 1 SV 62 5 6 2 DEVI E Asia fnk pd ai 68 5e S Digtal en pm pm mova 89 564 Digital UL ot sretnes dei ikel eb A O E A 104 Plo SAMAIOG AND UE sara ad ER SA O i 129 BoGanalog Output usana a oh GR i 167 567 Zijo Ulje mm vara mmen e renne mrvara nanio 232 6 Troubleshooting i EE GR S KS RG RE 274 PRD STN iure 275 A 1 Analog Input Type Code c ca 275 A 2 Analog Output Type Code flo aa ani debe i de e 276 A 3 Pulse Input Type Colere calare 276 A 4 C
75. d 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 0x53E 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 146 Document version 1 14 ICP DAS USB Class Members Public Methods Syntax public int AI ReadValue DWORD o_dwAIValue BYTE o_byAIChStatus Parameters o_dwAIValue OUT The raw value of AI value o_byAIChStatus OUT The byte array of channel status Return Value Error code Example Int iErrCode ICPDAS_USBIO m usblO DWORD o dwAIValuejUSBIO AI MAX CHANNEL Byte o bvAIChStatus jUSBIO AI MAX CHANNEL Int ildx m_usblO new ICPDAS USBIO if ERR NO ERR iErrCode m_usbI
76. de Analog input function Get supported type code Please refer to Appendix A 1 of user s manual to map AI 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 131 Document version 1 14 ICP DAS USB Class Members Public Methods Example Int iErrCode 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 l iErrCode m usblO AI GetTotalSupportTvpe amp o_ byTotalSupportType printf d iErrCode 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 132 Document version 1 14 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 public int AI GetTypeCode BYTE o_byTypeCode Parameters o_byTypeCode OUT The byte array of type code Return Value
77. e Parameters Xi bvChEnable IN The byte array of channel enable disable mask Return Value Error code 196 Document version 1 14 ICP DAS USB Class Members Public Methods Example int iErrCode ICPDAS USBIO m usblO BYTE m bvChEnablej USBIO AO MAX CHANNEL 7 8 BYTE o bvChEnable USBIO AO MAX CHANNEL 7 8 int ildx if ERR NO ERR iErrCode m usblO OpenDevice USB2026 1 for ildx 0 ildx lt USBIO AO MAX CHANNEL 7 8 ildx m_byChEnable ildx 0x03 if ERR_NO_ERR iErrCode m_usbIO AO_SetChEnable m_byChEnable printf d iErrCode if ERR_NO_ERR iErrCode m_usbIO AO_GetChEnable o_byChEnable printf d iErrCode else for ildx 0 ildx lt USBIO_AO_MAX_CHANNEL 7 8 ildx printf 0x 02x n o_byChEnable ildx iErrCode m_usblO CloseDevice return iErrCode 197 Document version 1 14 ICP DAS USB Class Members Public Methods 5 6 6 14 AO_ WriteValue The class library provides 4 overload methods to write AO expect value Two method provides specifying channel to write raw data and converted value The others write AO value for all channels The overview of these methods is as following table and will describe in the following section Name of Methods AO_ WriteValue BYTE i_byChToSet DWORD i_dwAOVal AO_ WriteValue DWORD i_dwAOValue AO_ WriteValue BYTE i_byChToSet float i_fAOExpValue AO_ WriteValue float i_fAOEx
78. e arrays of the DI value Return Value Error code 95 Document version 1 14 ICP DAS USB Class Members Public Methods Example Int iErrCode ICPDAS USBIO m usblO BYTE o bvDiValuejUSBIO 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 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_byDIValuelildx 96 Document version 1 14 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 DWORD o_dwDICntValue Parameters o_dwDICntValue OUT The double word arrays of the DI counter value Return Value Error code 97 Document version 1 14 ICP DAS USB Class Members Public Methods Example Int iErrCode ICPDAS_USBIO m usblO WORD o dwDICntValue USBIO DI MAX CHANNEL Int ildx Bool bRet true m usblO new ICPDAS USBIO if ERR NO ERR iErrCode m usblO OpenDevice USB2051 1 if ERR NO ERR l iErrCode m usblIO DI ReadCounterValue o dwDICntValue printf d iErrCode bRet false If bRet for ildx 0 ildx lt USBIO
79. el does not use own low pass filter width Please refer to following table to see what low pass filter width is referred to 0 amp 1 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 244 Document version 1 14 ICP DAS USB Class Members Public Methods Example Int iErrCode ICPDAS USBIO m_usblO WORD o_wLPFilterWidth JUSBIO 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 usblO PI GetL PFilterWidth o wLPFilterWidth printf d iErrCode else for ildx 0 ildx lt USBIO PI MAX CHANNEL ildx printf d n o_wLPFilterWidth ildx 245 Document version 1 14 ICP DAS USB Class Members Public Methods 5 6 7 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 of the channel status Return Value Error code 246 Document version 1 14 ICP DAS USB Class
80. embers 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_usblO 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 96 5An o_fCJCOffset 139 Document version 1 14 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 l iErrCode m_usbIO AI GetCJCEnable amp o_byCJCEnable printf d iErrCode else printf d n o_byCJCEnable 140 Document version 1 14 ICP DAS USB Class Members Public Methods 5 6 5 9 AI GetWireDetectEnable Analog input function Get wire detect enable Disable 0 Enable 1 Syntax public int AI GetWireDetectEnable BYTE o_byWire
81. er switching to INIT mode uses MUST have to re plug cable to reset USB I O module Step 3 Execute the firmware update software and select firmware The following figure is the USB I O content in the start menu Users can execute the firmware update software here di USBIO Patch Note i Samples 5 Uninstall ICP DAS USB IO di USBIO Document P USBIO Utility B USBIO FW Update Tool Once the software opened users can select the firmware file bv clicking the Browser button 280 Document version 1 14 Appendix C C 1 Steps of updating firmware for USB I O module KE ICPDAS USBIO FW Update Tool vL00 Ka zali mma pa iii 1 Firmware File Browser 2 Firmware Update Click Firmware Update button to start firmware updating Firmware Update ie Step 4 Start to download After selecting correct firmware file for downloading users can now click the Firmware Update button to start to download firmware into the USB I O module r ICPDAS USBIO FW Update Tool v1 00 bobas 1 Firmware File s USB 2000 Source Code Firmware 2KDIO UISB 2KDIO_y1 06 fal Browser i 2 Firmware Update Click Firmware Update button to start firmware updating Wait for the update message Firmware Update Success Please Reboot Module comes up and the download progress to 100 E fan ICPDAS USBIO FW Update Tool v1 00 gt
82. erate b Ifthe high width of the input signal is grater then T the counter will operate The time chart is shown as follow Input Signal eooo Filter Sample AO NR o Filtered Signal u Counter operate 46 Document version 1 14 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 4B System Windows Forms D System Xml amp EE Forml cs ci Program cs Add Reference NET COM Projects Browse Recent i me Filtered to NET Framework 2 0 neni ki xplorer al FINA Component Name Version Runtime Path f ien MT Accessibility 0 0 v2 0 50727 CAWINDOWSMicmsoi oq Solution WindowsFormsApplicetion AspNetMMCExt 0 04 v20 50727 CAWINDOWS Mierosof E WindowsFormsApplication escompmed 0 04 v2 0 50727 CAWINDOWS Microsof H Sa Properties b Za RUM Padine f E B References te 0 0 v2 0 50727 CAWINDOWS Microsof Ming ICPDAS USBIO dotNE IEHost 0 0 v2 0 50727 CAWINDOWS Microsof 4G System II
83. et 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 54 Document version 1 14 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 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 Name Description _ z_ _ Analog input function Get total supported AI GetTotalSupportType amount AI GetSupportTypeCode Analog input function Get supported type code AI GetTypeCode Analog input functi
84. et Power On Enable Each channel takes one byte Syntax public int AO_GetPowerOnEnable BYTE o_byPowerOnEnable Parameters o_byPowerOnEnable OUT The byte array of channel enable disable mask Return Value Error code Example int iErrCode ICPDAS USBIO m usblO BYTE o bvPwrOnEnable JUSBIO AO MAX CHANNEL int ildx if ERR NO ERR iErrCode m_usbIO OpenDevice USB2026 1 if ERR NO ERR l iErrCode m_usbIO AO_GetPowerOnEnable o bvPwrOnEnable printf d iErrCode else for ildx 0 ildx lt USBIO AO MAX CHANNEL ildx printf 0x 02x n o_byPwrOnEnable ildx return iErrCode 183 Document version 1 14 ICP DAS USB Class Members Public Methods 5 6 6 9 AO_GetSafetyEnable Analog output function Get Safety Enable Each byte indicates 8 channels enable disable mask EX Byte0 gt Channel0 7 Syntax public int AO_GetSafetyEnable BYTE o_bySafetyEnable Parameters o_bySafetyEnable OUT The byte array of Safety enable disable mask Return Value Error code Example int iErrCode ICPDAS USBIO m usblO BYTE o bvSafetvEnable USBIO AO MAX CHANNEL 7 8 int ildx if ERR NO ERR iErrCode m_usbIO OpenDevice USB2026 1 if ERR NO ERR l iErrCode m usbIO AO GetSafetvEnable o bvSafetvEnable printf d iErrCode else for ildx 0 ildx lt USBIO_AO_MAX_CHANNEL 7 8 ildx printf 0x 02x n o_bySafetyEnable ildx
85. etTriggerMode 0 0x1 printf d iErrCode iErrCode m usblO CloseDevicel 263 Document version 1 14 ICP DAS USB Class Members Public Methods 5 6 7 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_usblO CloseDevice 264 Document version 1 14 ICP DAS USB Class Members Public Methods 5 6 7 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 in following section Name of Methods PI SetChisolatedFlag BYTE i_byChToSet BOOL i_bChIsolatedFlag
86. evice USB2084 1 if ERR NO ERR l iErrCode m usblO PI GetChisolatedFlag o bvChisolatedFlag printf d iErrCode else for ildx 0 ildx lt USBIO PI MAX CHANNEL 7 8 ildx printf 02x n o_byChlsolatedFlaglildx 241 Document version 1 14 ICP DAS USB Class Members Public Methods 5 6 7 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 242 Document version 1 14 ICP DAS USB Class Members Public Methods Example Int iErrCode 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 iErrCode m_usbIO 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 243 Document version 1 14 ICP DAS USB Class Members Public Methods 5 6 7 7 PI_GetLPFilterWidth Pulse input function Get low pass filter width The unit of the width is uS The maximum value of width is 32767uS Note Each chann
87. g Public Methods 6 Troubleshooting 1 Cannotinstall ICP DAS USB I O package with the message like the following figure 2 J NET Framework 2 0 required Do you want to download the framework now Because the ICP DAS USB I 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 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 274 Document version 1 14 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 50mV 50 mV 0x02 100 mV 100 mV 0x03 500 mV 500 mV 0x04 1V 1V 0x05 2 5V 2 5V 0x06 20 mA 20 mA 0x07 4 mA 20 mA 0x08 10V 10V 0x09 5V 5V OxOA 1V 1V OxOB 500
88. 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 128 Document version 1 14 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 129 Document version 1 14 ICP DAS USB Class Members Public Methods Example Int iErrCode 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 l iErrCode m usblO AI GetTotalSupportTvpe amp o_ byTotalSupportType printf d iErrCode bRet false if ERR NO ERR l 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 130 Document version 1 14 ICP DAS USB Class Members Public Methods 5 6 5 2 AI GetSupportTypeCo
89. ing Return Value Error code Example Int iErrCode ICPDAS USBIO m_usbIO m_usblO 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 iErrCode iErrCode m_usblO CloseDevice 259 Document version 1 14 ICP DAS USB Class Members Public Methods 5 6 7 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_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 bvChClrMaskjildx 0x5A if ERR NO ERR l iErrCode m usblO PI ClearChStatus m bvChClrMask printf d iErrCode iErrCode m_usbIO CloseDevice 260 Document version 1 14 ICP DAS USB Class Members Public Methods 5 6 7 16 PI_ClearSingleChStatus Pulse input function Clear specific channel status Syntax public int PI ClearSingleChStatus BYTE i_byChToClr Parameters i_byChToClr IN The channel index for cle
90. 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 AI 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 42 Document version 1 14 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 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 Monit
91. it resolution and reading value is 0x53E 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 AI value cannot detect the channel status It only read the AI value but has the most efficiency 144 Document version 1 14 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 dwAIValuejUSBIO AI 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 iErrCode else For ildx 0 ildx lt USBIO AI MAX CHANNEL ildx printf 0x 08x n o_dwAlValue ildx 145 Document version 1 14 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 10V 10V the value 0x0 indicates 10V and OxFFFF 16bit resolution indicates 10V Please note that when channel was not in goo
92. 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 piste VENDE Tafal ol MI DIVA Celia 500 meters Max Input Impedance 10 KQ Overvoltage Protection 70 VDC Max Count 65535 16 bit Max Input 500 Hz Counter Frequency Min Pulse Width 1 ms 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 9 Document version 1 14 Introduction Specifications 33mm x 87mm x 107mm 10 Document version 1 14 Introduction Specifications 1 4 7 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 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 al
93. lana Status i g e iaia ao 276 ADpendhb gt s sone A a EA A dla a sal 277 BVETOFCOde allea 277 ADPERd itato leale os ia 280 C 1 Steps of updating firmware for USB I O module en 280 V Document version 1 14 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 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 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 14 Introduction Applications 1 3 Applications e Buildi
94. loseDevice Scan devices connected with local PC SR Send a synchronization packet to clear software WDT SetCommTimeout Set communication timeout GetCommTimeout Get communication timeout SetAutoResetWDT Enable disable automatic reset of the WDT 53 Document version 1 14 ICP DAS USB Class Members Table of Public Methods 5 3 2 Device Name Description 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 GetAITotal Get AI 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 Meme Description DI_GetDigitalFilterWidth Digital Input function Get DI Digital Filter Width DI_GetDigitalValuelnverse Digital Input function G
95. ls channels 27 Document version 1 14 Hardware Information Wiring Digital Output Drive Relay Resistance Load 2 3 6 USB 2060 Digital Input Dry Contact To other To other channels channels Wet Contact Sink SINO To other To other channels channels Wet Contact Source To other To other channels l channels Relay Output ON State LED ON OFF State LED OFF Output Type Readbackas 1 Readback as 0 Relay 0S RLx NO 0S RLx NO AC DC Contact orsi DOS RLx COM D x DS RLx COM 28 Document version 1 14 Hardware Information Wiring 2 3 7 USB 2064 ON State LED ON OFF State LED OFF Output Type Readbackas 1 Readback as 0 Contact Dir Pulse Up Down A B Phase Quadrant Vin Pulse Vin Pulse Vin Dir Vin Dir Vin Up aT Vin Up Vin Down Vin Down E Vin Up0 Vin Upo UES Vin Up1 Vin Upi Vin A0 Vin A0 LI Vin B0 Vin B0 Vin Freq0 Vin Freq0 Vin Freq1 Vin Freqi Document version 1 14 29 RLx NO RLx COM Vin Pulse DE gt Vin Dir i S Vin Pulse and Vin Dir Vin Up Vin Down Vin Up and Vin Down Vin Up0 Vin Up1 Vi
96. 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 39 Document version 1 14 Installation Software 3 2 1 2 Digital Output In the I 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 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 support diagnostic the value for readback will be the actual output value in this module e Configuration Region All T O related configurations can be set in this region m Powe
97. n Up0 and Vin Up1 Vin A0 Vin BO Vin A0 and Vin BO Vin Freq0 vin Freqt 116 Vin Freq0 and Vin Freq1 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 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 30 Document version 1 14 Hardware Information Hardware Configuration E
98. n 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 276 Document version 1 14 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 O 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 3 ERR_ DEV_BUFFERFULL 0x00000009 9 ERR_ DEV LTTIMEOUT 0x0000000A 10 ERR DEV_LTMODEFAIL 0x00000008 11 ERR DEV LIPKGLOST Document version 1 14 The operation completed successfullv 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 oniv The index is written only The buffer in transceiver is full The operation of large transfer has timeout The current mode is not in large transfer mode The large transfer packet is lost 277 Appendix B
99. ng automation e Factory automation Machine automation e Data acquisition and control e Environment monitor e Laboratory equipment and research 1 4 Specifications 1 4 1 General USB 2 0 Full Speed 1 Hardware watchdog 1 6 second 1 Software watchdog Programmable 3 LED as Power Run and Error 1 LED channel as I O status for Digital and Pulse I O 4 kV contact for each terminal 8 kV air for random point 0 5kV for USB cable 0 5kV for I O terminal 25 75 C 40 85 C 10 95 RH non condensing Document version 1 14 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 240Vrms In addition it has voltage and current input types It aH ere rasati also widely supports thermocouple devices with J K T E R S B N C L M and Lbina3710 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 2 5 V 5 V 10 V 20 mA 0 20 mA 4 20 mA Note An external resistor is required Thermocouple J K T E R S B N C L M and Lpina
100. ng section The corresponding type code can be found in Appendix A 1 Name of Methods AI SetTvpeCode BYTE i_byChToSet BYTE i_byTypeCode AI SetTypeCode BYTE i_byTypeCodes 156 Document version 1 14 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 iErrCode ICPDAS_USBIO m usblO m_usblO new ICPDAS USBIO if ERR NO ERR iErrCode m_usbIO OpenDevice USB2019 1 if ERR NO ERR l iErrCode m_usbIO AI SetTypeCode 0 0x10 printf d iErrCode iErrCode m_usbIO CloseDevice 157 Document version 1 14 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 iErrCode ICPDAS_USBIO m_usblO Byte m_byChTypeCode USBIO_AI_MAX_CHANNELJ Int ildx m_usbIO new ICPDAS USBIO if ERR NO ERR iErrCode m_usbIO OpenDe
101. ntAccessObj SetNormalPktByteArray SetActivePktByteArray ClearActivePktBuffer GetActivePktByteArray SetNormalPktEvent IsDevMonitorThreadStop IsCommWithDevice Document version 1 14 INTERNAL USE DO NOT USE THIS METHOD INTERNAL USE DO NOT USE THIS METHOD INTERNAL USE DO NOT USE THIS METHOD INTERNAL USE DO NOT USE THIS METHOD INTERNAL USE DO NOT USE THIS METHOD INTERNAL USE DO NOT USE THIS METHOD INTERNAL USE DO NOT USE THIS METHOD INTERNAL USE DO NOT USE THIS METHOD 58 ICP DAS USB Class Members Constructors 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 Svntax public ICPDAS_USBIO void Example ICPDAS USBIO m_usbIO m_usbIO new ICPDAS USBIO 59 Document version 1 14 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 60 Document version 1 14 ICP DAS USB Class Members Static Methods 5 5 2 ScanDevice Scanning device connected to PC This st
102. ntrol Library ArtiveMovie control tena library li di JOOOOORORERE z je JODOL 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 49 Document version 1 14 Operation Hardware structure 4 Operation 4 1 Hardware structure The ICP DAS USB I O provides various types of input and output The 1 0 is handled by embedded controller The hardware structure is shown in figure 4 1 below ICP DAS USB IO mS as FPGA lt gt Embedded controller Extajnal Memorv D ze mi il o Ee ct Ko ct EEPROM S n UJ E e 04 ct a O eb D a 2 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 50 Document version 1 14 Operation Software structure User s Application pa USB I O Class Library USB Device Library Access I O Class Initialization OpenDevice ae CloseDevice ICPD
103. ode Example int iErrCode ICPDAS USBIO m usblO DWORD o dwAOCurValuejUSBIO AO MAX CHANNEL int ildx if ERR NO ERR iErrCode m_usbIO OpenDevice USB2026 1 if ERR NO ERR l iErrCode m_usbIO AO_ReadCuValue o_dwAOCurValue printf d iErrCode else for ildx 0 ildx lt USBIO_AO_MAX_CHANNEL ildx printf 0x 04x n o_dwAOCurValue ildx return iErrCode 181 Document version 1 14 ICP DAS USB Class Members Public Methods 5 6 6 7 2 AO_ReadCurValue float Analog output function Read the real AO current value 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 AO_ReadCurValue float o_fAOCurValue Parameters o_fAOCurValue OUT The true value of AO current value Return Value Error code Example int iErrCode ICPDAS USBIO m usblO float o fAOCurValuejUSBIO AO MAX CHANNEL int ildx if ERR NO ERR iErrCode m_usbIO OpenDevice USB2026 1 if ERR NO ERR l iErrCode m usblO AO_ReadExpValue o_fAOCurValue printf d iErrCode else for ildx 0 ildx lt USBIO AO MAX CHANNEL ildx printf 04f n o_fAOCurValuelildx return iErrCode 182 Document version 1 14 ICP DAS USB Class Members Public Methods 5 6 6 8 AO_GetPowerOnEnable Analog output function G
104. og 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 iErrCode ICPDAS USBIO m usblO m_usbIO new ICPDAS USBIO if ERR NO ERR iErrCode m_usbIO OpenDevice USB2019 1 if ERR NO ERR l iErrCode m usblO AI SetCJCEnable 1 printf d iErrCode iErrCode m_usblO CloseDevice 165 Document version 1 14 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 iErrCode ICPDAS USBIO m_usbIO m_usblO new ICPDAS USBIO if ERR NO ERR iErrCode m_usbIO OpenDevice USB2019 1 if ERR NO ERR iErrCode m usblO AI SetWireDetectEnable O printf d iErrCode iErrCode m_usbIO CloseDevice 166 Document version 1 14 ICP DAS USB Class Members Public Methods 5 6 6 Analog Output 5 6 6 1 AO_GetTotalSupportType Analog output function Get total supported amount Syntax public int AO_GetTotalSupportType BYTE o_byTotalSupportType Parameters o_byTotalSupportType OUT The number of total support type Return Value Error code 167 Document ve
105. on Get type code AI_GetChCJCOffset Analog input function Get channel CJC offset AI GetChEnable Analog input function Get channel enable disable AI GetrilterRejection Analog input function Get filter rejection AI GetCJCOffset Analog input function Get CIC offset AI 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 AI value in double AI ReadValue word format Overload Analog input function Read bulk AI value Fast AI ReadBulkValue L L acquire functionalitv AI ReadCJCValue Analog input function Get CJC value Analog input function Set type code for specific AI SetTvpeCode channel Overload 55 Document version 1 14 ICP DAS USB Class Members Table of Public Methods AI SetChCICOffset AI SetChEnable AI SetFilterRejection AI SetCJCOffset AI SetCJCEnable AI SetWireDetectEnable Document version 1 14 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 56 ICP DAS USB Class Members Table of Public Methods 5 3 6 Analog Output AEG Description Analog output function Get tot
106. or 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 I 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 43 Document version 1 14 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 input 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 t
107. oseDevice 71 Document version 1 14 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 iErrCode ICPDAS USBIO m usblO Byte o bvDeviceNickName USBIO NICKNAME LENGTH m_usblO 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 iErrCode else printf s o_byDeviceNickName iErrCode m_usblO CloseDevice 72 Document version 1 14 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 iErrCode ICPDAS USBIO m usblO Byte o bvDeviceSN USBIO SN LENGTH m_usblO new ICPDAS USBIO if ERR NO ERR iErrCode m_usbIO OpenDevice USB2019 1 if ERR NO ERR l iErrCode m usblO GetDeviceSN o bvDeviceSN printf d iErrCode else printf 9os o_ byDeviceSN iErrCode m_usbIO CloseDevice 73 Document version 1 14 ICP DAS USB Class Members Public Methods 5 6 2
108. pValue 198 Document version 1 14 ICP DAS USB Class Members Public Methods 5 6 6 14 1 AO_WriteValue BYTE DWORD Analog output function Write AO expect value to specifying channel 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 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 0x53E 0X53E OxFFFF then we can get the actual value Y is Y 0 x 5 5 C 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 199 Document version 1 14 ICP DAS USB Class Members Public Methods Syntax public int AO_WriteValue BYTE i_byChToSet DWORD i dwAOVal Parameters i bvChToSet IN The specific AO channel to be set i dwAOVal IN The AO value Return Value Error code 200 Document version 1 14 ICP DAS USB Class Members Public Methods Example int iErrCode ICPD
109. r On The power on configuration 40 Document version 1 14 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 AI 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 I O value from decimal to hexadecimal 41 Document version 1 14 Installation Software e Monitor Region The I 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 module 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
110. r 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 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 14 Content Overview Content Revision PISTOM osla ona granit ul eee i atei i Piedini pr e lo i Contento delia li bimrosuctona sh Labe osob Eos u ill sla 1 i Ii a ile 1 li 2 Feature sao odi Sd id S A aN 1 LI APPICALONS carini dd rd S E real a 2 TA Specification Sere o e e o revan 2 Led General sai RT 2 dd ZUSBS20I9 ras aliena 3 DAS SBS 202 30 an jet sa a jo utd delve ketenes 4 WAS BH 2 OAS rogi o la PG sa ao Ra ul Ko 7 145 USB205 D elica dra 8 dLi amp 6USB 2055 analisi 9 LAPUSB200 Rtl elia 11 14 6 USB 20604 aurelio 13 L4 9USB 2084 all i o kt ell peltta laldnials 14 1 5 Product CHECKLIST ess rana 15 2 Hardware Information lle 16 2 1 Module OVER A E i ODE 16 AGVUSB 2019 og GO E o DGO EA A A S 17
111. rigger 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 44 Document version 1 14 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 45 Document version 1 14 Installation Software a If the high width of the input signal is shorter then T the counter will not operate The input signal will be filtered The time chart is shown as follow Input Signal Fa Filter Sample be gt T Filtered Signal Counter will not op
112. rn Value Error code Example Int iErrCode ICPDAS USBIO m usblO m_usblO new ICPDAS USBIO if ERR NO ERR iErrCode m_usbIO OpenDevice USB2051 1 if ERR NO ERR iErrCode m usblIO DI WriteClearCounters OxOOOOFFFF printf d iErrCode m_usbIO CloseDevice 103 Document version 1 14 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 104 Document version 1 14 ICP DAS USB Class Members Public Methods Example Int iErrCode ICPDAS USBIO m usblO 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 amp o_byPowerOnEnable printf d iErrCode bRet false If bRet for ildx 0 ildx lt USBIO_DO_MAX_CHANNEL ildx printf 02x n o_byPowerOnEnablelildx 105 Document version 1 14 ICP DAS USB Class Members Public Methods 5 6 4 2 DO_GetSafetyEnable Digital Output function Get Safety Ena
113. rrCode m_usbIO CloseDevice 76 Document version 1 14 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 77 Document version 1 14 ICP DAS USB Class Members Public Methods 5 6 2 10 GetAITotal Get AI total number of channels of the device Svntax public int GetAITotal BYTE o bvAITotal Parameters o_byAlTotal OUT The AI total number of channels Return Value Error code Example Int iErrCode ICPDAS USBIO m usblO Byte o bvAITotal m usblO new ICPDAS USBIO ifiERR NO ERR iErrCode m_usbIO OpenDevice USB20xx 1 if ERR NO ERR iErrCode m usblO GetAITotal amp o_byAITotal printf d iErrCode else printf d o_byAITotal iErrCode m_usbIO CloseDevice 78 Document version 1 14 ICP DAS USB Class Members Public Methods 5 6 2 11 GetAOTotal Get AO total number of channels of the device Syntax publi
114. rsion 1 14 ICP DAS USB Class Members Public Methods Example int iErrCode ICPDAS USBIO m usblO BYTE o_byTotalSupportType BYTE o_bySupportTypeCode USBIO_MAX_SUPPORT_TYPE int ildx bool bRet true if ERR_NO_ERR iErrCode m usblO OpenDevice USB2026 1 if ERR_NO_ERR iErrCode m_usbIO AO_GetTotalSupportType amp o_byTotalSupportType printf d iErrCode bRet false if ERR_NO_ERR iErrCode m_usbIO AO_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 return iErrCode 168 Document version 1 14 ICP DAS USB Class Members Public Methods 5 6 6 2 AO_GetSupportTypeCode Analog output function Get supported type code Please refer to Appendix A 2 of user s manual to map AO channels output type Syntax public int AO_GetTotalSupportType BYTE o_bySupportTypeCode Parameters o_byTotalSupportType OUT The number of total support type Return Value Error code 169 Document version 1 14 ICP DAS USB Class Members Public Methods Example int iErrCode ICPDAS USBIO m usblO BYTE o_byTotalSupportType BYTE o_bySupportTypeCode USBIO_MAX_SUPPORT_TYPE int ildx bool bRet true if ERR_NO_ERR iErrCode m usblO OpenDevice USB2026 1
115. s enable disable mask EX Byte0 gt Channel0 7 Syntax public int AI GetChCJCOffset BYTE o bvChEnable Parameters o_byChEnable OUT The byte array of channel enable disable mask Return Value Error code 136 Document version 1 14 ICP DAS USB Class Members Public Methods Example Int iErrCode ICPDAS USBIO m_usblO Byte o bvChEnable USBIO AI MAX CHANNEL 7 8 Int ildx m usblO new ICPDAS_USBIO ifiERR NO ERR iErrCode m_usbIO OpenDevice USB2019 1 if ERR NO ERR l iErrCode m_usbIO AI GetChEnable o bvChEnable printf d iErrCode else for ildx 0 ildx lt USBIO AI MAX CHANNEL 7 8 ildx printf 02x n o_byChEnable ildx 137 Document version 1 14 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 xo bvFilterRejection OUT The filter rejection Return Value Error code Example Int iErrCode ICPDAS USBIO m usblO Byte o_byFilterRejection m_usblO 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 printf d iErrCode else printf d n o_byFilterRejection 138 Document version 1 14 ICP DAS USB Class M
116. s figure 3 5 The utility will scan the ICP DAS USB series 37 Document version 1 14 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 P USB IO Utility Device List Sie 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 38 Document version 1 14 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 O 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
117. s follows the following rule 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 0x53E 0X53E OxFFFF then we can get the actual value Y is Y 0 x 5 5 C 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 213 Document version 1 14 ICP DAS USB Class Members Public Methods Syntax public int AO_ SetPowerOnValue BYTE i_byChToSet DWORD i_dwPowerOnValue Parameters i_byChToSet IN The specific AO channel to be set i_dwPowerOnValue IN The AO PowerOnValue Return Value Error code 214 Document version 1 14 ICP DAS USB Class Members Public Methods Example int iErrCode ICPDAS_USBIO m usblO DWORD o_dwPowerOnValue JUSBIO AO MAX CHANNEL BYTE bvChannel 0 DWORD dwSetPowerOnValue Oxff int ildx if ERR_NO_ERR iErrCode m_usbIO OpenDevice USB2026 1 if ERR_NO_ERR iErrCode m_usbIO AO_SetPowerOnValue byChannel dwSetPowerOnValue printf d iErrCode if ERR_NO_ERR iErrCode m_usbIO AO_GetPowerOnValue o_dwPowerOnValue printf d iErrCode else for ildx 0 ildx lt USBIO AO MAX CHANNEL ildx printf 0x 04x n o dwPowerOnvValuejildx
118. s in float analog format The writting value is calculated users write real value for current output type Ex The writting value is 1 316 in 2 5 2 5V the output signal is 1 316V Syntax public int AO_WriteValue float i fAOVal Parameters i fAOVal IN The AO value Return Value Error code 206 Document version 1 14 ICP DAS USB Class Members Public Methods Example int iErrCode ICPDAS USBIO m usblO float o fAOExpValuejUSBIO AO MAX CHANNEL float fAOValuejUSBIO AO MAX CHANNEL int ildx if ERR NO ERR iErrCode m usblO OpenDevice USB2026 1 for ildx 0 ildx lt USBIO AO MAX CHANNEL ildx fAOValuelildx 5 if ERR_NO_ERR iErrCode m_usbIO AO_WriteValue fAOValue printf d iErrCode if ERR_NO_ERR iErrCode m_usbIO AO_ReadExpValue o_fAOExpValue printf d iErrCode else for ildx 0 ildx lt USBIO AO MAX CHANNEL ildx printf 04f n o_fAOExpValuelildx return iErrCode 207 Document version 1 14 ICP DAS USB Class Members Public Methods 5 6 6 15 AO_SetPowerOnEnable Analog output function Set Power On Enable Each channel takes one byte Syntax public int AO_SetPowerOnEnable BYTE o_byPowerOnEnable Parameters o_byPowerOnEnable OUT The byte array of channel enable disable mask Return Value Error code 208 Document version 1 14 ICP DAS USB Class Members Public Methods Example int
119. s specifying channel to set another for all channel Please refer to user s manual for analog output 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 2 Name of Methods AO_SetTypeCode BYTE i_byChToSet BYTE i_byTypeCode AO_SetTypeCode BYTE i_byTypeCodes 191 Document version 1 14 ICP DAS USB Class Members Public Methods 5 6 6 12 1 AO_SetTypeCode BYTE BYTE Analog output function Set type code for specific channel The type code can reference to Appendix A 2 Syntax public int AO_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 192 Document version 1 14 ICP DAS USB Class Members Public Methods Example int iErrCode ICPDAS_USBIO m usblO BYTE o bvTvpeCode USBIO AO MAX CHANNEL int ildx if ERR NO ERR iErrCode m_usbIO OpenDevice USB2026 1 if ERR NO ERR l iErrCode m_usbIO AO_SetTypeCode 0 0x30 printf d iErrCode iErrCode m_usblO CloseDevice else return iErrCode if ERR_NO_ERR iErrCode m_usbIO OpenDevice USB2026 1 if ERR NO ERR l iErrCode m usblO AO GetTvpeCode o bvTvpeCode printf d iErrCode else for ildx 0 ildx lt USBIO AO MAX CHANNEL ildx printf 0x
120. se input function Get type code PI_GetTriggerMode Pulse input function Get trigger mode 57 Document version 1 14 ICP DAS USB Class Members Table of Public Methods PI_GetLPFilterEnable PI GetChisolatedFlag PI GetL PFilterWidth PI ReadValue PI ReadCntValue PI ReadFreqValue PI ReadBulkValue PI SetTvpeCode PI ClearChCount PI ClearSinglelChCount PI ClearChStatus PI ClearSinglelChStatus PI SetTriggerMode PI SetChisolatedFlag PI SetL PFilterEnable PI_SetLPFilterWidth 5 3 8 Other 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 Overload Pulse input function Set low pass filter width Overload Name Deseo GetCurre
121. signment 2 2 6 USB 2060 DI TheDigtalinuttorchamelN 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 7 USB 2064 MOJEM menopnotry HEGEL The COM pin of relay N 23 Document version 1 14 Hardware Information Connector Pin Assignment 2 2 8 USB 2084 ica PO Co fel 02 CORR i ARARANANA ARANANNKH o 24 Document version 1 14 Hardware Information Wiring 2 3 Wiring 2 3 1 USB 2019 Voltage Input Thermocouple Input 125 Q Note When connecting to current source an external 1250 resistor is required 2 3 2 USB 2026 2 3 2 1 Digital Input To othe To othe channels channels 25 Document version 1 14 Hardware Information Wiring 2 3 2 3 Analog Input Voltage Input Ext PWR DOx el i Ext GND Resistance 26 Document version 1 14 Hardware Information Wiring 2 3 4 USB 2051 Dry Contact To othe To othe channels channels Wet Contact Sink M y To othe To othe channels channels Wet Contact Source To othe channels channels 2 3 5 USB 2055 Digital Input To other To othe channels channels Wet Contact Sink To othe To other channels channels Wet Contact Source 7 To othe To other channe
122. so provided to enhance noise protection capabilities in industrial environments Digital Input Channels 6 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 piste VENDE Tafal ele Pameeaicrags 500 meters Max Input Impedance 10 KQ Overvoltage Protection 70 VDC Max Count 65535 16 bit Max Input 500 Hz Counter Frequency Min Pulse Width 1 ms Relav Output Channels 6 Output Tvpe Form A SPST NO Contact Rating 5A 30Vpc AC 5A 250Vac 47 63Hz Operate Time 10ms max Release Time 5ms max 11 Document version 1 14 Introduction Specifications 1 000 MQ at 500Vpc 1000Vac 1 min 3000Vac 1 min 2x10 ops 1 x 10 ops Yes D ns xH 33mm x 87mm x 107mm 12 Document version 1 14 Introduction Specifications 1 4 8 USB 2064 The USB 2064 is an 8 channel power relay output ET 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 lt Relav Output Output Tvpe Form A SPST NO ase 5A 250Vac 47 63H7 Contact Rating Resistive Load 5A 30Vpc Operate Time 10ms max Release Time 5ms max Ins
123. ss 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 Oct 29 2015 1 1 Modify some of the description some 1 Modify some of the description the description 2 Adding USB 2026 Module Information Aug 12 2015 3 Adding AO API for output function 1 Modifying the wiring diagram for USB 2051 USB 2055 1 12 Jan 13 2015 and USB 2060 1 Adding DO API for output inversing function 1 11 Aug 28 2014 2 Modifying DI API for reading counter value from 16 bit to 32 bit 1100 Aug 5 2014 Adding firmware upgrade instruction in Appendix C Adding USB 2045 Module Information Adding USB 2051 Module Information 1 09 May 8 2014 Adding USB 2055 Module Information 4 Adding USB 2060 Module Information Adding DI API Jan 29 2013 1 Adding System API SetAutoResetWDT Sep 20 2012 1 Adding DO API DO WriteValue 1 Adding DO API 1 06 Jul 6 2012 Lie f 2 Adding information for USB 2064 Jun 21 2012 1 Modifying analog output type code 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 14 Preface Overview Preface Warranty All products manufactured by ICP DAS are unde
124. t i byTypeCode IN The power on enable for the specific channel Return Value Error code Document version 1 14 ICP DAS USB Class Members Public Methods Example Int iErrCode ICPDAS USBIO m usblO m_usblO 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 usblO CloseDevicel 116 Document version 1 14 ICP DAS USB Class Members Public Methods 5 6 4 6 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 Syntax public int DO_SetPowerOnEnable BYTE i_byPowerOnEnables Parameters xi bvPowerOnEnables IN The byte array of the power on enable Return Value Error code Document version 1 14 ICP DAS USB Class Members Public Methods Example Int iErrCode 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_usblO CloseDevice 118 Document version 1 14 ICP DAS USB Class Members Public Methods 5
125. 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 36 Document version 1 14 Installation Software KE i5 Setup ICP DAS USB IO 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 dose 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 vour computer The application may be launched by selecting the installed icons Click Finish to exit Setup 3 2 1 Utilitv 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 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 a
126. trast 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 152 Document version 1 14 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 bvStartCh IN The starting acquire channel i bvChTotal 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 153 Document version 1 14 ICP DAS USB Class Members Public Methods Example Int iErrCode 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 Sample
127. tyValue BYTE DWORD Analog output function Set AO Safety Value to specifying channel 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 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 0x53E 0X53E OxFFFF then we can get the actual value Y is Y 0 x 5 5 C 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 223 Document version 1 14 ICP DAS USB Class Members Public Methods Syntax public int AO_ SetSafetyValue BYTE i_byChToSet DWORD i_dwSafetyValue Parameters i_byChToSet IN The specific AO channel to be set i_dwSafetyValue IN The AO Safety Value Return Value Error code 224 Document version 1 14 ICP DAS USB Class Members Public Methods Example int iErrCode ICPDAS_USBIO m usblO DWORD o_dwSafetyValue JUSBIO AO MAX CHANNEL BYTE bvChannel 0
128. ual 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 14 48 wins a Library files Directories l TOT CAProgram Files Microsoft Visual Studio VC98 LIB C Program Files Microsoft Visual Studio WC98 MFC LIB CWINDDK17600 16385 1 LIB WXP386 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 Il gt Zi Add Fom 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 EE 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 vbp Available References visual Basic For Applications Visual Basic runtime objects and procedures visual Basic objects and procedures OLE Automation Browse ICPDAS USBIO VB IAS Helper COM Component 1 0 Type Library a IAS RADIUS Protocol 1 0 Type Library Acrobat Access 3 0 Type Library Priority AcroBrokerLib Help AcroIEHelper 1 0 Type Library AcroIEHelperShim 1 0 Type Library Active DS Type Library Active Setup Co
129. ue 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_dwAIValue BYTE o bvAIChStatus AI ReadValue float o_fAIValue AI ReadValue float o_fAIValue BYTE o_byAIChStatus 143 Document version 1 14 ICP DAS USB Class Members Public Methods 5 6 5 11 1 AI_ReadValue DWORD 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 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 how many value under zero scale range This value can be calculated by following formula Assume current type is 5V 5V with 16 b
130. ulation 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 14 Introduction Specifications 1 4 9 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 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 Off Voltage Level 1Vpc maximum On Voltage Level 9 2Vpc 5Vpc Non isolated Input Level Off Voltage Level OVpc 0 8Vpc Intra Module Isolation 2500 Voc Field to Logic Individual Channel Configuration Yes Power Consumption 1 11W maximum Mechanical
131. urn Value Error code 112 Document version 1 14 ICP DAS USB Class Members Public Methods Example Int iErrCode ICPDAS USBIO m usblO Byte o_byDOValue 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 113 Document version 1 14 ICP DAS USB Class Members Public Methods 5 6 4 6 DO_SetPowerOnEnable The class has two overload methods for configuring power 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 i_byPowerOnEnables 114 Document version 1 14 ICP DAS USB Class Members Public Methods 5 6 4 6 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 se
132. 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 usblO PI SetTypeCode m_byChTypeCode printf d iErrCode iErrCode m_usblO CloseDevice 257 Document version 1 14 ICP DAS USB Class Members Public Methods 5 6 7 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 bvClrMask Parameters xi bvClrMask IN The byte arrav of channel count clear mask Return Value Error code Example Int iErrCode ICPDAS USBIO m usblO Byte m bvChClrMask USBIO PI MAX CHANNEL 7 8 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 7 8 ildx m_byChClrMasklildx Ox5A if ERR NO ERR l iErrCode m_usbIO PI_ClearChCount m_byChClrMask printf d iErrCode iErrCode m_usblO CloseDevice 258 Document version 1 14 ICP DAS USB Class Members Public Methods 5 6 7 14 PI_ClearSingleChCount Pulse input function Clear specific channel count Syntax public int PI ClearSingleChCount BYTE i_byChToClr Parameters i_byChToClr IN The channel index for clear
133. ut Default TTL input 34 Document version 1 14 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 2 na Blink Less frequent Warning Does not affect the operation Se Blink Minor Error Does not affect the operation Solid Major Error Does affect the operation 2 5 2 Firmware update KOM ine ating orrimvaretoupdste 35 Document version 1 14 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 Hardware i FoundNew 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
134. value is 1 316 in 2 5 2 5V the output signal is 1 316V Syntax public int AO_ SetPowerOnValue BYTE i_byChToSet DWORD i_fPowerOnValue Parameters i_byChToSet IN The specific AO channel to be set i_ fPowerOnValue IN The AO Power On Value Return Value Error code 218 Document version 1 14 ICP DAS USB Class Members Public Methods Example int iErrCode ICPDAS_USBIO m usblO float o fPowerOnValue USBIO AO MAX CHANNEL BYTE bvChannel 0 float fSetPowerOnValue 5 int ildx if ERR NO ERR iErrCode m_usbIO OpenDevice USB2026 1 if ERR NO ERR iErrCode m_usbIO AO_SetPowerOnValue bvChannel fSetPowerOnValue printf d iErrCode if ERR NO ERR l iErrCode m_usbIO AO_GetPowerOnValue o_fPowerOnValue printf d iErrCode else for ildx 0 ildx lt USBIO AO MAX CHANNEL ildx printf 04f n o_fPowerOnValuelildx return iErrCode 219 Document version 1 14 ICP DAS USB Class Members Public Methods 5 6 6 17 4 AO SetPowerOnValue float Analog output function Set AO Power On Value to all channels in float analog format The writting value is calculated users write real value for current output type Ex The writting value is 1 316 in 2 5 2 5V the output signal is 1 316V Syntax public int AO_ SetPowerOnValue float i_ fPowerOnValue Parameters i fPowerOnValue IN The AO Power On Value Return Value Error
135. verload 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 bvChToset BYTE i_byTypeCode PI_SetTypeCode BYTE i_byTypeCodes 255 Document version 1 14 ICP DAS USB Class Members Public Methods 5 6 7 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 iErrCode ICPDAS_USBIO m usblO m_usblO 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 256 Document version 1 14 ICP DAS USB Class Members Public Methods 5 6 7 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 Example Int iErrCode ICPDAS_USBIO m_usblO Byte m_byChTypeCode USBIO_PI MAX_CHANNEL Int ildx m_
136. vice 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 iErrCode iErrCode m_usbIO CloseDevice 158 Document version 1 14 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 bvChToset float i_fChCJCOffset AI SetChCICOffset float i_fChCJCOffsets 159 Document version 1 14 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 iErrCode 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 SetChCJCOffset 0 1 354 printf d iErrCode iErrCode m usblO CloseDevicel 160 Document version
137. 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 278 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 279 Document version 1 14 Appendix C C 1 Steps of updating firmware for USB I O module Appendix C C 1 Steps of updating firmware for USB I O module The USB I O supports firmware updating by USB cable Users can update firmware in their local site without sending module back The following instruction describes how to update USB I O firmware Step 1 Download the latest USB I O installation package The latest installation package version v1 0 0 8 adds an executable file for updating the USB I O firmware Users can find the file on the product page on the ICP DAS web site Step 2 Switch USB I O module into INIT mode The USB I O module only can update firmware when in INIT mode Users have to switch module into INIT mode by the 2 way switch Please refer to Section 2 1 Module Overview to have more information Aft

Download Pdf Manuals

image

Related Search

Related Contents

Motor Driven Gear Pumps  Thule Kit 110 User's Manual  HB-005456-e-SDMS_Quick Reference Guide_A5_ES  3041 - Candide  1. DATOS DE LA ASIGNATURA Nombre de la asignatura  RACE-X  ACR Traid-OA Site Sever User Manual  

Copyright © All rights reserved.
Failed to retrieve file