Home

USB-2000 Series

image

Contents

1. 2 2 Connector Pin Assignment 2 2 1 USB 2019 The connector of the USB 2019 is a 25 pin female D sub connector It can be connected by either the CN 1824 terminal block or the 25 pin D sub male connector The pin assignments of 25 pin female D sub connect and the CN 1824 are shown in figure 2 9 and 2 10 Document version 1 03 Hardware Information Connector Pin Assignment Pin Terminal No Pin Assignment Assignment sv o1 Pin Assignment Name 14 AGND ac 02 15 CH 0 CH 0 Gite Ma 16 CH1 CH 1 CH1 04 17 CH 2 Alt CH 2 CH 2 05 18 CH 3 CH 3 06 19 CH 4 CH 3 CH 4 07 20 CH 5 CH 3 CH 4 CH5 08 21 CH 6 Gia CH 6 09 22 CH 7 CH 5 CH7 10 23 N C Cisa N C 11 24 N C Het CH 6 N C 12 25 N C N C 13 Shield F G Git 25 pin Female D Sub Connector Figure 2 9 Figure 2 10 The pin assignments of 25 pin female D sub connector and the CN 1824 2 2 2 USB 2084 The connector of the USB 2084 is a 20 pin terminal block The pin assignment is shown as figure 2 11 Terminal No Pin Assignment ae 0t COA Xa 02 COA BHE COB C 04 C0B Epos CIA ns 06 CIA na 07 C1B 08 C1B ne 09 _C2A is 10 C2A HER ET C2B a 12 C2B m2 d 13 C3A 14 C3A w 15 C3B o 16 C3B ne 17 GND ree GND 12 19 N C V 20 N C Figure 2 11 The pin assignment of 20 pin terminal blo
2. 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 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 Control Library ArtiveMovie control bene library li di JLICICIDIETIKIKIIKII KS A DOOC 3i ICPDAS USBIO VB Location C WWINDOWS system32 ICPDAS_USBIO_YB dll Language Standard 3 2 3 Samples There are several samples to help user to develop project smoothly The samples can be found in Start Programs ICPDAS USB IO Samples or the path C ICPDAS USB IO Samples 25 Document version 1 03 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 D Z I s FPGA gt Embedded controller External Memory EA EG e enr e ct go ct lt gt EEPROM W UJ SE 72 Cr fa 9 o cr D m w Figure 4 1 Hardware structure of the ICP DAS USB series modules 4 2 Software structure In the programmer point of view the ICP DAS provides a cla
3. 88 Document version 1 03 ICP DAS USB Class Members Public Methods 5 6 3 13 AI ReadCJCValue Analog input function Read the current CJC value on the module Syntax public int AI ReadCJCValue float o fCJCValue Parameters o_fCJCValue OUT The CJC value Return Value Error code Example Int iErrCode ICPDAS USBIO m usblO float o fCJCValue Int ildx m_usbIO new ICPDAS_USBIO if ERR_NO_ERR iErrCode m usbIO OpenDevice USB2019 1 if ERR_NO_ERR iErrCode m usbIO AI ReadCJCValue o_fCJCValue printf 96d iErrCode else printf 5f n o fC CValue 89 Document version 1 03 ICP DAS USB Class Members Public Methods 5 6 3 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 following section The corresponding type code can be found in Appendix A 1 Name of Methods AI SetTypeCode BYTE i byChToSet BYTE i byTypeCode AI SetTypeCode BYTE i byTypeCodes 90 Document version 1 03 ICP DAS USB Class Members Public Methods 5 6 3 14 1 Al_SetTypeCode BYTE BYTE Analog input function Set type code for specific channel The type code can reference to Appendix A 1 Syntax public int Al SetTypeCode BYTE i_byChToSet BYT
4. 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 96d iErrCode while 1 Sleep 1 123 Document version 1 03 ICP DAS USB Class Members Public Methods 5 6 4 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 overload methods are listed as following table and described in following section The corresponding type code can be found in Appendix A 3 Name of Methods PI SetTypeCode BYTE i byChToSet BYTE i byTypeCode PI SetTypeCode BYTE i byTypeCodes 124 Document version 1 03 ICP DAS USB Class Members Public Methods 5 6 4 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
5. m usbIO OpenDevice USB2084 1 For ildx O ildx lt USBIO PI MAX CHANNEL 7 8 ildx m_byLPFilterEnable ildx 0x5a if ERR_NO_ERR iErrCode m usbIO PI SetLPFilterEnable m byLPFilterEnable printf 96d iErrCode iErrCode m_usblO CloseDevice 139 Document version 1 03 ICP DAS USB Class Members Public Methods 5 6 4 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 140 Document version 1 03 ICP DAS USB Class Members Public Methods 5 6 4 20 1 PI_SetLPFilterEnable BYTE WORD Pulse input function Set low pass filter width Syntax public int PI_SetLPFilterWidth BYTE i_byChToSet BOOL i wLPFilterWidth Parameters i_byChToSet IN The specific channel to set i_wLPFilterWidth IN The low pass filter width uS Return Value Error code Example Int 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 usbIO PI SetLPFilterWidth 5 10000 print
6. new ICPDAS USBIO if ERR NO ERR iErrCode m usbIO OpenDevice USB2084 1 if ERR_NO_ERR iErrCode m usbIO PI GetLPFilterWidth o wLPFilterWidth printf 96d iErrCode else for ildx 0 ildx lt USBIO PI MAX CHANNEL ildx printf odin o wLPFilterWidthjildx 114 Document version 1 03 ICP DAS USB Class Members Public Methods 5 6 4 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 dwPlValue OUT The byte array of the PI channel counter value o byChStatus OUT The byte array of the channel status Return Value Error code 115 Document version 1 03 ICP DAS USB Class Members Public Methods Example Int iErrCode ICPDAS USBIO m usbIO DWORD o dwPlValue USBIO PI MAX CHANNELJ BYTE o byChStatus 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 iErrCode m usbIO PI ReadValue o dwPlValue o byChStatus printf 96d iErrCode else for ildx 0 ildx lt USBIO PI MAX CHANNEL ildx printf d n o dwPiValuejildx 116 Document version 1 03 ICP DAS USB Class Member
7. o_byPOTotal iErrCode m_usbIO CloseDevice 55 Document version 1 03 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 usbIO SetUserDefinedBoardID 123 printf 96d iErrCode iErrCode m_usbIO CloseDevice 56 Document version 1 03 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 usbIO Byte byNickName USBIO NICKNAME LENGTH m usbIO new ICPDAS_USBIO if ERR NO ERR iErrCode m usbIO OpenDevice USB20xx 1 sprintf byNickName Station 1 1 3 if ERR_NO_ERR iErrCode m usbIO SetDeviceNickName byNickName printf 96d iErrCode iErrCode m usblO CloseDevice 57 Document version 1 03 ICP DAS USB Class Members Public Method
8. 1 03 ICP DAS USB Class Members Public Methods 5 6 4 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 105 Document version 1 03 ICP DAS USB Class Members Public Methods Example Int iErrCode ICPDAS USBIO m usbIO 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 iErrCode m usbIO PI GetTypeCode o_byTypeCode printf 96d iErrCode else for ildx 0 ildx lt USBIO PI MAX CHANNEL ildx printf 02x n o_byTypeCodelildx 106 Document version 1 03 ICP DAS USB Class Members Public Methods 5 6 4 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 107 Document version 1 03 ICP DAS USB Class Members Public Methods Example Int iErrCode ICPDAS USBIO m usbIO Byte o byTriggerMode USBIO PI MAX CHANNELJ Int ildx m usbIO new ICPDAS_USBIO if ERR NO ERR iErrCode m us
9. 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 5 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 80 Document version 1 03 ICP DAS USB Class Members Public Methods Syntax public int AI ReadValue DWORD o dwAlValue BYTE o byAlChStatus Parameters o dwAlValue OUT The raw value of Al value o_byAIChStatus OUT The byte array of channel status Return Value Error code Example Int iErrCode ICPDAS_USBIO m usbIO DWORD o dwAlValue USBIO AI MAX CHANNELJ Byte o byAIChStatus USBIO AI MAX CHANNELJ Int ildx m usbIO new ICPDAS_USBIO if ERR NO ERR iErrCode m usbIO OpenDevice USB2019 1 if ERR_NO_ERR iErrCode m usbIO Al ReadValue o dwAlValue o_byAIChStatus printf 96d iErrCode else For ildx O ildx lt USBIO Al MAX CHANNEL ildx printf Ox 08x 0x 02x n o dwAlValue ildx o_byAIChStatus 81 Document version 1 03 ICP DAS USB Class Members Public Methods 5 6 3 11 3 AI ReadValue float Analog input function Read the real AI value without channel status T
10. BYTE o_byLPFilterEnable Parameters o byLPFilterEnable OUT The byte array of the low pass filter enable mask Return Value Error code 111 Document version 1 03 ICP DAS USB Class Members Public Methods Example Int iErrCode ICPDAS USBIO m usbIO 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 96d iErrCode else for ildx 0 ildx lt USBIO PI MAX CHANNEL 7 8 ildx printf 02x n o byLPFilterEnable iIdx 112 Document version 1 03 ICP DAS USB Class Members Public Methods 5 6 4 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 channel 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 113 Document version 1 03 ICP DAS USB Class Members Public Methods Example Int iErrCode ICPDAS USBIO m usbIO WORD o_wLPFilterWidth USBIO PI MAX CHANNELJ Int ildx m usbIO
11. Ex Byte0 gt Channel0 7 Syntax public int PI_ClearChCount BYTE i_byClrMask Parameters i byclrMask IN The byte array of channel count clear mask Return Value Error code Example Int iErrCode ICPDAS USBIO m usblO Byte m byChClrMask USBIO PI MAX CHANNEL 7 8 Int ildx m usbIO new ICPDAS_USBIO if ERR NO ERR iErrCode m usbIO OpenDevice USB2084 1 For ildx 0 ildx lt USBIO PI MAX CHANNEL 7 8 ildx m byChClrMask ildx 0x5A if ERR_NO_ERR iErrCode m usbIO PI ClearChCount m byChClrMask printf 96d iErrCode iErrCode m_usblO CloseDevice 127 Document version 1 03 ICP DAS USB Class Members Public Methods 5 6 4 14 PI_ClearSingleChCount Pulse input function Clear specific channel count Syntax public int PI_ClearSingleChCount BYTE i_byChToClr Parameters i bychTocir IN The channel index for clearing Return Value Error code Example Int iErrCode ICPDAS USBIO m usblO m_usbIO new ICPDAS_USBIO if ERR_NO_ERR iErrCode m usbIO OpenDevice USB2084 1 if ERR_NO_ERR iErrCode m usbIO PI ClearSingleChCount 7 printf 96d iErrCode iErrCode m_usblO CloseDevice 128 Document version 1 03 ICP DAS USB Class Members Public Methods 5 6 4 15 PI_ClearChStatus Pulse input function Clear channel status with clear mask Each byte indicates 8 channels clear mask set for channel clear
12. 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 131 Document version 1 03 ICP DAS USB Class Members Public Methods 5 6 4 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 usbIO m usbIO new ICPDAS_USBIO if ERR NO ERR iErrCode m usbIO OpenDevice USB2084 1 if ERR_NO_ERR iErrCode m_usbIO PI_SetTriggerMode 0 0x1 printf 96d iErrCode iErrCode m_usblO CloseDevice 132 Document version 1 03 ICP DAS USB Class Members Public Methods 5 6 4 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 usbIO Byte m byChTriggerMode USBIO PI MAX CHANNELJ Int ildx
13. if ERR NO ERR iErrCode m usbIO OpenDevice USB2019 1 if ERR_NO_ERR iErrCode m usbIO AI ReadValue o fAlValue o_byAIChStatus printf 96d iErrCode else For ildx O ildx lt USBIO Al MAX CHANNEL ildx printf 5f Ox 02x n o fAlValue ildx o byAIChStatus 85 Document version 1 03 ICP DAS USB Class Members Public Methods 5 6 3 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 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 86 Document version 1 03 ICP DAS U
14. AI GetTotalSupportType BYTE o byTotalSupportType Parameters o_byTotalSupportType OUT The number of total support type Return Value Error code 63 Document version 1 03 ICP DAS USB Class Members Public Methods Example Int iErrCode ICPDAS_USBIO m usbIO Byte o_byTotalSupportType Byte o bySupportTypeCode USBIO MAX SUPPORT TYPE Int ildx Bool bRet true m_usbIO new ICPDAS_USBIO if ERR_NO_ERR iErrCode m usbIO OpenDevice USB2019 1 if ERR_NO_ERR iErrCode m usbIO AI GetTotalSupportType amp o_ byTotalSupportType printf 96d iErrCode bRet false if ERR_NO_ERR iErrCode m_usbIO AI GetSupportTypeCode o_ bySupportTypeCode printf 96d iErrCode bRet false If bRet printf d n o byTotalSupportType for ildx 0 ildx lt o_byTotalSupportType ildx printf 02x n o_bySupportTypeCodelildx 64 Document version 1 03 ICP DAS USB Class Members Public Methods 5 6 3 2 AI GetSupportTypeCode 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 65 Document version 1 03 ICP DAS USB Class Members Public Methods Example Int iErrCode ICPDAS_USBIO m usbIO
15. Ap D ANE delme ea 2 1 4 SECC AIO MS A ue E E KA N E UU NUR 2 lAlGenerale aa e manisa E S do 2 1 4 2JH9B 20 e RM ee ME BA 3 12 245 B20 BA elle RYAN 4 T5 e a ip e e KY dati MANCHER a QUEUE 4 2 Hardware Inforradtlon cesarea pte P aaa 5 2 a Module NEREN sm al alakal sal RU E E RU M 5 210U05B20 195 lenitiva 6 21205B 2094 Leelee 7 2 2 Connector PIRASSIGNIMENT criar 7 2 HUSB 2 ole LR 7 22 DAN SEE 20 lalla lee 8 2 3 Connector Symbol Description iaia 9 23 DU SB 20 T9 lle 9 22205B 2094 MEKE mn das ME MERLO NE 9 PA lone 9 ZA DUSBE2O S case quei ee OR SERI alm QUE 9 24205B 2094 x Barone Dira an ab Ria 10 2 5 Hardware Configuration ua i pe on e aa 10 25 1 Board Dallo 10 25 2 Firmware Update aa di RM lm 11 25 30 B0 19 heel eee 12 2 54 SBS20825 cortes A e la Pd ONU RTI ei adla e ed qd 12 2 6 LED Irielit GUQIS oae ripe tonto te etr amima SEO EO dj no 13 2 6 4 Normal Operation as medi ei madam ae ipt aH e NR tia avi dde 13 246 2 Firmware update sseestipecmetbokibei ape pa tus ba pe 13 e gesi EAE ONY oo rina tea ode petia Gi qM Dc PARE DEME erede de 14 SM airs sS 14 3 1 1 Connecting to ICP DAS USB series I O module sss 14 3 2 STEW aa kapla odak aua allik pido DEA beu ai 14 I Document version 1 03 Content Overview 5 2 LER Eois i kaideli ar aedes dei RI IRON 15 3 2 2 ICP DAS USB I O Software Integration tuti rte ite eel 23 32 3 SAMDIES edita end a vain abana aes 25 Ripe
16. Byte o_byTotalSupportType Byte o bySupportTypeCode USBIO MAX SUPPORT TYPE Int ildx Bool bRet true m_usbIO new ICPDAS_USBIO if ERR_NO_ERR iErrCode m usbIO OpenDevice USB2019 1 if ERR_NO_ERR iErrCode m usbIO AI GetTotalSupportType amp o_ byTotalSupportType printf 96d iErrCode bRet false if ERR_NO_ERR iErrCode m_usbIO AI GetSupportTypeCode o_ bySupportTypeCode printf 96d iErrCode bRet false If bRet printf d n o byTotalSupportType for ildx 0 ildx lt o byTotalSupportType ildx printf 02x n o bySupportTypeCode iIdx 66 Document version 1 03 ICP DAS USB Class Members Public Methods 5 6 3 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 Error code Example Int iErrCode ICPDAS USBIO m usbIO Byte o byTypeCode USBIO AI MAX CHANNEL Int ildx m usbIO new ICPDAS_USBIO if ERR NO ERR iErrCode m usbIO OpenDevice USB2019 1 if ERR_NO_ERR iErrCode m usbIO AI GetTypeCode o byTypeCode printf 96d iErrCode else for ildx O ildx lt USBIO Al MAX CHANNEL ildx printf 02x n o_byTypeCodelildx 67 Document versio
17. ICP DAS USB IO Setup Wizard This will install ICP DAS USB IO version 1 0 0 3 on your computer It is recommended that you close all other applications before continuing Click Next to continue or Cancel to exit Setup Figure 3 3 The welcome message of the ICP DAS USB series I O installer After the installation the window will indicate the installation has completed as the figure below Users can check the patch note to see the change or ignore 18 Setup ICP DAS USB IO Completing the ICP DAS USB IO Setup Wizard Setup has finished installing ICP DAS USB IO on your computer The application may be launched by selecting the installed icons Click Finish to exit Setup Figure 3 4 The installation has completed 3 2 1 Utility The USB IO Utility provides a simple way to test and acquire data easily and instantly for all ICP DAS USB series I O modules without programming You will find this program in Start Programs ICPDAS USB IO USB IO Utility or the path C ICPDAS USB IO USB IO Utility USB IO Utility exe 15 Document version 1 03 Installation Software fm ICPDAS SN ek tm Tp ond ius ri lim VT Renzi FTI eme MI Eg Mi dii Pai esl USB IO Utility When users open USB IO Utility the all ICP DAS USB series I O modules connected to PC are listed in Device List as figure 3 5 The utility will scan the ICP DAS USB series I O modules automatically The module in
18. Methods 5 6 3 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 Ox13E then we can get the actual value Y is Y 1 x 10 10 10 Channel Under The reading value represents a sign value X indicates how many value under zero scale range This value can be calculated by following formula Assume current type is 5V 5V with 16 bit resolution and reading value is Ox53E 0X53E OxFFFF then we can get the actual value Y is Y 0 x 5 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 Al value but has the most efficiency 78 Document version 1 03 ICP D
19. Mode Rejection 100 dB Voltage input gt 400 ko Input Impedance Current input 1250 External resistor is required Intra Module Isolation j 3000 Vpc Field to Logic Overvoltage protection 240 Vims OO TE Kel EEL Eo Yes Open Wire Detection Yes Software programmable Power Consumption 1 45W maximum Mechanical Body 33mm x 78mm x 107mm Dimensions WxLxH CN 1824 29mm x 43mm x 83mm Document version 1 03 Introduction Product Check List 1 4 3 USB 2084 Channels 4 channel counter type Up Down 4 channel counter type Dir Pulse 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 Freguency 500kHz maximum Digital Noise Filter 1 32767uS Software programmable Frequency Accuracy 0 4 On Voltage Level o 4 5Vpc 30Vpc Isolated Input Level Off Voltage Level 1Vpc maximum On Voltage Level 2Vpc 5Vpc Non isolated Input Level Off Voltage Level OVpc 0 8Vpc Intra Module Isolation i 2500 Vpc Field to Logic O VEIKA E ELi Eo Yes Power Consumption 1 11W maximum Mechanical Dimensions WxLxH 33mm x 102mm x 107mm 1 5 Product Check List The package includes the following items e One ICP DAS USB I O module e One Quick Start Guide e One USB cable with lockable kit It is highly recommended to read the Quick Start Guide first before using ICP DAS USB I O modules There
20. The valid range of offset is 40 96 40 95 These two overload methods are listed as following table and described in following section Name of Methods AI SetChCJCOffset BYTE i byChToSet float i_fChCJCOffset AI SetChCJCOffset float i fChCJCOffsets 93 Document version 1 03 ICP DAS USB Class Members Public Methods 5 6 3 15 1 AI SetChCJCOffset BYTE float Analog input function Set channel CJC offset for specific channel Syntax public int Al 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 usbIO m usbIO new ICPDAS USBIO if ERR NO ERR iErrCode m usbIO OpenDevice USB2019 1 if ERR_NO_ERR iErrCode m usbIO AI SetChCJCOffset 0 1 354 printf 96d iErrCode iErrCode m usblO CloseDevice 94 Document version 1 03 ICP DAS USB Class Members Public Methods 5 6 3 15 2 AI SetChCJCOffset float Analog input function Set channel CJC offset for specific channel Syntax public int AI SetTypeCode float i fChCJCOffset Parameters i fChCJCOffset IN The float array of channel CJC offset to set Return Value Error code Example Int iErrCode ICPDAS USBIO m usblO float m fChCJCOffset USBIO AI MAX CHANNELJ Int ildx m usbIO new ICPDAS USBIO if E
21. as following table and described in following section Name of Methods PI_SetLPFilterEnable BYTE i byChToSet BOOL i_bLPFilterEnable PI_SetLPFilterEnable BYTE i byLPFilterEnable 137 Document version 1 03 ICP DAS USB Class Members Public Methods 5 6 4 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 usbIO m usbIO new ICPDAS USBIO if ERR NO ERR iErrCode m usbIO OpenDevice USB2084 1 if ERR_NO_ERR iErrCode m usbIO PI SetLPFilterEnable 5 0x1 printf 96d iErrCode iErrCode m usblO CloseDevice 138 Document version 1 03 ICP DAS USB Class Members Public Methods 5 6 4 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 j byLPFilterEnable IN The byte array of low pass filter enable mask Return Value Error code Example Int iErrCode ICPDAS USBIO m usbIO Byte m byLPFilterEnable USBIO PI MAX CHANNEL 7 8 Int ildx m usbIO new ICPDAS USBIO if ERR NO ERR iErrCode
22. eri i aa al ea pd iki 26 41Hardwarestructure eee aaa aaa 26 4 2 Software structure osista a i R a aia 26 5 ICP DAS USB Class Members 30 5 1 Table of Constructors iii 30 5 2 Table of Static Methods eee i 30 5 3 Table of Public Methods eene anata nitentes tensis 30 SB jr pen mr aa nemo ma m tdi a oc ae SERENATA 30 532 DEVICE mmm m o ald rr ede 31 SES Analog IDDUE s aah onodi oun ketamin da SV Oh ledi e i lam 31 soi nuli dje Tn 32 5 3 5 Otlleto ani o o i DK bt deri nd ie ne 33 SA CODSLEUCELOLS oett tee e oet iet e te tute teet eee tue i reser 34 54 ICR DAS VISIO a a eicit alal 34 5 5 Stati Gi Methods zeit et E E REA l men OE SERE Biyeli dete ba 35 DE T ElSt D VICBo o eic ralli EE 35 55 2 SCANDEVICEr a toten te tere dtt te a te Ih A te alandada 36 5 6 Public Methods etit eret tre m optet 37 DOL SYSE al RI 37 5 6 2 DEV CE rena sko o eil DE 42 0 5 Analog 6 DUE ine e eno emma 63 OA Pulse IUE ner m e lada a i ai 101 Trouble sho ti i deri asit enis dospio i strato 143 BER realizato 144 A1lAnalog input Type Code aidat halel e LU lied 144 AZ Analog Output Type Code mler mel laleli nini iel dadli 145 A 3 Pulse Input Type GE Kasma sadnan n e 145 A A Channel Status asl ma ERR lll SCR dala NN RR keta 145 App ndix EE re e o e na 146 Bal Error Codes os ad RR en Badak ll a ll 146 V Document version 1 03 Introduction Overview 1 Introdu
23. if ERR NO ERR iErrCode m usbIO OpenDevice USB2019 1 if ERR_NO_ERR iErrCode m_usbIO AI GetChEnable o_byChEnable printf 96d iErrCode else for ildx 0 ildx lt USBIO AI MAX CHANNEL 7 8 ildx printf 02x n o byChEnable ildx 71 Document version 1 03 ICP DAS USB Class Members Public Methods 5 6 3 6 AI GetFilterRejection Analog input function Get filter rejection 60Hz 0 50Hz 1 Syntax public int AI GetFilterRejection BYTE o byFilterRejection Parameters o byFilterRejection OUT The filter rejection Return Value Error code Example Int iErrCode ICPDAS USBIO m usbIO Byte o byFilterRejection m usbIO new ICPDAS_USBIO if ERR NO ERR iErrCode m usbIO OpenDevice USB2019 1 if ERR_NO_ERR iErrCode m usbIO AI GetFilterRejection amp o byFilterRejection printf 96d iErrCode else printf d n o byFilterRejection 72 Document version 1 03 ICP DAS USB Class Members Public Methods 5 6 3 7 Al GetCJCOffset Analog input function Get CJC offset The valid range of offset is 40 96 440 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 fC COffset m usbIO new ICPDAS_USBIO if ERR NO ERR iErrCode m usbIO OpenDevice USB2019 1 if ERR
24. open Defined in ICPDAS_USBIO h i_byUSBIO_BID IN Board ID for the specific device to open Return Value Error code Example Int iErrCode ICPDAS_USBIO m usbIO m usbIO new ICPDAS_USBIO iErrCode m usbIO OpenDevice USB2019 1 iErrCode m usbIO CloseDevice 37 Document version 1 03 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 usbIO m usbIO new ICPDAS_USBIO if ERR NO ERR iErrCode m usbIO OpenDevice USB2019 1 Some code accessing USB I O iErrCode m_usbIO CloseDevice 38 Document version 1 03 ICP DAS USB Class Members Public Methods 5 6 1 3 SYNCDevice Send synchronization packet to I O module Note 1 The synchronization will be handled by library after calling OpenDevice the procedure will be closed after calling CloseDevice User can call this API to send synchronization packet manually it will not stop the original synchronization procedure handled by library 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 usblO OpenDevice USB2019 1 If ERR NO ERR iErrCode m_usblO SYNCDevice printf 96d iEr
25. the Device List will be removed when pull off from PC and added when plug in to PC USB IO Utility Device List low Computer E USB D Board 2 USB Board 1 Figure 3 5 USB Utility Device List form To access the any ICP DAS USB I O module by double clicking module in Device List then you will see another form comes out There are several function pages information and I O pages in this form In the information page it is used to configure basic system parameters And in the I O page it is used to access real time data and configuring I O parameters In addition there will be a data log page if module supports this function 16 Document version 1 03 Installation Software 3 2 1 1 Information Page USB Board ij Device Name Firmware Version Setting User defined Board ID a Set Software WDT ms Set Description Set Figure 3 6 The USB I O Information Page e Device Name The name of the opened device e Firmware Version The firmware version of the opened device User Defined Board ID The board ID of the opened device The value can configure when switched the board ID to 0 by the rotary switch Note The valid range of this ID is from 16 127 e Software WDT The software watch dog timer of the opened device The value enables the functionality to monitor module alive When enable the watch dog timer computer and module will send SYNC packet to ea
26. the root path of the CD 2 Returning timeout error code 65792 when access USB I O There are some possible reasons e The USB module connected to USB hub not local USB port on computer This will cause the time for communication increased To prevent this error users can increase the time of communication timeout Note We strongly recommended connecting USB modules to local USB port on computer to prevent unexpected problem e Module is failure caused by unknown reason You can refer to LED indicators section 143 Document version 1 03 Appendix A A 1 Analog Input Type Code Appendix A A 1 Analog Input Type Code Code InputType Code InputType 0x00 15 mV 15 mV 0x01 50mV 50mV 0x02 100 mV 100 mV 0x03 500 mV 500 mV 0x04 1V 1V 0x05 25V 25V 0x06 20 mA 20 mA 0x07 4mA 20 mA 0x08 10V 10 V 0x09 5V 5V Ox0A 1V 1V OxOB 500 mV 500 mV OxOC 150 mV 150 mV OxXOD 20 mA 20 mA Ox0E Type JTC 210 760 C OxOF Type K TC 210 1372 C 0x10 Type T TC 270 400 C 0x11 Type ETC 270 1000 C 0x12 TypeR TC 0 1768 C 0x13 Type S TC 0 1768 C 0x14 Type B TC 0 1820 C 0x15 Type N TC 270 1300 C 0x16 Type C TC 0 2320 C Document version 1 03 0x17 0x18 0x19 Ox1A Ox1B Ox1C 0x20 0x21 0x22 0x23 0x24 0x25 0x26 0x27 0x28 0x29 Ox2A 0x2B 0x2C 0x2D Ox2E Ox2F 144 Type LTC 200 800 C Type MTC 200 100 C T
27. watchdog 1 6 second Watchdog 1 Software watchdog Programmable LED Indicators Display System LED Indicators 3 LED as Power Run and Error I O LED Indicators 1 LED channel as I O status for Digital and Pulse I O EMS Protection 4 kV contact for each terminal ESD IEC 61000 4 2 S 8 kV air for random point Environment Ie TC HUI METH ILE ICE telato GE 25 75 C Storage Temperature Range 40 85 C Humidity 10 95 RH non condensing Document version 1 03 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 also widely supports thermocouple devices with J K T E R S B N C L M and Lpin43710 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 Channels 8 differential Voltage 15 mV 50 mV 100 mV 150 mV 500 mV 1V 2 5V 5V 10V Current 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 Input Type LDIN43710 Resolution 16 bit Accuracy 0 1 FSR Sampling Rate 10 Hz Total Zero Drift 20 uV C Span Drift 25 ppm C Common Mode Rejection 86 dB Normal
28. you to identify what types of IO are supported in the device Syntax public int GetSupportIOMask BYTE o_bySupportIOMask Parameters o bySupportloMask OUT The support IO mask of the device Return Value Error code 48 Document version 1 03 ICP DAS USB Class Members Public Methods Example Int iErrCode ICPDAS_USBIO m usbIO Byte o bySupportIOMask m usbIO new ICPDAS_USBIO if ERR NO ERR iErrCode m usbIO OpenDevice USB2019 1 if ERR_NO_ERR iErrCode m usbIO GetSupportIOMask amp o_bySupportIOMask printf 96d iErrCode else printf 0x9602x o bySupportIOMask iErrCode m usblO CloseDevice 49 Document version 1 03 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 iErrCode m usblO GetDITotal amp o_byDITotal printf 96d iErrCode else printf 96d o byDITotal iErrCode m usblO CloseDevice 50 Document version 1 03 ICP DAS USB Class Members Public Methods 5 6 2 9 GetDOTotal Get DO total number of channels of the device Syntax public i
29. 75 Document version 1 03 ICP DAS USB Class Members Public Methods 5 6 3 10 Al 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 usbIO Byte o byResolution 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 GetResolution o_byResolution printf 96d iErrCode else For ildx 0 ildx lt USBIO AI MAX CHANNEL ildx printf d n o byResolution iIdx 76 Document version 1 03 ICP DAS USB Class Members Public Methods 5 6 3 11 Al ReadValue The class library provides 4 overload methods to read AI value Two methods the parameter in float format will convert raw value to true inside the method Others will return raw value without having conversion The overview of these methods is as following table and will describe in the following section Name of Methods AI ReadValue DWORD o dwAlValue AI ReadValue DWORD o dwAlValue BYTE o byAlChStatus AI ReadValue float o_fAIValue AI ReadValue float o_fAIValue BYTE o byAlChStatus 77 Document version 1 03 ICP DAS USB Class Members Public
30. AS 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 usbIO DWORD o dwAlValue 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 dwAlValue printf 96d iErrCode else For ildx 0 ildx lt USBIO AI MAX CHANNEL ildx printf 0x 08x n o dwAlValue iIdx 79 Document version 1 03 ICP DAS USB Class Members Public Methods 5 6 3 11 2 Al 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 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
31. An error occur while getting device information 0x00010107 65799 while device opening procedure 148 Document version 1 03
32. E 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 usbIO m usbIO new ICPDAS_USBIO if ERR NO ERR iErrCode m usbIO OpenDevice USB2019 1 if ERR_NO_ERR iErrCode m usbIO AI SetTypeCode 0 0x10 printf 96d iErrCode iErrCode m usblO CloseDevice 91 Document version 1 03 ICP DAS USB Class Members Public Methods 5 6 3 14 2 AI SetTypeCode BYTE Analog input function Set type code for all channels The type code can reference to Appendix A 1 Syntax public int Al 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 Al MAX CHANNEL Int ildx m_usbIO new ICPDAS_USBIO if ERR_NO_ERR iErrCode m usbIO OpenDevice USB2019 1 For ildx 0 ildx lt USBIO Al MAX CHANNEL ildx m_byChTypeCodelildx 0x10 if ERR_NO_ERR iErrCode m usbIO AI SetTypeCode m_byChTypeCode printf 96d iErrCode iErrCode m_usblO CloseDevice 92 Document version 1 03 ICP DAS USB Class Members Public Methods 5 6 3 15 AI_SetChCJCOffset The class has two overload methods for setting channel CJC offset One provides specifying channel to set another for all channel
33. 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 usbIO 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 USBIO PI MAX CHANNEL 7 8 ildx m byChClrMask ildx 0x5A if ERR_NO_ERR iErrCode m usbIO PI ClearChStatus m byChClrMask printf 96d iErrCode iErrCode m usblO CloseDevice 129 Document version 1 03 ICP DAS USB Class Members Public Methods 5 6 4 16 PI_ClearSingleChStatus Pulse input function Clear specific channel status Syntax public int PI ClearSingleChStatus BYTE i_byChToClr Parameters i bychTocir IN The channel index for clearing Return Value Error code Example Int iErrCode ICPDAS USBIO m usblO m_usbIO new ICPDAS_USBIO if ERR_NO_ERR iErrCode m usblO OpenDevice USB2084 1 if ERR_NO_ERR iErrCode m usbIO PI ClearSingleChStatus 7 printf 96d iErrCode iErrCode m_usblO CloseDevice 130 Document version 1 03 ICP DAS USB Class Members Public Methods 5 6 4 17 PI SetTriggerMode The class has two overload methods for setting trigger mode One provides specifying channel to set another for all channels
34. GAL_FUNC 0x00000001 1 ERR_ DEV_ILLEGAL_INDEX 0x00000002 2 ERR_DEV_ILLEGAL_LENGTH 0x00000003 3 ERR_DEV_ILLEGAL_PARAMETER 0x00000004 4 ERR_DEV_ILLEGAL_MAPTABSIZE 0x00000005 5 ERR_DEV_ILLEGAL_MAPTABINDEX 0x00000006 6 ERR_DEV_READONLY 0x00000007 7 ERR_ DEV_WRITEONLY 0x00000008 8 ERR_ DEV_BUFFERFULL 0x00000009 9 ERR_ DEV_LTTIMEOUT 0x0000000A 10 ERR DEV LTMODEFAIL 0x0000000B 11 ERR DEV LTPKGLOST Document version 1 03 The operation completed successfully The function is invalid The index is invalid The length is invalid The parameter is invalid The size of mapping table is invalid The index in mapping table is invalid The index is read only The index is written only The buffer in transceiver is full The operation of large transfer has timeout The current mode is not in large transfer mode The large transfer packet is lost 146 Appendix B B 1 Error Codes 0x0000000C 12 ERR DEV LTINDEXNOTMACH 0x0000000D 13 ERR DEV LTNOTFINISH 0x0000000E 14 ERR DEV DO RELATED ERR 0x00004000 0x000047FFF ERR DEV DI RELATED ERR 0x00004800 0x00004FFF ERR DEV AO RELATED ERR 0x00005000 0x000057FF ERR DEV AI RELATED ERR 0x00005800 0x00005FFF ERR DEV PO RELATED ERR 0x00006000 0x000067FF ERR DEV PI RELATED ERR 0x00006800 0x00006FFF ERR USBDEV INVALID DEV 0x00010000 65536 ERR USBDEV DEV OPENED 0x00010001 65537 ERR USBDEV DEVNOTEXISTS 0x00010002 65538 ERR USBDEV
35. 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 03 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 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 147 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
36. I 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 19 Document version 1 03 Installation Software USB 2084 Board 1 Poll Interval 1000 C Hide setting panel Show hex VO Configuration I O Monitor 3 8 USB I O PI Configuration Page 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 e 1 0 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 willshowin I O configuration region e 1 0 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 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 C
37. IO new ICPDAS_USBIO if ERR NO ERR iErrCode m usbIO OpenDevice USB20xx 1 if ERR_NO_ERR iErrCode m usbIO GetAOTotal amp o byAOTotal printf 96d iErrCode else printf 96d o_byAOTotal iErrCode m_usblO CloseDevice 53 Document version 1 03 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 usblO Byte o_byPITotal m usblO new ICPDAS_USBIO if ERR_NO_ERR iErrCode m usbIO OpenDevice USB20xx 1 if ERR_NO_ERR iErrCode m usbIO GetPITotal amp o_byPITotal printf 96d iErrCode else printf 96d o byPlTotal iErrCode m usblO CloseDevice 54 Document version 1 03 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 usbIO Byte o byPOTotal m usblO new ICPDAS_USBIO if ERR_NO_ERR iErrCode m usbIO OpenDevice USB20xx 1 if ERR_NO_ERR iErrCode m usbIO GetPOTotal amp o byPOTotal printf 96d iErrCode else printf d
38. RR NO ERR iErrCode m usbIO OpenDevice USB2019 1 For ildx O ildx lt USBIO AI MAX CHANNEL ildx m_fChCJCOffsetlildx 1 358 if ERR_NO_ERR iErrCode m_usblO AL_SetChCJCOffset m_fChCJCOffset printf 96d iErrCode iErrCode m_usblO CloseDevice 95 Document version 1 03 ICP DAS USB Class Members Public Methods 5 6 3 16 Al SetChEnable Analog input function Set channel enable disable Each byte indicates 8 channels enable disable mask Ex Byte0 gt Channel0 7 Syntax public int Al SetChEnable BYTE i_byChEnable Parameters i_byChEnable IN The byte array of channel enable disable mask Return Value Error code Example Int iErrCode ICPDAS USBIO m usbIO Byte m byChEnable USBIO AI MAX CHANNEL 7 8 Int ildx m usbIO new ICPDAS_USBIO if ERR NO ERR iErrCode m usbIO OpenDevice USB2019 1 For ildx 0 ildx USBIO AI MAX CHANNEL 7 8 ildx m_byChEnable ildx Ox5A if ERR_NO_ERR iErrCode m usbIO AI SetChEnable m byChEnable printf 96d iErrCode iErrCode m usblO CloseDevice 96 Document version 1 03 ICP DAS USB Class Members Public Methods 5 6 3 17 Al 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 E
39. SB Class Members Public Methods Syntax public int AI ReadBulkValue BYTE i byStartCh BYTE i byChTotal DWORD i dwSampleWidth Float i fSampleRate DWORD i dwBufferWidth DWORD o dwDataBuffer OnBulkValueFinishEvent i CBFunc Parameters i byStartCh IN The starting acquire channel i byChTotal IN The total channels to acquire i dwSampleWidth IN The sampling width ms i fSampleRate IN The sampling rate Hz 10KHz maximum i dwBufferWidth IN The width of the buffer for single channel o dwDataBuffer OUT The 2 dimension buffer array to store i CBFunc IN Block operation NULL IN Non block operation The address of callback function Return Value Error code 87 Document version 1 03 ICP DAS USB Class Members Public Methods Example Int iErrCode ICPDAS_USBIO m usbIO To read 0 1 channel for 100ms in 5 KHz sample rate each channel in non block operation So we have the following variable declaration define SampleRate 5000 define BufferWidth 500 5000 Hz 0 1 100ms DWORD m_dwBuffer 2 BufferWidth Void BulkFinishCallback DWORD dwCount Callback function to handle data Int main m_usbIO new ICPDAS_USBIO if ERR_NO_ERR iErrCode m usblO OpenDevice USB2019 1 if ERR_NO_ERR iErrCode m usbIO AI ReadBulkValue 0 2 100 SampleRate BufferWidth m_dwBuffer BulkFinishCallback printf 96d iErrCode while 1 Sleep 1
40. SBIO if ERR NO ERR iErrCode m usbIO OpenDevice USB2084 1 if ERR_NO_ERR iErrCode m usbIO PI SetChisolatedFlag 5 0x1 printf 96d iErrCode iErrCode m usblO CloseDevice 135 Document version 1 03 ICP DAS USB Class Members Public Methods 5 6 4 18 2 PI_SetChIsolatedFlag BYTE Pulse input function Set channel isolated flag to all channels Syntax public int PI SetChisolatedFlag BYTE i byChisolatedFlags Parameters i byChisolatedFlags IN The byte arrays of channel isolated flag Return Value Error code Example Int iErrCode ICPDAS USBIO m usbIO Byte m byChIsolatedFlags 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 O ildx lt USBIO PI MAX CHANNEL 7 8 ildx m_byChlsolatedFlaglildx 0x5a if ERR_NO_ERR iErrCode m usbIO PI SetChisolatedFlag m byChisolatedFlag printf 96d iErrCode iErrCode m usblO CloseDevice 136 Document version 1 03 ICP DAS USB Class Members Public Methods 5 6 4 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 ChannelO 7 These two overload methods are listed
41. Well elik i E Solid Normal Operation RUN Green Blink USB Bus Communicating ERR Red Blink Less frequent Warning Does not affect the operation Solid Major Error Does affect the operation 2 6 2 Firmware update LIME sink Waiting for Firmware to update 13 Document version 1 03 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 ICPDAS USB E 4 Figure 3 1 The system detects the ICPDAS USB series I O modules has plugged in i Found New Hardware Your new hardware is installed and ready to use Figure 3 2 The ICPDAS USB series I O modules are ready to use 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 14 Document version 1 03 Installation Software 1G Setup ICP DAS USB IO Welcome to the
42. _NO_ERR iErrCode m usbIO AI GetCJCOffset amp o_fCJCOffset printf 96d iErrCode else printf 5f n o fCJCOffset 73 Document version 1 03 ICP DAS USB Class Members Public Methods 5 6 3 8 Al 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 usbIO Byte o byCJCEnable m usbIO new ICPDAS_USBIO if ERR NO ERR iErrCode m usbIO OpenDevice USB2019 1 if ERR_NO_ERR iErrCode m usbIO AI GetCJCEnable amp o_byCJCEnable printf 96d iErrCode else printf d n o_byCJCEnable 74 Document version 1 03 ICP DAS USB Class Members Public Methods 5 6 3 9 Al GetWireDetectEnable Analog input function Get wire detect enable Disable 0 Enable 1 Syntax public int AI GetWireDetectEnable BYTE o byWireDetectEnable Parameters o byWireDetectEnable OUT The wire detect enable Return Value Error code Example Int iErrCode ICPDAS USBIO m usbIO Byte o byWireDetectEnable m usbIO new ICPDAS_USBIO if ERR NO ERR iErrCode m usbIO OpenDevice USB2019 1 if ERR_NO_ERR iErrCode m usbIO AI GetWireDetectEnable amp o_byWireDetectEnable printf 96d iErrCode else printf d n o byWireDetectEnable
43. _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 usbIO Byte o byDeviceNickName USBIO NICKNAME LENGTH m usbIO new ICPDAS_USBIO if ERR NO ERR iErrCode m usbIO OpenDevice USB2019 1 if ERR_NO_ERR iErrCode m_usbIO GetDeviceNickName o_byDeviceNickName printf 96d iErrCode else printf 96s o_byDeviceNickName iErrCode m usblO CloseDevice 46 Document version 1 03 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 usbIO Byte o byDeviceSN USBIO SN LENGTH m usbIO new ICPDAS_USBIO if ERR NO ERR iErrCode m usbIO OpenDevice USB2019 1 if ERR_NO_ERR iErrCode m usbIO GetDeviceSN o byDeviceSN printf 96d iErrCode else printf 96s o byDeviceSN iErrCode m usblO CloseDevice 47 Document version 1 03 ICP DAS USB Class Members Public Methods 5 6 2 7 GetSupportIOMask Get the mask of this device IO distribution Each bit of the mask indicates each supported IO type as shown in the following table N A N A PI PO JA PAO ADI This mask can help
44. _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 usbIO m usbIO new ICPDAS_USBIO if ERR NO ERR iErrCode m usbIO OpenDevice USB2084 1 if ERR_NO_ERR iErrCode m usbIO PI SetTypeCode 0 0x10 printf 96d iErrCode iErrCode m usblO CloseDevice 125 Document version 1 03 ICP DAS USB Class Members Public Methods 5 6 4 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 usbIO Byte m byChTypeCode USBIO PI MAX CHANNELJ Int ildx m usbIO new ICPDAS_USBIO if ERR NO ERR iErrCode m usbIO OpenDevice USB2084 1 For ildx 0 ildx lt USBIO PI MAX CHANNEL ildx m_byChTypeCodelildx 0x50 if ERR_NO_ERR iErrCode m usbIO PI SetTypeCode m byChTypeCode printf 96d iErrCode iErrCode m usblO CloseDevice 126 Document version 1 03 ICP DAS USB Class Members Public Methods 5 6 4 13 PI_ClearChCount Pulse input function Clear channel count with clear mask Each byte indicates 8 channels clear mask set for channel clear
45. ass Members Table of Constructors D ICP DAS USB Class Members The members of the ICPDAS USBIO class are divided into constructors static and public methods The constructors initialize and create the instance of the ICPDAS USBIO Static methods are the ways to identify or scan what USB modules are connected Public methods are used to access USB modules The following tables list the members of ICPDAS USBIO class The detail of these will be described in the following section 5 1 Table of Constructors Mame Description ICPDAS_USBIO Initializes a new instance of the ICPDAS_USBIO class 5 2 Table of Static Methods Name Description KNEE NN 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 a KON OpenDevice List all devices connected with local PC CloseDevice Scan devices connected with local PC SYNCDevice Send a synchronization packet to clear software WDT SetCommTimeout Set communication timeout GetCommTimeout Get communication timeout 30 Document version 1 03 ICP DAS USB Class Members Table of Public Methods 5 3 2 Device me ee RefreshDevicelnfo Refresh device information GetSoftWDTTimeout Get software WDT timeout GetDevicelD 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 t
46. bIO OpenDevice USB2084 1 if ERR_NO_ERR iErrCode m usbIO PI_GetTriggerMode o byTriggerMode printf 96d iErrCode else for ildx 0 ildx lt USBIO PI MAX CHANNEL ildx printf 02x n o byTriggerMode ildx 108 Document version 1 03 ICP DAS USB Class Members Public Methods 5 6 4 5 PI GetChIsolatedFlag Pulse input function Get channel isolated flag Each byte indicates 8 channels flag EX Byte0 Channel0 7 Syntax public int PI GetChIsolatedFlag BYTE o byChisolatedFlag Parameters o_byChIsolatedFlag OUT The byte arrays of channel isolated flag Return Value Error code 109 Document version 1 03 ICP DAS USB Class Members Public Methods Example Int iErrCode ICPDAS USBIO m usbIO Byte o byChIsolatedFlag 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_GetChlsolatedFlag o_byChlsolatedFlag printf 96d iErrCode else for ildx O ildx lt USBIO PI MAX CHANNEL 7 8 ildx printf 02x n o byChlIsolatedFlag iIdx 110 Document version 1 03 ICP DAS USB Class Members Public Methods 5 6 4 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
47. ch 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 e 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 use for restoring module to default setting factory setting 17 Document version 1 03 Installation Software 3 2 1 2 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 C Hide setting panel Show hex I O Configuration 1 O Monitor Figure 3 7 USB I O AI Configuration Page 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 e 1 0 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 willshowin I O configuration region e 1 0 Configuration Region All I O related configurations can be set in this region This region is divided into two part
48. 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 fFregValue BYTE o byChStatus Parameters o fFregValue OUT The float array of the PI channel frequency value o byChStatus OUT The byte array of the channel status Return Value Error code 119 Document version 1 03 ICP DAS USB Class Members Public Methods Example Int iErrCode ICPDAS USBIO m usbIO float o fFreqValue USBIO PI MAX CHANNELJ BYTE o byChStatus 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 iErrCode m usbIO PI ReadValue o fFregValue o_byChStatus printf 96d iErrCode else for ildx 0 ildx lt USBIO PI MAX CHANNEL ildx printf f n o fFregValuelildx 120 Document version 1 03 ICP DAS USB Class Members Public Methods 5 6 4 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 t
49. ck of USB 2084 Document version 1 03 Hardware Information Connector Symbol Description 2 3 Connector Symbol Description 2 3 1 USB 2019 CH lt N gt I Analog input channel N positive reference SEDE IO Anoginpurchannei negati reference 2 3 2 USB 2084 TE 1 Ground pin fornon isolated connection I Counter positive signal channel for pair A ox EIE o 0 T Counter positive signal channel for pair B No connection on this pin 2 4 Wiring 2 4 1 USB 2019 Thermocouple Input Voltage Input Current Input Note When connecting to current source an external 125Q resistor is required Document version 1 03 Hardware Information Hardware Configuration 2 4 2 USB 2084 Input Mode Isolated Non isolated Vin Pulse gt p Vin Pulse 5 Vin Pulse pa Dir Pulse Vin Dir O Vin Dir L J mi m Vin Pulse and Vin Dir i Vin Dir Vin Up UES Vin Up Vin Up DE Up Down gd Vin Down Vin Down gt A Vin Up and Vin Down 1 l C Vin Down bar I Vin Up0 vin upo 13 Up dna rizi pud Vin Up1 LIS ins Up1 E Vin Up0 and vin Upi 3 Vin Up1 Vin A0 Vin A0 zm A B Phase Vin A0 IC gt Vin B0 Quadrant Vin B0 L Vin A0 and Vin BO Vin B0 NM v
50. ction 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 USB 2019 directly and easily without any coding The friendly API library is also provided for users to develop own USB application 1 2 Feature Maximum 10KS s sampling rate e Wide operating temperature range e RoHS compliant e USB 2 0 Full Speed compliant e Noexternal power supply Powered by USB e Plug and Play without driver installation e Lockable USB cable e Support firmware update via USB e Utility tool for module configuration and I O testing easily and quickly e PWR RUN ERR LED indicator e Built in dual watchdog hardware software e Providing API Library VC VB BCB NET e Module supported for Win2000 XP and Win7 32 64 bit Document version 1 03 Introduction Applications 1 3 Applications e Building automation Factory automation e Machine automation e Data acquisition and control Environment monitor e Laboratory equipment and research 1 4 Specifications 1 4 1 General Communication Interface USB 2 0 Full Speed 1 Hardware
51. e else printf d n o_dwCommTimeout iErrCode m_usbIO CloseDevice 43 Document version 1 03 ICP DAS USB Class Members Public Methods 5 6 2 3 GetDevicelD Get ID of the device Syntax public int GetDeviceID DWORD o dwDeviceID Parameters o_dwDeviceID OUT The device ID Return Value Error code Example Int iErrCode ICPDAS USBIO m usblO DWORD o dwbDevicelD m usblO new ICPDAS_USBIO if ERR_NO_ERR iErrCode m usbIO OpenDevice USB2019 1 if ERR_NO_ERR iErrCode m usbIO GetDeviceID amp o dwDeviceID printf 96d iErrCode else printf 96d o dwDevicelD iErrCode m usblO CloseDevice 44 Document version 1 03 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 usbIO WORD o wFwVer m usbIO new ICPDAS USBIO if ERR NO ERR iErrCode m usbIO OpenDevice USB2019 1 if ERR_NO_ERR iErrCode m usbIO GetFwVer amp o wFwVer printf 96d iErrCode else printf 96d o wDwVer iErrCode m usblO CloseDevice 45 Document version 1 03 ICP DAS USB Class Members Public Methods 5 6 2 5 GetDeviceNickName Get nick name of the device Syntax public int GetDeviceNickName BYTE o
52. eCode Pulse input function Set type code for specific channel Overload PI_ClearChCount Pulse input function Clear channel count with 32 Document version 1 03 ICP DAS USB Class Members Table of Public Methods clear mask PI ClearSinglelChCount Pulse input function Clear single channel count PI ClearChStatus Pulse input function Clear channel status with clear mask PI ClearSinglelChStatus Pulse input function Clear single channel status PI SetTriggerMode Pulse input function Set trigger mode Overload PI SetChIsolatedFlag Pulse input function Set channel isolated flag Overload PI SetLPFilterEnable Pulse input function Set low pass filter enable Overload PI SetlPFilterWidth Pulse input function Set low pass filter width Overload 5 3 5 Other CS 7 OOO GetCurrentAccessObj INTERNAL USE DO NOT USE THIS METHOD SetNormalPktByteArray INTERNAL USE DO NOT USE THIS METHOD SetActivePktByteArray INTERNAL USE DO NOT USE THIS METHOD ClearActivePktBuffer INTERNAL USE DO NOT USE THIS METHOD GetActivePktByteArray INTERNAL USE DO NOT USE THIS METHOD SetNormalPktEvent INTERNAL USE DO NOT USE THIS METHOD IsDevMonitorThreadStop INTERNAL USE DO NOT USE THIS METHOD IsCommWithDevice INTERNAL USE DO NOT USE THIS METHOD GetLastCmdTime INTERNAL USE DO NOT USE THIS METHOD 33 Document version 1 03 ICP DAS USB Class Members Constructors 5 4 Constructors 5 4 1 ICPDAS_USBIO Initialize a new instance of t
53. f 96d iErrCode iErrCode m usblO CloseDevice 141 Document version 1 03 ICP DAS USB Class Members Public Methods 5 6 4 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 j byLPFilterEnable IN The byte array of low pass filter enable mask Return Value Error code Example Int iErrCode ICPDAS USBIO m usbIO Byte m byLPFilterWidth USBIO PI MAX CHANNELJ Int ildx m usbIO new ICPDAS USBIO if ERR NO ERR iErrCode m usbIO OpenDevice USB2084 1 For ildx O ildx lt USBIO PI MAX CHANNEL ildx m byLPFilterEnable ildx 20000 if ERR NO ERR iErrCode m usbIO PI SetLPFilterWidth m byLPFilterWidth printf 96d iErrCode iErrCode m usblO CloseDevice 142 Document version 1 03 Troubleshooting Public Methods 6 Troubleshooting 1 Cannotinstall ICP DAS USB 1 O package with the message like the following figure 2 NET Framework v2 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 NET 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
54. he ICPDAS_USBIO class Syntax public ICPDAS_USBIO void Example ICPDAS_USBIO m usbIO m usbIO new ICPDAS USBIO 34 Document version 1 03 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 byNumbDevice ICPDAS USBIO ListDevice amp wDIDs amp byBIDs 35 Document version 1 03 ICP DAS USB Class Members Static Methods 5 5 2 ScanDevice Scanning device connected to PC This static 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 36 Document version 1 03 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
55. he mask of this device IO distribution GetDITotal Get DI total channel of the device GetDOTotal Get DO total channel of the device GetAlTotal 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 RegisterEmergencyPktEventHandle Register the callback function for emergency event sent from USBIO 5 3 3 Analog Input Meme Desen Al GetTotalSupportType Analog input function Get total supported amount AI GetSupportTypeCode Analog input function Get supported type code AI GetTypeCode Analog input function Get type code AI GetChCJCOffset Analog input function Get channel CJC offset AI GetChEnable Analog input function Get channel enable disable AI GetFilterRejection Analog input function Get filter rejection AI GetCJCOffset Analog input function Get CJC offset AI GetCJCEnable Analog input function Get CJC enable 31 Document version 1 03 ICP DAS USB Class Members Table of Public Methods Al GetWireDetectEnable Analog input function Get wire detect enable Al GetResolution Analog input function Get resolution Al ReadValue Analog input function Read AI value in double word fo
56. he 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 o fAlValue OUT The true value of Al value Return Value Error code 82 Document version 1 03 ICP DAS USB Class Members Public Methods Example Int iErrCode ICPDAS USBIO m usbIO float o fAlValue USBIO AI MAX CHANNELJ 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 printf 96d iErrCode else For ildx 0 ildx lt USBIO AI MAX CHANNEL ildx printf 5f n o dwAlValue ildx 83 Document version 1 03 ICP DAS USB Class Members Public Methods 5 6 3 11 4 Al ReadValue float BYTE Analog input function Read the real AI value with channel status Syntax public int AI ReadValue float o fAlValue BYTE o byAlChStatus Parameters o fAlValue OUT The true value of Al value o_byAIChStatus OUT The byte array of channel status Return Value Error code 84 Document version 1 03 ICP DAS USB Class Members Public Methods Example Int iErrCode ICPDAS USBIO m usbIO float o fAlValue USBIO AI MAX CHANNELJ Byte o byAIChStatus USBIO AI MAX CHANNELJ Int ildx m usbIO new ICPDAS_USBIO
57. i DA Solution WindowsFormsA pplication Accessibility 0 0 v2 0 50727 CAWINDOWS Microsof lod ka AspNetMMCExt 0 0 v2 0 50727 CAWINDOWS Microsof E WindowsFormsApplication escompmed 0 0 v2 0 50727 CAWINDO WS Mierosof sa Properties 000 v2050727 CIMINDONS Micro G Dar References de 0 0 v2 0 50727 CAWINDOWS Microsof REJICPDAS USBIO dotNE TEHost 0 04 v20 50727 CAWINDOWS Microsof System IIEHost 0 04 v2 0 50727 CAWINDOWS Mierosof os Data ISymWrapper 0 0 v2 0 50727 CAWINDOWS Microsof up Sysiem Da Microsoft Build Conversi 2 0 0 v2 0 50727 CAWINDOWS Microsof C3 System Deployment Microsoft Build Engine 0 04 v20 50727 CAWINDOWS Microsof 5 Microsoft Build Framew 2001 v20 50727 C WINDOWS Microsof 3 mlm Microsoft Build Tasks 0 04 v2 0 50727 CAWINDOWS Microsof 3 System Windows Forms Microsoft Build Utilities 2001 v2 0 50727 CAWINDOWS Microsof 23 System Xml Microsoft Build Visual 2 0 01 v2 0 50727 CAWINDOWS Microsof amp EB Fonni cs E Program cs 23 Document version 1 03 Installation Software 3 2 2 2 VC Ele Edit View Insert Project Build Tools Window Help la c di Gi X ma A Visu Component Manager 7 A Register Control Il z AA Error Lookup 1 al A ActiveX Control Test Container Tee im 5 gt 7 OLEICOM Object Viewer Symbols in Workspace 5 A Spyt Pi MEC Tracer Customize n Macro Record Quick Macro Ctr
58. igure 2 13 The hardware setting for enabling firmware update functionality Document version 1 03 Hardware Information Hardware Configuration 2 5 3 USB 2019 2 5 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 b b 2 5 4 USB 2084 2 5 4 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 Disabl isable 2 5 4 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 12 Document version 1 03 Hardware Information LED Indicators Jumper Counter Jumper setting Isolated input Non isolated input Default TTL input 2 6 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 6 1 Normal Operation PW
59. in Fredo DO CxA Vin Freq0 Frequency et Mi vin Freqt DE CxB bd vin Freq0 and 19 GND Vin Fregi Vin Freql lt 2 5 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 5 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 10 Document version 1 03 Hardware Information Hardware Configuration shown in figure 2 12 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 m E JB INIT UI RUN Figure 2 12 The hardware setting for board ID 2 5 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 13 The INIT side of the switch means firmware update mode run side means normal operation i So F
60. is some useful information in the Quick Start Guide e Howtoinstall hardware and use utility Document version 1 03 Hardware Information Module Overview 2 Hardware Information 2 1 Module Overview rm amp I Os Terminal Frame Ground DIN Rail Mount Normal Firmware 7 DIN Rail Lock gt gt Update Mode Switch Figure 2 1 Module Overview of the ICP DAS USB I O Board ID Rotary Switch 0 User defined Software Programmable 1 15 Fix board ID Normal Firmware Update Mode Switch INIT Firmware update mode RUN Normal mode Document version 1 03 Hardware Information Module Overview 2 1 1 USB 2019 2 1 1 1 Body 990 I F sak lle Y IM SEN E m Figure 2 2 Figure 2 3 The USB 2019 left and front side view with CN 1824 2 1 1 2 CN 1824 The CN 1824 is a connector transfers DB 25 connector to 18 pin terminal block to help user to wire The dimension is shown as follow 42 4 83 3 81 2 Figure 2 4 Figure 2 5 Figure 2 6 The CN 1824 left front and top side view 6 Document version 1 03 Hardware Information Connector Pin Assignment 2 1 2 USB 2084 2 1 2 1 Body 39 0 35 4 Imaj 0 Figure 2 7 Figure 2 8 The USB 2084 left and front side view
61. l Shift R Play Quick Macro Ctrl Shift P Editor Tabs Debug Compatibility Build Directories Source Editor Tabs Debug Compatibility Build Directories Source Platform Show directories for Platform Show directories for Win32 x Include files z Win32 x Library files x Directories IK Directo Directories OXI6 C Program Files Microsoft Visual Studio VC98YINCLUDE C Program Files Microsoft Visual Studio VC98 LIB C Program Files Microsoft Visual Studio YC98 MFCWINCLUDE C Program Files Microsoft Visual Studio YC98 MFCXLIB C Program Files Microsoft Visual Studio VC98 ATLIINCLUDE CAWINDDK 7600 16385 1 LIB WXP 1386 CAWINDDK 7600 16385 1 INC CAWINDDK 7600 16385 1 INC API 3 2 2 3 BCB This section is left blank intentionally 24 Document version 1 03 Installation Software 3 2 2 4 VB sx Al API Test Microsoft Visual Basic design File Edit View Project Format Debug Run Query Diagram Tools Add Ins Window Hel is gt T Z Add Fom 153 Add MDI Form cmm 238 Add Module x 1 Add Class Module Bf Add User Control TE Add Property Page ab A abi 1 Add User Document EI Add WebClass Add Data Report doo Add DHTML Page EB Add Data Environment 4 More ActiveX Designers 3H y Add File CthD DO Remove AL API Testfrm Ga g Components Cti T AL API Test Properties References Al API Test ybp Available References
62. lear counter value for specified channel 20 Document version 1 03 Installation Software 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 trigger modes The difference between rising and falling is the timing of counter operation In rising edge trigger mode counter will operate when the input signal from low to high level In contrast counter will operate when the input signal from high to low level in the falling edge trigger mode Rising edge Counter operate Input Signal Falling edge Counter operate Input Signal 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 21 Document version 1 03 Installation Software Low Pass Filter AO LPO BO LPO Al LP1 B1 LP1 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
63. m usblO new ICPDAS USBIO if ERR NO ERR iErrCode m usbIO OpenDevice USB2084 1 For ildx O ildx lt USBIO PI MAX CHANNEL ildx m_byChTriggerModelildx 0x2 if ERR_NO_ERR iErrCode m usbIO PI SetTriggerMode m byChTriggerMode printf 96d iErrCode iErrCode m usblO CloseDevice 133 Document version 1 03 ICP DAS USB Class Members Public Methods 5 6 4 18 PI_SetChIsolatedFlag The class has two overload methods for setting channel isolated flag One provides specifying 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 byte array 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 PI SetChisolatedFlag BYTE i byChIsolatedFlags 134 Document version 1 03 ICP DAS USB Class Members Public Methods 5 6 4 18 1 PI_SetChIsolatedFlag BYTE BOOL Pulse input function Set channel isolated flag Syntax public int PI SetChisolatedFlag BYTE i_byChToSet BOOL i_bChlsolatedFlag Parameters i_byChToSet IN The specific channel to set i bChIsolatedFlag IN The isolated flag for the specific channel Return Value Error code Example Int iErrCode ICPDAS_USBIO m usbIO m usbIO new ICPDAS U
64. n 1 03 ICP DAS USB Class Members Public Methods 5 6 3 4 Al 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 o fChCJCOffset OUT The float array of channel CJC offset Return Value Error code 68 Document version 1 03 ICP DAS USB Class Members Public Methods Example Int iErrCode ICPDAS USBIO m usbIO float o_fChCJCOffset USBIO AI MAX CHANNELJ 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 GetChCJCOffset o_fChCJCOffset printf 96d iErrCode else for ildx 0 ildx lt USBIO AI MAX CHANNEL ildx printf 5f n o fChcJCOffset ildx 69 Document version 1 03 ICP DAS USB Class Members Public Methods 5 6 3 5 Al GetChEnable Analog input function Get channel enable disable Each byte indicates 8 channels enable disable mask EX Byte0 gt Channel0 7 Syntax public int AI GetChCJCOffset BYTE o byChEnable Parameters o byChEnable OUT The byte array of channel enable disable mask Return Value Error code 70 Document version 1 03 ICP DAS USB Class Members Public Methods Example Int iErrCode ICPDAS USBIO m usbIO Byte o byChEnable USBIO AI MAX CHANNEL 7 8 Int ildx m usblO new ICPDAS_USBIO
65. nt GetDOTotal BYTE o_byDOTotal Parameters o byDOTotal OUT The DO total number of channels Return Value Error code Example Int iErrCode ICPDAS USBIO m usbIO Byte o byDOTotal m usblO new ICPDAS_USBIO if ERR_NO_ERR iErrCode m usbIO OpenDevice USB20xx 1 if ERR_NO_ERR iErrCode m usbIO GetDOTotal amp o_byDOTotal printf 96d iErrCode else printf 96d o_byDOTotal iErrCode m usblO CloseDevice 51 Document version 1 03 ICP DAS USB Class Members Public Methods 5 6 2 10 GetAlTotal Get AI total number of channels of the device Syntax public int GetAITotal BYTE o byAlTotal Parameters o byAlTotal OUT The AI total number of channels Return Value Error code Example Int iErrCode ICPDAS USBIO m usbIO Byte o byAlTotal m usbIO new ICPDAS_USBIO if ERR NO ERR iErrCode m usbIO OpenDevice USB20xx 1 if ERR_NO_ERR iErrCode m usbIO GetAlTotal amp o_byAITotal printf 96d iErrCode else printf 96d o byAlTotal iErrCode m usblO CloseDevice 52 Document version 1 03 ICP DAS USB Class Members Public Methods 5 6 2 11 GetAOTotal Get AO total number of channels of the device Syntax public int GetAOTotal BYTE o_byAOTotal Parameters o_byAOTotal OUT The AO total number of channels Return Value Error code Example Int iErrCode ICPDAS USBIO m usblO Byte o byAOTotal m usb
66. o 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 121 Document version 1 03 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_byStartCh IN The starting acquire channel i_byChTotal IN The total channels to acquire i_dwSampleWidth IN The sampling width ms i_fSampleRate IN The sampling rate Hz 10KHz maximum i_dwBufferWidth IN The width of the buffer for single channel o_dwDataBuffer OUT The 2 dimension buffer array to store i_CBFunc IN Block operation NULL IN Non block operation The address of callback function Return Value Error code 122 Document version 1 03 ICP DAS USB Class Members Public Methods Example Int iErrCode ICPDAS_USBIO m usbIO
67. rCode iErrCode m usblO CloseDevice 39 Document version 1 03 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_usbIO new ICPDAS_USBIO if ERR_NO_ERR iErrCode m_usblO SetCommTimeout 1000 printf 96d iErrCode 40 Document version 1 03 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 usbIO DWORD o dwCommTimeout m usbIO new ICPDAS_USBIO if ERR NO ERR iErrCode m u
68. rmat Overload Al ReadBulkValue Analog input function Read bulk AI value Fast acguire functionality Al ReadcJCValue Analog input function Get CJC value Al SetTypeCode Analog input function Set type code for specific channel Overload Al SetChCJCOffset Analog input function Set channel CJC offset for specific channel Overload Al SetChEnable Analog input function Set channel enable disable Al SetFilterRejection Analog input function Set filter rejection Al SetCJCOffset Analog input function Set CJC offset Al SetCJCEnable Analog input function Set CJC enable Al SetWireDetectEnable Analog input function Set wire detect enable 5 3 4 Pulse Input 7 PI_GetTotalSupportType Pulse input function Get total supported amount PI_GetSupportTypeCode Pulse input function Get supported type code PI_GetTypeCode Pulse input function Get type code PI_GetTriggerMode Pulse input function Get trigger mode PI_GetLPFilterEnable Pulse input function Get low pass filter enable PI_GetChIsolatedFlag Pulse input function Get channel isolated flag PI_GetLPFilterWidth Pulse input function Get low pass filter width PI_ReadValue Pulse input function Read PI value PI_ReadCntValue Pulse input function Read the count value of counters PI_ReadFreqValue Pulse input function Read the frequency value of counters PI_ReadBulkValue Pulse input function Get bulk PI value Fast acquire functionality PI_SetTyp
69. s 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 iErrCode m usbIO SetSoftWDTTimeout 1000 printf 96d iErrCode iErrCode m_usbIO CloseDevice 58 Document version 1 03 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 usblO new ICPDAS_USBIO if ERR NO ERR iErrCode m usbIO OpenDevice USB20xx 1 If ERR_NO_ERR iErrCode m usblO LoadDefault printf 96d iErrCode iErrCode m_usblO CloseDevice 59 Document version 1 03 ICP DAS USB Class Members Public Methods 5 6 2 18 StopBulk Stop current bulk process 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 iErrCode m
70. s Public Methods 5 6 4 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 117 Document version 1 03 ICP DAS USB Class Members Public Methods Example Int iErrCode ICPDAS USBIO m usbIO DWORD o dwCntValue USBIO PI MAX CHANNELJ BYTE o byChStatus USBIO PI MAX CHANNELJ 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 ReadCntValue o_dwCntValue o_byChStatus printf 96d iErrCode else for ildx O ildx lt USBIO PI MAX CHANNEL ildx printf d n o dwCntValue ildx 118 Document version 1 03 ICP DAS USB Class Members Public Methods 5 6 4 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
71. s 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 18 Document version 1 03 Installation Software m Type The ICP DAS USB series I O modules provide programmable input type for analog input Users can set different type for each analog input channel For more detail for type of analog input modules please refer to Appendix A 1 m Channel Enable Enable Disable channel m Channel CJC Offset Setting the CJC offset for the specific channel The behavior of the setting is the same as the CJC Offset but it only affects specific channel Note The CJC offset can be any in the range of 40 96 to 40 95 C m Filter Rejection In order to remove the noise from the power supply some analog input modules feature build in noise filter Two filters 50Hz and 60Hz are provided to remove noise generated from power source m Wire Detection Enable Disable the open wire detection for thermocouple and 4 20 mA m CJC Enable Enable Disable the CJC Cold Junction Compensation m CIC Offset Setting the CJC offset value for all 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 3 2 1 3 P
72. sbIO PI GetSupportTypeCode 0 bySupportTypeCode printf 96d iErrCode bRet false If bRet printf d n o byTotalSupportType for ildx 0 ildx lt o_byTotalSupportType ildx printf 02x n o bySupportTypeCode iIdx 102 Document version 1 03 ICP DAS USB Class Members Public Methods 5 6 4 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 103 Document version 1 03 ICP DAS USB Class Members Public Methods Example Int iErrCode ICPDAS_USBIO m usbIO Byte o_byTotalSupportType Byte o bySupportTypeCode USBIO MAX SUPPORT TYPE Int ildx Bool bRet true m_usbIO new ICPDAS_USBIO if ERR_NO_ERR iErrCode m usbIO OpenDevice USB2084 1 if ERR_NO_ERR iErrCode m usbIO PI GetTotalSupportType amp o_ byTotalSupportType printf 96d iErrCode bRet false if ERR_NO_ERR iErrCode m usbIO PI GetSupportTypeCode 0 bySupportTypeCode printf 96d iErrCode bRet false If bRet printf d n o byTotalSupportType for ildx 0 ildx lt o_byTotalSupportType ildx printf 02x n o_bySupportTypeCodelildx 104 Document version
73. sbIO SetCommTimeout 1000 if ERR NO ERR iErrCode m usbIO GetCommTimeout amp o dwCommTimeout printf 96d iErrCode else printf d n o dvCommTimeout 41 Document version 1 03 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 usbIO m usbIO new ICPDAS_USBIO if ERR NO ERR iErrCode m usbIO OpenDevice USB2019 1 if ERR_NO_ERR iErrCode m usbIO RefreshDevicelnfo printf 96d iErrCode iErrCode m_usblO CloseDevice 42 Document version 1 03 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 usbIO DWORD o dwSoftWDTTimeout m usblO new ICPDAS_USBIO if ERR NO ERR iErrCode m usbIO OpenDevice USB2019 1 if ERR_NO_ERR iErrCode m usbIO GetSoftWDTTimeout amp o dwSoftWDTTimeout printf 96d iErrCod
74. signal hold on the same level during filter width a Ifthe 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 Ue Filter Sample e gt T Filtered Signal Counter will not operate b If the high width of the input signal is grater then T the counter will operate The time chart is shown as follow Input Signal jo D m Filter Sample N B o gt Filtered Signal N Counter operate 22 Document version 1 03 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 Solution Explorer ix Biala Sel Solution WindowsForms pplication S E WindowsForms pplication Sa Properties Add Web Reference System Deployment 42 System Drawing 42 System Windows Forms 4G System Xml H EE Forml cs c Program cs Add Reference NET COM Projects Browse Recent olution Explorer IX Filtered to NET Framework 2 0 SE ni tal 3 gl Component Name Version Runtime Path ime
75. sion 1 03 ICP DAS USB Class Members Public Methods 5 6 3 20 Al 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 usblO m_usbIO new ICPDAS_USBIO if ERR_NO_ERR iErrCode m usbIO OpenDevice USB2019 1 if ERR_NO_ERR iErrCode m usbIO AI SetWireDetectEnable 0 printf 96d iErrCode iErrCode m usblO CloseDevice 100 Document version 1 03 ICP DAS USB Class Members Public Methods 5 6 4 Pulse Input 5 6 4 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 Value Error code 101 Document version 1 03 ICP DAS USB Class Members Public Methods Example Int iErrCode ICPDAS_USBIO m usbIO Byte o_byTotalSupportType Byte o bySupportTypeCode USBIO MAX SUPPORT TYPE Int ildx Bool bRet true m_usbIO new ICPDAS_USBIO if ERR_NO_ERR iErrCode m usbIO OpenDevice USB2084 1 if ERR_NO_ERR iErrCode m usbIO PI GetTotalSupportType amp o_ byTotalSupportType printf 96d iErrCode bRet false if ERR_NO_ERR iErrCode m u
76. 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 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 03 Preface Overview Preface Warranty All products manufactured by ICP DAS are under warranty regarding defective materials for a period of one year from the date of delivery to the original purchaser Warning ICP DAS assumes no liability for damages resulting from the use of this product ICP DAS reserves the right to change this manual at any time without notice The information furnished by ICP DAS is believed to be accurate and reliable However no responsibility is assumed by ICP DAS for its use or for any infringements of patents or other rights of 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 03 Content Overview Content Ee rope ES O B SS i PROT ACE ali o e ile ae ii Content sss illa Allam yi lal indi ie ili TinttodUc NON A ay lean 1 ET OVENI Geil 1 12 Feat te c cede a cacca salam i naan 1 LS
77. ss 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 26 Document version 1 03 Operation Software structure Users Application USB VO Class Library USB Device Library Figure 4 2 The software structure of the ICP DAS USB series I O modules Access I O LE OpenDevice F CloseDevice Initialization Figure 4 3 The procedure to access the USB I O 27 Document version 1 03 Operation Software structure ICPDAS_USBIO m_USBIO C Clas gt C ICPDAS_USBIO m_USBIO new ICPDAS_USBIO Initialization Dim m_USBIO As ICPDAS_USBIO VB Set m_USBIO New ICPDAS_USBIO Figure 4 4 Class initialization corresponding code C m_USBIO OpenDevice OpenDevice lt m_USBIO OpenDevice Call m_USBIO OpenDevice Figure 4 5 Device opening corresponding code CE m_USBIO AI ReadValue m_USBIO AI ReadValue Call m_USBIO AI ReadValue Figure 4 6 Accessing I O corresponding code Access I O 28 Document version 1 03 Operation Software structure m_USBIO CloseDevice Call m_USBIO CloseDevice CloseDevice m_USBIO CloseDevice Figure 4 7 Device closing corresponding code 29 Document version 1 03 ICP DAS USB Cl
78. usblO StopBulk printf 96d iErrCode iErrCode m_usblO CloseDevice 60 Document version 1 03 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 61 Document version 1 03 ICP DAS USB Class Members Public Methods Example Int iErrCode ICPDAS_USBIO m usbIO Bool m bEmcyPktArrive Byte byEmcyPKt USBIO MAX PACKET LENGTH 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 96d iErrCode while 1 User s application loop If m_ bEmcyPktArrive Handle emcy packet iErrCode m usblO CloseDevice 62 Document version 1 03 ICP DAS USB Class Members Public Methods 5 6 3 Analog Input 5 6 3 1 Al GetTotalSupportType Analog input function Get total supported amount Syntax public int
79. xample Int iErrCode ICPDAS USBIO m usbIO m usbIO new ICPDAS_USBIO if ERR NO ERR iErrCode m usbIO OpenDevice USB2019 1 if ERR_NO_ERR iErrCode m_usbIO AI SetFilterRejection 0 printf 96d iErrCode iErrCode m_usbIO CloseDevice 97 Document version 1 03 ICP DAS USB Class Members Public Methods 5 6 3 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 fC COffset IN The CJC offset Return Value Error code Example Int iErrCode ICPDAS USBIO m usbIO m usbIO new ICPDAS USBIO if ERR NO ERR iErrCode m usbIO OpenDevice USB2019 1 iFFERR NO ERR iErrCode m usbIO AI SetCJCOffset 20 81 printf 96d iErrCode iErrCode m usblO CloseDevice 98 Document version 1 03 ICP DAS USB Class Members Public Methods 5 6 3 19 Al SetCJCEnable Analog input function Set CJC enable Disable 0 Enable 1 Syntax public int AI SetCJCOffset BYTE i_byCJCEnable Parameters i_byCJCEnable IN The CJC enable Return Value Error code Example Int iErrCode ICPDAS USBIO m usbIO m usbIO new ICPDAS USBIO if ERR NO ERR iErrCode m usbIO OpenDevice USB2019 1 if ERR_NO_ERR iErrCode m_usbIO AI SetCJCEnable 1 printf 96d iErrCode iErrCode m_usbIO CloseDevice 99 Document ver
80. ype Lp na3710 TC 200 900 C 0 20 mA 150 V 150 V 50 V 50 V Pt 100 a 00385 100 100 C Pt 100 a 00385 0 100 C Pt 100 a 00385 0 200 C Pt 100 a 00385 0 600 C Pt 100 a 003916 100 100 C Pt 100 a 003916 0 100 C Pt 100 a 003916 0 200 C Pt 100 a 003916 0 600 C Nickel 120 80 100 C Nickel 120 0 100 C Pt 1000 a 00392 200 600 C Cu 100 a 00421 20 150 C Cu 100 a 00427 0 200 C Cu 1000 a 00421 20 150 C Pt 100 a 00385 200 200 C Pt 100 a 003916 200 200 C Appendix A A 2 Analog Output Type Code A 2 Analog Output Type Code Code InputType 0000000 0x30 O 20mA 0x31 0 20 mA 0x32 OV 10V 0x33 10V 10V 0x34 OV 5V 0x35 5V 5V A 3 Pulse Input Type Code Code InputType 000000 0x50 Up counter 0x51 Frequency 0x52 Counter with battery backup 0x53 Encoder 0x54 Up Down counter 0x55 Pulse Direction counter 0x56 AB phase A 4 Channel Status 0x00 Good 0x01 Over Range Overflow 0x02 Under Range Underflow 0x03 Open 0x04 Close 0x05 Type Not Supported 145 Document version 1 03 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_ILLE

Download Pdf Manuals

image

Related Search

Related Contents

取扱説明書 [詳細版]  Instruction Manual  DIAMINUS PH  The Red Dress  man_TP1520 (`15) LR  Terex Marine Lighting Light Tower User's Manual  Polk Audio F/X Wireless Surround    Finlux 37F501 User's Manual  BactiDropTM Dobell & O`Connor Iodine  

Copyright © All rights reserved.
Failed to retrieve file