Home
µPAC-5000 User Manual (C Language Based)
Contents
1. 45 2 5 2 Uploading and executing WPAC 5000 programs 50 2 5 3 Making programs start automatically 51 2 6 Updating UPAC 5000 OS Image 53 3 Hello World Your First Program 56 3 1 C Compiler Installation 57 3 1 1 Installing the C compiler 58 3 1 2 Setting up the environment variables 62 3 2 UPAC 5000 APIS 65 3 3 First Program in UPAC 5000 nnn nnn nenann nna 66 4 APIs and Demo References 76 4 1 API for COM Port 80 4 1 1 Types of COM port functions 81 4 1 2 API for MiniOS7 COM port 82 4 1 3 API for standard COM por
2. Windows application EXE a Project Type Use Microsoft EEEE oo ograd emo ma hello fo och o gt TBS gt DEMO gt MSC Hare CPD E HELLO List Files of Tope ea ae Project mak E c v UPAC 5000 Series C Language Based User Manual Version 1 0 2 Page 132 Copyright 2010 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com Step 3 Add the user s program and the necessary library files to the project Edit HELLO MAE File Hame Directories 1 88al lib co 1 edeademomecslib f1 oda lib co cy gt DEMO MSC B lib CG Board List Files of Type Drives Library lib E c McA Bika demakmechellahello c oN 1 boeakdemo mec libs r deyal lib Step 4 Set the Code Generation on the Compiler xj Project Type MS DOS application EXE Ok F Use Microsoft Foundation Classes Cancel Build Mode Help i Debug CiCl Compiler Options x Customize Build Options Compiler Linker Resources Build Options Debug Specific Release Specific C Common to Both 0K Options String Canes Mnologa Gs G1 AW AL Ox D NDEBUG D DOS FR A Help Ze Past Desis Use Project Defaults Category Code Generation Custom Options _ Custom Options C L Debug Options T Check Pointers M Disable Stack Checking
3. 3 1 Introduction 6 1 1 wPAC 5000 C Language Based 7 1 1 1 PAC 5000 Module Naming Convention 7 1 1 2 UPAC 5000 Comparison 8 1 2 FE atures nn nnn nnn nn nn e 16 1 3 Specifications 20 1 3 1 Common Specifications 20 1 3 2 GPS Specifications 21 1 3 3 2G GPRS Specifications 22 1 3 4 3G WCDMA Specifications 23 1 3 5 ZigBee Specifications 24 1 3 6 Wi Fi Specifications 25 1 4 Overview 26 1 5 DIMENSIONS aak a nnn nn n
4. 2G GPS 3G GPS Aa SS ae eee UPAC 5000 Series C Language Based User Manual Version 1 0 2 Page 7 Copyright 2010 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com 1 1 2 wPAC 5000 Comparison UPAC 5000 can be divided into eight types according to their features 1 General Series The following table provides a comparison of UPAC 5000 General Series specifications Memory Wiress RS 232 Flash SRAM Ethernet Expansion Communication RS 485 microSD uPAC 5001 D FD an MH 10 100 zZz 512KB 512 KB 1 1 256 MB Flash BaseTX MicroSD uPAC 5001 D SM 512 KB Battery Backup SRAM 2 GPS Series The following table provides a comparison of UPAC 5000 GPS Series specifications Memory Wiress RS 232 Flash SRAM Ethernet Expansion Communication RS 485 uPAC 5101 D microSD microSD 2 i 10 100 HPAC SIONDIED gomiz Sik FS12KE aoeniB tish GPS 1 1 BaseTX microSD uPAC 5101 D SM 512 KB Battery Backup SRAM UPAC 5000 Series C Language Based User Manual Version 1 0 2 Page 9 Copyright 2010 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com 3 2G GPRS Series The following table provides a comparison of UPAC 5000 2G GPRS Series specifications Memory Wiress RS 232 Flash SRAM Ethernet Expansion Communication RS 485 uPAC 5201 D microSD microSD 10 100 HPAC SZOMDIFD sowie 512KB S12 KB sem eene 2G GPRS 1 1 BaseTX
5. Calling Convertors P Code Generation CFC Precompiled Headers Preprocessor Floating Point Calls Code Generator Segment Names Use Emulator Auto Select Struct Member Byte Alignment 2 Bytes UPAC 5000 Series C Language Based User Manual Version 1 0 2 Page 133 Copyright 2010 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com Step 5 Change the Memory model large for uPAC5000 lib CACl Compiler Options Build Options Debug Specific Release Specific Common to Both Options String eae Toned Mnolaga Gs G1 AWG AL Ox D NDEBUG D DOS FR a Category Code Generation Custom Options Custom Options C g Debug Options Listing Fi Memory Model Optimizations P Code Generation Precompiled Headers Preprocessor Segment Hames Help Use Project Defaults Category Settings Memon Model agment Setup New Segment Data Size Threshold CF Assume extern and Uninitialized Data far Step 6 Remove the xcr afxcr library from the Input Category Build Options C Debug Specific Release Specific Common to Both Options String LIB scr ZLIB afecr LIB oldnames LIB slibce NOI PS TACK 5120 AOMNERROR NOESE OLOGO Category Memor Image Miscellaneous Output Remove the xer and afxcr Categor Settings Input M Distinguish Letter Case UPAC 5000 Series C Language Based User M
6. The software driver for the uPAC 5000 is an interrupt driven library that provides a 1K QUEUE buffer for each COM port The software is well designed and easy to use The MiniOS7 provides the same interface for all COM ports so each port can be used in the same way without any difficulty API for using COM ports 1 InstallCom Before using the COM port the COM port driver must be installed by calling InstallCom 2 RestoreCom If the program calls InstallCom the RestoreCom must be called to uninstall the COM port driver API for checking if there is any data in the COM port input buffer 3 IsCom Before reading data from COM port the IsCom must be called to check whether there is any data currently in the COM port input buffer API for reading data from COM port 4 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 API for sending data to COM ports 5 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 upac5ee e h void main void int quit 0 data InitLib Initiate the upac5000 library InstallCom 1 11520090L 8 1 Install the COM1 driver while quit if IsCom 1 Check if there is any data in the COM port input buffer data Re
7. Update MinioS Image 3 Moa Lock in Disk 4 i Hot List Ctrl D Size Ti No Name cr Exit Alb 3 n Fil E FIRMWAR E Fil we OS IMAGE Fil Oos m _ M F Ma BPO ia Wa Nama fats Step 4 Select the latest version of the MiniOS7 OS image Select MiniOS7 Imagr file Save rt Leos 0S Image aiea ra uPAC 5000_20100324 img UPAC 5000 Series C Language Based User Manual Version 1 0 2 Page 54 Copyright 2010 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com Step 5 Click the OK MiniOS7 Utility Verion 3 X Please wait a while for rebootuug Step 6 Click the Info from the Command menu to check the version of the OS image Z MiniOS Utility Ferion 3 2 1 Ga File Connection a Command E Configuration E Tools 2 Help eM ne DiskTool F6 Refresh FY Info i Size bin as B autoexec 16 2005 7 1 On Type i CS FIRMWARE fe YCE 323 64 236 2008 7 2 05_MAGE EEPROM ET isdeur4 Pack Disk icpdas Erase Disk S load232 al EE Mini0S7_Utility chm E Mini0S7_Utility exe Mini S7_Ltility ini uart dll Look ir TOPOS 72031P 1007 0 45 Port 10000 via TCF 2 files f Connection F2 E Uploads DiskTool F6 Fy InfoiF7 Delete Fa UPAC 5000 Series C Language Based User Manual Version 1 0 2 Page 55 Copyright 2010 ICP DAS Co Ltd All Rights Reserved E mail servic
8. Ltd All Rights Reserved E mail service icpdas com For example reading data from the microSD include lt string h gt include lt stdio h gt include upac5000 h include microSD h void main void int fd iRet unsigned char Buffer 80 InitLib if pc_init Print Init microSD ok r n else Print Init microSD failed r n iRet pc_ get _errno Switch iRet case PCERR_BAD_FORMAT 1 Print Error 01 format is not FAT r n break case PCERR_NO_CARD 2 Print Error 02 no microSD card r n break default Print Error 02d unknow error r n iRet break fd pc_open test txt word PO_RDONLY word PS_IWRITE PS_IREAD if fd gt 0 iRet pc_read fd Buffer 10 reads 10 bytes Buffer 10 0 adds zero end to the end of the string pc_close fd Print s Buffer For more demo program about the microSD please refer to CD NAPDOS uPAC 5000 Demo Basic microSD http ftp lcodas com pub cd 8000cd napdos upac 5000 demo basic microsd UPAC 5000 Series C Language Based User Manual Version 1 0 2 Page 108 Copyright 2010 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com 4 11 GSM API Function Required library and header files GSM lib and GSM lib OS7_COM lib and OS7_COM h 2G 3G is a service that allows information to be sent and received across a mobile telephone network It supports CSD Circuit Switched Dat
9. MiniOS7 COM port functions Standard COM port functions include lt stdio h gt include upac5000 h void main void unsigned char item InitLib InstallCom 1 115200 8 0 1 printCom 1 Press any key n printCom 1 Press the ESC to exit n for if IsCom 1 item ReadCom 1 if item g return else printCom 1 r n printCom 1 char ToCom 1 item printCom 1 r nASCII c r n item printCom 1 Hex 2X r n item Delay 10 RestoreCom 1 include lt stdio h gt include upac5 ee h void main void unsigned char item InitLib Print Press any key n Print Press the ESC to exit n for if Kbhit item Getch if item g return else Print P R Print char Putch item Print r nASCII c r n item Print Hex 2X r n item 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 Response Request cy na dp Inn Request Response a Debug information Command1 Command1 J Debug information Command2 Command2 Q Debug information Quick program Other command Debug info
10. ebur HONAMEHH CPP t mMer SESS EASES SEP sip al ri he fic Pee ee TL Ca UPAC 5000 Series C Language Based User Manual Version 1 0 2 Page 67 B il a oe el aa al eal cpa lee T MAALI AANIIRARSN IANK m ERN AA VA mall service i icodas com IE Eia Step 4 Type the following code Note that the code is case sensitive include demo basic lib upac50ee h Include the header file that allows uPAC5 00 lib functions to be used void main void InitLib Initiate the upac5 00 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 ii Type the file name Hello iii Select OK c CAWINDO WSicystem 2 cmd exe te Edit Search i NONAMEGEA C Print Get info DOS shell Quit Alt k ey CA VWINDO WS sy stem32tcmd exe tec SPEDE DODDS EEE PEDO Y C TCS HELLO CPP tiles gt a N N N Fi Help Enter directory path and file mask UPAC 5000 Series C Language Based User Manual Version 1 0 2 Page 68 Copyright 2010 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com Tips amp Warnings A You can write the code as shown below with your familiar text editor or other tools please note that you must save the source code under a filename that terminates with the extension C St
11. i GPS ET 87Pn ET 7000 2G 3G CAN 8000 Series CAN 20000 Series e ZigBee peu Boi e Wi Fi CAN B124 CAN 8224 CAN 8424 CAN 2018C CAN 2088C Rnet T i ip FR 2053iT FR 205 71T FR 2054T UPAC 5000 Series C Language Based User Manual Version 1 0 2 Page 17 Copyright 2010 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com Various Memory Expansions UPAC 5000 provides various memory storage options such as EEPROM Flash battery backup SRAM or microSD Users can choose the memory based on their characteristics e 16KB EEPROM to store not frequently changed parameters e microSD to implement portable data logging applications max of 2 GB on the MiniOS7 platform max of 32 GB on Linux and WinCE platforms e 256 MB NAND Flash rugged data storage to resist shock and vibration e 512 KB battery backup SRAM to retain data while power lost for 5 years no write cycle limitation gt Unique 64 bit Hardware Serial Number to Protect Your Program A unique 64 bit serial number is assigned to each hardware device to protect your software against piracy gt Small and Easy Installation ii DiDi m EER iii pe uPAC 5000 series have a slender shape 91 mm x 132 mm x 52 mm to be installing in a narrow space with DIN Rail z i m es LLLA E TL Se HG LSE el ee UPAC 5000 Series C Language Based User Manual Version 1 0 2 Page 18 Copyright 2010 ICP DAS Co Ltd
12. uPAC 5000 User Manual C Language Based Version 1 0 2 Jan 2012 Service and usage information for UPAC 500x D Series UPAC 510x D Series UPAC 520x D Series UPAC 530x D Series UPAC 54xx D Series UPAC 560x D Series UPAC 570x D Series 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 2011 by ICP DAS Co Ltd All rights are reserved Trademark The names used for identification only may be registered trademarks of their respective companies Contact US If you have any problem please feel free to contact us You can count on us for quick response Email service icpdas com UPAC 5000 Series C Language Based User Manual Version 1 0 2 Page 2 Copyright 2010 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com Table of Contents Table of Contents
13. All Rights Reserved E mail service icpdas com gt Plastic and Metal Housing The default case is plastic material Metal casing is also offered to provide extra security gt Redundant Power Inputs To prevent the WPAC 5000 from failing by the power loss the power module is designed with two input connectors Once a power input fails the power module switches to the other power input And there is a relay output for informing the power failure gt Highly Reliable Under Harsh Environment The wPAC 5000 operates in a wide range of temperature and humidity e Operating Temperature 25 C 75 C e Storage Temperature 40 C 80 C e Humidity 10 95 RH non condensing UPAC 5000 Series C Language Based User Manual Version 1 0 2 Page 19 Copyright 2010 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com 1 3 Specifications 1 3 1 Common Specifications Models uPAC5000 Series uPAC5000 FD Series uPAC5000 SM Series System Software MiniOS7 DOS like embedded operating system Program Upload Interface RS 232 COM1 or Ethernet Programming Language C language TC 1 01 TC2 01 BC 3 1 5 2x Compilers to Create exe Files MSC 6 0 MSVC Prior to version 1 5 2 CPU Module C T e A E SSCS a Communication Ports LED Indicator Hardware Expansion Mechanical e DNR Environmental 10 90 RH non condensing Power C UPAC 5000 Series C Language
14. C Language Based User Manual Version 1 0 2 Page 126 Copyright 2010 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com Step 4 Change the Memory model Large for uPAC5000 lib ol CAWINDO WStsystem32 emd exe I File Edit Search kun Compile Assume an DS fine ii Step 5 Set the Advanced code generation options and Set the Floating Point to Emulation and the Instruction Set to 80186 cy CAWINDO WSisystem32 cmd exe be Fi Help Tae Data hreshold ERA Se ae UPAC 5000 Series C Language Based User Manual Version 1 0 2 Page 127 Copyright 2010 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com Step 6 Set the Entry Exit Code Generation option and setting the DOS standard ec CAWINDOWS SS ystem32icod exe be muted oject le Debug Pr a HOANAMERR CPP attan options a Pb Source Step 7 Choosing the Debugger and set the Source Debugging to None File Edit Search Run Compile Debug Project Window Help C DOCUME 1 ADMI NI 1 NONAMESS Application Compiler Transfer Make Directories a Fnuirnnment program Heap Size EZA K bytes UPAC 5000 Series C Language Based User Manual Version 1 0 2 Page 128 Copyright 2010 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com Step 8 Make the project oc CARWINDO WS system37 cmd exe be cee HEE Edit ot Run
15. C Language Based User Manual Version 1 0 2 Page 38 Copyright 2010 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com 2 4 Boot Configuration Before you upload some programs to uPAC 5000 you need to enter the Init mode and disable the Write Protection Make sure the switch of the Lock placed in the OFF position and the switch of the Init placed in the ON position UPAC 5000 Series C Language Based User Manual Version 1 0 2 Page 39 Copyright 2010 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com 2 5 Uploading uPAC 5000 Programs MiniOS7 Utility is a suite of tool for managing MiniOS7 devices uPAC 5000 iPAC 8000 uPAC 7186 etc It s comprised of four components System monitor communication manager file manager and OS loader Before you begin using the MiniOS7 Utility to upload programs ensure that uPAC 5000 is connected to PC The upload process has the following main steps 1 Establishing a connection between PC and uwPAC 5000 2 Uploading and executing programs on wPAC 5000 3 Making programs start automatically All of these main steps will be described in detail later 2 5 1 Establishing a connection between PC and pPAC 5000 There are two ways to establish a connection between PC and wPAC 5000 1 RS 232 connection 2 Ethernet connection rm S A namam m a a a a a a a a o Each of the connection types will be
16. microSD uPAC 5201 D SM 512 KB Battery Backup SRAM UPAC 5000 Series C Language Based User Manual Version 1 0 2 Page 10 Copyright 2010 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com 4 3G WCDMA Series The following table provides a comparison of uPAC 5000 3G WCDMA Series specifications Memory Wiress RS 232 Flash SRAM Ethernet Expansion Communication RS 485 uPAC 5301 D microSD microSD i i 10 100 HPACSSONDIPD sowie Sik S12 KB aoeniB tish 3G WCDMA 1 1 BaseTX microSD uPAC 5301 D SM 512 KB Battery Backup SRAM UPAC 5000 Series C Language Based User Manual Version 1 0 2 Page 11 Copyright 2010 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com 5 ZigBee Series The following table provides a comparison of UPAC 5000 ZigBee Series specifications Memory Model CPU Flash SRAM Expansion uPAC 5401 D microSD uPAC 5411 D uPAC 5401 D FD ern 80 MHz 512 KB 512 KB UPAC 5411 D FD 256 MB Flash microSD 512 KB Battery Backup SRAM UPAC 5401 D SM UPAC 5411 D SM RS 232 RS 485 Wiress Ethernet ad p ZigBee ZigBee Host ZigBee Slave 10 100 ZigBee Host PRIA ZigBee 3 pee ZigBee Host ZigBee ZigBee slave 6 Wi Fi Series The following table provides a comparison of UPAC 5000 Wi Fi Series specifications Memory Wiress RS 232 CPU Flash SRAM Ethernet Expansion Communication RS 485 uPAC 550
17. 4 Enter the path to the directory you wish to install files to BEE co Turbo C 2nd Edition Installation Utility OO a errs Enter the path to the directory containing the Turbo C files MENTER Select ESC Page 59 UPAC 5000 Series C Language Based User Manual Version 1 0 2 ilk carvica ic EE CO dalal aVsay ail a b 1 tee Jt V ON P PEERS Ali LA Gre 7 IC Al itu 4 O27 wD pwi ii me Step 5 Select Start Installation to begin the install process cs CADOCUME 1 0 seria titepp101UNS TALL EXE Turbo C 2nd Edition Installation Utility Turbo G Directory HKinary Files Subdirectory Header Files Subdirectory Library Subdirectory EGI Subdirectory Tour Subdirectory Class Library Subdirectory Examples Subdirectory ce WG C IC BIN C TC INCLUDE C XICNLIB C IC BGI C ICNIOUR C TIC CLASSLIB C ITC EXAMPLES Yes Yes amp MHCLH Description Selecting Creeper vill begin copying Files to your hard drive into the directories specified above Start Installation Fi Help F Start the installation ENTER Select ESC Previous Step 6 Press any key to continue es CADOCUME 1 O0sertst iitcpp101UNS TALL EXE Turbo C 2nd Edition Installation Utility Turbo C 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 shoul
18. Before uploading and executing UPAC 5000 programs you must firstly establish a connection between PC and wPAC 5000 for more detailed information about this process please refer to section 2 5 1 Establishing a connection between PC and wPAC 5000 Step 1 On PC side right click the file name that you wish to upload and then select the Upload PA MiniOS Utility Verion 3 1 7 3 GH File b Connection te Command Configuration T Tools Help Name Size Type No Name Size Modified m Helo ERB Application Upload Upload amp Execute E M Update MimOs Image Tis G11 Step 2 On the module side right click the file name that you wish to execute and then select the 1 Run A MiniOS Utility Yerion 3 1 7 GH File b Connection te Command Configuration 7 Look in Hell Leckin DskA M aP Name Size Type No ee Modified E Halo 187KB Application g hello ere l l 1 J oc ttt FES J 2 BF eee Run Run with parameters Reset Mims F4 i 2 5 3 Making programs start automatically After upload programs on the wPAC 5000 if you need programs to start automatically after the UPAC 5000 start up it is easy to achieve it to create a batch file called autoexec bat and then upload it to the wPAC 5000 the program will start automatically in the next start up For example to mak
19. CD NAPDOS upac 5000 Demo basic Lib 01_ Lib Update History_20100507 txt http ftp icodas com pub cd 8000cd napdos upac 5000 demo basic lib O1 Lib Update History 201 00507 txt Before creating the application ensure them that you have installed If they are not installed please refer to section 2 3 Software Installation 3 3 First Program in pPAC 5000 Here we assume you have installed the Turbo C 1 01 as the section 3 1 C Compiler Installation and the wPAC 5000 APIs as the section 2 3 Software Installation under the C driver root folder Below are step by step instructions for writing your first program Step 1 Open a MS DOS command prompt i Select Run from the Start menu ii On the Run dialog box type cmd iii Click the OK button document or mill open it For you p and Support fw Fun lt Shut Gown sta g cy CW IRDO W S 1 Syske Windows XP Professional Step 2 At the command prompt type TC and then press Enter coy Microsoft Windows XP CUersion 5 1 2600 KC Copyright 1985 26601 Microsoft Corp C Documents and Settings Administrator gt Tt Step 3 Select New from the File menu to create a new source file BEE Debug j Opt ions Window H 1 WEE Open Save Save as BEE File Edit Search Run Compile Debug Project Options Window Help
20. Copyright 2010 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com Appendix B What is MiniOS7 Utility a TT mni IAA F i Lh TE Ta T TF au e TE i o mih TI HTE amp l Wia ig TI TS i be i ms 3 TR ee yu E as i AY rw oe aih ra jo wH P TF hi T w nb i J oer af g pf aeei p E x esac OT Ba SE vF COA wadii a 7 3 J Det el jeer ee CEY ee Functions e Supported connection ways 1 COM port connection RS 232 2 Ethernet connection TCP and UDP Supported since version 3 1 1 e Maintenance 1 Upload file s 2 Delete file s 3 Update MiniOS7 image e Configuration 1 Date and Time 2 IP address 3 COM port 4 Disk size Disk A Disk B e Check product information 1 CPU type 2 Flash Size 3 SRAM Size 4 COM port number CLG Upload location MiniOS7 Utility is a tool for configuring uploading files to all products embedded with ICP DAS MiniOS7 Since version 3 1 1 the Utility can allow users remotely access the controllers 7188E 8000E etc through the Ethernet Including frequently used tools a 7188XW b 7188EU c 7188E d Send232 UPAC 5000 Series C Language Based User Manual Version 1 0 2 Page 118 Copyright 2010 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com Appendix C What is MiniOS7 File System MFS MiniOS7 file system MEFS offers a rugged alternative to mechanical stora
21. EXE file HELLO EKE Linking BC3i L B CL LIB Total Link Lines compiled 1257 PAES 2 Warnings amp 5 Errors amp 4 Available memory 197 7EK Y Success Fi Help Bring target up to date by compiling and linking as necessary UPAC 5000 Series C Language Based User Manual Version 1 0 2 Page 129 Copyright 2010 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com D 3 MSC 6 00 Step 1 In the source file folder create a batch file called Gomsc bat using the text editor E Untitled Notepad Fie Edt Format vow Help el ve Ga FPa Fm Gl AL HELLG c link Ma NOE NOI HELLO 41lib 7188xbl 1 The source code 2 The object file name 3 The path of the functions library Tip amp Warnings 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 os CAWINDO ASS ystem32 cmd exe C 7188XA Demo MSC Hel 1o gt Gomsc C 7188XA Demo MSC Helloscl 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 7188XA Demo MSC Hello gt link MA NOE NOI Hello l1b 7188xal icrosoft 68 Segmented Executable Linker Version 5 10 Copyright C Microsoft Corp 1984 1990 All rights reserved C 71L88xXA Demo MSC Hello gt del obj C 7188XA Demo MSC Hello gt del map C 7188X
22. Flash Memory For example to write an integer to segnment OxDOOO offset 0x1234 of the Flash memory include lt stdio h gt include upac5ee e h void main void int data 0xAA55 data2 char dataptr int dataptr2 InitLib Initiate the upac5000 library EraseFlash xd0ee Erase a block from the Flash memory dataptr char amp data Flashwrite xd0e0 x1234 dataptr FlashwWrite xd0e0 x1235 dataptr Read data from the Flash Memory method 1 dataprt char amp data2 dataptr FlashRead xd0 0 x1234 dataptr 1 FlashRead xd0e 0 x1235 Read data from the Flash Memory method 2 dataptr2 int far _MK_FP xd0 0 0x1234 data data UPAC 5000 Series C Language Based User Manual Version 1 0 2 Page 94 Copyright 2010 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com 4 5 API for NVRAM e The uPAC 5000 equip an RTC Real Time Clock 31 bytes of NVRAM can be used to store data e NVRAM is SRAM but it uses battery to keep the data so the data in NVRAM does not lost its information when the module is power off e NVRAM has no limit on the number of the re write times Flash and EEPROM both have the limit on re write times If the leakage current is not happened the battery can be used 10 years API for writing data to the NVRAM 1 WriteNVRAM The WriteNVRAM must be called in order to write data to the NVRAM API for
23. GSM modem Since the modem status can affect sending receiving this function should be called by your main program loop periodically and also whenever data transmission is required API functions for sending receiving SMS over GSM 4 GM_SMS_SendMsg Send an SMS message to the recipient phone You need to specify the receiver phone number and the message content 5 GM_SMS_GetNewMsg Receive incoming SMS message via GSM modem UPAC 5000 Series C Language Based User Manual Version 1 0 2 Page 110 Copyright 2010 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com Here is an example of sending SMS messages to the recipient phone via GSM modem include lt stdlib h gt include lt string h gt include upac5ee e h include OS7 COM h include GSM h void main void strEncode Msg SendMsg SYSProfile sysProfile int iRet sendStatus char bSend Act InitLib initialize the GSM modem strcpy sysProfile PINCode 9 0 if you are using a SIM that has a PIN you must enter the pin or your SIM will be blocked by your mobile operator sysProfile modemPort 11 modem port number uPAC 5000 11 sysProfile hardware 2 hardware type uPAC 5000 2 if iRet GM SYS InitModem sysProfile GM_NOERROR Print Failed to initiate the modem Error Code d r n iRet return check whether the GSM modem is ready to service while GM_SYS_ CheckModemStatus G
24. Key Thread UPAC 5000 Series C Language Based User Manual Version 1 0 2 Page 75 Copyright 2010 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com 4 APls and Demo References There are several APIs and demo programs that have been designed for uwPAC 5000 You can examine the APIs and demo source code which includes numerous functions and comments to familiarize yourself with the MiniOS7 APIs and quickly develop your own applications quickly by modifying these demo programs The following table lists the APIs grouped by functional category API Description Header File Library 256 MB Flash Disk driver MES h MFS V212 lib For more detailed information regarding UPAC 5000 APIs please refer to CD NAPDOS upac 5000 Demo basic Lib 01_ Lib Update History_20100507 txt http ftp icodas com pub cd 8000cd napdos upac 5000 demo basic lib O1 Lib Update History 201 00507 txt UPAC 5000 Series C Language Based User Manual Version 1 0 2 Page 76 Copyright 2010 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com The following introduces the core API MiniOS7 API which is integrated into the uPAC5000 API set Functions Library uPAC5000 lib This file contains the MiniOS7 API Application Programming Interface and has hundreds of pre defined functions related to uPAC 5000 Header File uPAC5000 h This file contains the forward declarations of subroutines variables and other ide
25. Step 2 Connect the wPAC 5000 to PC and setting up the power supply The WPAC 5000 equip an RJ 45 Ethernet port for connection to an Ethernet hub switch and PC and powered by a standard 12 Vpc power supply gt External power supply via a standard 12 Vpc power supply i Connect PC to LAN port of u PAC 5000 ii Connect the power supply 12 48 V to PWR1 and GND terminals of uPAC 5000 a a Suir r 12 48 Voc Power Supply UPAC 5000 Series C Language Based User Manual Version 1 0 2 Page 34 Copyright 2010 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com 2 2 GSM Series Installation For first time users please follow the steps below to complete the pre installation 2 2 1 Installing the SIM card With the contact area face up insert the SIM card into the SIM card holder Make sure the SIM card fits in the SIM card holder properly and in the correct direction The contact area on the SIM card should be facing upward To eject SIM card simply use you finger nail and apply slight pressure OS a ae ee ee ee ee es ee ee g m eee Ce a oo eee eee i e m m Tips amp Warnings AN Always power off uPAC 5000 before installing or taking out SIM card 2 2 2 Installing the GSM antenna You need to install the antenna before using the GSM series module Install the GSM antenna to antenna connector on the top panel tightly Please refer to the fig
26. 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 For example the following code can be used to read the main time ticks from 0 include lt stdio h gt include upac5ee e h void main void Unsigned long time iTime InitLib Initiate the upac5000 library TimerOpen While quit If Kbhit TimerResetValue Reset the main time ticks to iTime TimerReadValue Read the main time ticks from TimerClose Stop using the uPAC5000 timer function UPAC 5000 Series C Language Based User Manual Version 1 0 2 Page 99 Copyright 2010 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com 4 8 API for WatchDog Timer WDT e The uPAC 5000 equips the MiniOS7 the small cored operating system MiniOS7 uses the Timer 2 A CPU internal timer as system Timer It is 16 bits Timer and generate interrupt every 1 ms So the accuracy of system is 1 ms e The Watch Dog Timer is always enabled and the system Timer ISR Interrupt Service Routine refreshes it e The system is reset by WatchDog The timeout period of WatchDog is 0 8 seconds API for refreshing WDT 1 EnableWDT The WDT is always enabled before user s programming to refres
27. What is MiniOS7 117 Appendix B What is MiniOS7 Utility 118 Appendix D More C Compiler Settings 122 D 1 Turbo C 2 01 123 D 2 Borland C 3 1 126 Ba SC O OO ce 130 D 4 MSVC I Oee 22 222 nena cee 132 UPAC 5000 Series C Language Based User Manual Version 1 0 2 Page 5 Copyright 2010 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com 1 Introduction Rich Development Tools HPAC 5000 Famil 5 Digit LED Display j microSD Various Local 1 0 Communications Expansion Board snae ayes k E ey rien More than 10 WO XW Doard are supported UPAC 5000 family is a palm size PAC It can install in narrow space and survive in harsh environment For different applications uPAC 5000 family offers 3 series uPAC 5000 LP 5000 and WP 5000 Customers who needs MiniOS 7 Linux or WinCE all can find a product to fit their requirement UPAC 5000 family offers two CPU types 80186 PXA270 3 OS solutions WinCE 5 0 Linux MiniOS7 and several software development toolkits C VS NET ISaGRAF InduSoft for chosen and all of them are featured same stability and flexibility as ICP DAS s P
28. described in detail later a RS 232 connection Below are step by step instructions on how to connect to PC using a RS 232 connection Step 1 Ensure the switch of the Lock is in the OFF position and the switch of Init is ON position Then reboot the uPAC 5000 Step 2 Use the RS 232 Cable CA 0910 to connect to PC eee cy em r eee Step 3 Run the MiniOS7 Utility Step 4 Click the New connection function from the Connection menu Z Config Last Connection Alt F2 _ t Disconnect Ctrl F2 bin Search Fi2 ia A Step 5 On the Connection tab of the Connection dialog box choose the COM port that your uPAC 5000 is connecting to and then click OK ne TA Connection Connection History Pork 110000 UPAC 5000 Series C Language Based User Manual Version 1 0 2 Page 43 Copyright 2010 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com Step 6 The connection has already established P MiniOS Utility Yerion 3 1 7 Lau File l Connection Command Configuration T Tools Help Look in O Mini 7 Utility Name eto odified tin Ca FIRMWAR gt Connection F2 Refresh FS UPAC 5000 Series C Language Based User Manual Version 1 0 2 Page 44 Copyright 2010 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com b Ethernet Connecti
29. iRet InitLib initialize the GSM modem strcpy sysProfile PINCode 9 0 if you are using a SIM that has a PIN you must enter the pin or your SIM will be blocked by your mobile operator sysProfile modemPort 11 modem port number uPAC 500 11 sysProfile hardware 2 hardware type uPAC 5000 2 if iRet GM SYS InitModem sysProfile GM_NOERROR Print Failed to initiate the modem Error Code d r n iRet return check whether the GSM modem is ready to service while GM_SYS_ CheckModemStatus GM NOERROR DelayMs 1000 J Print GSM modem registered r n UPAC 5000 Series C Language Based User Manual Version 1 0 2 Page 112 Copyright 2010 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com for if Kbhit amp amp Getch q break press q to exit the program if GM_SYS CheckModemStatus GM NOERROR continue if GM SMS GetNewMsg amp RecMsg Print r n r n Print phone number s r n RecMsg phoneNumber Print receive time s r n RecMsg time Print mode d r n RecMsg mode Print message length d r n RecMsg dataLen if RecMsg mode Print message s r n RecMsg msg else Print message r n for i 0 i lt RecMsg dataLen i Print 02X unsigned char RecMsg msg i Piette Ni le ee r n J before exiting program the modem should
30. reading data from the NVRAM 2 ReadNVRAM The ReadNVRAM must be called in order to write data to the NVRAM For example use the following code to write data to the NVRAM address 0 include lt stdio h gt include upac5ee e h void main void int data 0x55 data2 InitLib Initiate the upac5000 library WriteNVRAM data data2 ReadNVRAM Now data2 data 0x55 j UPAC 5000 Series C Language Based User Manual Version 1 0 2 Page 95 Copyright 2010 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com For example the following can be used to write an integer two bytes to NVRAM include lt stdio h gt include upac5ee e h void main void int data 0xAA55 data2 char dataptr char amp data InitLib Initiate the upac5000 library WriteNVRAM dataptr Write the low byte WriteNVRAM 1 dataptr 1 Write the high byte dataptr char amp data2 dataptr ReadNVRAM Read the low byte dataptr 1 ReadNVRAM 1 Read the high byte UPAC 5000 Series C Language Based User Manual Version 1 0 2 Page 96 Copyright 2010 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com 4 6 API for 5 Digital LED The wPAC 5000 contains a 5 Digit 7 SEG LED with a decimal point on the right hand side of each digit which be used to display numbers IP addresses time and so on _ o API for starting the 5 Di
31. usage and virtual memory Settings User Protiles Desktop settings related to your logon Settings mMoironment Variables Startup and Recovery System startup systern failure and dy User variables For Administrator Variable Value TEMP C Documents and Settings 4dministrat TMF Documents and SettingsiAdministrat Environment Yarnables j x JC Ee m eT System variables Variable Value Com Spin WINDOWS systemse cmd exe MUOMBER 1 OS Windows MT L OW INOC WS Sy stems CEHE Ww INOC MAS fara PATHEST COM ESE BAT CMD WBS WBE I5 UPAC 5000 Series C Language Based User Manual Version 1 0 2 Page 63 Copyright 2010 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com 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 UPAC 5000 Series C Language Based User Manual Version 1 0 2 Page 64 Copyright 2010 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com 3 2 uPAC 5000 APIs There are several APIs for customizing the standard features and integrating with other applications devices and services For more detailed information regarding UPAC 5000 APIs please refer to
32. 0 1 amp data EE WriteProtect EE MultiRead 1 10 1 amp data2 Now data2 data x55 UPAC 5000 Series C Language Based User Manual Version 1 0 2 Page 92 Copyright 2010 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com 4 4 API for Flash Memory e The uPAC 5000 module contains 512K bytes of Flash memory e MiniOS7 uses the last 64K bytes the other parts of the memory are used to store user programs or data Each bit of the Flash memory only can be written from 1 to 0 and cannot be written from 0 to 1 Before any data can be written to the Flash memory the flash must be erased first which returns all data to OxFF meaning that all data bits are set to 1 Once there is completed new data can be written Free 448K bytes O x A000 MiniOS7 64K bytes Ozeo Total Size 512K bytes E o E000 O x FOOO API for erasing data from the Flash Memory 1 EraseFlash The only way to change the data from 0 to 1 is to call the EraseFlash function to erase a block from the Flash memory UPAC 5000 Series C Language Based User Manual Version 1 0 2 Page 93 Copyright 2010 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com API for writing data to the Flash Memory 2 FlashWrite The FlashWrite must be called to write data to the Flash Memory API for reading data from the Flash Memory 3 FlashRead The FlashRead must be called to read data from the
33. 1 D microSD microSD i 10 100 Wi Fi HPAC SSONDPED T cone 512KB SIKE sence 1 1 BaseTX 802 11 b g microSD uPAC 5501 D SM 512 KB Battery Backup SRAM UPAC 5000 Series C Language Based User Manual Version 1 0 2 Page 13 Copyright 2010 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com 7 2G GPRS GPS Series The following table provides a comparison of UPAC 5000 2G GPRS GPS Series specifications Memory Wiress RS 232 CPU Flash SRAM Ethernet Expansion Communication RS 485 uPAC 5601 D microSD microSD g 10 100 HPAC SCOMNOED I goinz SIP ke SIKE JsEniB Fih 2G GPRS GPS 1 1 BaseTX microSD uPAC 5601 D SM 512 KB Battery Backup SRAM UPAC 5000 Series C Language Based User Manual Version 1 0 2 Page 14 Copyright 2010 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com 8 3G WCDMA GPS Series The following table provides a comparison of uPAC 5000 3G WCDMA GPS Series specifications Memory Wiress RS 232 CPU Flash SRAM Ethernet Expansion Communication RS 485 uPAC 5701 D microSD uPAC 5701 D FD microSD 40 100 3G wcDMa Basel X GPS microSD uPAC 5701 D SM 512KB Battery Backup SRAM UPAC 5000 Series C Language Based User Manual Version 1 0 2 Page 15 Copyright 2010 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com 1 2 Features gt Various CPU and OS for Choos
34. 1 P GND 12 PWR1 Power Input 1 13 P GND i UPAC 5000 Series C Language Based User Manual Version 1 0 2 Page 29 Copyright 2010 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com 1 5 Dimensions All dimensions are in millimeters 113 5 123 0 a Y D CEWE EEEE ETTA UPAC 5000 Series C Language Based User Manual Version 1 0 2 Page 30 Copyright 2010 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com 1 6 Companion CD This package comes with a CD that provides drivers software utility all of the required documentations etc All of them are listed below ODN Elerelers uPAC 5000 Tene Demos related to uPAC 5000 Data Sheet Documents related to uPAC 5000 OS images related to uPAC 5000 PC Tools MiniOS7_ Utility Tools related to uPAC 5000 UPAC 5000 Series C Language Based User Manual Version 1 0 2 Page 31 Copyright 2010 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com 2 Getting Started If you are a new user begin with this chapter it includes a guided tour that provides a basic overview of installing configuring and using the wPAC 5000 Before beginning any installation please check the package contents If any items are damaged or missing please contact us In addition to Quick Start Guide the package includes the following items uPAC 5000 Software Utility CD
35. A Demo MSC Hel 1o gt _ UPAC 5000 Series C Language Based User Manual Version 1 0 2 Page 130 Copyright 2010 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com Step 3 A new executable file will be created if it is successfully compiled cy CAWINDOWS S ystem32 cmd exe c 7188XA Demo MSC Hel lo gt dir Volume in drive C has no label Volume Serial Number 1s 1072 89A3 Directory of C 7188XA Demo MSC Hel lo 2006 05 29 2006 05 29 2006 05 29 2006 05 29 2006 05 29 08 lt DIR gt 08 03 47 08 6 71 a p 3 File s 7 496 bytes 2 Dir s 22 041 571 328 bytes free C 7188xXA Demo MSC Hel lo gt _ UPAC 5000 Series C Language Based User Manual Version 1 0 2 Page 131 Copyright 2010 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com D 4 MSVC 1 50 Step 1 Run MSVC exe a Microsoft Visual C DEMO4 MAE File Edit Yew Project Browse Debog Toole Options Window Help lt 2 gt DATIBSEVICPIZSER VER DEMO MSYC 1 _5 iDEMONDAVSER C include strina h gt include pemaos include g void Use Project Name Oo o Browse toe lt a d pz Pr Browse ee z ed5 MAK Ea List Files of Type Oo RERA kerasa Project mak j E d ICFDATA r h oe Step 2 Create a new project mak by entering the name of the project in the Project Name field and then select MS DOS application EXE as the Project type Hew Project
36. AC family This makes WPAC 5000 have a good potential to apply to factory automation building automation machine automation manufacturing management environment monitoring etc Besides combining one of the optional expansion boards XW boards for uPACs such as DI DO A D D A Timer Counter communication interface RS 232 422 485 CAN FRnet etc customers can customize the hardware specification of their uPAC 5000 for different situations UPAC 5000 Series C Language Based User Manual Version 1 0 2 Page 6 Copyright 2010 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com 1 1 wPAC 5000 C Language Based 1 1 1 pwPAC 5000 Module Naming Convention As you examine this manual you ll notice there are many different products available Sometimes it is difficult to remember the specifications for any given product However if you take a few minutes to understand the module naming conventions it may save you some time and confusion The figure below shows how the module naming conventions work for each WPAC 5000 product The wPAC 5000 series are divided into eight series the General GPS 2G GPRS 3G WCDMA Zigbee D WiFi 2G GPS and 3G GPS series UPAC 5 X o D Wireless Communication Display or Casing Memory None 1 Cc aia based D LED Display FO 256 MB Flash GPS 7 SaGRAF M Metal Casing SM 512 KB Battery 2G GPRS Backup SRAM 3G WCDMA ZigBee WHA 802 11 b g
37. 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 Outputs a string to the COM1 and appends a newline character 4 Putch For sending one character Outputs a character to the COM1 API for showing data from standard I O port 5 Print Functions such as printf in the C library allow data to be output from the COM1 For example reading and receiving data through COM1 include lt stdio h gt include upac5ee e h void main void int quit 0 data InitLib Initiate the upac5000 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 g quit 1 If q is received exit the program j i For example showing data through COM1 include lt stdio h gt include upac5ee e h void main void int 1 InitLib Initiate the upac5eee library for i 0 i lt 10 i Print Test d r n i UPAC 5000 Series C Language Based User Manual Version 1 0 2 Page 86 Copyright 2010 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com 4 1 4 Port functions Comparison For example learning to show the ASCII code
38. Based User Manual Version 1 0 2 Page 20 Copyright 2010 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com 1 3 2 GPS Specifications GPS specifications of tPAC 5100 wPAC 5600 and wPAC 5700 series Channels 32 channels all in view tracking Sensitivity 159 dBm Acquisition Rate Cold start 42 seconds warm start 35 seconds reacquisition rate 0 1 second Accuracy Position 25 m CEP S A off Velocity 0 1 second S A off Time 1 ms Protocol 1 3 3 2G GPRS Specifications 2G GPRS specifications of UPAC 5200 and wPAC 5600 series 2G GPRS Band 850 900 1800 1900 MHz GPRS Multi slot Class 10 8 1 3 4 3G WCDMA Specifications 3G WCDMA specifications of uPAC 5300 and uPAC 5700 series 3G WCDMA Band UMTS 2100 1900 850 MHz UMTS HSDPA HSUPA Data Transfer Upload Max 5 76 Mbps Download Max 7 2 Mbps CPU Module Band 850 900 1800 1900 MHz 1 3 5 ZigBee Specifications ZigBee specifications of UPAC 5400 series ZigBee Host ZigBee Slave Receive sensitivity 102 dBm 1 3 6 Wi Fi Specifications Wi Fi specifications of UPAC 5500 series CPU Module Frequency Range 2 412GHz 2 484GHz WEP 64 WEP 128 WPA TKIP WPA AES Receive sensitivity 87 dBm IEEE 802 11b 72 dBm IEEE 802 118 12 dBm IEEE 302 11b 14 dBm IEEE 802 118 1 4 Overview Here is a brief overview of the components and its descriptions for module status Front Panel The LED
39. ELLO OBJ Total compiled 1573 Warnings Errors H Fi Help Alt F8 Mext Msg Alt F Prev Msg Alt F Compile F Make Fi Menu Step 13 Configure the operating mode Make sure the switch of the Lock placed is in the OFF position and the switch of the Init placed is in the ON position UPAC 5000 Series C Language Based User Manual Version 1 0 2 Page 74 Copyright 2010 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com Step 14 Create an autoexec bat file Untitled Notepad SRE HELLO exe li Type the HELLO exe iii Save the file as autoexec bat Step 15 Upload programs to uPAC 5000 using MiniOS7 Utility For more detailed information about this process please refer to section 2 5 1 Establishing a connection between PC and wPAC 5000 P MiniOS Utility erion 3 1 7 3 i File b Connection de Command Configuration T Tools lt 2 Help Look in 3 Mini0 _Utility w Lock in Disk A Name Size pe Heo Name Size Modified bin File Folder 0 helloere 138 928 2008 69 G FIRMWARE File Folder 1 autoexec 25 2005 8 9 C 05_IMAGE File Folder icpdas 1KB 8 load 32 dll SKE E Mini0 S7_Utiity chm 1 025KB e UDP Connect to 10 1 0 224 23 path D SYS TEM One is the Hello application file and the AutoRun HELLO EXE Autodownload Files Mone other IS the Current work directory D 5SYSTEM autoexec bat batch file Begin
40. For more information please refer to CD 8000 NAPDOS 8000 841x881x Demo hello Hello_C gotc bat tcc Ic tc include Lc tc lib helloi c Demo basic Lib uPACS5000 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 C WINDO WS ystem32tcmd exe d ie20 ite kun Gompile Project Options Debug Break watch N TE 19 Insert Indent Tab Fill Unindent D NONAME C Message Fi Help F5 Zoom F Switch F Trace F Step F9 Make Fifl Menu BILE UPAC 5000 Series C Language Based User Manual Version 1 0 2 Page 123 Copyright 2010 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com Step 3 Save the project and entering a name such as LED prj WINDO WSS y O x File Edit Run Compile ao Options Debus Break watch Colts Insert Indent Tab Firs E D NONAME C Ir 0S shell Quit Alt Step 4 Load the Project File Edit Run fe Line 1 er a i Inserti Project name LED PRJI Break male on Errors Step 5 Change the Memory model Large for uPAC5000 lib and set the Code Generation to 80186 80286 File Edit Run Compile cence Dpt ions Debug Break watch it Line i Col i Insert Indent Ta NONAME C Model Large Def ines Code generation Calling convention C Instruction set 80186 80286 Floating point Emulation Default char type Signed Alignment Generate
41. M NOERROR DelayMs 1000 Print GSM modem registered r n for if Kbhit continue if Act Getch q break press q to exit the program else if Act s continue press s to send a SMS text massage and any other key 1S ignored bSend 0 while bSend if GM SYS CheckModemStatus GM_NOERROR continue Switch sendStatus GM SYS CheckCmdStatus case GM READY specify the phone number that you are sending the message to strcpy SendMsg phoneNumber 1234567890 SendMsg mode GSM_ 7BIT strcpy SendMsg msg hello world SendMsg dataLen strlen SendMsg msg GM_SMS_SendMsg SendMsg send an ASCII message break UPAC 5000 Series C Language Based User Manual Version 1 0 2 Page 111 Copyright 2010 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com case GM NOERROR Print send success r n bSend 1 break case GM_BUSY break default Print send error and skip this one error code d r n sendStatus bSend 1 break i i before exiting program the modem should be shut down GM_SYS CloseModem close the modem not turn off the modem 1 turn off modem Here is an example of receiving incoming SMS messages via GSM modem include lt stdlib h gt include lt string h gt include upac5ee e h include OS7_COM h include GSM h void main void strEncode Msg RecMsg SYSProfile sysProfile int i
42. RS 232 cable CA 0910 Screw Driver 1C016 GSM GPRS Antenna ANT 421 02 for GSM series only UPAC 5000 Series C Language Based User Manual Version 1 0 2 Page 32 Copyright 2010 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com 2 1 Hardware Installation Before installing the hardware you should have a basic understanding of hardware specification such as the size of hard drive the usable input voltage range of the power supply and the type of communication interfaces For complete hardware details please refer to section 1 3 Specifications Below are step by step instructions for deploying the basic uPAC 5000 system Step 1 Mount the hardware The wPAC 5000 can be mounted with the bottom of the chassis on the DIN rail or piggyback gt DIN Rail mounting The wPAC 5000 has simple rail clips for mounting reliably on a standard 35 mm DIN rail i ry C Ea 1 Se H HUNUHUNU I Ee H i m 7a rw im im 7 is Mounting on DIN rail Removing from DIN rail i LS Hh hs bp Wii ht THRE Y A A M a Ahh Wi difil as Shi D Aiii ii Ss ijji i ai hiii I Ep UPAC 5000 Series C Language Based User Manual Version 1 0 2 Page 33 Copyright 2010 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com Piggyback mounting The wPAC 5000 has two holes on both sides for piggyback mounting
43. a SMS Short Message Service and GPRS General Packet Radio Service ICP DAS provides the 2GAG library for GSM series module The library is an easy way to applying the 2G3G service in the GSM series module Therefore there are many application architectures to apply in the system Or users can integrate other controller system with GSM library Summarize of the GSM functions Function Description GM_SYS_InitModem Initialize Modem GM_SYS_CloseModem Close the modem Check modem status and suggest you check it in your loop every GM_SYS_CheckModemStatus i ime UPAC 5000 Series C Language Based User Manual Version 1 0 2 Page 109 Copyright 2010 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com The OS7_COM lib library is required for using the GSM functions AN The speed of GPRS connection is less than one packet per second The GSM library kernel uses the timer that installed by InstallUserTimer The specific timer should be avoided when developing program using GSM library System Functions 1 GM_SYS_InitModem Before using any GSM functions the GM_SYSInitModem must be called to initialize the GSM modem 2 GM_SYS_CloseModem If the program calls the GM_SYSInitModem to initialize the GSM modem the GM_SYS_CloseModem must be called to shut down the modem before exiting program 3 GM_SYS_CheckModemStatus This function can be used to retrieve the current status of
44. adCom 1 Read data from COM1 port ToCom 1 data Send data via COM1 port if data g quit 1 If q is received exit the program j RestoreCom 1 Release the COM1 UPAC 5000 Series C Language Based User Manual Version 1 0 2 Page 83 Copyright 2010 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com API for showing data from COM ports 6 printCom Functions such as printf in the C library allow data to be output from COM ports For example showing data from the COM 1 port include lt stdio h gt include upac5000 h void main void int i InitLib Initiate the upac5000 library InstallCom 1 1152 0L 8 1 Install the COM1 driver for i 0 i lt 10 i printCom 1 Test d r n i Delay 10 Wait for all data are transmitted to COM port RestoreCom 1 4 1 3 API for standard COM port The standard COM port is used to upload program from PC to the wPAC 5000 Tips amp Warnings C style Standard COM port functions only can be used with the COM1 port the following configurations of the COM1 port are fixed Baud rate 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
45. anual Version 1 0 2 Page 134 Copyright 2010 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com Step 7 Remove the OLOGO option from the miscellancous Category Linker Options Build Options C Debug Specific Release Specific C Common to Both Options String Cancel MLIB wer YLIBS aber LIBS oldnarmes LIB shboe NOL S TACK 5120 fONERROR NOEXE OLOGO Help Use Project Defaults Category Categor Settings Miscellaneous Input Memory Image Miscellaneous Output Step 8 Rebuild the project ie Edit View aia Browse Debug Tools Optons Window Help HELLO MAE Ctlt Fo Build HELLO EXE Rebuild AU HELLO EXE AltHFE vild Execute HEL iwp Cth FS QD lt 1 gt Output Initializing Compiling c S 7188zaNdemos mscshellosShello c Linking Microsoft R Segmented Executable Linker Version 5 60 339 Dec 5 1994 Copyright C Microsoft Corp 1984 1993 All rights reserved Object Modules o0bj NOI STACK 5120 ONERROR NOEXE HELLO OBJ Object Modules obj Run File HELLO exe HELLO EXE List File c HELLO map nul Libraries lib c msvec 1libs Libraries lib c msve mfc libs j lib 5LIBN7188XAL LIB mrar lib oldnames Libraries lib llibce Creating browser database HELLO EXE 0 erroris 0 warning s al UPAC 5000 Series C Language Based User Ma
46. be shut down GM_ SYS CloseModem close the modem not turn off the modem 1 turn off modem The GSM series module comes with a full TCP IP architecture to make it easy to connect the cellular network The GSM series supports the standard connection mechanisms TCP and UDP Whichever mechanism is used once a connection is established the two sides of the connection can both send and receive data API functions for sending receiving data through TCP UDP connection 6 GM_NET_SetNet Initialize all network interface Note that all interfaces only can be initialized all at once 7 GM_NET_InstallLink This function performs an active open allowing a client program to establish a connection with a remote server The serverlP and serverPort parameters are used to specify the IP address and port number for the remote end of the connection UPAC 5000 Series C Language Based User Manual Version 1 0 2 Page 113 Copyright 2010 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com 8 GM_NET_GetLinkStatus Retrieve the status of established TCP UDP connection 9 GM_NET GetIP Retrieve local IP address from the cellular network 10 GM_NET_Send Send data packets to the recipient device using the established TCP UDP connection 11 GM_NET_GetNewPacket Receive incoming data packets from the remote device using the established TCP UDP connection Here is an example of sending recei
47. d now read the README file hy typing README and pressing ENTER in your Turbo G directory Mext make sure the line FILES 20 is in your CONF LG ie gt TC XBHIN your path xample PATH H C TCO BIN Press any key to continue CG M IC BI Executing CG M5 IC BI Executing CG M IC BI Executing C TC BINSUNZIP EXE TC Executing C IC BINSTHELP COM FC TC BIMSICHELP TCH zU Any Key Cont inue UPAC 5000 Series C Language Based User Manual Version 1 0 2 Page 60 Copyright 2010 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com Step 7 Press any key to continue ce CADOCUME 1 O0serte eppil INSTALL EXE Turbo C 2nd Edition Installation Utility Turbo G Directory G NIC Hinary Files Subdirector C TC BIM Header F Library For a tutorial on the Turbo C integrated environment change to the Turbo G Tour directory and run the Turbo G Tour For example Change to TC TonD C 2 TC BI And type 2 Executing C2 TC BI Press any key to continue Executing C TC BINSTHELP COM a FC TC BIN TCHELP TCH Executing C ITC BIMSNUNZIP EXE TC ZIF C TC Executing C IC BIMSIHELP COM FC IC BINSTICGHELP TCH zU Any Key Continue Step 8 Installation is complete UPAC 5000 Series C Language Based User Manual Version 1 0 2 Page 61 Copyright 2010 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com 3 1 2 Setting up the environ
48. e to open the file the FlashRead must be called to read data from the Flash Memory For example writing data to the 256MB flash memory include lt stdio h gt include upac5ee e h include MFS h define DISKA define DISK B 1 void main void int iFileHandle iRet InitLib Initiate the upac5000 library iRet mfs_ Init if iRet 256 return iFileHandle mfs OpenFile DISK A Test txt w if iFileHandle gt Print Write string to Test txt mfs_ Puts iFileHandle test mfs on 256MB flash mfs CloseFile iFileHandle Print done else Print Open file error r n mfs Stop i UPAC 5000 Series C Language Based User Manual Version 1 0 2 Page 103 Copyright 2010 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com API for reading data from the 256MB flash memory 6 mfs_Gets After using the mfs_OpenFile to open the file the mfs_Gets must be called to read data from the 256MB flash memory For example reading data from the 256MB flash memory include lt stdio h gt include upac5ee e h include MFS h define DISKA define DISK B 1 void main void int iFileHandle iRet InitLib Initiate the upac5eee library iRet mfs_ Init if iRet 256 return iFileHandle mfs_OpenFile _DISK_A Test txt r if iFileHandle gt Print Read from Test txt r n iRet mfs_ Gets iFileHand
49. e icpdas com 3 Hello World Your First Program When you learn every computer programming language you may realize that the first program to demonstrate is Hello World it provides a cursory introduction to the language s syntax and output Below are step by step instructions on how to write your first u PAC 5000 program UPAC 5000 Series C Language Based User Manual Version 1 0 2 Page 56 Copyright 2010 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com 3 1 C Compiler Installation C is prized for its efficiency and is the most popular programming language for writing applications Before writing your first uPAC 5000 program ensure that you have the necessary C C compiler and the corresponding functions library on your system The following is a list of the C compilers that are commonly used in the application development services e Turbo C Version 1 01 e Turbo C Version 2 01 Borland C Versions 3 1 5 2 x e MSC e MSVC Prior to version 1 52 We recommend that you use Borland C compiler as the libraries have been created on the companion CD Tips amp Warnings Before compiling an application you need to take care of the following matters Generate a standard DOS executable program Set the CPU option to 80188 80186 Set the floating point option to EMULATION if floating point computation is required Be sure not to choose 8087 Cancel the Debug Informati
50. e switches and interface are on the bottom panel that provides a simple way of adjusting the system and wiring the connection Rotary Switch Lock and Init Switch COM1 I COM2 a on wm A A pr pr Pa 1 5 gt xe e amp ao a sAN Pimassigment AACA P GND FG HO P GND PWR2 PWR1 gt Init Switch Operating Mode Selector Switch ON Init mode MiniOS7 configuration mode OFF Normal mode Firmware running mode In the WPAC 5000 series the switch is always in the OFF position Only when updating the UPAC 5000 firmware or OS the switch can be moved from the OFF position to the ON position Move the switch to the OFF position after the update is complete gt Lock Switch Flash Memory Write Protection Switch ON Enable Write Protection OFF Disable Write Protection UPAC 5000 Flash memory with Write Protection can physically lock that prevents modification or erasure of valuable data on uPAC 5000 UPAC 5000 Series C Language Based User Manual Version 1 0 2 Page 28 Copyright 2010 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com gt LAN An Ethernet port is an opening on uPAC 5000 network equipment that Ethernet cables plug into Ethernet ports accept cables with RJ 45 connectors gt Pin Assignment The pin assignments of the connector are as follows Signal Description N A Unassigned COM1 RS 232 COM2 RS 485 10 PWR2 Power Input 2 1
51. e the program hello run on start up Step 1 Create an autoexec bat file i Open the Notepad Type the command i The command can be either the file name HELLO exe run the specified file or runexe run the last exe file iii Save the file as autoexec bat D Untitled Notepad Sele File Edit Format View Help HELLO exe The file name a Run the specified file Untitled Notepad Sele Ele Edit Format View Help ou Runexe Run the last execuntion file exe runexe UPAC 5000 Series C Language Based User Manual Version 1 0 2 Page 51 Copyright 2010 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com Step 2 Upload programs to UPAC 5000 using MiniOS7 Utility For more detailed information about this process please refer to section 2 5 1 Establishing a connection between PC and wPAC 5000 P MiniOS Utility erion 3 1 7 3 i File b Connection a Command Configuration T Tools amp amp Help Look in 0 Mini0 S7 Utility kd Lock in Disk A Name Size pe Ho Name Size Modified bin File Folder 0 helloexe 138 926 2008 6 9 9 FIRMWARE File Folder SULOeXeC 25 2005 8 9 O 05_MAGE File Folder 2 Icpdas TRB Iriternet Shortcut 8 load 32 dll SKE Mini0S7_Utilty chm 1 025KE A MiniOS7_Utiity exe 2 055KB F s _ k umi kin a e DDP Connect to 10 1 0 224 23 path D SYS TEM 5 One is the Hello applica
52. ep 6 Create a project prj i Select Open project from the Project menu ii Type the project name Hello prj iii Select OK ey CA VWINDO WS sy stem32cmd exe tc Options Window Help i L t Close project Add item Delete item Include files c CA VWFINDO WS tsy stem32tcemd exe tc File Edit Search Run Compile Debug Project Options Window Help C TC HELLO PRJ iles Fi Help Enter directory path and file mask UPAC 5000 Series C Language Based User Manual Version 1 0 2 Page 69 Copyright 2010 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com Step 7 Add the necessary function libraries lib to the project i Select Add item from the Project menu ii Type lib to display a list of all necessary function libraries iii Choose the function libraries you require iv Select Add v Slelect Done to exit cy CA WFINDO WS sy stem32cmd exe tc File Edit Search Run Compile Debug Options Window Hely HELLO CPP 3 Open project Close project Delete item Include files ey CA WINDO WS sy stem32cmd exe tc File Edit Search Eun Compile Debug Project Options Window Help HELLO CPE _ _ oOo Mo _ _ioomA i H 4MO BASTIC LIBSNUPACS BH LIB f Fi Help Enter directory path and file mask Step 8 Add the source file c to the project i Select Add item f
53. es and files opened for Automate file system reading are never at risk Only data written since the last writing operation recovery mfs_WriteFile might be lost When the file system reboots it restores the file system to its state at the time of the last writing operation mfs_WriteFile 147 5 KB Sec verification enabled default 244 0 KB Sec verification disabled Writing speed mfs_ Puts 142 1 KB Sec verification enabled default 229 5 KB Sec verification disabled mfs_ReadFile 734 7 KB Sec Reading speed mfs_ Gets 414 2 KB Sec Max length of writing data 32767 bytes Max length of reading data 32767 bytes Resources upload e MFS SDKs http ftp lcodas com pub cd 8000cd napdos upac 5000 demo basic lib e MFS Demos http ftp lcodas com pub cd 8000cd napdos upac 5000 demo basic 256mb_ flash UPAC 5000 Series C Language Based User Manual Version 1 0 2 Page 121 Copyright 2010 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com Appendix D More C Compiler Settings This section describes the setting of the following compilers e Turbo C 2 01 e Borland C 3 1 e MSC 6 00 e MSVC 1 50 Prior to version 1 52 UPAC 5000 Series C Language Based User Manual Version 1 0 2 Page 122 Copyright 2010 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com D 1 Turbo C 2 01 You have a couple of choices here you can 1 Using a command line
54. g UPAC 5000 Series C Language Based User Manual Version 1 0 2 Page 47 Copyright 2010 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com Step 8 Click the New connection function from the Connection menu 2A MiniOS7 Utility Verion 3 1 7 Gp File gt Connection gt Command Config PE e T i p Ters a Look ire New connection BOs Last Connection Alt F2 L a Disconnect Ctrl4F2 oa Name 3 i i gi bin Search Fi jer 7 Step 9 On the Connection tab of the Connection dialog box select UDP from the drop down list type the IP address which you are assigned and then click OK TA Connection Serial Port TCP UDP Baud Rate 115200 IP 10 0 9 52 Data Bit Fort Parity U Mone Stop Bit UPAC 5000 Series C Language Based User Manual Version 1 0 2 Page 48 Copyright 2010 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com Step 10 The connection has already established P MiniOS 7 Utility Yerion 3 1 7 Gal File gt Connection de Command Configuration Tools F Help Look in Mini 7 Utility S oam b ConnectioniF2 m y DeletelFal S RefteshiFs UPAC 5000 Series C Language Based User Manual Version 1 0 2 Page 49 Copyright 2010 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com 2 5 2 Uploading and executing WPAC 5000 programs
55. ge systems Designed for the 256MB NAND flash memory MFS implements a reliable file system with C language API for embedded data logger applications on MiniOS7 Hardware Supported UPAC 5000 FD With 256MB Flash Memory NVRAM all of the 31 bytes UPAC 5000 Series C Language Based User Manual Version 1 0 2 Page 119 Copyright 2010 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com Applications Log data with timestamp Log data and forward via the Ethernet User s program NX COM Port Functions Serial Devices Devices MFS Specifications Item Description Disk size File number File size File name 1 Read only 2 Write only Creates a new file to write data or overwrite a file if the file is File operation modes already exit 3 Append appends data to a file 10 max for each disk For read mode the 10 file handles can all be used for reading operation on File handle each disk Total 20 files can be opened for reading mode For write and append mode only one file handle can be used for writing operation on all disks UPAC 5000 Series C Language Based User Manual Version 1 0 2 Page 120 Copyright 2010 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com Default is enabled Writing verification Calling mfs_EnableWriteVerification and mfs_DisableWriteVerification can change the setting If an unexpected reset or power loss occurs closed fil
56. git 7 SEG LED 1 InitSDigitLed Before using any LED functions the Init5DigitLed must be called to initialize the 5 Digit 7 SEG LED API for displaying a message on the 5 Digit 7 SEG LED 2 Show5 DigitLed 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 For example use the following code to display 8000E on the 5 Digit 7 SEG LED include lt stdio h gt include upac5ee e h void main void InitLib Initiate the upac5000 library Init5DigitLed Show5DigitLed 1 8 Show5DigitLed 2 0 Show5DigitLed 3 0 Show5DigitLed 4 Show5DigitLed 5 14 The ASCII code for the letter E is 14 UPAC 5000 Series C Language Based User Manual Version 1 0 2 Page 97 Copyright 2010 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com 4 7 API for Timer e The wPAC 5000 can support a single main time tick 8 stop watch timers and 8 counts down timers e The uPAC 5000 uses a single 16 bit timer to perform these timer functions with a timer accuracy of 1 ms API for starting 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 zero 3
57. h 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 For example to refresh the Watchdog Timer include lt stdio h gt include upac5ee e h void main void Unsigned long time iTime InitLib Initiate the upac5000 library Enable WDT While quit RefreshwWDT User_function DisableWDT UPAC 5000 Series C Language Based User Manual Version 1 0 2 Page 100 Copyright 2010 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com 4 9 API for MFS For pPAC 5000 FD series only Required library and header files MFS Vnnn LIB and MFS h The wPAC 5000 FD series products equip an extra 256MB flash memory the MFS is designed to read write file from to the 256MB flash memory For full usage information regarding the hardware supported applications and the specification please refer to section Appendix C What is MiniOS7 File System MFS e Summarize of the MFS functions Function Description l 1 Opens a file with a file name mfs_OpenfFile 2 Creates a new file l Closes a file with a file handle mfs_CloseFile All buffers associated with the stream are flushed before closing UPAC 5000 Series C Language Ba
58. he file 4 pc_close After the data has finished being written read to from the microSD PC_close must be called to close the file with a file handle API for writing data to the microSD 5 pc_write After using PC_open to open the file PC_write must be called to read data from the microSD UPAC 5000 Series C Language Based User Manual Version 1 0 2 Page 106 Copyright 2010 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com For example writing data to the microSD include lt string h gt include lt stdio h gt include upac5000 h include microSD h void main void int fd iRet InitLib if pc_init Print Init microSD ok r n else Print Init microSD failed r n iRet pc_get_errno switch iRet case PCERR_BAD_FORMAT 1 Print Error 01 format is not FAT r n break case PCERR_NO_CARD 2 Print Error 02 no microSD card r n break default Print Error 02d unknow error r n iRet break fd pc_open test txt word PO WRONLY PO CREAT PO APPEND word PS IWRITE PS IREAD if fd gt 0 pc _write fd 1234567890 10 write 10 bytes pc close fd j API for reading data from the microSD 6 pc_read After using PC_open to open the file PC_read must be called to read data from the microSD UPAC 5000 Series C Language Based User Manual Version 1 0 2 Page 107 Copyright 2010 ICP DAS Co
59. indicators and 5 digit 7 Segnment LED display are on the front panel that provides a very convenient way of displaying information for faster easier diagnostics GSM Y for GSM series only Programmable LED LAN LED 7 Segment LED Display for D version only gt LED Indicators LED indicators are on the front panel of the uPAC 5000 their functions are summarized in the table below Indicator State Meaning iam Flashing green Ethernet packet received GSM Y Slow blanking UPAC 5000 is registered full service Fast blanking 1 UPAC 5000 is searching GSM network 5 Digit 7 SEG LED display for display version only UPAC 5000 display series equip 5 digital 7 SEG LED display that can be used to display decimal numbers from 0 to 9 and provided a very convenient way of displaying digital data in the form of Numbers Top Panel The microSD memory socket is on the top panel that provides a simple way of expanding capacity External GSM GPRS Antenna microSD Slot for GSM series only SIM Card Solt for GSM series only gt microSD Memory Socket UPAC 5000 equip a microSD slot and it can support up to 2 GB microSD card gt SIM Card Socket and GSM GPRS Antenna UPAC 5200 Series equip a SIM card slot and GSM Antenna UPAC 5000 Series C Language Based User Manual Version 1 0 2 Page 27 Copyright 2010 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com Bottom Panel Th
60. ing MiniOS7 80186 CPU uPAC 5000 Series e DOS like e Boot up in 0 4 0 8 second e Build in hardware diagnostic e Standard version for C language programming e SaGRAF version for IEC 61131 3 programming gt Local I O and Communication Expansion Board The wPAC 5000 series equip an I O expansion bus to support one optional expansion board called XW board It can be used to implement various I O functions such as DI DO A D D A Timer Counter and various communication interface such as RS 232 4422 485 CAN FRnet etc UPAC 5000 Series C Language Based User Manual Version 1 0 2 Page 16 Copyright 2010 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com gt Remote I O Module and Expansion Unit GPS With the built in RS 485 and Ethernet port the uPAC 5000 series can connect RS 485 Ethernet ilar SENE remote I O Units RU 87Pn ET 87Pn or modules I 7000 M 7000 ET 7000 With an XW board the uPAC 5000 series can have more communication ports or different interface to connect to other type GSM GPRS ett Ww ith z pi La eon of devices for example CANOpen devices DeviceNet devices or FRnet I O modules Internet Cell Phone gt Multi Communication Interface There are several communication interfaces to expand I O and connect external devices Ethernet Remote 1 0 e RS 232 485 o CAN bus RUF 1 7000 M 700G e FRnet ral g Enthernet
61. le Data 80 max length is 80 bytes if iRet gt Print Data s r n Data mfs_ CloseFile iFileHand1le Print done else Print Open file error r n mfs Stop For more demo program about the Flash memory please refer to CD NAPDOS uPAC 5000 Demo Basic 256MB _Flash http ftp lcodas com pub cd 8000cd napdos upac 5000 demo basic 256mb_ flash UPAC 5000 Series C Language Based User Manual Version 1 0 2 Page 104 Copyright 2010 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com 4 10 API for microSD Required library and header files SD_Vnnn LIB and microSD h The uPAC 5000 series can support one microSD card and the size can be 1GB or 2 GB Summarize of the microSD functions Function Description Initializes the microSD socket library 1 Open an existing file and return a file handle c_open ee 2 Creates a new file UPAC 5000 Series C Language Based User Manual Version 1 0 2 Page 105 Copyright 2010 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com Function Description pc_get_attributes Gets the file attributes pc_set_attributes Sets the file attributes API for starting microSD 1 pc_ Init Before using any miscroSD functions PC_Init must be called to initialize the microSD API for enabling disabling microSD 3 pc_open Before writing reading data to from the microSD card PC_open must be called to open t
62. m A 2 1 20 ReadComn A 2 1 21 SetComTimeout A 2 1 22 SetComPortBufferSize S 2 1 23 SetCtsControlMode ii gt e Options gt x DT Library Selection for All 7188 80 EHS 2 COM Ports Functions E B 2 1 Common Functions ariables A 2 1 1 InstallCom DS 2 1 2 bCtsChanged_x Attachments Attachments a i D E o i d UPAC 5000 Series C Language Based User Manual Version 1 0 2 Page 78 Copyright 2010 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com The following table lists the demo programs grouped by functional category Folder DITAA O Explanation MISC Shows how to control the LED display Rotary _Switch Shows how to read the position of the switch 256 MB_Flash Gets Shows how to get a string from a file in the 256MB flash memory Quality assurance program for the MiniOS7 File System Including function test read write performance test Puts Shows how to write a string to a file in the ere Utility Utility for the MiniOS7 File System Operations rei microSD sda _qa Shows how to connect and control the microSD modbus MTDemo00 Shows how to use a standard Modbus driver to MTDemo01_Link_i7000 retrieve data MTDemo03_Link_PLC acid iene eee Modbus_TCP_Master_1 MTDemo05 _ MTDemo05_Modbus_TCP_Master_2 _TCP_Master_2 XWboard xw 107 Shows how to connect and control the XW107 board For more detailed information regarding UPAC 5000 APIs
63. ment 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 simple 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 PE Right click My My Computer Computer and then select Properties Search Manage Map Network D ystem Properties fx DS CO SE A E E E E D System Restore I Automatic Updates General Computer Hame Hardware Advanced Remote System Microsoft Windows sF Professional Properties Version 2002 Registered to pihuang icp AA 4 640 0000356 23006 Computer AMD E6 tm 3D processor 451 MHz 192 MB of RAM Apply 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 x Systern Restore il Automatic Updates Remote General Computer Name Hardware Advanced You must be logged on as an Administrator to make most of these changes Performance Visual effects processor scheduling memory
64. n nnn nnn nnn nnncnn 30 1 6 Companion CD 22 2 n neon nn nnn nn nnn nnn cnn nnn cn nn nnn nena nnnnnnn 31 2 Getting Started 32 2 1 Hardware Installation 33 2 2 GSM Series Installation 35 2 2 1 Installing the SIM card 35 2 2 2 Installing the GSM antenna 36 2 3 Software Installation 37 2 4 Boot Configuration 39 2 5 Uploading WPAC 5000 Programs 40 2 5 1 Establishing a connection between PC and uPAC 5000 41 UPAC 5000 Series C Language Based User Manual Version 1 0 2 Page 3 Copyright 2010 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com a RS 232 connection 42 b Ethernet Connection
65. ntifiers used for the MiniOS7 API Standard IO MinliOS API Progra Functions mmable IO RTC and WatchDogT imer z Os UPAC 5000 Series C Language Based User Manual Version 1 0 2 Page 77 Copyright 2010 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com 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 ftp lcodas com pub cd 8000cd napdos minios 7 document Ele Cptions X i A A 1 Library Selection for All L7188 80 2 J Adobe Reader MiniOS7_API pdf El Fe a2 COW Ports Functions Bow ps File Edit View Document Tools Window Help oo x B Bseveacony i Pi searen Tp setect EHIH 2 1 Common Functions Variables ayas ge F A 2 1 1 InstallCom A 2 1 2 bCtsChanged x A 2 1 3 CurCTS x 52 1 4 CurRTS x pee LS 2 1 5 fCtsContralvode_x I 2 1 5 fCtsControlMode_x F 2 1 6 fRtsContralMlode x A 2 1 6 fRtsContralMade_x m A 2 1 7 ClearCom A D3 2 1 8 ClearTxBuffer _ a A 2 1 9 DataSizelnCom 2 1 12 InstallCominputData FE 2 1 10 setTxBufferFreesize Bain E DA 2 1 11 GetCtsStatus oe a A 2 1 12 InstallCominputData Spe A 2 1 13 IsCom D 21 19 ReadCom A 2 1 14 IsTxBufEmpty ko ai F 2 1 15 IslomutBufEmpty TEATS D 2 1 16 IsDetectBreak a DA 2 1 17 printCom Dp 2 1 10 RestoreCom A 2 1 19 ReadCo
66. nual Version 1 0 2 Page 135 Copyright 2010 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com
67. on Below are step by step instructions on how to connect to PC using an Ethernet connection Step 1 Ensure the switch of the Lock is in the OFF position and the switch of Init is ON position Then reboot the uPAC 5000 Step 2 Use an Ethernet cable to connect to PC UPAC 5000 Series C Language Based User Manual Version 1 0 2 Page 45 Copyright 2010 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com Step 3 Run the MiniOS7 Utility Step 4 Click the Search function from the Connection menu gt c MiniOS Utility Verion 3 1 1 build 3 1 1 1 B File p Connection e e Command F Configuration Tools 7 H New connection F2 peas re IS Last Connection Alt F2 O 7 E Disconnect Ctrl F2 _Name Size Type File Folder File Foldes 2 05_IMAGE File Folder rI D i PA Se aa T 3 E EO ky Ci Ll j wit Step 5 On the MiniOS7 Scan dialog box choose the module name from the list and then choose IP setting from the toolbar MiniOS7 Scan IF setting UPAC 5000 Series C Language Based User Manual Version 1 0 2 Page 46 Copyright 2010 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com Step 6 On the IP Setting dialog configure the IP settings and then click the Set button Recommend Settings DHL Disable Enable IP setting success Do you want to leave IP setting dialo
68. on function as this helps to reduce program size MiniOS7 supports this feature UPAC 5000 Series C Language Based User Manual Version 1 0 2 Page 57 Copyright 2010 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com 3 1 1 Installing the C compiler If there is no compiler currently installed on your system installation of the compiler should be the first step Below are step by step instructions for guiding you to install Turbo C Version 1 01 on your system Step 1 Double click the Turbo C executable file to start setup wizard INSTALL Step 2 Press Enter to continue ex CADOCUME 1 VWserts fiicpp101MNSTALL EZXE Turbo C 2nd Edition Installation Utility Copyright 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 ayes disk space if you wish to install all the memory E a examples and copy the Tour files Press ENTER to continue ESC to quit ENTER Continue ESC Cancel Step 3 Enter the letter of the hard drive you wish to install the software rbo G 2nd Edition Installation Utility Enter the SOURCE drive to use A Ji Enter the drive from which you wish the INSTALL utility to copy Typically this is the drive that contains the INSTALL disk ESC Cancel ENTER Se lect Step
69. please refer to CD NAPDOS upac 5000 Demo basic http ftp Icodas com pub cd 8000cd napdos upac 5000 demo basic UPAC 5000 Series C Language Based User Manual Version 1 0 2 Page 79 Copyright 2010 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com 4 1 API for COM Port The wPAC 5000 provides two built in COM ports COM1 and COM2 e COM1 A RS 232 port can use to connect to PC e COM2 A RS 485 port in a point to point connection UPAC 5000 Series C Language Based User Manual Version 1 0 2 Page 80 Copyright 2010 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com 4 1 1 Types of COM port functions There are two types of functions below for using COM port 1 MiniOS7 COM port functions 2 C style Standard COM port functions Tips amp Warnings C style Standard COM port functions only can be used with the COM1 if you AN use the COM1 port you ll have the alternative of MiniOS7 COM ports functions or C style Standard COM port functions If you choose the ones then another cannot be used Summarize the results of the comparison between MiniOS7 COM port functions and C style Standard COM port functions Types of Functions COM Port Buffer Functions MiniOS7 1 2 etc 1 KB 1 KB IsCom ToCom ReadCom printCom COM port C style Standard Puts 1 512 Bytes 256 Bytes Kbhit Getch Print COM port Putch 4 1 2 API for MiniOS7 COM port
70. pyright 2010 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com 4 3 API for EEPROM e The EEPROM contains 64 blocks block 0 63 and each block has 256 bytes address 0 255 witha total size of 16 384 bytes 16K capacity e The default mode for EEPROM is write protected mode e The system program and OS are stored in EEPROM that are allocated as shown below API for writing data to the EEPROM System Block 0 6 amt Block 8 31 Reserved for system use Block 32 63 API for reading data from the EEPROM 4 EE_MultiRead 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 Read data from the EEPROM no matter what the current mode is UPAC 5000 Series C Language Based User Manual Version 1 0 2 Page 91 Copyright 2010 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com For example to write data to block1 address 10 of the EEPROM include lt stdio h gt include upac5ee e h void main void int data 0x55 data2 InitLib Initiate the upac5000 library EE WriteEnable EE MultiWrite 1 1
71. rmation Unknown command 4 2 API for I O Modules The uPAC 5000 equip a RS 485 communication interface COM2 to access l 7000 series I O modules for a wide range of RS 485 network application as shown below Steps to communicate with i 7000 series I O modules Step 1 Use Installcom to install the COM port driver Step 2 Use SendCmdTo7 000 2 to send commands Step 3 Use ReceiveResponseFrom7000_ms to get the response Step 4 Use RestoreCom to uninstall the COM port driver UPAC 5000 Series C Language Based User Manual Version 1 0 2 Page 89 Copyright 2010 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com For example to send a command S01M to l 7000 I O module for getting the module name include lt stdio h gt include upac5ee e h void main void unsigned char InBuf 6 InitLib Initiate the upac5000 library InstallCom 1 11520 L 8 1 Install the COM1 driver InstallCom 2 11520 L 8 1 Install the COM2 driver SendCmdTo7000 2 01M Send DCON command via COM2 Timeout 50ms check sum disabled ReceiveResponseFrom7 0 _ms 2 InBuf 50 0 printCom 1 Module Name s InBuf Delay 10 Wait for all data are transmitted to COM port RestoreCom 1 Release the COM1 RestoreCom 2 Release the COM2 UPAC 5000 Series C Language Based User Manual Version 1 0 2 Page 90 Co
72. rom the Project menu ii Type c to display a list of source files iii Choose the source file you require iv Select Add v Slelect Done to exit UPAC 5000 Series C Language Based User Manual Version 1 0 2 Page 70 Copyright 2010 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com Step 9 Set the memory model to large i Select Compiler from the Options menu and then select Code generation ii On Model option select Large iii Select OK cs Command Prompt te Window A ication Advanced code generation Entry Exit Code C options Optimizations c Command Prompt te Assume amp amp Equals DS efines Use large memory model iMb for code iMb for static data UPAC 5000 Series C Language Based User Manual Version 1 0 2 Page 71 Copyright 2010 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com Step 10 Set the Floating Point to Emulation and the Instruction Set to 80186 d i Select Compiler from the Options menu and then select Advanced code generation ii On Floating Point option select Emulation iii On Instruction Set option select 80186 iv Select OK co Command Prompt te ao E a e e ee Se Je Mindan A E Code generation Entry Exit Code G options Optimizations c Command Promp
73. sed User Manual Version 1 0 2 Page 101 Copyright 2010 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com Function Description mfs_Puts Outs a string a file mfs_ EOF Macro that tests if end of file has been reached on a file mfs_ Seek Repositions the file pointer of a file mfs_ Tell Returns the current file pointer l l Enable the data verification mfs_EnableWriteVerify o By default the data verification is enabling mfs_DisableWriteVerify Disable the data verification API for starting 256MB flash memory 1 mfs_ Init Before using any MFS functions the mfs_Init must be called to initialize the 256MB flash memory 2 mfs_Stop If the program calls the mfs_Init to initialize the 256MB flash memory the mfs_Stop must be called to allocate buffers to free upon closing API for writing reading files from the 256MB flash memory 3 mfs_OpenFile Before writing reading data to from the 256MB flash memory the OpenFile must be called to open the file 4 mfs_CloseFile After the data has finished being written read to from the 256MB flash memory the mfs_CloseFile must be called to close the file with a file handle UPAC 5000 Series C Language Based User Manual Version 1 0 2 Page 102 Copyright 2010 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com API for writing data to the 256MB flash memory 5 mfs_Puts After using the mfs_OpenFil
74. t 85 4 1 4 Port functions Comparison 87 4 1 5 Request Response protocol define on COM port 88 4 2 API for O Modules 89 4 3 API for EEPROM 91 4 4 API for Flash Memory 93 4 5 API for NVRAM 95 4 6 API for 5 Digital LED 97 4 7 API for TimMer 98 4 8 API for WatchDog Timer WDT 100 4 9 API for MFS For uPAC 5000 FD series only 101 4 10 API for microSD 105 UPAC 5000 Series C Language Based User Manual Version 1 0 2 Page 4 Copyright 2010 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com AILO MAPIO ON A Aea ee ne 109 Appendix A
75. t te File Edit Search Run as i MAA Soa Instruction Set cout aa Far Data hreshold Fi Help Detect and use coprocessor otherwise emulate the 80877 80287 UPAC 5000 Series C Language Based User Manual Version 1 0 2 Page 72 Copyright 2010 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com Step 11 Specify the include directories where the compiler can search for header file and libraries i Select Directories from the Options menu ii On Include Directories option specify the header file directory iii On Library Directories option specify the function library directory iv Select OK c Command Prompt te Edit Search Run Window Application Compiler Transfer Make Linker H Librarian EEE co Command Prompt te sks I B IC INCLUDE areas Directories cae caiman ource Directories Fi Help The directories to search for your include H gt files UPAC 5000 Series C Language Based User Manual Version 1 0 2 Page 73 Copyright 2010 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com Step 12 Select Build all from the Compile menu to build the project c Command Prompt te ile Edit Search Run Debug Project Options Window Help Compile Alt F Make F Link Build allo Information Remove messages Search Run Compile Debug Project Options Window Help Library HELLO LIB Adding H
76. tablished connection GM_NET CloseNet shut down networking before exiting program the modem should be shut down GM_SYS_ CloseModem close the modem not turn off the modem 1 turn off modem For more demo programs about the GSM features please refer to CD NAPDOS uPAC 5000 Demo Basic GSM http ftp icodas com pub cd 8000cd napdos upac 5000 demo basic gsm UPAC 5000 Series C Language Based User Manual Version 1 0 2 Page 116 Copyright 2010 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com Appendix A 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 DOS whether PC DOS MS DOS or ROMDOS is a set of commands or code that A 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 Feature MiniOS7 l nO V DIO Supportfor VOexpansionbus es o Support for ASICkey es o Flash ROM management es o OS update Upload es o Built in hardware diagnostic functions Yes NO Direct control of 7000 series modules Yes NO Customer ODM functions es o Freeofcharge es UPAC 5000 Series C Language Based User Manual Version 1 0 2 Page 117
77. ter value GM_ NET SetNet netProfile specify the IP and the port number of remote server that you are connecting to GM_ NET InstallLink 1 192 168 255 2 10000 for if Kbhit amp amp Getch q break press q to exit the program if GM_ SYS CheckModemStatus GM NOERROR continue if GM NET GetLinkStatus 1 continue else GM NET GetIP myIP Switch netSendStatus GM SYS CheckCmdStatus case GM READY send data to the remote server gprsData link 0 sprintf gprsData data hello world gprsData dataLen strlen gprsData data if GM NET Send gprsData link gprsData data gprsData dataLen GM_ NOERROR Print Failed to send data r n break case GM _NOERROR Print send success r n break case GM BUSY break default Print Failed to send data Error Code d r n netSendStatus break receive incoming data packets via TCP IP if GM_NET GetNewPacket amp gprsData NULL no Print new GPRS Data d r n no Print IP Port s d from link d r n gprsData IP gprsData port gprsData link Print Data length d r n gprsData dataLen Print Data r n for i 0 i lt gprsData dataLen i Putch gprsData data i UPAC 5000 Series C Language Based User Manual Version 1 0 2 Page 115 Copyright 2010 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com GM_NET CloseLink close the es
78. tion file and the AutoRun HELLO EXE Autodownload Files Mone other iS the Current work directory D 5SYSTEM autoexec bat batch file Begin Key Thread 1 Tips amp Warnings AN Before rebooting the module for settings to take effect you must firstly turn the switch of Init to OFF position UPAC 5000 Series C Language Based User Manual Version 1 0 2 Page 52 Copyright 2010 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com 2 6 Updating pPAC 5000 OS Image ICP DAS will continue to add additional features to UPAC 5000 in the future we advise you periodically check the ICP DAS web site for the latest update to UPAC 5000 Step 1 Obtain the latest version of the uPAC 5000 OS image The latest version of the uPAC 5000 OS image can be obtained from CD NAPDOS upac 5000 OS_image http ftp Icpodas com pub cd 8000cd napdos upac 5000 os image Module Name Release Date Step 2 Establish a connection For more detailed information about this process refer to section 2 5 1 Establishing a connection between PC and uwPAC 5000 UPAC 5000 Series C Language Based User Manual Version 1 0 2 Page 53 Copyright 2010 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com Step 3 Click the Update MiniOS7 Image from the File menu P MiniOS7 Utility Yerion 3 1 7 Bes File j Connection he bninn F See T Tools P Help pal 4
79. underbars Merge duplicate TER INYS Standard stack ine nunbers 1 OBJ debug information a ar UPAC 5000 Series C Language Based User Manual Version 1 0 2 Page 124 A am ANN AY UUs J Uh YV IU 9 U z 5 Step 6 Building the project cy CAWINDO WS Systems cmd exe d tce20 tc gids Edit Run ompile Project Options Debug EBreak watch EAEE Compile to OF DiNONAME OB D NONAME C ie east file Build all factors GC Soler cy CAWINDO WSS ystem32 cemd exe d te20 tite File Edit Run Compile Project Options De bug Break watch Edit Line 1 re on Insert Indent Tah Fill Unindent D NOHANE C Linking EXE file LED EXE Linking IT C26 LIB CL LIB Total Link compiled 1335 PASS 2 Warnings 5 Errors Success Fi Help FS Zoom F6 Switch FY Trace F8 Step F9 Make Fi Menu Gilli UPAC 5000 Series C Language Based User Manual Version 1 0 2 Page 125 Copyright 2010 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com D 2 Borland C 3 1 Step 1 Executing the Borland C 3 1 Step 2 Creating a new project file prj o Command Prompt be File Edit Search Fun Compil Compile Dofiy CG DOCUME 1 ADMIN MIN Open project lose project Tr item E Step 3 Add all the necessary files to the project co Command Prompt be Search Run Compile Debu UPAC 5000 Series
80. ures below GSM Antenna Connector UPAC 5000 Series C Language Based User Manual Version 1 0 2 Page 36 Copyright 2010 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com 2 3 Software Installation The Companion CD includes complete sets of APIs demo programs and other tools for developing your own applications Below are step by step instructions for installing the uPAC 5000 APIs demo programs and tools Step 1 Copy the Demo folder from the companion CD to PC The folder is an essential resource for users developing your own applications which contains libraries header files demo programs and more information as shown below CD Napdos upac 5000 Demo Basic 64MB_ Flash Lib modbus XWboard FTP_Demo_yyyymmdd zip uPACS000_GPRS_GPS_Demo_yyyymmdd zip UPAC 5000 Series C Language Based User Manual Version 1 0 2 Page 37 Copyright 2010 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com Step 2 Installing the MiniOS7 Utility Mas Utility 321 ee M Ea Mimms Utility Yer 3 41 setup hy MiniOS7 Utility is a suite of tool for managing MiniOS7 devices uPAC 5000 iPAC 8000 uPAC 7186 etc It s comprised of four components System monitor communication manager file manager and OS loader The MiniOS7 Utility can be obtained from companion CD or our FTP site CD Napdos minios7 utility minios7_utility UPAC 5000 Series
81. ving data packets using TCP connection include lt stdlib h gt include lt string h gt include upac5ee e h include OS7 COM h include GSM h void main void NetProfile netProfile SYSProfile sysProfile GPRSData gprsData int i iRet no int netSendStatus char myIP 16 InitLib initialize the GSM modem strcpy sysProfile PINCode 0000 if you are using a SIM that has a PIN you must enter the pin or your SIM will be blocked by your mobile operator sysProfile modemPort 11 modem port number uPAC 5000 11 sysProfile hardware 2 hardware type uPAC 5000 2 if iRet GM SYS InitModem sysProfile GM_NOERROR Print Failed to initiate the modem Error Code d r n iRet return check whether the GSM modem is ready to service while GM SYS CheckModemStatus GM NOERROR DelayMs 1000 UPAC 5000 Series C Language Based User Manual Version 1 0 2 Page 114 Copyright 2010 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com Print GSM modem registered r n configure the network settings strcpy netProfile APN INTERNET APN for network provided by your cellular provider strcpy netProfile pw username for network provided by your cellular provider strcpy netProfile user password for network provided by your cellular provider strcpy netProfile DnsServerIP if NULL is used as the default parame
Download Pdf Manuals
Related Search
Related Contents
取扱説明書 - M Providing compliance enforcement for manually dialed wireless NIXIE_CTRL_Library v1.0 の取扱説明書 user manual Philips DS3010 Product Manual - California Analytical Instruments, Inc. Copyright © All rights reserved.
Failed to retrieve file