Home

DCON_FUN User`s Manual, 2006.Aug , Version.1.0. ------1

image

Contents

1. TODO Add your control notification handler code here Close Com 3 void CManual1Dlg OnAnalog Out TODO Add your control notification handler code here int iRet int iChannelNum float fAnalog_ out CString sTemp char cTemp 20 UpdateData ChannelNum m ChannelNum GetWindowText sTemp wcstombs cTemp sTemp 6 iChannelNum atoi cTemp AO Value m AnalogOut GetWindowText s Temp wcstombs cTemp sTemp 6 sscanf cTemp f amp fAnalog out iRetZDCON Write AQG 3 1 1 ChannelNum 4 fAnalog out 0 100 Com port 3 Address 1 Slot 1 TotalChannel 4 Checksum disable Timeout 100 ms DCON FUN User s Manual 2006 Aug Version 1 0 36 Test result DCON_FUN User s Manual 2006 Aug Version 1 0 4 Function List 4 1 DCON Write DO Description Output the value of the digital output module Syntax DCON Write DO unsigned char cComPort Return Value NoError Others Input Parameter cComPort iAddress iSlot IDO TotalCh IDO Value iCheckSum iTimeout short iAddress short iSlot short iDO TotalCh unsigned long IDO Value short iCheckSum short iTimeOut OK Error code COM port number 0 to 255 Module address from 0x00 to OxFF Slot number 0 to 7 or 1 for module of RS 485 The total channel of DO module Digital output data 0 Disable or 1 Enable Time out setting normal 100 unit ms DCON FUN User s Man
2. 20 Demo code int iRet float fRead_ value InitLib InstallCom 0 115200 8 0 1 Comport 0 Baudrate 115200 Databit 8 Stopbit 0 ParityBit 1 iRet DCON Write AO 0 0 2 0 2 3 2 0 100 Comport 0 Address 0 Slot 2 SingleChannel 0 TotalChannel 2 AOVal 3 2 Checksum disable Timeout 100 if iRet NoError I Print Output successful n r iRetZDCON Read A0O 0 0 2 0 2 0 100 amp fRead value Comport 0 Address 0 Slot 2 SingleChannel 0 TotalChannel 2 Checksum disable Timeout 100 if iRet NoError I Print Output value f n r fRead value else Print Reading Analog Output error Error Code d n r iRet j else Print Output error Error Code d n r iRet Test result Jut put SUCCESSTULT utput value 3 2BBBBB DCON FUN User s Manual 2006 Aug Version 1 0 21 Mode 2 The l 8000 acts as master to control another I 8000 that run DCON firmware slave type Location of DCON firmware CD NAPDOS DCON or ftp ftp icodas com tw pub cd 8000cd napdos dcon 1 8000 parameter setting Mode2 gt User can use com2 com3 com4 to Means of Commumication connect Slave ComPort Slave l 8000 run firmware 8K and 87K module so OT CheckSum 0 Disable 1 Enable 1 Only support 8K or 87K module Announcements 2 User need to know the address and baudrate of slave 133 i m mi Li RS 232 m BB Slave gilt NET ID me Baudr
3. DCON FUN User s Manual 2006 Aug Version 1 0 l DCON_FUN User s Manual Version 1 0 Dynamic Link Library DLL for DCON I 7000 8000 87K Series Modules Warranty All products manufactured by ICPDAS Inc are warranted against defective materials for a period of one year from the date of delivery to the Original purchaser Warning ICPDAS Inc assumes no liability for damages consequent to the use of this product ICPDAS Inc reserves the right to change this manual at any time without notice The information furnished by ICPDAS Inc is believed to be accurate and reliable However no responsibility is assumed by ICPDAS Inc for its use or for any infringements of patents or other rights of third parties resulting from its use Copyright Copyright 1997 2003 by ICPDAS Inc and all rights is reserved Trademark The names used for identification only maybe registered trademarks of their respective companies License The user can use modify and backup this software on a single machine The user may not reproduce transfer or distribute this software or any copy in whole or in part DCON FUN User s Manual 2006 Aug Version 1 0 2 Table of Contents 1 INTRODUCTION ke 4 Ba EK RTE EEN 4 1 2 ARCHITECTURES UNDER EVERY OS PLATFORM eene 5 2 DCON FUN APPLICATION nnnnnnnvnnnvnnnnnnnnnnnnnnnnnusnnnnnnnnnnn 6 2 1 USING C LANGUAGE COMPILER FOR 1 8000 sse 6 2 2 USING VISUAL BASIC FOR PO
4. int iChannelNum float fAnalog_ out CString sTemp char cTemp 20 UpdateData ChannelNum m ChannelNum GetWindowText sTemp wcstombs cTemp sTemp 6 iChannelNum atoi cTemp AO Value m AnalogOut GetWindowText sTemp wcstombs cTemp sTemp 6 sscanf cTemp f amp fAnalog out iRet DCON Write AOQ 1 0 L iChannelNum 4 fAnalog out 0 100 Com port 1 Address 0 Slot 2 TotalChannel 4 Checksum disable Timeout 100 ms DCON FUN User s Manual 2006 Aug Version 1 0 30 Test result DCON_FUN User s Manual 2006 Aug Version 1 0 Mode 2 Wincon connet to l 8000 run firmware Wincon 8000 parameter setting Mode2 User can use com2 coms to connect Means of Commumication Slave ComPort Slave Wincon 8000 run firmware 8K and 87K module a OT 0 Disable heck 1 Only support 8K or 87K module Announcements 2 User need to know the address and baudrate of slave win i el b J 14 8331 mpm 000 lew E a l 8000 Run firmware 87K module or 8K module Note If user needs to look up the pin assignment please refer to Appendix B DCON FUN User s Manual 2006 Aug Version 1 0 32 Demo code void CManual1Dlg OnOpen Com TODO Add your control notification handler code here Open Com 3 115200 8 0 1 ComPort 3 Baudrate 115200 DataBit 8 ParityBit 0 StopBit 1 void CManual1 Dig OnClose_Com TODO Add yo
5. 11 2 3 USING EMBEDDED VISUAL C FOR WINCON eeren 13 3 DEMO LIST 22 45 55 18 3 1 USAGE MODE OF DEMO FOR 1 8000 nee 20 3 2 USAGE MODE OF DEwMotropbC tette tenens 26 3 3 USAGE MODE OF DEMO FOR WINCON 8000 see 29 4 FUNCTION LIST 38 4 1 DCON WRITE DO see 38 4 2 DCON WRITE DO Rm 39 135 DEON READ DNO geo 40 44 DCON READ DO LATCH WE 41 AS DCON GEM DIO gi E ue diio t nl 42 4 6 DCON READ DI QCOUNTER sse tette tette 43 4 7 DCON CLEAR DI COUNTER ettet tentent 44 4o DOONCWBITE NO ee 45 4 9 DCON READ AQ ettet tette tette tette tetto 46 4 10 DEON READER EEUU PIT 47 4 11 DCON READ CGOUNTER ctr tet sets 48 4 12 DCON CLEAR CGOUNTER eerte tette tette tette ttti 49 4 13 DOON READ OVERFLOW ee 50 NAE ID Kee EE 51 MEPENDN BANE 53 DCON FUN User s Manual 2006 Aug Version 1 0 3 1 Introduction The general Dcon function is a LIB or DLL functions designed for Minios7 Windows 95 98 2000 XP or Wince and can use the same function interface on those platform 1 1 Feature I7000 DLL DCON FUN upport protocol DCON protocol DCON protocol Method of communication HS 232 RS 485 RS 232 RS 485 Support Module DCON series DCON series modules modules Windows Minios7 Support OS Wince Windows Wince Support Demo programs DCON FUN User s Manual 2006 Aug Version 1 0 4 1 2 Architectures under every OS platform Dcon_8KI lib MiniOS7 8000 BC3 01 800
6. 3 Demo List Based on the demo programs User can easily understand how to use the function and develop their own application in a quick way 8000E lib Write DO DI Counter Driver V66 Dcon PC lib Dcon PC dll Dcon Fun h Dcon DC bas Dcon PC dll u Nm Im ee E km Ca Fank vocun went rus te Jonte set elm EK er DCON FUN User s Manual 2006 Aug Version 1 0 18 Sub of directory tree of Wincon a EE EE ee WT ogram Files Windows CE tools PET Include Dcon_CE lib A AO c O gt I C m 3 Read DIO DIO Latch DI Counter Counter Note If users can t find wce410 in the Windows CE tools of Program Files please install WinconSDK The location of WinconSDK CD Napdos WinCE SDK http www icpdas com products PAC wincon 8000 Download download SDK htm DCON FUN User s Manual 2006 Aug Version 1 0 19 3 1 Usage Mode of Demo for l 8000 Mode 1 The operation of Backplane l 8000 parameter setting Modei Means of commumication Backplane Com0 fixed ComPort sot en gei e Note Install the serial I O modules 87K into the I 8000 controller the 87K module will go to its initial state as following Module address 00 Baud rate 115200 Checksum disable lf user needs to look up the pin assignment please refer to Appendix A DCON FUN User s Manual 2006 Aug Version 1 0
7. 0 to 7 or 1 for module of RS 485 The total channel of DI module The total channel of DO module 0 Disable or 1 Enable Time out setting normal 100 unit ms Read Digital input data Read Digital output data Read Digital input data 0 or 1 Read Digital output data 0 or 1 DCON FUN User s Manual 2006 Aug Version 1 0 40 4 4 DCON READ DIO Latch Description Obtain the latch value of DI DO DIO Syntax DCON READ DIO Latch unsigned char cComPort short iAddress short iSlot short iDI TotalCh short iDO TotalCh short iLatch Type short iCheckSum short iTimeOut unsigned long IDI Latch Value unsigned long IDO Latch Value char cDI Latch BitValue char cDO Latch BitValue Return Value NoError OK Others Error code Input Parameter cComPort COM port number 0 to 255 iAddress Module address from 0 to 255 iSlot Slot number 0 to 7 or 1 for module of RS 485 iDI TotalCh The total channel of DI module IDO TotalCh The total channel of DO module iLatchType 0 low latch mode 1 high latch mode iCheckSum 0 Disable or 1 Enable iTimeout Time out setting normal 100 unit ms IDI Latch Value Read Digital input latch IDO Latch Value Read Digital output latch CDI Latch BitValue Read DI state of single channel cDO Latch BitValue Read DO state of single channel DCON FUN User s Manual 2006 Aug Version 1 0 41 4 5 DCON Clear DIO Latch Description The function
8. DCON Read Overflow Description Head specified channel s Counter overflow value Syntax DCON Read Overflow unsigned char cComPort Return Value NoError Others Input Parameter cComPort iAddress iSlot iChannel iCheckSum iTimeout iDataFormat iOverflow short iAddress short iSlot short iChannel short iCheckSum short iTimeOut short iDataFormat unsigned int iOverflow OK Error code COM port number 0 to 255 Module address from 0 to 255 Slot number 0 to 7 or 1 for module of RS 485 The Counter frequence Channel No 0 Disable or 1 Enable Time out setting normal 100 unit ms 0 engineer 1 s s comp Overflow value DCON FUN User s Manual 2006 Aug Version 1 0 50 Appendix A The pin assignment of l 8000 3 GND OG 3 RXD y ITXD Calg ZS RS 232 The COM 1 Pin assignment 1 Data CIS Le o Data 9 A GND RS 232 RS 485 The COM Pin assignment DCON FUN User s Manual 2006 Aug Version 1 0 51 CD DSR 6 2 RXD RTS Lei TXD CTS 5 geg e Ge GND amp RS 232 The COM4 Pin assignment DCON FUN User s Manual 2006 Aug Version 1 0 52 Appendix B The pin assignment of wincon 2 CD e TXD CS TO Ot mm e Al Son amp RS 232 The COM2 Pin assignment DCON FUN User s Manual 2006 Aug Version 1 0 53
9. can clear the latch status of DI DO DIO module when latch function has been enabled Syntax DCON Clear DIO Latch unsigned char cComPort short iAddress short iSlot short iCheckSum short iTimeOut Return Value NoError OK Others Error code Input Parameter cComPort COM port number 0 to 255 iAddress Module address from 0 to 255 iSlot Slot number 0 to 7 or 1 for module of RS 485 iCheckSum 0 Disable or 1 Enable iTimeout Time out setting normal 100 unit ms DCON FUN User s Manual 2006 Aug Version 1 0 42 4 6 DCON Read DI Counter Description Obtain the counter event value of the channel number of Digital input module Syntax DCON Read DI Counter unsigned char cComPort Return Value NoError Others Input Parameter cComPort iAddress iSlot iChannel iDI TotalCh iCheckSum Timeout ICounter Value short iAddress short iSlot short Channel short iDI TotalCh short iCheckSum short iTimeOut unsigned long ICounter Value OK Error code COM port number 0 to 255 Module address from 0 to 255 Slot number 0 to 7 or 1 for module of RS 485 The digital input Channel No The total channel of DI module 0 Disable or 1 Enable Time out setting normal 100 unit ms Counter value DCON FUN User s Manual 2006 Aug Version 1 0 43 4 7 DCON Clear DI Counter Description Clear the counter value of the channel number of
10. of analog output modules Syntax DCON Read AO unsigned char cComPort Return Value NoError Others Input Parameter cComPort iAddress iSlot iChannel IAO TotalCh iCheckSum iTimeout fValue short iAddress short iSlot short iChannel short iAO TotalCh short iCheckSum short iTimeOut float fValue OK Error code COM port number 0 to 255 Module address from O to 255 Slot number 0 to 7 or 1 for module of RS 485 The analog output Channel No The total channel of AO module 0 Disable or 1 Enable Time out setting normal 100 unit ms Head analog output value DCON FUN User s Manual 2006 Aug Version 1 0 46 4 10 DCON Read AI Description Obtain the analog input value in float format Syntax DCON Read Al unsigned char cComPort Return Value NoError Others Input Parameter cComPort iAddress iSlot iChannel IAl_TotalCh iCheckSum Timeout fValue Value short iAddress short iSlot short iChannel short iAl TotalCh short iCheckSum short iTimeOut short iDataFormat float fValue short iValue OK Error code COM port number 0 to 255 Module address from 0 to 255 Slot number O to 7 or 1 for module of RS 485 The analog input Channel No The total channel of Al module 0 Disable or 1 Enable Time out setting normal 100 unit ms Read analog input value for float format Read analog input value for hex
11. 0l lib DCON PC dll Windows PC VC 6 0 Platform Uart dll DCON CEO Wince Wincon EVC4 0 Uartce dll Application layer Deon series modules driver function Driver Layer Serial port function of DCON Physics layer DCON FUN User s Manual 2006 Aug Version 1 0 5 2 Dcon Fun APPLICATION 2 1 USING C language compiler for I 8000 The demo programs are tested OK under MiniOS7 and C language compiler Those usable compilers are shown as follows TC 2 01 TC 1 01 BC 3 1 MSC 6 0 MSVC before Version 1 52 From Borland website use can download the free TC2 01 and TC 1 01 compilers Website http community borland com museum The user of l 8000 series has to use these file to develop program as following Lib 8000e lib gt function to deal with RS 232 or RS 485 Lib 8000 h Lib Dcon_8K lib gt function for A D D A D I D O Counter Lib Dcon fun h The key points for how to develop these demo programs are given as following Step 1 Create a new project file prj Compile Dehug HOHARMEHB Add item Delete iten Include files DCON FUN User s Manual 2006 Aug Version 1 0 6 Step 2 Type the name of the project file and then click the OK button Se ee ON iles SHH Step 3 Add all necessary files to the project File Edit Search Run Compile Debug MSG Options Window Help HOHRMEHBHB G d Open project Close pro
12. 1 0000 bd fstack 0x10000 0x1000 entry wy vinMainCRTStartup fincremental yes pdb ARMYADbgftest pdb debug Step 4 7 Select the Build of Menu and choose the Set Active Platform B Al Microsoft eMbedded Yisual C AIDIg cpp f Hie Edit View Insert Project Build Tools Window Help e SCH lel il E SE Compile AlDlecpp Ctl F7 Build Al ew Ei ar tes Rebuild All Al Jan lA ad 2 E E en gt CAIDIg CWn fs Workspace Al 1 projec iit Debug in Al e 3 Update Remote Output File s RFX DATA I a Execute Aleme CheFS PPRFX DATA I EI Al cpp Hote that L Al rc Set Active Configuration aIcon DES LEI AIDIg cpp Configurations otdAfx cpp eet Active Flatfora Si WincnnSNK lih Hips Dona DCON FUN User s Manual 2006 Aug Version 1 0 16 step 4 8 Select SA_IA in the Windows CE Platforms Then press OK button set Active Platform Windows CE Platforms SADU SACR CEN If users need the detail information please refer to the following content of web site or CD disk W 8x3x Web ftp fto icodas com tw pub cd winconcd napdos wince user manual wincon getting started 1 4 pdf CD Napdos Wince User Manual WinCON Getting Started 1 4 pdf W 8x4x Web ttp ftp icodas com tw pub cd w 8x4x user manual wincon getting started 1 4 pdf CD User Manual WinCON Getting Started 1 4 pdf DCON FUN User s Manual 2006 Aug Version 1 0 17
13. Digital input module Syntax DCON Clear DI Counter unsigned char cComPort Return Value NoError Others Input Parameter cComPort iAddress iSlot iChannel iDI TotalCh iCheckSum Timeout short iAddress short iSlot short iChannel short iDI TotalCh short iCheckSum short iTimeOut OK Error code COM port number 0 to 255 Module address from O to 255 Slot number 0 to 7 or 1 for module of RS 485 The digital input Channel No The total channel of DI module 0 Disable or 1 Enable Time out setting normal 100 unit ms DCON FUN User s Manual 2006 Aug Version 1 0 44 4 8 DCON Write AO Description Output the analog value from analog output module Syntax DCON Write AO unsigned char cComPort Return Value NoError Others Input Parameter cComPort iAddress iSlot iChannel IAO TotalCh fValue iCheckSum i Timeout short iAddress short iSlot short iChannel short iAO TotalCh float fValue short iCheckSum short iTimeOut OK Error code COM port number 0 to 255 Module address from 0 to 255 Slot number O to 7 or 1 for module of RS 485 The analog output Channel No The total channel of AO module Write analog output value 0 Disable or 1 Enable Time out setting normal 100 unit ms DCON FUN User s Manual 2006 Aug Version 1 0 45 4 9 DCON Read AO Description Head the analog output value
14. PC as gt declarations for UART amp DCON PC DLL In the project files users must include declaration files DCON PC bas into VB modules environment as shown in below figure Project Al AT F jAl vbp Forms 3 final FrmAI for XK dog ei Lib DCON PC bas DCON FUN User s Manual 2006 Aug Version 1 0 11 After double clicking on the DCON_PC bas to open the file users can see the declarations of function for UART DLL and DCON PC DLL and some defined constant declarations Declare Function Open Com Lib nart dll ByVal port As Integer ByVal BaudRate As Long ByVal chata As Byte ByVal cPar ty Declare Function Change Bandrate Lib uart dll ByVal port As Integer ByVal Baudrate As Long As Integer Declare Function Change Config Lib nart dll ByVal port As Integer ByVal BandRate As Long ByVal chata As Byte ByVal d Declare Function Get Com Status Lib mart dll ByVal port As Integer As Integer Declare Function Close Com Lib wart dll ByVal port As Integer As Boolean Declare Function Send Binary Lib uart dll ByVal port As Integer Byket szEuf As Byte ByVal length s Integer As Intege Declare Function Recelve Binary Lik nart dll ByVal port As Integer Byket szResult As Byte ByVal TimeQut As Integer Bs Receive Blnarv unslgned char cPort char szResult WORD gint WORD when WORD Ti Declare Function Send Cmd Lib nart dl ByVal port As Integer ByVal Cmd As String ByVal wChkSum As Int
15. ate I 8000 Run firmware 87K module or 8K module Note If user needs to look up the pin assignment please refer to Appendix A DCON FUN User s Manual 2006 Aug Version 1 0 22 Demo code int iRet float fRead_ value InitLib InstallCom 3 115200 8 0 1 Comport 3 Baudrate 115200 Databit 8 Stopbit 0 ParityBit 1 iRet DCON Write AO 3 2 1 0 2 3 2 0 100 Comport 3 Address 2 Slot 1 SingleChannel 0 TotalChannel 2 AOVal 5 6 Checksum disable Timeout 100 if iRet NoError I Print Output successful n r iRet DCON_Read_AO 3 2 1 0 2 0 100 amp fRead_value Comport 3 Address 2 Slot 1 SingleChannel 0 TotalChannel 2 Checksum disable Timeout 100 if iRet NoError Print Output value f n r fRead value else Print Reading Analog Output error Error Code d n r iRet else Print Output error Error Code d n r iRet Test result Output successful Output value b 6HBHHB Note If use Com2 as communication interface please add AddCom2Fun DCON FUN User s Manual 2006 Aug Version 1 0 23 Mode 3 I 8000 connect to 7K or 87K module Means of Commumication Com3 Rs 485 and Com2 ComPort Slot 4 NONE CheckSum 0 Disable 1 Enable 87K expansion uint 87K module Note If user connects to the serial modules directly user needs to set the slot to 1 The 1 represents NONE If user needs to loo
16. e User need to know the address and Announcements baudrate of slave l 7520 I 8000 Run firmware 87K module or 8K module DCON FUN User s Manual 2006 Aug Version 1 0 26 Mode1 PC connect to7K or 87K module User can refer to the following demo to set parameter Private Sub CmdOpen_com_Click Step 1 iRet Open_Com 1 9600 8 0 0 End Sub Private Sub CmdAnalogOut Click Dim fDO Value As Single Dim iChannelNum As Integer iChannelNum CInt TxtChannelNum Text fDO Value Val TxtDO Value Text Step2 iRet DCON Write AO I 1 1 iChannelNum 4 fDO Value 0 100 Comport 1 Address 1 Slot 1 TotalChannel 4 Checksum disable Timeout 100 It iRet Then MsgBox Error Code amp StrGRet vbCritical Error End If End Sub Private Sub CmdClose_Com_Click Step3 Close_Com 1 End Sub Test result Setting Cam Part Channel um Baud Hate 9600 Address 1 DO Value T T 4 Timeout 100 ms Open Com Close Com DCON FUN User s Manual 2006 Aug Version 1 0 27 Mode2 PC connect to Slave l 8000 run firmware User can refer to the following demo to set parameter Private Sub CmdOpen_com_Click Stepl iRet Open Com l1 9600 8 0 0 End Sub rivate Sub CmdAnalogOut Click Dim fDO Value As Single Dim iChannelNum As Integer iChannelNum CInt TxtChannelNum Text fDO Value Val TxtDO Value Text Step2 iRet DCON Write AO I 2 3 iChan
17. eger As Integer Declare Function Recelve Cmd Lib uart dll ByVal port As Integer ByVal szResult As String ByVal Timelut As Integer Byi Declare Function Send Receive Cmd Lib uart dll ByVal port As Integer ByVal szCmd As String ByVal szResult As String I ByVal let s Integer By 1DO Tol ICh As E Ga IN p i Long _ Byval or As Integer ByVal gint As Integer As Integer PE EEA E AERTS REED PPE R EERE A NER RE ETRE TREES EE ER QConPort I 255 DCON FUN User s Manual 2006 Aug Version 1 0 12 2 3 Using Embedded VISUAL C for Wincon The demo program are tested OK in Wince and EVC 4 0 version From Microsoft website user can download the free EVC 4 0 Website http msdn microsoft com downloads Default aspx How to create the new project of wince step 1 Installing Embedded Visual C 4 0 Please refer to Microsoft website and look up related information Step 2 Installing EVC 4 0 Service Pack 4 SP4 Please refer to Microsoft website and look up related information Step 3 Installing WinconSDK to your PC Download website http www icpdas com products PAC wincon 8000 Download download S DK htm CD W 8x3x CD Napdos WinCE SDK W 8x4x CD SDK The user of wincon has to implement these files as following Program Files Windows CE Tools wce410 include Armv4 Uartce h Program Files Windows CE Tools wce410 lip Armv4 Uartce lib gt functions to deal with RS 232 or 485 Progra
18. format DCON FUN User s Manual 2006 Aug Version 1 0 47 4 11 DCON Read Counter Description Obtain the value of the selected counter frequence for the counter freuence module Syntax DCON Clear Counter unsigned char cComPort Return Value NoError Others Input Parameter cComPort iAddress iSlot iChannel iCheckSum iTimeout ICounter Value short iAddress short iSlot short iChannel short iCheckSum short iTimeOut OK Error code COM port number 0 to 255 Module address from 0 to 255 Slot number 0 to 7 or 1 for module of RS 485 The Counter frequence Channel No 0 Disable or 1 Enable Time out setting normal 100 unit ms Read counter frequnece value DCON FUN User s Manual 2006 Aug Version 1 0 48 4 12 DCON Clear Counter Description Obtain the value of the selected counter frequence for the counter freuence module Syntax DCON Clear Counter unsigned char cComPort short iAddress short iSlot short iChannel short iCheckSum short iTimeOut Return Value NoError OK Others Error code Input Parameter cComPort COM port number 0 to 255 iAddress Module address from 0 to 255 iSlot Slot number 0 to 7 or 1 for module of RS 485 Channel The Counter frequence Channel No iCheckSum 0 Disable or 1 Enable iTimeout Time out setting normal 100 unit ms DCON FUN User s Manual 2006 Aug Version 1 0 49 4 13
19. ject Local options Include files Project HELLO s File Edit Search Run Compile Ferne HONA MERR G Add file tn neniert items DCON FUN User s Manual 2006 Aug Version 1 0 T Step 5 Select the function library and then click the Add button HOHANMEBH C DCON AKL LIG my re Im Ll a ur dl KORK AE AT C Project ESI on to use full set nf menn enmmande DCON FUN User s Manual 2006 Aug Version 1 0 8 Step 7 Set Code generation options HOHRAIMEHBH co Messages IT 1 m Project TEST Overlay support fin M Step 9 Set the Floating Point to Emulation and the Instruction Set to 80186 L Overlay su Calling Convention Opt ions Instruction Set DCON FUN User s Manual 2006 Aug Version 1 0 9 Project If user need the detail information please refer to the following web site ftp ftp icpdas com tw pub cd 8000cd napdos minios7 document quickstart_dev elop program pdf DCON FUN User s Manual 2006 Aug Version 1 0 10 2 2 USING VISUAL BASIC for PC The demo programs are tested OK in Windows 95 98 NT 2000 XP and VB6 0 version The user of PC has to implement these files as following DCON_DLL Driver UART DLL gt functions to deal with RS 232 DCON DLL NEW DLL DCON PC DLL gt functions for A D D A D I D O Counter Frequency DCON DLL NEW DLL New DCON
20. k up the pin assignment please refer to Appendix A DCON FUN User s Manual 2006 Aug Version 1 0 24 Demo code int iRet float fRead_ value InitLib InstallCom 3 115200 8 0 1 Comport 3 Baudrate 115200 Databit 8 Stopbit 0 ParityBit 1 iRet DCON Write AO 3 2 1 0 2 7 6 0 100 Comport 3 Address 2 Slot 1 SingleChannel 0 TotalChannel 2 AOVal 7 6 Checksum disable Timeout 100 if iRet NoError I Print Output successful n r iRet DCON_Read_AO 3 2 1 0 2 0 100 amp fRead_value Comport 3 Address 2 Slot 1 SingleChannel 0 TotalChannel 2 Checksum disable Timeout 100 if iRet NoError Print Output value f n r fRead value else Print Reading Analog Output error Error Code d n r iRet j else Print Output error Error Code d n r iRet Test result Output successtul Qutput value 588888 Note lf use Com2 as communication interface please add AddCom2Fun before installCom2 DCON FUN User s Manual 2006 Aug Version 1 0 25 3 2 Usage Mode of Demo for PC PC parameter setting Means of Commumication Com Port 0 255 ComPort Mode 1 Address of 7K or 87K module Address Mode 2 Address of slave NET ID Mode 1 Baudrate of 7K or 87K module Baudrate Mode 2 Speed of Slave Mode 1 1 NONE Mode 2 0 4 or 0 8 0 Disable CheckSum 1 Enable Mode 1 Support 7K or 87K module Mode 2 Only support 8K or 87K modul
21. m Files Windows CE Tools wce410 include Armv4 WinconSDK h Program Files Windows CE Tools wce410 lib Armv4 WinconSDK lib gt 1 8000 series module function Program Files Windows CE Tools wce410 include Armv4 Dcon_Fun h Program Files Windows CE Tools wce410 lip Armv4 Dcon_Fun lib gt functions for A D D A Di D O Counter Frequency DCON FUN User s Manual 2006 Aug Version 1 0 13 Step 4 Use EVC 4 0 Step 4 1 Create new project IB Microsoft eMbedded Yisual C Eil Edit View Insert Project Build Tools Window Help CT D gen Ca De Ge Open Coho E Close M mii Va bm Open Workspace cave Workspace IG SE IN n Cen ace lel Ze Clg nave Rs L Save All Page sep ey Punt Chile Recent Files Recent Workspaces Exit Step 4 2 Select WCE MFC AppWizard exe Step 4 3 Select Win32 WCE ARMV4 Hew Files Projects Workspaces CSlwWCE Application Project name AWCE ATL COM AppWizard demg gt WCE Dynamic Link Library Hg WCE MFC Activex Control Wizard TGs WCE MFC AppWizard exe Location EXATESTIdemo i Create new workspace E Add fo current workspace I Dependency of Z Win32 WCE ARMV4 gt 1 Wun gr CCRA 8 Win32 WCE ARMVAT CIWin32 WCE MIPS16 Win32 WCE MIPSII Win32 WCE MIPSII FP DCON FUN User s Manual 2006 Aug Version 1 0 14 Step 4 4 Select your applicati
22. nelNum 4 fDO Value 0 100 Comport 1 Address 2 Slot 3 TotalChannel 4 Checksum disable Timeout 100 It iRet Then MsgBox Error Code amp Str iRet vbCritical Error End If End Sub Private Sub CmdClose_Com_Click Step3 Close_Com 1 End Sub Test result setting Com Part 21 Channel um PO Baud Rate 9600 Address 2 DO Value 5 5 Total hannel 4 Eer Timeout 100 ms te Open Com Close Com DCON FUN User s Manual 2006 Aug Version 1 0 28 3 3 Usage Mode of Demo for Wincon 8000 Mode 1 Operation of Backplane Wincon 8000 parameter setting Mode1 Means of Commumication Backplane Com1 fixed ComPort 0 fixed 115200 fed aw ra 0 Disable CheckSum wO Ke ma a mE a ME Note Install the serial UO modules 87K into the W 8000 controller the 87K module will go to its initial state as following Module address 00 Baud rate 115200 Checksum disable If user needs to look up the pin assignment please refer to Appendix B DCON FUN User s Manual 2006 Aug Version 1 0 29 Demo code void CManual1Dlg OnOpen Com TODO Add your control notification handler code here Open Com 1 115200 8 0 1 void CManual1Dlg OnClose Com TODO Add your control notification handler code here Close Com 1 void CManual1Dlg OnAnalog Out TODO Add your control notification handler code here int iRet
23. on and press Finish buttom WCE MFC App Wizard exe Step I of 4 Application What type of application would you like to create C Single document Ez m rr K mu D A P D E 5 L D rr F Je pc a eee ee Te VI Pf NERT CSR as FEEREREER J i LL FRE VE BEALE EEP d ae E I What language would you like your resources in EM test Microsoft eMbedded Yisual C test re IDD TEST DIALOG German Germany Dialoz E Fie Edit View Insert Project Build Tools Window Help a GE OG ve oet Active Project 54 MBTCPInit D A Add To Project KE ce il 5 an Ti K test v STAN Mal Debug STANDARDSDK Emul Export Makefile SE Insert Project into Workspace Source Files 09 Header Files Resource Files E ReadMe txt au ERLED DialogFeld Steuerelem bier DCON FUN User s Manual 2006 Aug Version 1 0 15 Step 4 6 Select Link and key in Uart lib and Dcon Fun lib in the Object library modules field Then press OK button ees Settings Settings For General Debug C C Link Resources MI zu 132 CE ARMY AI Deb LEGS Debug Category General Reset Output file name ARMY 4Dbg test exe CT Uartec lib Dcon fun lib iv Generate debug info Ignore all default libraries Generate mapfile Project Options Uartec lib Dcon_fun lib nologo jbase 0x000
24. ual 2006 Aug Version 1 0 38 4 2 DCON Write DO Bit Description Set the digital output value of the specific digital output channel No of the digital output module The output value is only for 0 or 1 Syntax DCON Write DO Bit unsigned char cComPort short iAddress short iSlot short iChannel short iDO TotalCh short iBitValue short iCheckSum short iTimeOut Return Value NoError OK Others Error code Input Parameter cComPort COM port number 0 to 255 iAddress Module address from 0 to 255 iSlot Slot number 0 to 7 or 1 for module of RS 485 iChannel The digital output channel No IDO TotalCh The total channel of DO module iBitVaule 0 off 1 on iCheckSum 0 Disable or 1 Enable iTimeout Time out setting normal 100 unit ms DCON FUN User s Manual 2006 Aug Version 1 0 39 4 3 DCON Read DIO Description Obtain the DI DO DIO value Syntax DCON Read DiO unsigned char cComPort short iAddress Return Value NoError Others Input Parameter cComPort iAddress iSlot iDI TotalCh IDO TotalCh iCheckSum Timeout iDI Value iDO Value cDI BitValue cDO BitValue short iSlot short iDI TotalCh short IDO TotalCh short iCheckSum short iTimeOut unsigned ong IDI Value unsigned long IDO Value Char cDI_BitValue char cDO BitValue OK Error code COM port number 0 to 255 Module address from 0 to 255 Slot number
25. ur control notification handler code here Close Com 3 void CManual1Dlg OnAnalog Out TODO Add your control notification handler code here int iRet int iChannelNum float fAnalog_ out CString sTemp char cTemp 20 UpdateData ChannelNum m ChannelNum GetWindowText sTemp wcstombs cTemp sTemp 6 iChannelNum atoi cTemp AO Value m AnalogOut GetWindowText sTemp wcstombs cTemp sTemp 6 sscanf cTemp f amp fAnalog out iRetZDCON Write A0 3 2 2 iChannelNum 4 fAnalog out 0 100 Com port 3 Address 2 Slot 2 TotalChannel 4 Checksum disable Timeout 100 ms DCON FUN User s Manual 2006 Aug Version 1 0 33 Test result DCON_FUN User s Manual 2006 Aug Version 1 0 Mode 3 Wincon connect to 7K or 87K module Wincon 8000 parameter setting Mode3 Means of Commumication Com3 ComPort gw NONE CheckSum 0 Disable 1 Enable d H rm P TLLA Ti Tg Se H a mil j i 1 e 1 1 i i 5 D D d 87K expansion uint 87K module Note lf user needs to look up the pin assignment please refer to Appendix B DCON FUN User s Manual 2006 Aug Version 1 0 35 Demo code void CManual1Dlg OnOpen Com TODO Add your control notification handler code here Open Com 3 115200 8 0 1 ComPort 3 Baudrate 115200 DataBit 8 ParityBit O StopBit 1 void CManual1Dlg OnClose Com

Download Pdf Manuals

image

Related Search

Related Contents

    II. Controls and Functions II. Controls and Functions  La fiche pédagogique du stage de 2013, pour info (fichier PDF).    PV-DC252 PV-DC152-K PV-DC252-K  3D MADE SIMPLE … no glasses needed  Toshiba Satellite P50t-AST2GX1  Cardbox 2.0 User Manual  - Frank`s Hospital Workshop  

Copyright © All rights reserved.
Failed to retrieve file