Home

uPAC-7186EX User Manual Version 1.0 beta1, October 2008

image

Contents

1. The FlashWrite must be called to write data to the Flash Memory API for reading data from the Flash Memory 2 FlashRead The FlashRead must be called to read data from the Flash Memory uPAC 7186EX Series User Manual Version 1 0 beta1 October 2008 80 For example to write an integer to segment OxD000 offset 0x1234 of the Flash memory include lt stdio h gt include 7186e h void main void int data 0xAA55 data2 char dataptr int dataptr2 InitLib Initiate the 7186e library dataptr char amp data FlashWrite 0xd000 0x1234 dataptr FlashWrite 0xd000 0x1235 dataptr Read data from the Flash Memory method 1 dataprt char amp data2 dataptr FlashRead 0xd000 0x1234 dataptr 1 FlashRead 0xd000 0x1235 Read data from the Flash Memory method 2 dataptr2 int far MK_FP 0xd000 0x1234 data data gt For more demo program about the Flash memory please refer to CD NAPDOS 7186e Demo Basic memory http fto icodas com pub cd 8000cd napdos 7186e Demo Basic memor uPAC 7186EX Series User Manual Version 1 0 beta1 October 2008 81 4 5 API for NVRAM and RTC o The uPAC 7186EX is equipped with an RTC Real Time Clock and 31 bytes of NVRAM memory can be used to store data o NVRAM is the same as SRAM but it uses a battery to retain the data so the data store in the NVRAM is not lost when the module is powered off and
2. 26 2 3 1 1 Steps to use a COM1 connection Step 1 Connect the uPAC 7186EX to the host PC using a COM1 connection Minis Utility Wer a1 uPAC 7186EX Series User Manual Version 1 0 beta1 October 2008 2 Step 3 Click the New connection from the Connection menu 7A MiniOS7 Utility Verion 3 1 7 3 JJ File lb Connection 7 i Command Configuration l New connection Look ir Last Connection Alt F2 Disconnect Ctrl F2 Name N 9 bin Search Fi jer FIRMWARE File Folder 0S_IMAGE File Folder a 1KB Internet Shortcut Asnlication Fete Step 4 On the Connection dialog box select COM1 from the drop down list TA Connection Connection History 192 168 255 I led Data Bit Por 110000 Parity UN one w Stopt o w uPAC 7186EX Series User Manual Version 1 0 beta1 October 2008 Step 5 The connection has already established P MiniOS Utility Verion 3 1 7 3 G File lj Connection de Command F Sanaa El Tools E Help Look ir 9 Minis _Utility mm Name bin any Connection Status F Disconnected Connected gt Connection F2 El Hoan i 5 uPAC 7186EX Series User Manual Version 1 0 beta1 October 2008 29 2 3 1 2 Steps to use a LAN1 connection Step 1 Connect uPAC 7186EX to the host PC using a LAN1 connection 10 30 VDC Step 2 Run the MiniOS
3. 8 For example to write data to block1 address 10 of the EEPROM include lt stdio h gt include 7186e h void main void int data 0x55 data2 InitLib Initiate the 7186e library EE WriteEnable EE MultiWrite 1 10 1 amp data EE WriteProtect EE MultiRead 1 10 1 amp data2 Now data2 data 0x55 A To write an integer to the EEPROM the EE_WriteEnable function must be called twice in the same manner as writing data to the NVRAM gt For more demo program about the EEPROM please refer to CD NAPDOS 7186e Demo Basic memory htto fto icodas com pub cd 8000cd napdos 7 186e demo basic memor uPAC 7186EX Series User Manual Version 1 0 beta1 October 2008 9 4 4 API for Flash Memory Free 448 K bytes o The uPAC 7186EX module contains 512K Ea bytes of Flash memory MiniOS7 64 K bytes Total Size 512 K bytes o MiniOS7 uses the last 64K bytes the other parts of the memory are used to store user 0 x 8000 programs or data o Each bit of the Flash memory only can be 0 x 9000 written from 1 to 0 and cannot be written from 0 to 1 0 x A000 o Before any data can be written to the Flash memory the flash must be erased first 0 x B000 which returns all data to OxFF meaning that all data bits are set to 1 Once their is 0x SANG completed new data can be written 0 x D000 API for writing data to the Flash Memory 0 x E000 1 FlashWrite MiniOS7 0 x F000
4. 7188XA Demo MSC Hello gt cl c Gs FPa Fm G1 AL Hello c icrosoft R C Optimizing Compiler Version 6 00 Copyright c Microsoft Corp 1984 1990 All rights reserved Hello c C 188xXA Demo MSc Hello gt link MA NOE NOI Hello 1l1b 188xal 683 Segmented Executable Linker Version 5 10 C Microsoft Corp 1984 1990 All rights reserved C 7188XA Demo MSC Hello gt del obj C 7188XA Demo MSC Hello gt del map C 7188XA Demo MSC Hel lo gt m UuPAC 7186EX Series User Manual Version 1 0 beta1 October 2008 Step 3 A new executable file will be created if it is successfully compiled cy C FINDOWS S ystem32 cmd exe c 7188XA Demo MSC Hel lo gt dir Volume in drive C has no label Volume Serial Number is 1072 89A3 Directory of C 7188xXA Demo MSC Hel lo 17 08 17 08 17 03 16 47 17 08 l Ianni 3 Files 7 496 bytes 2 Dir s 22 041 571 328 bytes free C 7188XA Demo MSC Hel lo gt _ UuPAC 7186EX User Manual Version 1 0 beta1 October 2008 102 E 4 MSVC 1 50 Step 1 Step 2 Create a new project mak by entering the name of the project in Run MSVC exe Microsoft Fisnal C DEMOA MAE File Edit View Project Brows Debug Toole Option Window Help a lt 2 gt DATISBE ICPLESER YER DEMO MSYC 1 S DEMOD4 USER C include lt string h gt include idee include void Use PieletName Bowe oe List Files of Type RRR vou Pr
5. J Memory Model ees Disable Stack Checking Optimizations Calling Convention Ce C Floating Point Calls Code Generator Segment Names Use Emulator Auto Select Struct Member Byte Alignment 2 Bytes uPAC 7186EX User Manual Version 1 0 beta1 October 2008 104 Step 5 Change the Memory model large for 8000e lib CAC Compiler Ophons x Build Options C Debug Specific Release Specific C Common to Both Options String Cancel nologo Gs G7 W S AL Os 7D NDEBUG YD DOS FR Help Use Project Defaults Category Category Settings Memon Model Code Generation a Custom Options ee Model aaa nent Setup Custom Options C Debug Options Listing Files a Memon Model Optimizations New Segment Data Size Threshold Po P Code Generation Precompiled Headers Preprocessor Segment Hames Assume extern and Uninitialized Data far Step 6 Remove the xcr afxcr library from the Input Category Linker Options Build Options C Debug Specific Release Specific Common to Both Options String fLIBS wer LIB afec LIB oldnames LIB shbce NOL STACK 5120 ONERROR NOESE OLOGO Help Use Project Defaults Cancel Category Memory Image Miscellaneous Output Remove the xcr and afxer M Distinguish Letter Case uPAC 7186EX User Manual Version 1 0 beta1 October 2008 105 Step 7 Remove the OLOGO option from
6. 1 lt 10 i printCom 1 Test d n r i Delay 10 Wait for all data are transmitted to COM port RestoreCom 1 gt For more demo program about the COM port please refer to CD NAPDOS 7186e Demo Basic com_port http fto icodas com pub cd 8000cd napdos 7186e Demo Basic com_ port uPAC 7186EX Series User Manual Version 1 0 beta1 October 2008 69 4 1 3 API for standard COM port o The standard COM port is used to download program from PC to the uPAC 7186EX The following configurations of the standard COM port are fixed AN Baudrate 115200 bps Data format 8 bits Parity check none Start bit 1 Stop bit 1 API for checking if there is any data in the input buffer 1 Kbhit Before reading data from standard I O port the kbhit must be called to check whether there is any data currently in the input buffer API for reading data from standard I O port 2 Getch After kbhit confirms that the input buffer contains data the Getch must be called to read data from the input buffer API for sending data to standard I O port 3 Puts For sending a string Before sending data to standard I O port the Puts must be called to send data to COM Port uPAC 7186EX Series User Manual Version 1 0 beta1 October 2008 7 0 4 Putch For sending one character Before sending data to standard I O port the Putch must be called to send data to COM Port API for sho
7. 186e Demo Basic timer uPAC 7186EX Series User Manual Version 1 0 beta1 October 2008 8 4 8 API for WatchDog Timer WDT o The default WatchDog timer WDT value for the uUPAC 7186EX module is fixed at 0 8 seconds for MiniOS7 version 2 0 o When the uPAC 7186ExX is first powered on the WatchDog Timer will always be enabled o The MiniOS7 for the uUPAC 7186EX will automatically refresh the WatchDog Timer after being powered on The software driver can be called by a user program to prevent the MinOS7 from refreshing the WatchDog Timer API for refreshing WDT 1 EnableWDT The WDT is always enabled before user s programming to refresh it the EnableWDT must be called to stop refreshing WDT 2 RefreshWDT After EnableWDT stop refreshing WDT the RefreshWDT must be called to refresh the WDT 3 DisableWDT After user s programming to refresh WDT the DisableWDT should be called to automatically refresh the WDT uPAC 7186EX Series User Manual Version 1 0 beta1 October 2008 88 For example to refresh the Watchdog Timer include lt stdio h gt include 7186e h void main void Unsigned long time iTime InitLib Initiate the 7186e library Enable WDT While quit RefreshWDT User _function DisableWDT gt For more demo program about the WatchDog Timer please refer to CD NAPDOS 7186e Demo Basic Misc httpo fto icodas com pub cd
8. 7 Utility Minis Utility Wer a1 UuPAC 7186EX Series User Manual Version 1 0 beta1 October 2008 30 Step 3 Click the Search from the Connection menu P MiniOS Utility Ferion 3 1 8 New connection Last Connection AlHF2 Disconnect Ltht F2 S125 pEArCh autoexec bat FPJE100_400 EXE cr Mini s 7_utility zip 47 BNPL2303_ICPDAS_iPS000_All 3 0 YPL2303_1CPDAS_iPS000_All 231 Mi UpdateNewiersion CAB 42 ae 11K Type Meme fs H UDF SrasdCast 192 168 255 1 Cea V22 UDF 5 i l uPAC 7186EX Series User Manual Version 1 0 beta1 October 2008 31 Step 5 Select IP setting button from the toolbar i MiniOS T Scan Step 6 On the IP Setting dialog set the IP settings and then click the Set button rex Recommend Settings DHL Disable Enable UuPAC 7186EX Series User Manual Version 1 0 beta1 October 2008 Step 7 On the Confirm dialog click the Yes button to exit gt TP setting success J Do you want to leave IP ttmg dialog Step 8 Click the New connection from the Connection menu 2A MiniOS7 Utility Verion 3 1 7 3 233 File gt Connection Command Configuration New connection Look in Last Connection alt F2 3 Disconnect Ctrl F2 p Name H N gt bin Search FIZ jer FIRMWARE File Folder 05_IMAGE File Folder 1KB Inte
9. 7186EX series module has a build in web server for configuration You can use standard web browsers such as IE Netscape Firefox and etc to configure its Ethernet and COM ports configurations o Remote Configuration Maintenance uPAC 7186EX series module can be operated via the Ethernet TCP IP or UDP or RS 232 to allow tasks such as downloading files configuration updating the MiniOS7 image etc o Built in Watchdog Timer WDT uPAC 7186EX series module includes an internal watchdog timer WDT The watchdog timer will trigger a system reset if the main program fails or neglects to regularly service the watchdog The intention is to bring the system back from the hung state into normal operation o I O Expansion Bus Interface The uPAC 7186EX series module supports the use of an I O Expansion bus to add a single I O Expansion Board ICP DAS provides all function libraries for I O Expansion Boards to enable easy use of the I O Expansion Board functions uPAC 7186EX Series User Manual Version 1 0 beta1 October 2008 9 uPAC 7186EX series module has more features as followings o ROHS Compliance and CE Certification o Low Power Input 10 to 30VDC according to industrial environment o Frame Ground design for ESD protection o Fire Retardant Materials UL94 VO Level and Robust Case o VxComm Driver for Windows NT 4 0 2000 XP 2003 and Vista32 UuPAC 7186EX Series User Manual Version 1 0 beta1 October 2008 10
10. 8000cd napdos 7186e Demo Basic Misc UuPAC 7186EX Series User Manual Version 1 0 beta1 October 2008 89 Appendix A Frame Ground Electronic circuits are constantly vulnerable to Electro Static Discharge ESD which become worse in a continental climate area Some l 7000 M 7000 and l 8000 series modules feature a new design for the frame ground which provides a path for bypassing ESD allowing enhanced static protection ESD capability and ensures that the module is more reliable uPAC 7186EX Series User Manual Version 1 0 beta1 October 2008 90 Appendix B What is MiniOS7 MiniOS7 is an embedded ROM DOS operating system design by ICP DAS It is functionally equivalent to other brands of DOS and can run programs that are executable under a standard DOS Photo Shop office 2007yj i4 AN DOS whether PC DOS MS DOS or ROMDOS is a set of commands or code that tells the computer how to process information DOS runs programs manages files controls information processing directs input and output and performs many other related functions The following table compares the features between MiniOS7 and ROM DOS A T E E aa Yes No Support for ASIC key Flash ROM FA T e Yes no Built in hardware diagnostic functions Yes No uPAC 7186EX Series User Manual Version 1 0 beta1 October 2008 91 Appendix C What is MiniOS7 Utility MiniOS7 Utility is a tool for configuring uploading files to all
11. Automation Controller tu uPAC 7186EX Series User Manual Version 1 0 beta1 October 2008 65 4 1 1 Types of COM port functions o There are two types of functions below for using COM port 1 MiniOS7 COM port functions 2 C style Standard COM port functions You have the alternative of MiniOS7 COM ports functions or C style AN Standard COM port functions If you choose the ones then the another can not be used o Summarize the results of the comparison between MiniOS7 COM port functions and C style Standard COM port functions Kinds of Functions Check Send Read Show data data data data Functions MiniOS7 IsCom ToCom ReadCom printCom COM port C style seit Puts l Standard Kbhit Getch Print Stes aes Putch COM port uPAC 7186EX Series User Manual Version 1 0 beta1 October 2008 66 4 1 2 API for MiniOS7 COM port API for using COM ports 1 InstallCom Before any COM Port can be used the driver must be installed by calling InstallCom 2 AddCom2fun Before using COM2 the AddCom2fun must be called to work for UPAC 7186EX 3 RestoreCom lf the program calls InstallCom the RestoreCom must be called to restore the COM Port driver API for checking if there is any data in the COM port input buffer 4 lsCom Before reading data from COM port the IsCom must be called to check whether there is any data currently in the COM port input
12. can be used for 10 years o NVRAM has no limit on the number of times the data can be written Both Flash and EEPROM both have a limit on the numbers of data can be re written API for writing data to the NVRAM 1 WriteNVRAM The WriteNVRAM must be called in order to write data to the NVRAM API for reading data from the NVRAM 2 ReadNVRAM The ReadNVRAM must be called in order to write data to the NVRAM uPAC 7186EX Series User Manual Version 1 0 beta1 October 2008 82 For example use the following code to write data to the NVRAM address 0 include lt stdio h gt include 7186e h void main void int data 0x55 data2 InitLib Initiate the 7186e library WriteNVRAM 0 data data2 ReadNVRAM 0 Now data2 data 0x55 For example the following can be used to write an integer two bytes to NVRAM include lt stdio h gt include 7186e h void main void int data 0xAA55 data2 char dataptr char amp data InitLib Initiate the 7186e library WriteNVRAM 0 dataptr Write the low byte WriteNVRAM 1 dataptr 1 Write the high byte dataptr char amp data2 dataptr ReadNVRAM 0 Read the low byte dataptr 1 ReadNVRAM 1 Read the high byte gt For more demo program about the NVRAM and RIC please refer to CD NAPDOS 7186e Demo Basic memory http fto icodas com pub cd 8000cd napdos 7186e Demo Basic memo
13. cece reareccternceenesaranetseennucuauccencisseewsneu sev saueuaeeuseenseeneueceuanauecsuanatuseemunee 15 Meee PIMEN O e E ates acetatetatesaicsatcsatesaces 16 To OOMPANOT OO ee E EE E E E EE E EE EE 17 PE EOL eta E O E E A 18 2 1 Hardware installation cccccccccceccceceseeeeeceeeceeseeeseeceeeeeeeseeeseeeseeesueseeeseeeseeeaes 18 Ziels Tsai dhe URAC 7 1 GOP XK dec ctacenceceaccacentacaecestadeacectadsoceetadaacectacieaaecbacaade 18 2 1 2 Mounting the I O Expansion BUsS ccccccseceeseeeeeeeeeeseeeesaaeeesaeeesaaes 20 213 IMOUNTING the VQ Expansion DUS escerai ai 21 2st ANCON GIONS errean 22 Ze E E e ie EEE g a E E E E E E 24 2 3 MiniOS7 Utility for downloading Programs cccccccsseeeecseeeeeeeeeeseeeeeseeeeseeeeeeas 26 2 3 1 Establishing a connection between the Host PC and the uPAC 7186EX 26 2 3 2 Uploading and executing programs on UPAC 7186EX ccceeeeeeeeees 35 2 3 3 Making programs start automatically ceececeeeeeeeeeeeeeeeeeeeseeeesaeeeens 36 2 4 MiniOS7 Utility for Updating OS IMAaQE cc ceeccceeeeecseeeeeeeeeeeeeeeeseeeeeaeeesaeeeeas 37 VOF E PrO am OW UP AG 7 OO A eE 40 Ge PRNO UTS COMMONS aaa RE EEE EE 40 3 1 1 Installing the Compiler 20 0 cccccceeececeeeeeceeeeeseeeeeseeeesseeessaeeesaeeeesaaes 41 3 1 2 Setting up the environment Variables c ccccccceeceeseeeeeseeeeeaeeeeeaeeeesaees 46 232 APH GAL a a oo gt eee ne ee een eee eee 4
14. products embedded with ICPDAS MiniOS7 with easiness and quickness Note Since version 3 1 1 the Utility can allow users remotely access the controllers 7188E 8000E ect through a the Ethernet iS 4 DALAL Functions Including Frequently Used Tools Supported connection ways a 188XW 1 COM port connection RS 232 b 7188EU 2 Ethernet connection TCP amp UDP c 7188E Supported since version 3 1 1 d SendTCP Maintenance e Send232 1 Upload file s f VxComm Utility 2 Delete file s PC System Requirements 3 Update MiniOS7 image 1 IBM compatible PC Configuration 2 Windows 95 98 NT 2000 XP 1 Date and Time Supported Products 2 IP address 1 7188XA 3 COM port 2 188XB 4 Disk size Disk A Disk B 32 7188XC Check product information 4 7188EX series 1 CPU type 5 All i 8000 series 2 Flash Size 6 iView100 3 SRAM Size 7 UPAC 7186XB 4 COM port number 8 UPAC 7186EX 9 ET 6000 series 10 ET 7000 series Download location http fto icodas com tw oub cd 8000cd napdos minios utility minios utility uPAC 7186EX Series User Manual Version 1 0 beta1 October 2008 92 Appendix D What is VxComm Utility driver amp utility Where remote ser become part of your UuPAC 7186EX Series User Manual Version 1 0 beta1 October 2008 93 Appendix E More C Compiler Settings This section describes the setting of the following compilers o Turbo C 2 01 Compiler o BC 3
15. 08 56 Step 9 Set the memory model to large i Select Compiler from the Options menu and then select Code generation li On Model option select Large iii Select OK ec Command Prompt te uPAC 7186EX Series User Manual Version 1 0 beta1 October 2008 57 Step 12 Select Build all from the Compile menu to build the project ec Command Prompt te File Edit Search Run Debug Project Options Window Hely _ 2 t1 gt Compile Alt F Make F Link Infanrpmation _ Compile Debug Project Options Window Help Library HELLO LIB Adding HELLO OBJ Total Lines compiled 1573 Warnings B Errors Available memory i 78K Fi Help A1Lt FG Next Msg lt FY Prev Msg Al1t F Compile F Make Fi Menu uPAC 7186EX Series User Manual Version 1 0 beta1 October 2008 60 Step 13 Use the MiniOS7 Utility to connect the uUPAC 7186EX For more detailed information about this process please refer to section 2 3 1 Establishing a connection Minis Utility Ver al Bee pars ae A MiniOS Utility Verion 3 1 7 R File lb Connection gt da Command Configuration New connection F2 Last Connection Alt F2 Disconnect Ctrl F2 Loon Name jer Folder Folder emet Shortcut ninatan Estes EF E e Connection Hx Connection COM COM TCF TCP
16. 1 2 Specifications PACs uPAC 7186EX uPAC 7186EXD U C V D 2 h O Q O O PU 80186 CPU 80MHz or compatible RAM 512K Bytes 512K Bytes Erase unit is one sector 64K bytes 100 000 erase write cycles 16K Bytes Data retention 40 years 1 000 000 erase write cycles 31 Bytes Battery backup data valid up to 10 year Year 2000 compliance seconds minutes hours date of the month month year valid up from 1980 to 2079 Flash EEPROM NVRAM JJ r O Real Time Clock Hardware Serial Number uild in Watchdog Timer Communication Interface COM 1 COM 2 Ethernet Port u RS 232 TXD RXD CTS RTS and GND Non isolation RS 485 D2 D2 self tuner ASIC inside Non isolation 10 100Base TX Ethernet Controller Auto negotiating Auto MDIX LED indicator RS 232 TXD RXD CTS RTS and GND Non isolation O U O 1 O g 3 V Data bit arity top bit aud Rate ED Display digit 7 segment LED ystem LED Indicator None Even Odd Mark Space N CO 115200 bps Max r D Q D m lt D 5 V O 5 ep O expansion bus ser defined I O pins l 0p 14 pins O D 9 5 m 5 lt O 5 3 D 5 r 25 C to 75 C 13 F to 167 F torage Temperature 40 C to 80 C 40 F to 176 F Humidity 5 to 95 Non condensing DY O O k Q OQ Comal
17. 1 IDE o MSC 6 00 Compiler o MSVC 1 50 Compiler E 1 Turbo C 2 01 You have a couple of choices here you can 1 Using a command line For more information please refer to CD 8000 NAPDOS 8000 841 x881x Demo hello Hello_C gotc bat tcc Ic tc include Lc tc lib hellot c lib 8000e lib 2 Using the TC Integrated Environment Step 1 Executing the TC 2 01 Step 2 Editing the Project file Adding the necessary library and file to the project cy CAWINDO WSS ystem32temd exe d Vic20 c haf Run Compile Project Options De bug Break watch m Edit gt Cob 19 Insert Indent Tab Fill Unindent D NONMANE C Message Fi Help F5 Zoom F 6 Switch FY Trace F amp Step F Make Fi Menu Milliy uPAC 7186EX Series User Manual Version 1 0 beta1 October 2008 94 Step 3 Save the project and entering a name such as LED prj ey CURTIN DO WSS vstem32 cmd exe d ttce20 tec File Edit Run Compile Project Options De bug Break watch p ee col 19 Insert Indent Tab Fite vcindent D MOMAME C OS shell Quit Alt A Step 4 Load the Project ec CAWINDO WS ystem32 emd exe d tic 20 File Edit Run Col i In cert Project name LED PRI Break nals on Step 5 Change the Memory model Large for 8000e lib and set the Code Generation to 80186 80286 uPAC 7186EX Series User Manual Version 1 0 beta1 October 2008 95 File Edit Run Compile Project Oyen Debug Break watch Line i Col 1 Ins
18. 28 oo ta aa r eth E EE 91 Appendix C What is MiniOS7 Utility ce cccccecccceeeeeceeeeeseeeeeseeceeseeeesseeessaeeeseeeesaeees 92 Appendix De Whats VXCOMM UTM sssnejancensnienndamy e een eubes 93 Appendix E More C Compiler SettingS ccccccccssccccescceceeeeeceeeeeeeeceeseeeesseeeesaaeeeseeeeesaeess 94 Fae WOOO CO cease suede E N 94 Fe Mica Oa sess stents tees gee cea A E A se aap AAA E N 97 are im SGO a omemete mre czar at ereatne ema nen nT rere nc ne ree ean ee ene ee ee 101 BN E OO Sashes gee Fe aa at ee Rea eee lc eae ag a lata Rea hanet ae 103 Appendix F Application of RS 485 Network cccccccccsecccseeeeseeeeseeeeseeeeseeeeeeeeeseeeseeeenaes 107 Fa lig SIG WOO ONC IW Ol catenin enceunpeeaaiebousacee aaa seaie OEE 107 F2 DalSy chain RS 485 NETWORK ooren E E E ER 108 F202 lal VOE RSA TNEIWO K anninannn nE A ATEA TA 109 F 4 Random RS 485 network eccone nann a A E N 111 uPAC 7186EX Series User Manual Version 1 0 beta1 October 2008 4 Oe Ulm UNH OW HC SISIONS ccnvudancusiertecrnanemaramavanevansouneuxnabuaeuacoumanannenenietomennaren F 5 1 UPAC 7186EX as a Master ccccc cc ccccccceccccccecccceceucacuceceacsceceacsteeaceneaeas F 5 2 UPAC 7186EX as a slaVe 0 ccc ccccccceccccaceccccccececcccececcsceccauscaceavsteneausneneas uPAC 7186EX Series User Manual Version 1 0 beta1 October 2008 5 1 Introduction The uPAC 7186EX is a palm size programmable automation con
19. 49 3 O 49 Q S rotection Power reverse polarity protection rame Ground Yes for ESD Protection 10VDC to 30VDC non regulated on OI ower Consumption 123mm x 72mm x 33mm UDU D Q D Q O O lt lt o prs Q Q 49 uPAC 7186EX Series User Manual Version 1 0 beta1 October 2008 11 PACs UPAC 7186EX FD UPAC 7186EXD FD U C V D L h O 9 3 80186 CPU 80MHz or compatible 512K Bytes 512K Bytes Erase unit is one sector 64K bytes 100 000 erase write cycles 64M Bytes Data retention 10 years 100 000 erase write cycles 16K Bytes Data retention 40 years 1 000 000 erase write cycles 31 Bytes Battery backup data valid up to 10 year Year 2000 compliance seconds minutes hours date of the month month year valid up from 1980 to 2079 uild in Watchdog Timer Yes T Z VIO gt Q Z o D J A 2 A G 3 oO D U RAM Flash EEPROM RTC Real Time Clock u O O 3 3 O 9 O 5 5 r D mi D O COM 1 RS 232 TXD RXD CTS RTS and GND Non isolation COM 2 RS 485 D2 D2 self tuner ASIC inside Non isolation 10 100Base TX Ethernet Controller Auto negotiating Auto MDIX LED indicator COM Port Formats z F S 49 o U O N CO Data bit arity top bit aud Rate ED Display digit 7 segment LED ystem LED Indicator Z one Even Odd Mar
20. 5 communication interface COM2 to access the i 7K series I O modules for a wide range of RS 485 network application as shown below uPAC 7186EX Link Act ia e i 10 100M g uonewony ajqewwesbog Connect to the Power supply es a XD98TL DEMI 13 030 B GND 9 RS 485 Dataa Nata Connect to the ___ Power supply uPAC 7186EX i 7000 modules uPAC 7186EX Series User Manual Version 1 0 beta1 October 2008 5 Steps to communicate with i 7K series I O modules Step 1 Use Installcom to install the COM port driver Step 2 Use AddCom2fun when using COM2 Step 3 Use SendCmdTo07000 0 to send commands Step 4 Use ReceiveResponseFrom7000_ms to get the response Step 5 Use RestoreCom to restore the COM port driver The AddCom2fun function must be called when using the COM2 after using the InstallCom 2 function UuPAC 7186EX Series User Manual Version 1 0 beta1 October 2008 76 For example to send a command 00M to slot 7 s i 7K I O module for getting the module name include lt stdio h gt include 7186e h void main void unsigned char InBuf0 60 InitLib Initiate the 7186e library InstallCom 1 115200 8 0 1 Install the COM1 driver InstallCom 2 115200 8 0 1 Install the COM2 driver AddCom2fun SendCmdTo7000 2 00M 0 Send a command to COM2 Timeout 50ms check sum disabled ReceiveResp
21. 5 network is over 4000 ft or 1 2Km the RS 485 repeater must be added to extend the RS 485 network F 1 Basic RS 485 network The basic component of the RS 485 network consist of a Master Controller or using a PC as a host controller and some RS 485 devices 232 485 Converter 7520 Series UuPAC 7186EX User Manual Version 1 0 beta1 October 2008 107 F 2 Daisy chain RS 485 network There are branches along the main network In this case it is better to have a repeater to isolate or filter the noise that is made by devices There is a better choice to use 7513 as a RS 485 hub on start type network c _1 2Km 1 2 Km 4 ie ie 8 232 485 Converter 485 Repeater 485 Repeater 7520 Series 7510 Series 7510 Series UuPAC 7186EX User Manual Version 1 0 beta1 October 2008 108 F 3 Star type RS 485 network All RS 485 devices are wired directly to the main network If the network is up to 1 2 Km it will need a repeater 7510 series to extend the network length 232 485 Converter 7520 Series Me Ye gt i A 485 Repeater 485 Re thee 7 185 Repeater 7510 Series 7510 Series 485 Repeater 7510 Series UuPAC 7186EX User Manual Version 1 0 beta1 October 2008 109 There is a better choice to use 7513 as a RS 485 hub on start type network 232 485 Converter 7520 Series gt 485 Hub 7513 Series uPAC 7186EX User M
22. 9 3 3 Build ANd run your first program ccceeccsececeeeceeeneeeseeeeeeeeseeeseeseueeseeeseeeeaeeens 51 API and Demo Program Reference cccccccceeeeeeeceeeceeeeaeeeseeseueeneeeseeeseueeaeeeseeesaneens 63 uPAC 7186EX Series User Manual Version 1 0 beta1 October 2008 3 AT Grate WON OOO Mites sce ee cee cia eet AAN S EE AE 65 4 1 1 Types of COM port fUNCTIONS cc cecccceecceceeeeeceeeeeeeeeeseeeesseeeesaaeeesaaes 66 Ads APOLMiInIOS7 GOM DOM sxe ceria 67 AAc3 dAPITORStandard GOM DOW sssxieoteeseccaiyeaeetncecsoctats AAA 70 4 1 4 Comparing with MiniOS7 COM port function and Standard COM port function 73 4 1 5 Request Response protocol define on COM poft cccccceeeeeseeeeeeeees 74 Aver ARROIO MOGUICS siusuarsatunuavsmsusasunosesuasinsunannnes DENEN 75 4 35 APIIOP EEPROM ssicouncmpienctensinccteent cuseestcstetnateapiecstens ac teehee aaa 78 AAs APHORISM MOMON aistasctossincstasntanstonatnontacndnectounhentaceiaestaiadaentacniauatoadanstnesiees 80 25 APHOCNVRAM and RTO 2e eee eas 82 AiG PPL TOr SDI Ite BED os geiccese sects pace itiog nde ac gale Gain tgace Gavi Gore Gati gaeeS asi GndeGese Gas Gaegeceeeest 84 4 7 API for Timer and WatchDOgTiIMe l ccccccccssccceeeceeeceeeeeeeeceeeseeeenseeseeeseeeens 86 43 APITO WatcnDog Timer WDE reretia neina a Aa ESRAS 88 PODS GI A Frame Grond shee sete te enen sence ENEE EE EEE AEAEE EEN aa 90 Appendix BW MAU SAINI SF
23. EX indicator CPU 80186 80 E1 Ethernet 10 100 Base TX COM1 RS 232 COM2 RS 485 10 23 User Defined I O Pins 5 digits 7 SEG LED for display version only Programmable Automation Controller Lu 5 m ae aj Gal LI Ethernet Port Power COM1 RS 232 Connector COM2 RS 485 uPAC 7186EX Series User Manual Version 1 0 beta1 October 2008 1 4 Dimension Top View 30 0 Z QO F 2 SCREW M3 Y Side View Rear View Unit mm DIN RAIL MOUNTING BRACKET Front View ij _ E aa e jC ES 25 60 g J ka a aT uPAC 7186EX Series User Manual Version 1 0 beta1 October 2008 16 1 5 Companion CD This package comes with a CD that includes the following software and documention CD Napdos 7186E DITAA Basic Framework Xserver Document Firmware VxComm_Firmware Doc Driver PC OS_Image Server 7186E OS_Image PC_Tool MiniOS7_Studio MiniOS7_Utility PC_Test_Program PCDiag Vxcomm_ Utility uPAC 7186EX Series User Manual Version 1 0 beta1 October 2008 17 2 Quick Start This chapter provides users with basic information needed to begin using the uPAC 7186EX 2 1 Hardware installation 2 1 1 Installing the uUPAC 7186EX Step 1 Mounting the uPAC 7186EX The uPAC 7186EX can either be mounted on DIN rail or stack 1 DIN rail mounting uPAC 7186EX Series User Manual Versi
24. IMAGE icpdas S load232 dl J m Step 4 Select the latest version of the MiniOS7 OS image Select MimOS7 Image file Save in O OS_Image O p e g My Recent Documents i Ej Desktop My Documents My Computer a a File name if My Network Save as type uPAC 7186EX Series User Manual Version 1 0 beta1 October 2008 38 Step 5 Click on the Update MiniOS7 Image from the File menu MiniOS Utility Ferion 3 X Please weit a while for rebooting Step 6 Click on the Info buttion to check OS image version UuPAC 7186EX Series User Manual Version 1 0 beta1 October 2008 39 3 Your First Program on uPAC 7186EX Before writing your first program ensure that you have the necessary C C compiler and the corresponding functions library on your system 3 1 Setting up the compiler The following compilers are available for UPAC 7186EX o Turbo C Version 1 01 Freeware o Turbo C Version 2 01 Freeware o Borland C Versions 3 1 5 2 x o MSC o MSVC A N ICP DAS suggests that the Borland C version compiler is used as the libraries provided on the companion CD have been created using this compiler Special attention should be paid to the following items before using the compiler to develop custom applications o Generate a standard DOS executable program o Set the CPU option to 80188 80186 o Set the floating point opti
25. TS and GND Non isolation COM 2 RS 485 D2 D2 self tuner ASIC inside Non isolation 10 100Base TX Ethernet Controller Auto negotiating Auto MDIX LED indicator COM Port Formats aT F q9 w U O 7 8 None Even Odd Mark Space Data bit arit top bit aud Rate ED Display digit 7 segment LED ystem LED Indicator 115200 bps Max r D Q D D m lt D 5 V O 5 op O expansion bus ser defined I O pins O C S D 9 5 To m 5 lt O 5 3 D 5 dp 14 pins 25 C to 75 C 13 F to 167 F torage Temperature 40 C to 80 C 40 F to 176 F Humidity 5 to 95 Non condensing Y O D ma o 5 t D 3 le D Q t x D rotection Power reverse polarity protection rame Ground Yes for ESD Protection 10VDC to 30VDC non regulated NO NO ower Consumption UDU D Q D Q ep O lt lt 2 prs Q Q 123mm x 72mm x 338mm uPAC 7186EX Series User Manual Version 1 0 beta1 October 2008 13 PACs uPAC 7186EX SM uPAC 7186EXD SM O D C V D O h O Q O WI I W O DA a O 5 x 3 8 S B JE D z Q O 3 8 D O O 3 3 O S 5 r D mi D O U RAM 80186 CPU 80MHz or compatible 640K Bytes 16K Bytes Data retention 40 years 1 000 000 erase write cycles 31 Bytes Battery backu
26. Turbo G 2nd Edition Installation Utility Enter the letter of the hard drive you wish to install the software Step 6 Enter the path to the directory you wish to install files to SEE Turbo C 2nd Edition Installation Utility STOCPP141_ Enter the path to the directory you wish to install files to uPAC 7186EX Series User Manual Version 1 0 beta1 October 2008 43 Step 7 Select Start Installation to begin the install process es CADOCUME 1 VWeserlg eppil INSTALL EXE Turbo G 2nd Edition Installation Utility Turbo C Directory C TC Binary Files Subdirectory C o TC BIN Header Files Subdirectory CoxTO INCLUDE Library Subdirectory GCe Tco LIE EGI Subdirectory C TC BGI Tour Subdirectory C TC TOUR Class Library Subdirectory C TC CLASSLIB Examples Subdirectory C2 TC ERAMPLES Install Tour Yes Unpack Examples Yes Memory Models TS HACLH J Start Installation a m LOD Selecting thig a UO hard drive into the director Select Start Installation to begin the install process Step 8 Press any key to continue es CADOCUME 1W r f icpp101 MNSTALL EXE Turbo G 2nd Edition Installation Utility Turbo G is now installed on your system All the necessary files have been copied to your hard drive and a configuration file has heen created for the command line version of the compiler You should now read the README f
27. Type the name of a program Folder document or 66 2 Type cmd Internet resource and Windows will open it For vou Open Maie a 3 Lok Pe h Browse uPAC 7186EX Series User Manual Version 1 0 beta1 October 2008 51 Step 2 At the command prompt type TC and then press Enter Microsoft Windows AP Version 5 1 2606 CCG Copyright 1985 2001 Microsoft Corp C o Documents and Settings Administrator I Step 3 Select New from the File menu to create a new source file Ser L S o Edit Gy Open IG File Edit Search Run Compile Debug Project Options Window Help Lil F Make Fi Menu Fi Help A1t FE Mext Msg Alt F Prev Msg ALt F Compile UuPAC 7186EX Series User Manual Version 1 0 beta1 October 2008 Step 4 Type the following code Note that the code is case sensitive include 7186e h Include the header file that allows 8000e lib functions to be used void main void InitLib Initiate the 7186e library Print Hello world r n Print the message on the screen Step 5 Save the source file i Select Save from the File menu li Type the file name Hello iii Select OK s aile Debug Project Opt ions HELLO CPP Compile Debug Project Options Window Hely je gt ee eS ee a UuPAC 7186EX Series User Manual Version 1 0 beta1 October 2008 AN lf there i
28. UDP 4 Lock in Disk 4 Hame Type Name bin File Folder FIRMWARE File Folder B 05_IMAGE File Folder icpdas TEB Internet Shortcut 8 load 232 dll SEKE Application Extens EE Mini0 S7_Utility chm 1 025KB Compiled HTML H EY MiniOS7_Utiityexe 2 055KB Application f uart dll BEKE Application Estensi unini dat ORB DAT File iSl unins000 exe BFSEB Application 5 amp DiskT oats E1 norn O Deletara E Reheshirsy uPAC 7186EX Series User Manual Version 1 0 beta1 October 2008 61 Step 14 Upload and execute files For more detailed information about this process please refer to section 2 3 2 UPloading and executing programs on uPAC 7186EX Lis oh FF PL dasdetir tie oO re ee MINIS S Unb Teron 3 1 7 3 aa File Connection de Command F Configuration T Tools 42 Help Look in C Hello Lack in Disk A t Mame Size 2 Mame Size Modified Hello 187KB i aaa E 2S SS SS EE E EEEE EE E EEE I RET ORE EEEE EEEE EEEE Fun with parameters Begin Key Thread l Current set Use COM1 115266 N 8 1 aew Pag Reset Himik F4 Autodownload files None Cu Documents and Settings Wser Hello Hello_C Erase Disk C837_U2 2_UDP gt run 6 Hello 8666 lt Flash memory is 512 K gt C83 7_U2 2_UDP gt _ Fe MIMS s Utility vernon 3 1 7 3 File gt Connection ae Command F Configu am Look in C Mini 7 Utility ee Disk A i Name Size Type No M
29. ame Size Modified D bin File Folder P0 hello exe 138 928 2008 6 9 O FIRMWARE File Folder aULOEHEC 25 2005 8 9 9 05_IMAGE File Ego icpdas EDE Current set Use COM1 115266 N 8 1 NDocuments and Settings WUser Hello Hello_C t C837_U2 2_UDP gt run 6 Hello 8000 lt Flash memory is 512 K C83 7_U2 2_UDP gt _ uPAC 7186EX Series User Manual Version 1 0 beta1 October 2008 62 4 APl and Demo Program Reference There are several demo programs that have been designed for UPAC 7186EX You can examine the demo source code which includes numerous comments to familiarize yourself with the MiniOS7 API This will allow to quickly develop your own applications quickly by modifying these demo programs o Basic Folder Demo Explanation File Config_1_Basic Reads information from a text file basic Config_2 Advanced Reads a config file text file advanced Hello Hello _C Reads the library version and flash memory size Hello C Misc Reset Resets the software Runprog Illustrates how to select an item and run it Serial Illustrates how to retrieve 64 bit hardware unique serial number Watchdog Enables the WDT or bypasses the enable WatchDog function smmi systemKey Shows how to operate the systemkey function simply and easily Led shows how to control the red LED and 7 segment display Memory 256 Shows how to read or write to the 256K byte batt
30. anual Version 1 0 beta1 October 2008 110 F 4 Random RS 485 network There are branches along the main wire In this case it is better to have a repeater to isolate or filter the noise that is made by devices Vv NSE 232 485 Converter 7520 Series 485 Repeater 7 510 Series ie 485 Repeater 7 510 Series titties UPAC 7186EX User Manual Version 1 0 beta1 October 2008 ss TT F 5 Pull High Pull Low Resistors The uPAC 7186EX provides two RS 485 serial port based on the master slave architecture all of which have a pull high pull low resistor you can set it to master mode or slave mode for implementing a RS 485 multi drop network F 5 1 UPAC 7186EX as a Master When one of UPAC 7186EX is set to master then all the other devices on the same network must be slave mode then the master one s UPAC 7186EX pull high pull low resistors have to adjusted to enabled Please refer to the Figure H 1 for the jumpers setting of the pull high pull low resistors which are located at the power board of UPAC 7186EX Figure H 1 iad g Master Mode 485 Repeater 485 Repeater 7510 Series 7510 Series A i i l l Slave Mode Slave Mode uPAC 7186EX User Manual Version 1 0 beta1 October 2008 112 F 5 2 UPAC 7186EX as a slave For most of application when using one 7520 series as RS 232 485 converter its pull high pull low resistors are set to enab
31. buffer API for reading data from COM ports 5 ReadCom After IsCom confirms that the input buffer contains data the ReadCom must be called to read the data from the COM port input buffer uPAC 7186EX Series User Manual Version 1 0 beta1 October 2008 6 API for sending data to COM ports 6 ToCom Before sending data to COM ports the ToCom must be called to send data to COM ports For example reading and receiving data through the COM1 include lt stdio h gt include 7186e h void main void int quit 0 data InitLib Initiate the 7186e library InstallCom 1 115200 8 0 1 Install the COM1 driver while quit if lsCom 1 Check if there is any data in the COM port input buffer data ReadCom 1 Read data from COM1 port ToCom 1 data Send data via COM1 port if data q quit 1 If q is received exit the program RestoreCom 1 Uninstall the COM1 driver uPAC 7186EX Series User Manual Version 1 0 beta1 October 2008 68 API for showing data from COM ports 7 printCom Functions such as printfCom in the C library allow data to be output from COM ports For example showing data from the COM1 port include lt stdio h gt include 7186e h void main void int i Initiate the 7186e library InitLib InstallCom 1 115200 8 0 1 Install the COM1 driver for i 0
32. d the Instruction Set to 80186 Opt inion ae ove Source Fi Help View f Far Data hreshold EPREW UuPAC 7186EX Series User Manual Version 1 0 beta1 October 2008 Step 6 Set the Entry Exit Code Generation option and setting the DOS standard Project Window Hely CPP gt al eration i iranian code nerat Lon ma options n 1 C options z i he SOUPCE Messages L 7 Ce DOS standard ie Convention Stack tandard Step 7 Choosing the Debugger and set the Source Debugging to None Gy 5 x File Edit Search Run Compile Debug Project Window Help C DOCUNE 1 ADMINI 1 MOMANESS Application Compiler Transfer Make Librarian Directories Inspectors rogram Heap Size K bytes uPAC 7186EX Series User Manual Version 1 0 beta1 October 2008 E 3 MSC 6 00 Step 1 In the source file folder create a batch file called Gomsc bat using the text editor Untitled Notepad cl fe Gs FPa Fm G1 AL HELLO c link M NOE NOI HELLO 4 1i1b 7156xb1 del obq del map C2 1 The source code 2 The object file name 3 The path of the functions library Note C Don t strip comments GS_ No stack checking Fpa Calls with altmath Fm map file G1 186 instructions AL Large model Step 2 Run the Gomsc bat file o CARIN DOSS ystem32tcmd exe C 7188XA Demo MSC Hel 1lo gt Gomsc C
33. e controller file list Right click on the file name that you wish to execute and then select the Run option Look in Hello E Lock in Disk a Mame Size Ty Name Size Modified Hello 187KB Ap tien S ce 7188X W 1 31 COM1 115200 N 8 1 FC 0 CTS 1 DIR C Documenis gs User Hello Jof x Begin Key Thread F Eun with parameters Reset Minus F4 Erase Disk C837_U2 2_UDP gt run 6 Hello 8606 lt Flash memory is 512 E gt C83 7 _U2 2_UDP gt _ a ae uPAC 7186EX Series User Manual Version 1 0 beta1 October 2008 35 2 3 3 Making programs start automatically After download programs on the uPAC 7186EX if you need programs to start automatically after the uPAC 7186EX start up it is easy to achieve it to create a batch file called autoexec bat and then upload it on the uUPAC 7186EX the program will start automatically in the next start up For example to make the program hello run on start up Z MiniOS Utility Verion 3 1 Seles Oa Fi gt Connection lt e Command coniioucation E Tools E Help hi a a ee aa aaa aa aaa aa a naa naa aa na aaa na aaa aa aa aa aa Ee ee Ce aaa naan ee TA A Cais Li z C gg Ho Hame Size Modified Look m Name Size pe O bin File Folder lo helos 138 928 2008 6 9 C FIRMWARE File Folder aUtOEXEC 25 2005 8 9 3 05_MAGE File Folder Icpdas load 232 One is the H
34. e zip file to a folder on your hard drive Turbo C version 1 01 shipped on 4 floppy disks The zip fle contains all the files that were on the 4 floppy disk images nn n neal drive Run the Install ex program and follow the _ iets a A N Free versions of the Turbo C version 1 01 and Turbo version 2 01 Compilers can be downloaded from the Borland web site o Turbo C version 1 01 http dn codegear com article 21751 o Turbo C version 2 01 http dn codegear com article 20841 uPAC 7186EX Series User Manual Version 1 0 beta1 October 2008 4 Step 2 Unzip the downloaded zip file to the temporary folder tepplol Step 3 Double click the executable file to start setup wizard INSTALL Step 4 Press Enter to continue o CADOCUME 1 VWser mtcpp101 UNS TALL EXE Turbo G 2nd Edition Installation Utility Copyright lt c 1991 by Borland International Inc Install Utility Welcome to the Turbo G installation program This program will copy the files needed to install Turbo G on your system You will need about 7 5 megabytes of available disk space if you wish to install all the memory models unpack the examples and copy the Tour files Press ENTER to continue ESC to quit 74 3y 7 ENTER Cont i Press Enter to continue uPAC 7186EX Series User Manual Version 1 0 beta1 October 2008 42 Step 5 Enter the letter of the hard drive you wish to install the software ey O x
35. ello application file and the other is the autoexec bat batch file a autoexec Note Pad Files Edit Options 0 View Help hello exe autoexec bat batch file uPAC 7186EX Series User Manual Version 1 0 beta1 October 2008 36 2 4 MiniOS7 Utility for updating OS image ICP DAS will continue to add additional features to MiniOS7 in the future we advise you periodically check the ICP DAS web site for the latest update to MiniOS7 Step 1 Get the latest version of the MiniOS7 OS image The latest version of the MiniOS7 OS image can be obtain from CD NAPDOS 7186e OS_Image http ftp icodas com pub cd 8000cd napdos 7186e OS_Image I ooo 0 CES ZMF UDP YY MIMD img 1 CPU type 2 MAC address 3 Protocol type 4 Release date Step 2 Establish a connection For more detailed information about this process please refer to section 2 3 1 Establishing a connection uPAC 7186EX Series User Manual Version 1 0 beta1 October 2008 3 Step 3 Click on the Update MiniOS7 Image from the File menu PA MiniOS7 Utility Verion 3 1 P Tools g Help Lock in Disk f Modifie Update Minit Image m n ma nma n nma ama nman Hot List Ctrl D Mame Size H Exit Ak Y 7 Jon FIRMWARE 05_
36. ert Indent Ta NONAME C Model Large Def ines Code generation Calling convention CG Instruction set 80186780286 Floating point Emulation Default char type Signed Alignment Generate underbars Merge ere eRe ine mniboee 1 OBJ debug information k Step 6 Building the project ca CAWINDOWSYSy z l x File Edit Run ompile Project Options De bug Break uatch Line 1 i j D NONAME C Build all Primary C file wU CAWINDOWS Sy of x File Edit Run Compile Pro ject Opt ions De bur EBreakrwatch Edit 2 Line i Col i Insert maene Teh Fill Unindent D HOHAME C Linking ESE file LED EXE Linking STC2H LIESCL LIE Total Lines compiled 1335 Warnings amp Errors Available E 235K Message Fi Help F5 Zoom F6 Switch FY Trace F Step F Make Fi Menu Wlily uPAC 7186EX Series User Manual Version 1 0 beta1 October 2008 96 E 2 BC 3 1 IDE Step 1 Executing the Borland C 3 1 Step 2 Creating a new project file prj co Command Prompt be File Edit Search Run Compile Doug C DOCUMNE 1 ADMIM MIN Step 3 Add all the necessary files to the project co Command Prompt be File Edit Search Run Compile uPAC 7186EX Series User Manual Version 1 0 beta1 October 2008 97 Step 4 Change the Memory model Large for 8000e lib File Edit Search Rui Compile Step 5 Set the Advanced code generation options and Set the Floating Point to Emulation an
37. ery backup uPAC 7186EX Series User Manual Version 1 0 beta1 October 2008 63 Folder Demo Explanation DateTime DateTime Shows how to read and write the date and time from the RTC Com port C Style lO 1 Shows how to write a function to input data 2 Shows how to receive a string 3 Shows how to use a C function sscanf or just use Scanf Receive Receives data from COM port Slv_COM c is in non blocked mode Receive c is in blocked mode Slv_COM A slave COM Port demo for request reply or command response applications ToCom_In Out Illustrates how to Read Write byte data via COM Port Com port K87K_DI_for_Com GOM Port can be used to connect and 7K87K DO for Com control i 7k or i 87k series modules For UPAC 7186EX module and can use COM2 7K87K_Al for Com COMS eo IO ON m For uPAC 7186EX module and CPU 40 and AO_024_for_Com 80M can use COM3 COM4 For more information about these demo programs please refer to CD NAPDOS 7186e Demo Basic http ftp icodas com pub cd 8000cd napdos 7186e Demo Basic uPAC 7186EX Series User Manual Version 1 0 beta1 October 2008 64 4 1 API for COM port o The uPAC 7186EX include two COM ports 1 MiniOS7 COM port functions 2 C style Standard COM port functions d m ac UMPAC 7186EX O CPU 80186 80 E1 Ethernet 10 100 Base TX COM1 RS 232 COM2 RS 485 10 23 User Defined I O Pins EEEEE Programmable
38. es em Introduction v o uPAC 7186EX Series User Manual Version 1 0 beta1 October 2008 l 7188 series i T D T D T r a T o rt EHIS 2 COM Ports Functions 4 gt 4 zje Options X py 1 Library Selection for All l 7 166 16 Si El Fe 2 1 Common Functions arables IDS 2 1 1 DA 2 1 2 ID 2 1 3 DA 2 1 4 DA 2 1 5 DA 2 1 A 2 1 A 2 1 2 1 2 1 Dy 2 1 A 2 1 A 2 1 A 2 1 DA 2 1 DA 2 1 DA 2 1 7 g 9 40 411 DA 2 1 A 2 1 14 15 16 Al 16 19 12 13 A 2 1 20 A 2 1 21 Dy 2 1 22 DS 2 1 23 UII Installlormn bCtsChanged x CurlTo X CurkTs_ x flisContralMiode x fRisContralMode x Clearlom Clear Butter Datasizelnloam set xButterFreesize setCtsotatus InstallComlnputData IsCom IsTxButErmpty IsComUutButEmpty IsDetectBreak printlom Restorelom Readlom ReadComn setlomlimeout setlomPortButtersize setCtsControliode z gt 50 3 3 Build and run your first program If you don t using the TC Turbo C to write a program please take the following steps Step 1 Open a MS DOS command prompt i Select Run from the Start menu ll On the Run dialog box type cmd lil click the OK button 3 Windows Catalog Windows Update Programs b A Documents Settings b Windows XP Professional 7 Shut Down c Toy Run ud Ed tg Start
39. h contains libraries header files demo programs and more information as shown below CD Napdos 7186EX Domo Basic 7K8 7K_for_COM _COM_Po Timer Framework FW_Demo01_Client FW_Demo02_Server dio Xserver XDemo04_Basic XDemo07_printCom1 XDemo14_7Seg_LED Readme txt uPAC 7186EX Series User Manual Version 1 0 beta1 October 2008 24 Step 2 Install the MiniOS7 Utility The MiniOS7 Utility is a tool that can be used to configure and upload files to the controller and is located at CD Napdos minios utility minios7_utility ftp ttp icodas com pub cd 8000cd napdos minios 7 utility minios7_utility uPAC 7186EX Series User Manual Version 1 0 beta1 October 2008 25 2 3 MiniOS7 Utility for downloading programs Before you begin using the MiniOS7 Utility to download programs ensure that the controller is connected to the Host PC The download process has the following main steps 1 Establishing a connection 2 Download and executing programs on the controller 3 Making programs start automatically All of these main steps will be described in detail later 2 3 1 Establishing a connection between the Host PC and the uPAC 7186EX Connect the Host PC to the uPAC 7186EX with the following connection types 1 COM1 connection 2 LAN1 connection Each of the connection types will be described in detail later uPAC 7186EX Series User Manual Version 1 0 beta1 October 2008
40. ile hy typing README and pressing ENTER in your Turbo G directory Mext make sure the line FILES 28 CG 5SICN5EBI is in your COMFIG SYS file and C TC BIN is in STOSBGI Executing your path For example CG 5TITCNBI PATH C BIN C TC BRIN Executing Peess any key to continue CG 5TCNBI Executing C 5IC EIH UHZI F EZE Executing GC TG BINS THELS EE Press any key to continue uPAC 7186EX Series User Manual Version 1 0 beta1 October 2008 44 Step 9 Press any key to continue ces CADOCUME 1 V ser eppil INSTALL EXE Turbo G 2nd Edition Installation Utility Turbo C Directory ConTc Binary Files Subdirector C TC BIN Header F Library For a tutorial on the Turbo C integrated EGI Subd Be eee ee ee ed a Pa a a LEA S directory and run the Turbo G Tour For example Change to C TC TOUR G 5ITCNBI And type TCTOUR STOSBGI Executing C TC BI Press any key to continue Executing C 2 TO BINSTHELP COM WU FOC Executing C 5SIC EINSUHNHZIF EZE TC a Executing CG 5ITC EBEIHNTHELF COM Any Key Continue Press any key to continue Step 10 Installation is complete uPAC 7186EX Series User Manual Version 1 0 beta1 October 2008 45 3 1 2 Setting up the environment variables After installing the compiler several compilers will be available from the Windows Command line You can set the path environment variable so that you can execute This compiler on the command line by entering sim
41. iniOS7 API Programm Functions Timer and WatchDog Timer uPAC 7186EX Series User Manual Version 1 0 beta1 October 2008 49 For full usage information regarding the description prototype and the arguments of the functions please refer to the MiniOS7 API Functions User Manual located at CD Napdos MiniOS7 Document http ttp icodas com pub cd 8000cd napdos minios 7 document J Adobe Reader ManiOS 7_API pdf C Fie Edit View Document Tools Window Help agaga 8 X B sweacoy A G seren 0D A C e Bf o il Orero Ea wer ea E Ze Options X o D 2 COM Ports Functions Bookmarks A 2 1 1 InstallCom DS 2 1 2 bCtsChanged_x D 2 1 3 CurCTS_x DS 2 1 4 CurRTS_x D 2 1 5 fCtsControlMode_x DS 2 1 6 fRtsControlMode_x D 2 1 7 ClearCom T 2 1 8 ClearTxBuffer 2 1 9 DataSizelnCom 18 2 1 10 GetTxBufferFreeSize D 2 1 11 GetCtsStatus D 2 1 12 InstallComlnputData DS 2 1 13 IsCom DS 2 1 14 IsTxBufEmpty A 2 1 15 IsComOutBufEmpty D 2 1 16 IsDetectBreak A 2 1 17 printCom B 2 1 18 RestoreCom B 2 1 19 ReadCom T 2 1 20 ReadComn A 2 1 21 SetComTimeout A 2 1 22 SetComPortBufferSize DS 2 1 23 SetCtsControlMode lt gt Pages Y Layers ic o G E a E Comments BS 1 Library Selection for All 7188 80 D 2 1 Common Functions ariables 7188 D 752N l l 7188EN l l 8000 seri
42. k Space m 15200 bps Max W Q D Q D D m x lt D 5 V O 5 WM O expansion bus ser defined I O pins l 0p O D 9 5 To m 5 O 5 3 D r 14 pins 25 C to 75 C 13 F to 167 F torage Temperature 40 C to 80 C 40 F to 176 F Humidity 5 to 95 Non condensing Y O O 49 D Q ms 3 O 4D Q rotection Power reverse polarity protection rame Ground Yes for ESD Protection 10VDC to 30VDC non regulated OW NO ower Consumption WwW ia itl wv E Q Cp O lt lt a pre Q OQ 49 123mm x 72mm x 33mm uPAC 7186EX Series User Manual Version 1 0 beta1 October 2008 12 PACs uPAC 7186EX SD uPAC 7186EXD SD O D C V D 2 h O Q O 80186 CPU 80MHz or compatible 512K Bytes 512K Bytes Erase unit is one sector 64K bytes 100 000 erase write cycles 1G Bytes 16K Bytes Data retention 40 years 1 000 000 erase write cycles 31 Bytes Battery backup data valid up to 10 year Year 2000 compliance seconds minutes hours date of the month aE DO Q D O D a Z 3 O D U RAM Flash Micro SD EEPROM RTC Real Time Clock month year valid up from 1980 to 2079 uild in Watchdog Timer Yes u O O 3 3 z O 9 5 5 r D mi D O COM 1 RS 232 TXD RXD CTS R
43. led Then the uPAC 7186EX and all the other devices on this network must be slave mode the pull high pull low resistors must be disabled Please refer to the figure H 2 to for the jumpers setting of the pull high pull low resistors which are located at the power board of uPAC 7186EX Figure H 2 W NZ K airite a 23921485 Converter 7520 Series lf there are repeaters on the RS 485 network there will be pull high pull low resistors on both sides of the repeaters i 7510 UuPAC 7186EX User Manual Version 1 0 beta1 October 2008 113 K k 1 2 Km HE 1 am ine is 232 485 Converter 485 Repeater 485 Repeater 7520 Series 7510 Series 7510 Series Slave Mode Slave Mode i Slave Mode uPAC 7186EX User Manual Version 1 0 beta1 October 2008 114
44. oject mak e Baca t E Ys the Project type Hew Project 7 ji l x Poete OS Browse Beta Fi cor leexatdemomnacthello fo ch o gt TIBKA gt DEMO MSc He CAT f HELLO List Files of Type ieee Cv Project ek uPAC 7186EX User Manual Version 1 0 beta1 October 2008 the Project Name field and then select MS DOS application EXE as Step 3 Add the user s program and the necessary library files to the project Edit HELLO MAE x File Hame Directories Close 71 88xal lib cM Bbsademo mec ib 1eoxal lib FS ch Cancel T168Ha5S lib F gt TBE gt DEMO Help gt MSC g lib HE CG Board List Files of Type Drives Library lib Sc Pic ee a demo mecshelloshello c Myc Todnaidemowmeciliby 1odnal lib a Project Type MS DOS application EE OF Cancel Use Microsoft Foundation Classes Customize Build Options Build Mode i Debug CfC Compiler Options x Build Options Debug Specific Release Specific Common to Both Options String fnologo Gs G7 AWS AL Oe D UNDEBUG ZB DOS FA Help Flee Compiler Linker lil Cancel ee Help Deme Use Project Defaults Category Category Settings Code Generation Code Generation Custom Options pee Custom Options C Fi Debug Options 20186 7 80188 Check Pointers Listing Files
45. om 1 item printCom 1 n rASCII c n r item printCom 1 Hex 02X n r item Delay 10 RestoreCom 1 Standard COM port functions include lt stdio h gt include 7186e h void main void unsigned char item InitLib Print Hits any key n Print Hits the ESC to exit n for if kbhit item Getch if item q return else Print n r Print char Putch item Print n rASCII c n r item Print Hex 02X n r item uPAC 7186EX Series User Manual Version 1 0 beta1 October 2008 13 4 1 5 Request Response protocol define on COM port Request Response communication is very typical protocol architecture if you want to design a command set of communication protocol as table below you can refer to slave com demo For a request response application please refer to slave_com demo r 2 Request Sex 1 PAC Response UPAC 7186EX eere Request Response GetCounter gt 1234 SetDO1 gt OK ResetDO2 gt OK GetVersion gt V1 0 0 For more demo program about the COM port please refer to CD NAPDOS 7186e Demo Basic com_port http fto icodas com pub cd 8000cd napdos 7186e Demo Basic com_ port uPAC 7186EX Series User Manual Version 1 0 beta1 October 2008 4 4 2 API for I O modules o The uPAC 7186EX is equipped with a RS 48
46. on 1 0 beta1 October 2008 18 2 Stack mounting Step 2 Connecting the Host PC to the uPAC 7186EX of e Off D oh By in Wa uPAC 7186EX Series User Manual Version 1 0 beta1 October 2008 19 2 1 2 Mounting the I O Expansion Bus UuPAC 7186EX Series User Manual Version 1 0 beta1 October 2008 20 1 3 Mounting the I O Expansion Bus 21 UuPAC 7186EX Series User Manual Version 1 0 beta1 October 2008 2 1 4 Wiring connections Link Act BAC 10 100M UPAC 7186EX O CPU 80186 80 E1 Ethernet 10 100 Base TX 10 23 User Defined I O Pins Programmable Automation Controller R Vst B GND 9 The pin assignment of 9 pin screw terminal block is as follows TXD pin for COM1 RS 232 6 D2 DATA pin for COM2 RS 485 8 Vs V of power supply 10 to 30VDC unregulated _ lt 9 GND GND for the power supply uPAC 7186EX Series User Manual Version 1 0 beta1 October 2008 22 The pin assignment of top 14 pin screw terminal block is as follows uPAC 7186EX Series User Manual Version 1 0 beta1 October 2008 23 2 2 Software installation All software resources are included on the companion CD the following steps will help you to install the resources and software from the companion CD Step 1 Copy the Demo folder from the companion CD to the Host PC The folder is an essential resource for users developing custom programs whic
47. on to EMULATION if floating point computation is required Be sure not to choose 8087 o Cancel the Debug Information function as this helps to reduce program size MiniOS7 supports this feature uPAC 7186EX Series User Manual Version 1 0 beta1 October 2008 40 3 1 1 Installing the Compiler lf there is no compiler currently installed on your system installation of the compiler should be the first step The following section guides you to install Turbo C Version 1 01 on your system Step 1 Go to the Borland web site and download Turbo C version 1 01 EMBARCADERO TECHNOLOGIES Home Products Solitions Support Developer Network Education Downloads How t CDN gt C Tools Other T Submit Translation Author P Antique Software Turha C version 1 01 By David Intersimone stract Turbo Cr Click here Suonored the C language The C How to Download _ w install Turbo C version 1 01 Click on Turbo C V rsion 1 01 to download the software 2 7mb software use wan Y Zip utility like PKZIP or WinZip to f conformed to i l l tools ran und drive Turbo C vers A 1 01 shipped on 4 floppy disks The zip Era ita e release of tht How to Download anda Turbo C version 1 01 Click on Turbo C version 1 01 to download the software 2 mb When you are finished downloading the software use your favorite zip utility like PRZIP or Winzip to decompress th
48. onseFrom7000_ms 2 InBuf0 50 0 printCom 1 Module Name s InBuf0 Delay 10 Wait for all data are transmitted to COM port RestoreCom 1 Uninstall the COM1 driver RestoreCom 2 Uninstall the COM2 driver uPAC 7186EX Series User Manual Version 1 0 beta1 October 2008 f 4 3 API for EEPROM o The EEPROM contains 64 blocks block 0 63 and each block has 256 bytes address 0 255 with a total size of 16 384 bytes 16K capacity o The default mode for EEPROM is write protected mode o The system program and OS are stored in EEPROM that are allocated as shown below Block 0 2 oa Block 6 7 Block 7 Reserved a system T Block 31 Block 32 i Block 63 m eS eS SS API for reading data from the EEPROM API for writing data to the EEPROM 1 EE WriteEnable Before writing data to the EEPROM the EE _WriteEnable must be called to write enable the EEPROM 2 EE WriteProtect After the data has finished being written to the EEPROM the EE_WriteProtect must be called to in order to write protect the EEPROM 3 EE MultiWrite After using the EE_WriteEnable to write enable EEPROM the EE_MultiWrite must be called to write the data 4 EE MultiRead The EE_WriteEnable must be called to read data from the EEPROM no matter what the current mode is uPAC 7186EX Series User Manual Version 1 0 beta1 October 2008
49. p data valid up to 10 year Year 2000 compliance seconds minutes hours date of the month month year valid up from 1980 to 2079 ES Flash EEPROM NVRAM 0p uild in Watchdog Timer 80186 CPU 80MHz or compatible COM 1 RS 232 TXD RXD CTS RTS and GND Non isolation COM 2 RS 485 D2 D2 self tuner ASIC inside Non isolation 10 100Base TX Ethernet Controller m tF 3 o 5 U O ms O U O 1 O x 3 V N 0 Auto negotiating Auto MDIX LED indicator Data bit arit top bit aud Rate ED Display digit 7 segment LED ystem LED Indicator Z one Even Odd Mark Space 15200 bps Max mAN r D Q 9 m lt D 5 V O 5 ep O expansion bus ser defined I O pins l n O D 9 5 Co m 5 lt O 5 3 D 14 pins 25 C to 75 C 13 F to 167 F torage Temperature 40 C to 80 C 40 F to 176 F Humidity 5 to 95 Non condensing DY O O 49 SA Q Comal 4D 3 O 49 Q rotection Power reverse polarity protection rame Ground Yes for ESD Protection 10VDC to 30VDC non regulated NO NO ower Consumption 123mm x 72mm x 33mm vonid D 2 D Q O 2 lt lt o F Q G D uPAC 7186EX Series User Manual Version 1 0 beta1 October 2008 14 1 3 Overview User define pins q m AC System LED UPAC 7186
50. ple names rather than by using Their full path names Step 1 Right click on the My Computer icon on your desktop and select the Properties menu option EE Right click My Computer Open and then select Properties Explore Search Manage Map Network Brive Disconnect Wekwork Drive Create Shortcut Delete Rename System Properties Properties System Restore Automatic Updates Remote General ComputerName Hardware Advanced System Microsoft Windows sF Professional Version 2002 Registered to pthuang icp ABS 4 640 0000356 23006 Computer AMD F6 tm 30 processor 451 MHz 192 MB of RAM uPAC 7186EX Series User Manual Version 1 0 beta1 October 2008 46 Step 2 On the System Properties dialog box click the Environment Variables button located under the Advanced sheet Step 3 On the Environment Variables dialog box click the Edit button located in the System variables option System Properties 1 System Restore Automatic Updates Remot General Computer Name Hardware Advanced Tou must be logged on as an Administrator to make most of these changes Performance Visual effects processor scheduling memory usage and virtual memory Settings User Profiles Desktop settings related to your logon Settings Startup and Recovery S
51. port a single main time tick 8 stop watch timers and 8 count down timers o The uPAC 7186EX uses a single 16 bit timer to perform these timer functions with a timer accuracy of 1 ms API that can be used to control the Timer 1 TimerOpen Before using the Timer functions the TimerOpen must be called at the beginning of the program API for reading the Timer 2 TimerResetValue Before reading the Timer the TimerResetValue must be called to reset the main time ticks to 0 3 TimerReadValue After the TimerResetValue has reset the main time ticks to 0 the TimerReadValue must be called to read the main time tick API for stopping the Timer 4 TimerClose Before ending the program the TimerClose must be called to stop the Timer uPAC 7186EX Series User Manual Version 1 0 beta1 October 2008 86 For example the following code can be used to read the main time ticks from 0 include lt stdio h gt include 7186e h void main void Unsigned long time iTime InitLib Initiate the 7186e library TimerOpen While quit lf Kbhit TimerResetValue Reset the main time ticks to O iTime TimerReadValue Read the main time ticks from 0 TimerClose Stop using the 8000e timer function gt For more demo program about the timer please refer to CD NAPDOS 7186e Demo Basic timer httpo fto icodas com pub cd 8000cd napdos 7
52. r uPAC 7186EX Series User Manual Version 1 0 beta1 October 2008 83 4 6 API for 5 Digit LED o The uPAC 7186EX contains a 5 Digit 7 SEG LED with a decimal point on the left hand side of each digit which be used to display numbers IP addresses time and so on API for controlling the 5 Digit 7 SEG LED 1 InitsDigitLed Before using any LED functions the InitsDigitLed must be called to initialize the 5 Digit 7 SEG LED API for displaying a message on the 5 Digit 7 SEG LED 2 Show5DigitLed After the InitsDigitLed is used to initialize the 5 Digit 7 SEG LED the Show5DigitLed must be called to display information on the 5 Digits 7 SEG LED uPAC 7186EX Series User Manual Version 1 0 beta1 October 2008 84 For example use the following code to display 8000E on the 5 Digit 7 SEG LED include lt stdio h gt include 7186e h void main void InitLib Initiate the 7186e library InitsDigitLed Show5DigitLed 1 8 Show5DigitLed 2 0 Show5DigitLed 3 0 Show5DigitLed 4 0 showdDigitLed 5 14 The ASCII code for the letter E is 14 gt For more demo program about the 5 digit 7 SEG LEDs please refer to CD NAPDOS 7186e Demo Basic smmi http fto icodas com pub cd 8000cd napdos 7186e Demo Basic smmi UuPAC 7186EX Series User Manual Version 1 0 beta1 October 2008 85 4 7 API for Timer and WatchDogTimer o The uPAC 7186EX can sup
53. rnet Shortcut emilieation Fhe Step 9 On the Connection dialog box select TCP from the drop down list and enter the IP which just assigns Connection Connection History TCP Ww Seral Port 7 TCRLUDP Baud Rate 115200 Data Bit Port 10000 Parity HN or Stop Bit uPAC 7186EX Series User Manual Version 1 0 beta1 October 2008 33 Step 10 The connection has already established P MiniOS Utility Verion 3 1 7 3 G File lj Connection de Command F Sanaa El Tools E Help Look ir 9 Minis _Utility mm Name bin any Connection Status F Disconnected Connected gt Connection F2 El Hoan i 5 uPAC 7186EX Series User Manual Version 1 0 beta1 October 2008 34 2 3 2 Uploading and executing programs on uPAC 7186EX Step 1 On the host pc file list Right click on the file name that you wish to download and then select the Upload option P MiniOS 7 Utility Yerion 3 1 7 3 EF File gt Connection W Command Configuration Tools 3 Help sd Look ir O Hello k Lock in Disk A ka aP Size Type Heo Mame Size Modified 187KB Application Upload Upload amp Execut RAM Update Mauls Image Die F11 Host PC file list re Controller file list ee se a p en a ns ee eaws Si aa ee aN SSS Se ea Step 2 On th
54. s a text editor you are familiar with or prefer to use such as Notepad or edit you may use it to write the code shown above It should be noted that a word processor application cannot be used for this purpose as the application must save the file as plain text C language program files should always have a C extension name Step 6 Create a project prj i Select Open project from the Project menu ll Type the project name Hello iii Select OK cx Command Prompt te LL _ Edit Search Kun Cor ile Ba 4 Options Window Helg Close project Edit Search Run Compile Debug Project Options Window 0 G sIC Hello PRJ a iles uPAC 7186EX Series User Manual Version 1 0 beta1 October 2008 54 Step 7 Add the necessary source files to the project CPP i Select Add item from the Project menu ll Type CPP to display a list of all available source files iii Choose the source files you require iv Select Add uPAC 7186EX Series User Manual Version 1 0 beta1 October 2008 55 Step 8 Add the necessary function libraries to the project lib i Select Add item from the Project menu ll Type LIB to display a list of all available function libraries iii Choose the function libraries you require iv Select Add v Select Done to exit uPAC 7186EX Series User Manual Version 1 0 beta1 October 20
55. the miscellancous Category Linker Options E3 Build Options C Debug Specific Release Specific C Common to Both Options String LIB scr ALIB ahacr ALIB oldnames LIB sibee NOL STACK 5120 ONERROR NOESE OLOGO Help Cancel Use Project Defaults Category Category Settings Miscellaneous Input Memory Image Miscellaneous Output Remove the OLOGO Step 8 Rebuild the project cap Microsoft isual C HELLO MAE File Edit View aja Browse Debug Tool Options Window Help HELLO MAE Compile wild HELLO EXE ap lt 1 gt Output Initializing Compiling c N7 18 8za deno mac gt hellohello c Linking Microsoft iF Segmented Executable Linker Version 5 60 3399 Dec 5 1994 Copyright C Microsoft Corp 1984 1993 All rights reserved Object Modules obj NOI ZSTACEK 5120 ONERROR NOEEE HELLO OBJ Ohject Modules obj Fun File HELLO exe HELLO EXE List File c HELLO map nul Libraries lib c meveo libyt Libraries lib c smeave michli b Libraries lib LIB 7188EAL LIB Libraries lib oldnames Libraries lib llibce Creating browser database HELLO EXE 0 error s 0 warning s UuPAC 7186EX User Manual Version 1 0 beta1 October 2008 106 Appendix F Application of RS 485 Network The RS 485 length can be up to 4000 ft or 1 2 km over a single set of twisted pair cables if the RS 48
56. troller that with Ethernet RS 232 and RS 485 communication ICP DAS provides easy to use Software development tool kits Framework Xserver VxComm Modbus function Library Users can use them to easily integrate serial devices to have Ethernet Internet communication ability and through the standard Modbus protocol to Communicate with SCADA software Indusoft ISaGARF DasyLab Trace Mode Citect iFix and so forth For the hardware it also supports for I O expansion bus interface The I O expansion bus can be used to implement various I O functions such as D I D O A D D A Timer Counter UART flash memory battery backup SRAM ASIC key and other I O functions This I O expansion bus can implement nearly all kinds of I O functions but only one expansion board can be added There are more than 50 boards available for uUPAC 7186EX series module so far uPAC 7186EX Series User Manual Version 1 0 beta1 October 2008 6 Package List In addition to this manual the shipping package includes the following items o One uPAC 7186EX module o One download cable CA0910 o One companion CD containing software drivers and digital versions of the user manuals o One copy of the release notes uPAC 7186EX Series User Manual Version 1 0 beta1 October 2008 1 1 Features o Support for Virtual COM technology PC can create virtual COM ports to map the RS 232 RS 485 of uPAC 7186EX series module using the VxComm technolog
57. uPAC 7186EX User Manual Version 1 0 beta1 October 2008 service and usage information for uPAC 7186EX SD uPAC 7186EXD SD uPAC 7186EX SM uPAC 7186EXD SM Written by Hans Chen Edited by Anna Huang uPAC 7186EX Series User Manual Version 1 0 beta1 October 2008 Important Notices Warranty All products manufactured by ICP DAS are under warranty regarding defective materials for a period of one year beginning from the date of delivery to the original purchaser Warning ICP DAS assumes no liability for any damage 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 not for any infringements of patents or other rights of third parties resulting from its use Copyright Copyright 2007 by ICP DAS Co Ltd All rights are reserved Trademark The names used for identification only may be registered trademarks of their respective companies uPAC 7186EX Series User Manual Version 1 0 beta1 October 2008 2 Table of Contents Taole Or 7014 eee eee eee eer eee ere ee ee ee eee 3 We WPM O ast sets cece pes EEEE EEEE ER E E EE EEE ERNE 6 e E e L T E E E E E E E 8 1 2 Specifications ec eeccceeccceecccenceceuceceececeuceceueecsueecsucessueessueessueessueessasessaeessaeesas 11 We CWO VIG WY ooo
58. wing data from standard I O port 5 Print Functions such as Print in the C library allow data to be output from the COM Port For example reading and receiving data through COM1 include lt stdio h gt include 7186e h void main void int quit 0 data InitLib Initiate the 7186e library while quit if Kbhit Check if any data is in the input buffer data Getch Read data from COM1 Putch data Send data to COM1 if data q quit 1 If q is received exit the program uPAC 7186EX Series User Manual Version 1 0 beta1 October 2008 1 For example showing data through COM1 include lt stdio h gt include 7186e h void main void int i Initiate the 7186e library InitLib for i 0 i lt 10 i Print Test Yod n r i UuPAC 7186EX Series User Manual Version 1 0 beta1 October 2008 f2 4 1 4 Comparing with MinitOS7 COM port function and Standard COM port function For example learning to show the ASCII code MiniOS7 COM port functions include lt stdio h gt include 7186e h void main void unsigned char item InitLib InstallCom 1 115200 8 0 1 printCom 1 Hits any key n printCom 1 Hit the ESC to exit n for if IsCom 1 item ReadCom 1 if item q return else printCom 1 n r printCom 1 char ToC
59. y The software running on the PC can operate the virtual COM ports like a standard COM port to access the serial devices connect to the UPAC 7186EX In other words the original software developed for the serial devices can access the serial devices via the Ethernet Internet without any modification Each PC can control up to 256 COM ports including real COM ports Using the I O expansion board each uPAC 7186EX can have up to 8 COM ports Support Modbus Protocol Using the Modbus firmware uPAC 7186EX offers following Modbus features 1 Modbus TCP RTU ASCII slave 2 Modbus TCP RTU ASCII master 3 Gateway for Modbus TCP to Modbus RTU VxComm Technique Supported VxComm technique is used to create virtual COM ports on PC for windows 2K XP to map remote COM ports of PDS 700 I 7188E l 8000 and uUPAC 7186EX over the Ethernet Using the technique RS 232 485 software can access devices locally via the physical RS 232 485 bus or remotely via the Ethernet The RS 232 485 software only needs to change COM port number from the physical COM port to virtual COM port o Ethernet Protocols TCP UDP IP ICMP and ARP uPAC 7186EX Series User Manual Version 1 0 beta1 October 2008 8 o Easy Use Software Development Tool Kits Using C Language The custom firmware can be developed for uUPAC 7186EX series module using the SDK Framework Xserver Modbus function libray provided by ICP DAS o Support Web configuration UuPAC
60. ystem startup system tallur nd debug 4 PAS a ertaariahidk ul x User variables for Administrator aa Variable Value LE hvironment Variables TEMP C Documents and Settings Administra TMF C Documents and Settings 4drministrat System variables Variable Value ComSpec C WINDOW Sisystem32 cmd exe NUMBER OFF 1 3 os Windows MT CoWINDOW Sisystemse PATHE T COM ESE BAT CMD ves YBE JS uPAC 7186EX Series User Manual Version 1 0 beta1 October 2008 4 Step 4 Add the target directory to the end of the variable value field A semi colon is used as the separator between variable values For example c TC BIN c TC INCLUDE Edit System Variable Variable name Variable value Step 5 Restart the computer to allow your changes to take effect UuPAC 7186EX Series User Manual Version 1 0 beta1 October 2008 48 3 2 API for uPAC 7186EX To develop a custom program ensure that the files below are installed the Host PC lf they are not installed refer to section 2 2 Software Installation o Functions Library 7186e lib This file contains the MiniOS7 API Application Programming Interface and has hundreds of pre defined functions related to your controller o Header File 7186e h This file contains the forward declarations of subroutines variables and other identifiers used for the MiniOS7 API Standard M

Download Pdf Manuals

image

Related Search

Related Contents

Cromatix RGB3/15 Colour Controller Installation and Operating  Fraiseuses XMD Megaplot  Magnasonic DVD816 DVD Player User Manual  STRIGER - Interempresas  Samsung PS43D450A2W Uživatelská přiručka  A9GT-80R1 type RGB input interface module User`s Manual  USER MANUAL  manuel d`utilisation porte-outils pour rainurer  KitchenAid KSM150  apri PDF - Istituto Comprensivo Statale "G. VERGA"  

Copyright © All rights reserved.
Failed to retrieve file