Home
User Manual - ICP DAS USA's I
Contents
1. 89 4 2 1 Steps to use I 8K series I O modules in slots for VP 2111 module only 91 4 2 2 Steps to use I 87K series I O modules in slots for VP 2111 module only 92 4 2 3 Steps to use I 7K and I 87K series I O modules that are connected with COM PONTS 2 22 n nnn nnn nn nnn nnn nn nnn nnn nnn nnn nnn nnn nn sense 94 4 3 API for EEPROM 96 4 4 API for Flash Memory 98 4 5 API for NVRAM 101 4 6 API for Timer 103 4 7 API for WatchDog Timer WDT 105 4 8 API for MFS For VP 2111 module only 107 Appendix A What is MiniOS7 113 VP 2000 VH 2000 Series C Language Based User Manual Version 1 0 3 Page 4 Copyright 2011 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com Appendix B What is MiniOS7 Utility 114 Appendix C What is MiniOS7 File System MFS For VP 2111 module only 115 Appendix D I 8K and I 87K serial Modules For VP 2111 module only
2. 41 2 5 Updating the ViewPAC OS image 43 3 Hello World Your First Program 46 VP 2000 VH 2000 Series C Language Based User Manual Version 1 0 3 Page 3 Copyright 2011 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com 3 1 C Compiler Installation 47 3 1 1 Installing the Compiler 48 3 1 2 Setting up the Environment Variables 52 3 2 ViewPAC APIs 55 3 3 First Program in ViewPAC 56 4 APIs and Demo References 68 4 1 API for COM Port 77 4 1 1 Types of COM port functions 79 4 1 2 API for MiniOS7 COM port 80 4 1 3 API for standard COM port 83 4 1 4 COM Port functions Comparison 86 4 1 5 Request Response protocol define on COM port 88 4 2 API for 1 0 Modules
3. 7 1 2 Features mmmmnnnnnnnnnnnnnnnnnnnnmnnnnss 8 1 3 Specification 9 1 4 Overview 11 1 5 Dimension 13 1 6 Companion CD 16 2 Getting Started 17 2 1 Hardware Installation 18 2 1 1 Mounting the Hardware 19 2 1 2 Mounting the IP 65 Waterproof connector 25 2 2 Software Installation 27 2 3 Boot Configuration 29 2 4 Uploading ViewPAC Programs 30 2 4 1 Establishing a connection between PC and ViewPAC 31 2 4 1 1 RS 232 connection 32 2 4 1 2 Ethernet Connection 35 2 4 2 Uploading and executing ViewPAC programs 40 2 4 3 Making programs start automatically
4. 119 Appendix E Application of RS 485 Network 120 E 1 Basic RS 485 Network 121 E 2 Daisy Chain RS 485 Network 122 E 3 Star Type RS 485 Network 123 E 4 Random RS 485 Network 125 E 5 Master Slaves Settings 126 E 5 1 ViewPAC as a Master default 126 E 5 2 ViewPAC as a Slave 128 Appendix F Revision History 130 VP 2000 VH 2000 Series C Language Based User Manual Version 1 0 3 Page 5 Copyright 2011 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com 1 Introduction ViewPAC combines iPAC graphic display and keypad in one unit It equips an 80186 CPU 16 bit and 80MHz running a MiniOS7 operating system several communication interface Ethernet RS 232 485 3 slots to expand I O modules STN LCD and a rubber keypad ViewPAC Family cf Development Tools IP65 Waterproof Variant Communications Ce I O Slots P sr gg i S 55 UJ GY Os S More than 60 types of O are supported ok ys Its ope
5. GisTC HELLO PRJ VP 2000 VH 2000 Series C Language Based User Manual Version 1 0 3 Page 60 Copyright 2011 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com Step 7 Add the necessary function libraries to the project lib i Select Add item from the Project menu ii Select the source file hello c and then click the Add button iii Select the function library 7186el lib and then click the Add button iv Select Done to exit cx CAWINDO W System 2 cmd exe te np HELLO CPP ER Include files CSDEMOSBASICSLIBSUPEK LIB iles Fi Help Enter directory path and file mask gt 2 2 2 2 2 2 2 VP 2000 VH 2000 Series C Language Based User Manual Version 1 0 3 Page 61 Copyright 2011 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com Step 8 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 et Command Prompt te vanced code generation Entry Exit Code C options Optimizations Mb for stat VP 2000 VH 2000 Series C Language Based User Manual Version 1 0 3 Page 62 Copyright 2011 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com Step 9 Set the
6. Copyright 2011 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 You also need to know the expansion capacities in order to choose the best expansion module for achieving maximal efficiency For more information about expansion module that are compatible with the unit please refer to http www icodas com products PAC viewpac IO Expansion htm VP 2000 VH 2000 Series C Language Based User Manual Version 1 0 3 Page 18 Copyright 2011 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com 2 1 1 Mounting the Hardware ViewPAC can be mounted in a panel of maximum thickness 12mm Adequate access space can be available at the rear of the instrument panel for wiring and servicing purposes Panel thickness up to 12mm THT TEE EEE eee VP 2000 VH 2000 Series C Language Based User Manual Version 1 0 3 Page 19 Copyright 2011 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com Below are step by step instructions for mounting the ViewPAC hardware Step 1 Prepare the panel cut out to the size as below shown 153 1 Ti 136 T e RS se M
7. Unsigned long time iTime InitLib Initiate the ViewPAC library TimerOpen While quit If Kbhit TimerResetValue Reset the main time ticks to O iTime TimerReadValue Read the main time ticks from 0 TimerClose Stop using the ViewPAC timer function For more demo program about the Timer please refer to VP 2111 CD NAPDOS vp 2000 demo vp 2111 Basic Timer http ftp lcodas com pub cd 8000cd napdos vp 2000 demo vp 2111 basic timer VH 2110 CD NAPDOS vp 2000 demo vh 2110 Basic Timer http ftp lcodas com pub cd 8000cd napdos vp 2000 demo vh 2110 basic timer VP 2000 VH 2000 Series C Language Based User Manual Version 1 0 3 Page 104 Copyright 2011 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com 4 7 API for WatchDog Timer WDT e The ViewPAC 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 refresh it the EnableWDT must be called to stop refreshing WDT 2 RefreshWDT After EnableW
8. include MFS h define DISK A O Hdefine DISK B 1 int main void int iFileHandle iRet InitLib Initiate the ViewPAC library iRet mfs_Init if iRet lt 0 return iFileHandle mfs_OpenFile _ DISK _A Test txt w if iFileHandle gt O Print Write string to Test txt mfs_Puts iFileHandle test mfs on 64MB flash mfs_CloseFile iFileHandle Print done else Print Open file error n r mfs_ Stop return VP 2000 VH 2000 Series C Language Based User Manual Version 1 0 3 Page 110 Copyright 2011 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com API for reading data from the 64MB 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 64MB flash memory For example reading data from the 64MB flash memory include lt stdio h gt include vp2k h include MFS h define DISK A O Hdefine DISK B 1 int main void int iFileHandle iRet InitLib Initiate the ViewPAC library iRet mfs_Init if iRet lt 0 return iFileHandle mfs_OpenFile _DISK_A Test txt r if iFileHandle gt O Print Read from Test txt n r iRet mfs_Gets iFileHandle Data 80 max length is 80 bytes if iRet gt O Print Data s n r Data mfs_CloseFile iFileHandle VP 2000 VH 2000 Series C Language
9. void main void InitLib Initiate the ViewPAC library Print Hello world r n Print the message on the screen I VP 2000 VH 2000 Series C Language Based User Manual Version 1 0 3 Page 58 Copyright 2011 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com Step 5 Save the source file i Select Save from the File menu ii Type the file name Hello iii Select OK CARIN DO WSisystem32 cmd exe te dit Search T cy CAWINDO WStsystem32 cmd exe olx Z File Edit Search Fun Compile Debug Proj i Window He ly ae T Fi Help Enter directory path and file mask 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 VP 2000 VH 2000 Series C Language Based User Manual Version 1 0 3 Page 59 Copyright 2011 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com Step 6 Create a project prj i Select Open project from the Project menu ii Type the project name Hello iii Select OK C WINDOWS system32 cmd exe te zompile Debug HELLO CPES er CAWINDO WSi system3 cmd exe te E x Pes le Edit Search Run Comp t Eo S ect Opt ons __Hindow_ Hel m J alu a L
10. VP 2000 VH 2000 Series C Language Based MiniOS7 Inside User Manual Version 1 0 3 July 2011 ae GI A a ra Es wa alali ia e JE Service and usage information for VP 2111 VH 2110 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 VP 2000 VH 2000 Series C Language Based User Manual Version 1 0 3 Page 2 Copyright 2011 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com Table of Contents 1 Introduction 6 1 1 ViewPAC Family MiniOS7 Inside
11. VP 2000 VH 2000 Series C Language Based User Manual Version 1 0 3 Page 123 Copyright 2011 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com There is a better choice to use 7513 as a RS 485 hub on start type network hf LS EU ASUS Ni ESS RS 485 Hub 1 7520 RS 232 to RS 485 Converter VP 2000 VH 2000 Series C Language Based User Manual Version 1 0 3 Page 124 Copyright 2011 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com E 4 Random RS 485 Network There are branches along the main wire In this case it is better to have a repeater to isolate or filter the noise that is made by devices 1 7520 I 7510 RS 232 to RS 485 RS 485 Repeater Converter 5 l 7510 RS 485 Repeater l 7561 USB to RS 485 Converter VP 2000 VH 2000 Series C Language Based User Manual Version 1 0 3 Page 125 Copyright 2011 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com E 5 Master Slaves Settings There must be exist one master to have a jumper in the same network Ina master slave application Master is the default configuration of ViewPAC E 5 1 ViewPAC as a Master default When one of ViewPAC is set to the master mode then all the other devices on the Same network must be set to the slave mode Set ViewPAC to the master mode by adjusting the jumpers on the power board of ViewPAC Refer to the following figure VP 2
12. Enable the data verification mfs_EnableWriteVerify nn By default the data verification is enabling mfs_DisableWriteVerify Disable the data verification VP 2000 VH 2000 Series C Language Based User Manual Version 1 0 3 Page 108 Copyright 2011 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com API for starting 64MB flash memory 1 mfs_ Init Before using any MFS functions the mfs_Init must be called to initialize the 64MB flash memory 2 mfs_Stop If the program calls the mfs_Init to initialize the 64MB flash memory the mfs_Stop must be called to allocate buffers to free upon closing API for writing reading files from the 64MB flash memory 3 mfs_OpenFile Before writing reading data to from the 64MB 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 64MB flash memory the mfs_CloseFile must be called to close the file with a file handle API for writing data to the 64MB flash memory 5 mfs_Puts After using the mfs_OpenFile to open the file the FlashRead must be called to read data from the Flash Memory VP 2000 VH 2000 Series C Language Based User Manual Version 1 0 3 Page 109 Copyright 2011 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com For example writing data to the 64MB flash memory include lt stdio h gt include vp2k h
13. 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 VP 2000 VH 2000 Series C Language Based User Manual Version 1 0 3 Page 54 Copyright 2011 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com 3 2 ViewPAC APIs There are several APIs for customizing the standard features and integrating with other applications devices and services For more detailed information regarding ViewPAC APIs please refer to CD NAPDOS vp 2000 Readme txt http ftp icodas com pub cd 8000cd napdos vp 2000 Readme txt Before creating the application ensure that you have installed the required APIs demo programs and tools If they are not installed please refer to section 2 2 Software Installation VP 2000 VH 2000 Series C Language Based User Manual Version 1 0 3 Page 55 Copyright 2011 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com 3 3 First Program in ViewPAC Here we assume you have installed the Turbo C 1 01 as the section 3 1 C Compiler Installation and the ViewPAC APIs as the section 2 2 Software Installation under the C driver root folder Below are s
14. e The ViewPAC equip an RTC Real Time Clock 31 bytes of NVRAM can be used to store data eNVRAM 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 eNVRAM 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 reading data from the NVRAM 2 ReadNVRAM The ReadNVRAM must be called in order to write data to the NVRAM VP 2000 VH 2000 Series C Language Based User Manual Version 1 0 3 Page 101 Copyright 2011 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com For example use the following code to write data to the NVRAM address O include lt stdio h gt include vp2k h void main void int data 0x55 data2 InitLib Initiate the ViewPAC library WriteNVRAM 0 data data2 ReadNVRAM 0 Now data2 data 0x55 For example the following can be used to write an integer two bytes to NVRAM include lt stdio h gt include vp2k h void main void int data 0xAA55 data2 char dataptr char amp data InitLib Initiate the ViewPAC library WriteNVRAM O dataptr Write the low byte WriteNVRAM 1 dataptr
15. A The following settings of the COMO are fixed Baud rate 115200 bps Data bit 8 bits Parity check None Stop bit 1 The following settings of l 87k series 1 0 modules that plugged in slots are fixed Address 0 Check sum Disable Besides the ChangeToSlot function must be called VP 2000 VH 2000 Series C Language Based User Manual Version 1 0 3 Page 92 Copyright 2011 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com For example sending a command SOOM to the I 87k I O module that plugged on the slot 7 for getting the module name include lt stdio h gt Hinclude vp2k h void main void unsigned char InBuf0 60 InitLib Initiate the vp2k library InstallCom 0 115200 8 0 1 Install the COMO driver InstallCom 1 115200 8 0 1 Install the COM1 driver ChangeToSlot 7 SendCmdTo7000 0 SOOM 0 Send a command to COMO Timeout 50ms check sum disabled ReceiveResponseFrom7000_ms O InBufO 50 0 printCom 1 Module Name s InBuf0 Delay 10 Wait for all data are transmitted to COM port RestoreCom 0 Uninstall the COMO driver RestoreCom 1 Uninstall the COM1 driver VP 2000 VH 2000 Series C Language Based User Manual Version 1 0 3 Page 93 Copyright 2011 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com 4 2 3 Steps to use I 7K and I 87K series I O modules that are connected wit
16. RAM Apply VP 2000 VH 2000 Series C Language Based User Manual Version 1 0 3 Page 52 Copyright 2011 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com 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 f x Remote Advanced System Restore Automatic Updates E General Computer Name Hardware ou must be logged on as an Administrator to make most of these changes Performance Visual effects processor scheduling memory usage and virtual memory _ settings User Protiles Desktop settings related to your logon Settings Environment Variables Startup and Recovery System startup system failure an4 User variables For Administrator Variable Value TEMP C Documents and Settings 4dministrat TMF C Documents and Settingsi drainistrat A Environment Variables System variables Variable value Compu MIND Sisystem32icmd exe NUMBER 5 Windows MT L 1 y I M Ci Ci LU 1 5 Y ats i FPATHEXT COM EXE BAT CMD WES BE J51 Y VP 2000 VH 2000 Series C Language Based User Manual Version 1 0 3 Page 53 Copyright 2011 ICP DAS Co
17. Start Installation a amin LE Ei Tes Tr CS MCLH Description ie Ebiti T begin copying files to your hard drive into the directories specified above Fi Help F9 Start the installation Step 6 Press any key to continue es CADOCUME 1 Oserist iitcpp101UNS TALL EXE Turbo C 2nd Edition Installation Utility C NTCNEI Executing C NTCONEI Executing C NTCNEI Executing ENTER Select ESC Previous 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 should now read the README typing README and pressing ENTER in your C directory Mext make sure the line FILES 20 is LME CURFIG STS Trand C 5IC BIH ugar path For example PATH C BIN C STCNHIN Press any key to con inue C STCSBINSUMEIP EXE TC ZIF C STCNSBTH Executing C IC BIMSTHELP COM FC STCSBINSTCHELP TCH W Any Key Continue File hy Turbo VP 2000 VH 2000 Series C Language Based User Manual Version 1 0 3 Page 50 Copyright 2011 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com Step 7 Press any key to continue ce CADOCUME 1 User te teppi INSTALL EXE Turbo C 2nd Edition Installation Utility Turbo C Directory C TC Binary Files Subdirector C TC BIM For a tutorial on the Turbo C integrated environment change to the Turbo C Tour directory and run the Tur
18. T i VP 2000 VH 2000 Series C Language Based User Manual Version 1 0 3 Page 70 Copyright 2011 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com gt Demo programs for display LCD and sound control 128 x 64 Dot Matrix LCD E Speakers Folder Demo Explanation ee a VP 2000 VH 2000 Series C Language Based User Manual Version 1 0 3 Page 71 Copyright 2011 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com gt Demo programs for basic application Folder Demo Explanation Misc Mem 512Kk flash Read write integer float and string data ory from to flash 512k SRAM Read write data from to SRAM eeprom Read write integer and float data from to EEPROM User can read and write the date amp time of RTC Timer Timer Please refer to the following location ftp ftp icpdas com tw pub cd 8000cd napd os 8000 common minios7 demo Com Ports C Style 10 1 Show how to write a function for input data 2 To get a string 3 To use C function sscanf or just use Scanf Receive Receive COM port Slv_COM c is non blocked mode Receive c is blocked mode Slv_COM Slave COM port demo for request reply or ae ToCom_In_Out How to Read Write the byte data via COM ll ml VP 2000 VH 2000 Series C Language Based User Manual Version 1 0 3 Page 72 Copyright 2011 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com gt Demo p
19. VP 2000 VH 2000 Series C Language Based User Manual Version 1 0 3 Page 9 Copyright 2011 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com COM3 RS 232 RS 485 RxD TxD RS 232 RxD TxD CTS RTS CTS RTS and GND for and GND for RS 232 RS 232 Data and Data for non isolated RS 485 non isolated MMI Man Machine Interface STN 128 x 64 Dot Matrix LCD Text Graphics English Simplified Chinese Traditional Chinese LED Indicators 3 Dual Color LEDs PWR 2 Dual Color LEDs RUN RUN LAN1 L1 L2 L3 L1 LAN1 L1 L2 L1 L2 for L3 for user programmable user programmable I O Expansion Slots Slot Number 3 For High Profile I 8K and Hot Swap will be available For High Profile 1 87K Data Bus 8 16 bits Address Bus Range 2 K for each slot Mechanical Dimensions W x H x D 182 mm x 158 mm x 125 mm Installation Panel mounting Ingress Protection Front panel IP 65 Environmental 15 55 C 30 80 C 10 90 RH non condensing Operating Temperature Storage Temperature Ambient Relative Humidity Power Input PoE Range Terminator Block 10 30 Vic 12 48 Voc Capacity 3 A 5 V supply to I O expansion slots Consumption 6 W 0 25 A 24 V 3 6 W 0 15 24 V VP 2000 VH 2000 Series C Language Based User Manual Version 1 0 3 Page 10 Copyright 2011 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com 1 4 Over
20. 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 with a 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 Block 0 6 Block 7 1 EE_WriteEnable Block 8 31 Before writing data to the EEPROM Reserved for the EE_WriteEnable must be called system use to write enable the EEPROM 2 EE_WriteProtect After the data has finished being Block 32 64 written to the EEPROM the For user 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 API for reading data from the EEPROM 4 EE_MultiRead The EE_WriteEnable must be called to read data from the EEPROM no matter what the current mode is VP 2000 VH 2000 Series C Language Based User Manual Version 1 0 3 Page 96 Copyright 2011 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 vp2k h void main void int data 0x55 data2 InitLib Initiate the ViewPAC library EE _WriteEnable EE MultiWrite 1 10 1 a
21. 000 VH 2000 Series C Language Based User Manual Version 1 0 3 Page 126 Copyright 2011 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com l 7510 l 7510 RS 485 Repeater RS 485 Repeater g 7 a gt Slave Mode VP 2000 VH 2000 Series C Language Based User Manual Version 1 0 3 Page 127 Copyright 2011 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com E 5 2 ViewPAC as a Slave Set ViewPAC to the slave mode by adjusting the jumpers on the power board of ViewPAC Refer to the following figure RS485 slave Master 1 VP 2000 VH 2000 Series C Language Based User Manual Version 1 0 3 Page 128 Copyright 2011 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com l 7520 RS 232 to RS 485 Converter l 7561 USB to RS 485 Converter Slave Mode The maximum distance of RS 485 without using a repeater is 1 200 meters 4 000 feet You can extend that distance by adding an RS 485 Repeater every 1 200 meters as shown below 1 2 Km 1 2 Km 1 7520 l 7510 1 7510 RS 232 to RS 485 RS 485 Repeater RS 485 Repeater Converter l 7561 USB to RS 485 Converter Slave Mode VP 2000 VH 2000 Series C Language Based User Manual Version 1 0 3 Page 129 Copyright 2011 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com Appendix F Revision History The table below shows the revision history Revision DEV k Descri
22. 1 Write the high byte dataptr char amp data2 dataptr ReadNVRAM 0 Read the low byte dataptr 1 ReadNVRAM 1 Read the high byte VP 2000 VH 2000 Series C Language Based User Manual Version 1 0 3 Page 102 Copyright 2011 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com 4 6 API for Timer e The ViewPAC can support a single main time tick 8 stop watch timers and 8 counts down timers e The ViewPAC 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 O 3 TimerReadValue After the TimerResetValue has reset the main time ticks to O 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 VP 2000 VH 2000 Series C Language Based User Manual Version 1 0 3 Page 103 Copyright 2011 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com For example the following code can be used to read the main time ticks from 0 include lt stdio h gt include vp2k h void main void
23. Based User Manual Version 1 0 3 Page 111 Copyright 2011 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com Print done else Print Open file error n r mfs_Stop return I For more demo program about the Flash memory please refer to CD NAPDOS vp 2000 demo vp 2111 Basic 64MB_Flash http ftp lcpdas com pub cd 8000cd napdos vp 2000 demo vp 2111 basic 64mb flash VP 2000 VH 2000 Series C Language Based User Manual Version 1 0 3 Page 112 Copyright 2011 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 Tips amp Warnings A DOS whether PC DOS MS DOS or ROMDOS is a set of commands or code that tells the computer how to process information DOS runs programs manages files controls information processing directs input and output and performs many other related functions The following table compares the features between MiniOS7 and ROM DOS Feature MiniOS7 ROM DOS More compact size lt 64 K bytes 64 K bytes Support for I O expansion bus Yes Support for ASIC key Yes Flash ROM management Yes O S update Download Yes Built in hardware diagnostic functions Yes Direct control of 7000 series modules Yes Customer ODM functions
24. C Language Based User Manual Version 1 0 3 Page 98 Copyright 2011 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 Flash Memory VP 2000 VH 2000 Series C Language Based User Manual Version 1 0 3 Page 99 Copyright 2011 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com For example to write an integer to segnment OxDOOO offset 0x1234 of the Flash memory include lt stdio h gt include vp2k h void main void int data 0xAA55 data2 char dataptr int dataptr2 InitLib Initiate the ViewPAC library EraseFlash Oxd000 Erase a block from the Flash memory dataptr char amp data FlashWrite Oxd000 0x1234 dataptr FlashWrite Oxd000 0x1235 dataptr Read data from the Flash Memory method 1 dataprt char amp data2 dataptr FlashRead Oxd000 0x1234 dataptr 1 FlashRead Oxd000 0x1235 Read data from the Flash Memory method 2 dataptr2 int far MK _FP Oxd000 0x1234 data data VP 2000 VH 2000 Series C Language Based User Manual Version 1 0 3 Page 100 Copyright 2011 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com 4 5 API for NVRAM
25. DT 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 VP 2000 VH 2000 Series C Language Based User Manual Version 1 0 3 Page 105 Copyright 2011 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com For example to refresh the Watchdog Timer include lt stdio h gt include vp2k h void main void Unsigned long time iTime InitLib Initiate the ViewPAC library Enable WDT While quit RefreshWDT User_function I DisableWDT For more demo program about the WatchDog Timer please refer to VP 2111 CD NAPDOS vp 2000 demo vp 2111 Basic Timer http ftp lcodas com pub cd 8000cd napdos vp 2000 demo vp 2111 basic timer VH 2110 CD NAPDOS vp 2000 demo vh 2110 Basic Timer http ftp lcodas com pub cd 8000cd napdos vp 2000 demo vh 2110 basic timer VP 2000 VH 2000 Series C Language Based User Manual Version 1 0 3 Page 106 Copyright 2011 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com 4 8 API for MFS For VP 2111 module only Required library and header files MFS_V211 lib and MFS h The VP 2111 equips an extra 64MB flash memory the MFS is designed to read write file from to the 64MB flash memory For full usage information regarding the hardware supported applications and t
26. Digital 1 0 Module I O Type 1 0 select by programming User can refer to the demo to write I 8050W s code 8017hw 8017HW is a 14 bit 100K sampling rate 8 channel analog input module User can refer to the demo to write I 8017HW s code I 8024W is a 4 channel Isolated Analog Output Module User can refer to the demo to write I 8024W s code Tg 87K_demo This demo program is for 87K General Function in VP 2000 VH 2000 Series C Language Based User Manual Version 1 0 3 Page 75 Copyright 2011 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com como 87K_DI This demo program is for I 87K Digital Input Module evn sens 0 eS 87K DO This demo program is for I 87K Digital Output Module evn see aire 87K_DIO The demo program is for l 87K DIO Module in Com0O SG Revco ances This demo program is for I 87K Analog Input Modules Such as I 87013W I 87015W I 87017W I 87018W 8088W is a8 PWM output channels and 8 Digital Input Module User can refer to the demo to write I 8088W s code 87024w This demo program is for I 87024W Analog Output Module Find_lO This demo program is the basic function Let you know how to get the card information in the MCU of l 8000 series o 8084 m o For more detailed information regarding the I O expansion module APIs please refer to CD NAPDOS vp 2000 demo vp 2111 Basic lib http ftp icodas com pub cd 8000cd napdos vp 2000 demo vp 2111 basic lib
27. E A load232 dl MiniOS7_Utility chm 1 025KE z1 UDF Lonnect to 100 0 74 47 patha GTS I EM z One is the Hello eee application file and the futodounload Files Hong other IS the Current work directory D autoexec bat batch file Keagin Key Thread l Tips amp Warnings AN Before restaring the module for settings to take effect you must firstly turn the switch of Init to OFF position and if the ViewPAC work in the highly complex environment the switch of Unlock mst be turned to be ON position VP 2000 VH 2000 Series C Language Based User Manual Version 1 0 3 Page 42 Copyright 2011 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com 2 5 Updating the ViewPAC OS image ICP DAS will continue to add additional features to ViewPAC in the future we advise you periodically check the ICP DAS web site for the latest update to ViewPAC Step 1 Get the latest version of the ViewPAC OS image pan 20080 EEE Module Name Release Date VH2110 20090903 i1mg 6 Module Name B Release Date amp The latest version of the ViewPAC OS image can be obtained from VP 2111 CD NAPDOS vp 2000 os_image vp 2111 http ftp Icodas com pub cd 8000cd napdos vp 2000 os image vp 2111 VH 2110 CD NAPDOS vp 2000 os_image vh 2110 http ftp Icodas com pub cd 8000cd napdos vp 2000 os image vh 2110 VP 2000 VH 2000 Series C Language Based User Man
28. ER Continue ESC Cancel VP 2000 VH 2000 Series C Language Based User Manual Version 1 0 3 Page 48 Copyright 2011 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com Step 3 Enter the letter of the hard drive you wish to install the software Turbo G 2nd Edition Installation Utility Enter the SOURCE drive to use Enter the drive from which you wish the INSTALL utility to copy files Typically this is the drive that contains the INSTALL disk ENTER Select ESC Cancel Turbo C 2nd Edition Installation Utility Enter the path to the directory containing the Turbo C files ERE petetenset VP 2000 VH 2000 Series C Language Based User Manual Version 1 0 3 Page 49 a ee 3 r a 7 5 PNR Ll L a ke IrnArRKM IRAN AA IL ARK Arm PRESS r s y a AN mee VT TO mt ACA AY 27e Y Le ie ag ay V A av I mE CAR WVU LLU FM N TICO I MWO OUI VOU L d C S Step 5 Select Start Installation to begin the install process cs CADOCUME 1 User t MtcppiDIUNSTALL EXE Turbo C 2nd Edition Installation Utility Turbo C Directory C STC Binary Files Subdirectory C NTCNHBIN Header Files Subdirectory C NTCSINCLUDE Library Subdirectory CESTCSLIE BGI Subdirectory C 2 TC BGI Tour Subdirectory C NTCSTOUR Class Library Subdirectoruy CENTCSCLASSLIE Examples Subdirectory CENTCSERAMPLES Install Tour Yes Un pa Le
29. Floating Point to Emulation and the Instruction Set to 80186 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 cs Command Prompt te Application eneration Entry Exit Code C options Optimizations SOUPCE Detect and use coprocessor other VP 2000 VH 2000 Series C Language Based User Manual Version 1 0 3 Page 63 Copyright 2011 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com Step 10 Set the TC compiler include and library directories i Select Directories from the Options menu ii On Include Directories option specify the header file iii On Library Directories option specify the function library file iv Select OK cn Command Prompt te Application Compiler Transfer Make Linker Librarian Dine ented Environment ource Directories VP 2000 VH 2000 Series C Language Based User Manual Version 1 0 3 Page 64 Copyright 2011 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com Step 11 Select Build all from the Compile menu to build the project ce Command Prompt te Edit Search Run Debug Project 0 tions Alt F F void void Information Remove messages S
30. Hello fut o Aun HELLO _ EXE application file and the futodoumload Files Mone other iS the Current work directory D SYSTEM autoexec bat batch file Legin Key Thread VP 2000 VH 2000 Series C Language Based User Manual Version 1 0 3 Page 66 Copyright 2011 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com Tips amp Warnings VAN Before restaring the module for settings to take effect you must firstly turn the switch of Init to OFF position and if the ViewPAC work in the highly complex environment the switch of Unlock mst be turned to be ON position VP 2000 VH 2000 Series C Language Based User Manual Version 1 0 3 Page 67 Copyright 2011 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com 4 APIs and Demo References There are several APIs and demo programs that have been designed for ViewPAC 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 Header File Library VP 2111 VH 2110 VP 2111 VH 2110 vp2k h VH2K h vp2k lib VH2K lib API Description For more detailed information regarding ViewPAC APIs please refer to CD NAPDOS vp 2000 demo Readme txt http ftp icodas com pub cd 8000cd napdos vp 2000 d
31. Manual Version 1 0 3 Page 86 Copyright 2011 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com printCom 1 char Print char Putch item ToCom 1 item Print n rASCII c n r item printCom 1 n rASCII c n r item printCom 1 Hex 02X n r item Print Hex 02X n r item I I I I I I Delay 10 RestoreCom 1 I I VP 2000 VH 2000 Series C Language Based User Manual Version 1 0 3 Page 87 Copyright 2011 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com 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 Request VP 2111 Request Response a Debug information Command1 Command1 gt Debug information Command2 Command2 Q Debug information Quick program Other command Debug information Unknown command VP 2000 VH 2000 Series C Language Based User Manual Version 1 0 3 Page 88 Copyright 2011 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com 4 2 API for I O Modules gt The ViewPAC is equipped with 3 1 0 slots to access the I 8k and I 87k series I O modules High profile as shown the poi
32. VP 2000 VH 2000 Series C Language Based User Manual Version 1 0 3 Page 76 Copyright 2011 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com 4 1 API for COM Port The ViewPAC provides built in COM ports as below shown gt VP 2111 COMS3 COM1 60 P VP 2000 VH 2000 Series C Language Based User Manual Version 1 0 3 Page 77 Copyright 2011 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com gt VH 2110 COMS3 COM1 80 P VP 2000 VH 2000 Series C Language Based User Manual Version 1 0 3 Page 78 Copyright 2011 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 COM1 if you use the COM1 port you ll have the alternative of C style Standard COM port functions only can be used with the 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 COM Buffer Functions Functions Port MiniOS7 1 2 ReadCom 1 KB 1KB IsCom ToCom COM port etc C style 512 256 Standard 1 Kbhit Getch Print Bytes Bytes COM port VP 2000 VH 2000 S
33. Yes Free of charge Yes VP 2000 VH 2000 Series C Language Based User Manual Version 1 0 3 Page 113 Copyright 2011 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com Appendix B What is MiniOS7 Utility IVIEW 100 Functions Supported connection ways 1 COM port connection RS 232 2 Ethernet connection TCP amp UDP Supported since version 3 1 1 Maintenance 1 Upload file s 2 Delete file s 3 Update MiniOS7 image Configuration 1 Date and Time 2 IP address 3 COM port 4 Disk size Disk A Disk B Check product information 1 CPU type 2 Flash Size 3 SRAM Size 4 COM port number Download location MiniOS7 Utility is a tool for configuring uploading files to all products embedded with ICPDAS MiniOS7 with easiness and quickness Note Since version 3 1 1 the Utility can allow users remotely access the controllers 7188E 8000E ect through the Ethernet Including Frequently Used Tools a 7188XW b 7188EU c 188E d SendTCP e Send232 f VxComm Utility PC System Requirements 1 IBM compatible PC 2 Windows 95 98 NT 2000 XP Supported Products 1 7188XA XB XC 2 188EX series 3 All i 8000 series 4 iView100 5 uPAC 7186EX 6 ET 6000 series 7 ET 7000 series VP 2000 VH 2000 Series C Language Based User Manual Version 1 0 3 Page 114 Copyright 2011 ICP DAS Co Ltd All Rights Reserved E mail service icpdas co
34. _com VP 2000 VH 2000 Series C Language Based User Manual Version 1 0 3 Page 90 Copyright 2011 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com 4 2 1 Steps to use I 8K series 1 0 modules in slots for VP 2111 module only API for reading DI modules DI 8 DI_16 DI_ 32 The DI 8 amp DI_16 DI32 must be called to read input value of DI modules Sending commands to I 8K series O modules For example reading the input value of slot 3 DI modules include lt stdio h gt include vp2k h void main void Int DI_ data iSlot 3 InitLib Initiate the vp2k library For DI_ data DI_ 8 iSlot Read the input value of slot 3 DI module printf DI Status x n r DI data VP 2000 VH 2000 Series C Language Based User Manual Version 1 0 3 Page 91 Copyright 2011 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com 4 2 2 Steps to use I 87K series I O modules in slots for VP 2111 module only Follow the following steps to use I 87K series I O modules in slots 1 Use Installcom to install the COM port driver 2 Use ChangeToSlot to assign the slot which the I 87k I O module plugged in 3 Use SendCmdTo7000 0 to send commands 4 Use ReceiveResponseFrom7000_ms to get the response 5 Use RestoreCom to restore the COM port driver Sending commands to i 87K series O modules Tips amp Warnings
35. ate online k orms Co i eB IFA Save aCopy a P Search 1 W T gt Sigi A 2 1 1 InstallCom A 2 1 2 bCtsChanged x A 2 1 3 CurCTS x 52 1 4 CurRTS x A 2 1 5 fCtsControlMode x DS 2 1 6 fRisControlhiode x A 2 1 7 ClearCom S 2 1 8 ClearTxBuffer 5 2 1 9 DataSizelnCom A 2 1 10 GetTxBufferFreeSize A 2 1 11 GetCtsStatus DA 2 1 12 InstallcomlinputData A 2 1 13 IsCom A 2 1 14 IsTxBufEmpty A 2 1 15 IsComOutBufEmpty A 2 1 16 IsDetectBreak A 2 1 17 printCom L 2 1 18 RestoreCom A 2 1 19 ReadCom A 2 1 20 ReadComn A 2 1 21 SetComTimeout A 2 1 22 SetComPortBufferSize 5 2 1 23 SetCtsControlMode ll gt e Options x 1 Library Selection for All 1 7188 80 ER 2 COM Ports Functions E B 2 1 Common Functions Yariables A 2 1 1 InstallCom A 2 1 2 bCtsChanged_x A 2 1 3 CurCTS x 2 1 4 CurRTS x A 2 1 5 fCtsControlMode x A 2 1 6 fRtsContralMade_x B 2 1 7 ClearCom A 2 1 8 ClearTxBuffer A 2 1 9 DataSizelnCom A 2 1 10 GetTxBufferFreeSize A 2 1 11 GetCtsStatus 2 1 12 InstallCominputData A 2 1 13 IsCom A 2 1 14 IsTxBufEmpty A 2 1 15 IsComOutBufEmpty A 2 1 16 IsDetectBreak 2 1 17 printCom D 2 1 18 RestoreCom 2 1 19 ReadCom 2 1 20 ReadComn A 2 1 21 SetComTimeout A 2 1 22 SetComPortBufferSize A 2 1 23 SetCtsControlMode y gt E Attachments E Comments Attachments a
36. bo C Tour For example Change to C NTCTOILR C NTCSHI And type TUUR Executing C o TC BI Press any key to continue Executing e CENTCSBINNTHELPF Cest FC NTCNBINNTCHELPF TCH Executing CS TCSBINNUNZIP EXE TC IP C ITC HIN Executing C TC BIMSTHELP COM FC TC BINSICHELP TCH zH Any Key Cont inue Step 8 Installation is complete VP 2000 VH 2000 Series C Language Based User Manual Version 1 0 3 Page 51 Copyright 2011 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com 3 1 2 Setting up the Environment Variables After installing the compiler several compilers will be available from the Windows Command line You can set the path environment variable so that you can execute this compiler on the command line by entering 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 BL Right click My My Computer Computer and then oper select Properties Explore Search Manage 2 X System Restore Automatic Updates Remote General Computer Hame Hardware Advanced System Microsoft Windows 4P Professional Properties Version 2002 Registered to pthuang Icp p527 4 640 0000356 23006 Computer AMD K6ftm 30 processor 451 MHz 192 MB of
37. d to take care of the following matters e Generate a standard DOS executable program e Set the CPU option to 80188 80186 e Set the floating point option to EMULATION if floating point computation is required Be sure not to choose 8087 Cancel the Debug Information function as this helps to reduce program size MiniOS7 supports this feature Here we have used the Turbo C 1 01 to write your first program as an example VP 2000 VH 2000 Series C Language Based User Manual Version 1 0 3 Page 47 Copyright 2011 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com 3 1 1 Installing the 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 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 es CADOCUTME l User tcppl0lUNETALL EXE Turbo C 2nd Edition Installation Utility Copyright lt c 1991 by Borland International Inc Install Utility Welcome to the Turbo C installation program This program will copy the files needed to install Turbo G on your system You will need about 7 5 megabytes of avai Bale 5 care 1f you wish to install all the memory cels unpack the execvles and copy the Tour files Press ENTER to continues ESC to quit O ENT
38. e is any data in the COM port input buffer data ReadCom 1 Read data from COM1 port ToCom 1 data Send data via COM1 port ifldata q quit 1 If q is received exit the program RestoreCom 1 Uninstall the COM1 driver VP 2000 VH 2000 Series C Language Based User Manual Version 1 0 3 Page 81 Copyright 2011 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com API for showing data from COM ports 6 printCom Functions such as printfCom in the C library allow data to be output from COM ports For example showing data from the COM1 port include lt stdio h gt include vp2k h void main void int i Initiate the ViewPAC library InitLib InstallCom 1 115200 8 0 1 Install the COM1 driver for i 0 i lt 10 i printCom 1 Test d n r i Delay 10 Wait for all data are transmitted to COM port RestoreCom 1 VP 2000 VH 2000 Series C Language Based User Manual Version 1 0 3 Page 82 Copyright 2011 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com 4 1 3 API for standard COM port The standard COM port is used to upload program from PC to the ViewPAC Tips amp Warnings C style Standard COM port functions only can be used with the COM port the following configurations of the COM1 port are fixed Baudrate 115200 bps Data format 8 bits Parity check n
39. earch Run Compile Debug Project Options Window Help Library HELLO LIB Adding HELLO OBJ Total File Lines compiled 1573 A Warnings f 4 Errors amp 4 Available Sama 1978K Fi Help lt F8 Next Msg ALt FY Prev Mag Al1t F Compile F9 Make Fil Menu Step 12 Configure the operating mode Make sure the switch of the Unlock placed in the ON position and the switch of the Init placed in the ON position Init VP 2000 VH 2000 Series C Language Based User Manual Version 1 0 3 Page 65 Copyright 2011 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com Step 13 Create an autoexec bat file Untitled Notepad SRE File Edit Format view Help i Open the Notepad HELLO exel ii Type the HELLO exe iii Save the file as autoexec bat Step 14 Upload programs to ViewPAC using MiniOS7 Utility For more detailed information about this process please refer to section 2 4 1 Establishing a connection PA MiniOS Utility Verion 3 1 7 3 En Fie Connection de Command Configuration D Tools 4 Help Look in 0 Mini0S 7 _ Utility w Lock in Disk A Name Size Type Name Size Modified bin File Folder hello exe 138 9285 2006 679 CD FIRMWARE File Folder autoenec 25 2005 8 5 9 05_IMAGE File Folder icpdas 1KE A load232 dll EP MiniOS7_Utility chm 1 025KE z1 T DF Lonnect to 100 0 74 47 path STs TEM 2 u One is the
40. eceived exit the program I I VP 2000 VH 2000 Series C Language Based User Manual Version 1 0 3 Page 84 Copyright 2011 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com For example showing data through COM1 include lt stdio h gt H include vp2k h void main void int i Initiate the ViewPAC library InitLib for i 0 i lt 10 i Print Test d n r i VP 2000 VH 2000 Series C Language Based User Manual Version 1 0 3 Page 85 Copyright 2011 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com 4 1 4 COM Port functions Comparison For example learning to show the ASCII code MiniOS7 COM port functions Standard COM port functions include lt stdio h gt include vp2k h void main void unsigned char item InitLib InstallCom 1 115200 8 O 1 printCom 1 Hits any key n printCom 1 Hit the ESC to exit n for if IsCom 1 item ReadCom 1 if item q return else printCom 1 n r include lt stdio h gt include vp2k h void main void unsigned char item InitLib Print Hits any key n Print Hits the ESC to exit n for if kbhit item Getch if item q return else Print n r VP 2000 VH 2000 Series C Language Based User
41. ed User Manual Version 1 0 3 Page 15 Copyright 2011 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 DANE ere 0 vp 2000 demo vh 2110 Demos related to VH 2110 vp 2111 Demos related to VP 2111 Readme txt document data _ sheet VP 2000_VH 2000 pdf Documents related to ViewPAC os Image vh 2110 OS images related VH 2110 vp 2111 OS images related to VP 2111 PC_ Tools MiniOS7_ Utility Files related to MiniOS7 Utility PC Test Program Tools related to ViewPAC VP 2000 VH 2000 Series C Language Based User Manual Version 1 0 3 Page 16 Copyright 2011 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 installation and configuration In addition to Quick Start Guide the package includes the following items if any items are damaged or missing please contact us oo WU eee 252 Ee VP 2111 VP 2111 TC RJ 45 Waterproofing Kit Software Utility CD VH 2110 VH 2110 TC A i n a re N A a P Co RS anel Clips crew Driver cre RS 232 Cable j y VP 2000 VH 2000 Series C Language Based User Manual Version 1 0 3 Page 17
42. emo readme txt VP 2000 VH 2000 Series C Language Based User Manual Version 1 0 3 Page 68 Copyright 2011 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 ViewPAC API set Functions Library VH 2110 vh2k lib VP 2111 vp2k lib This file contains the MiniOS7 API Application Programming Interface and has hundreds of pre defined functions Header File VH 2110 vh2k h VP 2111 vp2k h This file contains the forward declarations of subroutines variables and other identifiers used for the MiniOS7 API COM Ports EEPROM Flash Standard IO Memory MiniOS7 API Progra Functions mmable 10 Timer and WatchDogTi mer VP 2000 VH 2000 Series C Language Based User Manual Version 1 0 3 Page 69 Copyright 2011 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 Icodas com pub cd 8000cd napdos minios7 document zje Options X ra at L 1 Library Selection for AI l 7 1807l 5 a A 4 F Adobe Reader MiniOS7_API pdf o E A 2 COM Ports Functions MAG i it View Document Too indow He ties ox Re A a e m cH 2 1 Common Functions ariables cre
43. er Controller or using a PC as a host controller and some RS 485 devices Tips amp Warnings lf PC Laptop has no COM port you can use the l 7561 USB to A RS 485 converter for connection between ViewPAC and PC Laptop Before using the l 7561 converter you must install the USB driver The USB driver can be obtained from ftp ftp icodas com pub cd 8000cd napdos 7000 756x l 7520 RS 232 to RS 485 Converter or l 7561 USB to RS 485 Converter pes 7 SS ME VP 2000 VH 2000 Series C Language Based User Manual Version 1 0 3 Page 121 Copyright 2011 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com E 2 Daisy Chain RS 485 Network All RS 485 devices are wired directly to the main network If the network is up to 1 2 km it will need a repeater 7510 series to extend the network length 1 2 Km 1 2 Km 1 7520 l 7510 1 7510 RS 232 to RS 485 RS 485 Repeater RS 485 Repeater Converter or l 7561 USB to RS 485 Converter VP 2000 VH 2000 Series C Language Based User Manual Version 1 0 3 Page 122 Copyright 2011 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com E 3 Star Type RS 485 Network There are branches along the main network In this case it is better to have a repeater to isolate or filter the noise that is made by devices I 7510 I 7510 I 7510 RS 485 Repeater RS 485 Repeater RS 485 Repeater l 7520 RS 232 to RS 485 Converter
44. eries C Language Based User Manual Version 1 0 3 Page 79 Copyright 2011 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com 4 1 2 API for MiniOS7 COM port API for using COM ports 1 InstallCom Before any COM Port can be used the driver must be installed by calling InstallCom 2 RestoreCom If the program calls InstallCom the RestoreCom must be called to restore the COM Port driver API for checking if there is any data in the COM port input buffer 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 ports 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 VP 2000 VH 2000 Series C Language Based User Manual Version 1 0 3 Page 80 Copyright 2011 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com For example reading and receiving data through the COM 1 include lt stdio h gt include vp2k h void main void int quit 0 data InitLib Initiate the ViewPAC library InstallCom 1 115200 8 0 1 Install the COM1 driver while quit if IsCom 1 Check if ther
45. h COM ports Follow the following steps to use I 7K and I 87K series 1 0 modules that are connected with COM port 1 Use Installcom to install the COM port driver 2 Use SendCmdTo7000 0 to send commands 3 Use ReceiveResponseFrom7000_ms to get the response 4 Use RestoreCom to restore the COM port driver Sending commands to l 87K series 1 0 modules Sending commands to I 7K series I O modules VP 2000 VH 2000 Series C Language Based User Manual Version 1 0 3 Page 94 Copyright 2011 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com For example sending a command SOOM to the I 7K and I 87k I O module that are connected with COM 2 for getting the module name include lt stdio h gt include vp2k h void main void unsigned char InBufO 60 InitLib Initiate the vp2k library InstallCom 1 115200 8 0 1 Install the COM1 driver InstallCom 2 115200 8 0 1 Install the COM2 driver SendCmdTo7000 2 SOOM 0 Send a command to COM2 Timeout 50ms check sum disabled ReceiveResponseFrom 000_ms 2 InBufO 50 0 printCom 1 Module Name s InBufO Delay 10 Wait for all data are transmitted to COM port RestoreCom 1 Uninstall the COM1 driver RestoreCom 2 Uninstall the COM2 driver VP 2000 VH 2000 Series C Language Based User Manual Version 1 0 3 Page 95 Copyright 2011 ICP DAS Co Ltd All Rights Reserved E
46. he specification please refer to section Appendix C What is MiniOS7 File System MFS e Summarize of the MFS functions Function Description mfs_X600Fs_GetLibVersion Gets the total number of files stored in the NAND mfs_GetFileNo Flash Gets the size of available space that can be used to mfs_GetFreeSize append file mfs_GetBadSize Gets the size of non available space mfs_GetUsedSize Gets the size of used space mfs_GetFileSize Gets the size of file stored in the NAND Flash Uses the specified filename to retrieve file mfs_GetFilelnfoByName information Uses the file number index to retrieve file mfs_GetFilelnfoByNo l l information mfs_DeleteAllFiles Delete all files stored in the NAND Flash Delete one selected file that has been written to mfs_DeleteFile the NAND Flash mfs_OpenFile 1 Opens a file with a file name VP 2000 VH 2000 Series C Language Based User Manual Version 1 0 3 Page 107 Copyright 2011 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com Function Description 2 Creates a new file Closes a file with a file handle mfs_CloseFile All buffers associated with the stream are flushed before closing mfs_ Gets Gets a string from a file mfs_ Puts Outs a string a file Macro that tests if end of file has been reached on mfs_EOF fi a file mfs_ Seek Repositions the file pointer of a file mfs_ Tell Returns the current file pointer
47. he VP 2111 is switched off when wring the I O module which are plugging in the VP 2111 slots For more information about expansion module that are compatible with the ViewPAC please refer to htto Wwww icodas com products PAC viewpac lO Expansion htm Tips amp Warnings A By I 8K and I 87K series expansion modules support is provided only in High Profile series VP 2000 VH 2000 Series C Language Based User Manual Version 1 0 3 Page 24 Copyright 2011 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com 2 1 2 Mounting the IP 65 Waterproof connector The ViewPAC provides an IP 65 waterproof connector which consists of the following components plugged in RJ 45 cable Below are step by step instructions for mounting the IP 65 Waterproof connector Step Step 2 080608 OC Step 3 VP 2000 VH 2000 Series C Language Based User Manual Version 1 0 3 Page 25 Copyright 2011 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com Step 9 Er Step 11 a ee Step 12 Step 15 Step 16 VP 2000 VH 2000 Series C Language Based User Manual Version 1 0 3 Page 26 Copyright 2011 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com 2 2 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 insta
48. ie Recommended Panel Cut Out Take care not to cover ventilation holes in the top bottom and sides of the instrument Step 2 Insert the ViewPAC through the panel cut out VP 2000 VH 2000 Series C Language Based User Manual Version 1 0 3 Page 20 Copyright 2011 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com Step 3 Install the panel mounting clips in the View PAC of the upper and lower panel surface VP 2000 VH 2000 Series C Language Based User Manual Version 1 0 3 Page 21 Copyright 2011 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com Step 4 Screw the panel mounting clips to the panel Tips amp Warnings A Recommended Screw Torque 3 4 4 5 kgf cm Mounting screw M4 x 35L VP 2000 VH 2000 Series C Language Based User Manual Version 1 0 3 Page 22 Copyright 2011 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com Step 5 Connect the ViewPAC to PC and setting up the power supply i Connect PC to LAN port of ViewPAC ii Connect the power supply 10 30 V to PWR1 and GND terminals of ViewPAC Power Supply 10 30 Voc VS GND Switch VP 2000 VH 2000 Series C Language Based User Manual Version 1 0 3 Page 23 Copyright 2011 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com Step 6 Inserting the 1 0 modules for VP 2111 module only It is recommended that the power to t
49. ies C Language Based User Manual Version 1 0 3 Page 29 Copyright 2011 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com 2 4 Uploading ViewPAC 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 ViewPAC is connected to PC The upload process has the following main steps 1 Establishing a connection between PC and ViewPAC 2 Uploading and executing programs on ViewPAC 3 Making programs start automatically All of these main steps will be described in detail later VP 2000 VH 2000 Series C Language Based User Manual Version 1 0 3 Page 30 Copyright 2011 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com 2 4 1 Establishing a connection between PC and ViewPAC There are two ways to establish a connection between PC and ViewPAC gt RS 232 Connection gt Ethernet Connection Hub mes Each of the connection types will be described in detail later VP 2000 VH 2000 Series C Language Based User Manual Version 1 0 3 Page 31 Copyright 2011 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com 2 4 1 1 RS 232 connection Below are step by step instructions on how to connect to PC using a RS 232 c
50. le D Connection amp Command Config L New connection Look i w i m we Last Connection Alt F2 Disconnect Ctrl F2 7 Name h bn Search Fiz je i FM Fab Va ders _ 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 vs Connection Connection History Serial Port TCP UDP Baud Rate 115200 IF 10095 Data Bit Port Parity DlM one Stop Bit VP 2000 VH 2000 Series C Language Based User Manual Version 1 0 3 Page 38 Copyright 2011 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com Step 10 The connection has already established P MiniOS7 Utility Verion 3 1 7 gt Connection F2 Ey pi Delete F 3 SS Refresh F 3 VP 2000 VH 2000 Series C Language Based User Manual Version 1 0 3 Page 39 Copyright 2011 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com 2 4 2 Uploading and executing ViewPAC programs Before uploading and executing ViewPAC programs you must firstly establish a connection between PC and ViewPAC for more detailed information about this process please refer to section 2 4 1 Establishing a connection Step 1 On PC side right click the file name that you wish to upload and then se
51. lect the Upload A MiniOS7 Utility Verion 3 1 7 Seles GH File jb Connection Wa Command Configuration T2 Tools amp Help hi TT a aa a EEEE OCT OCT TOO CC OC CO EEE EEEE EEEE C EEEE EEEE OO OO OOOO COOL 3 Se f p3 PPP eee eee ee rere eee eee eer ee eee eee eee eee ee ree eee eT ee ee ee eee eee eee eee eee eee ee eee Tere ee Tere ere Tee eT ee eee Tee eee eT eee eee eee eT Tere ee Terre Mo Mame Size Modified Name Size Type B Hello TKE Application _ Uplu Upload amp Execute R AM Update Mims Image Tu Fil uzme EERE LLLLLLLLELLLLELLLLLLLLLLLLLLLLLLLLLLLLLLLLELLLLLLLLLLLLLLLELLLLLEL r nnn nannu en r module side Step 2 On the module side right click the file name that you wish to execute and then select the Run MiniOS7 Utility Verion 3 1 7 Sele GH File gt Connection ae Command Configuration T Tools 43 Help j Tr OOOO OCC OL O iii NN TU NT ENT UN TON EEEE EEEE EEEE EEEE EEEE EEEE TENTE TENTE TETE TENTE TE a F5 CCT x af Name Size Tope Ho Mame Size Modified Hello 187KB Application irene 41 962 2008 Run with parameters Reset Mims F4 COLLLLLLLLLLLLLLLLLLLLLELLLLLLLLLLLLLLLLLLLLLLLLLLE saan Purema a a DLA VP 2000 VH 2000 Series C Language Based User Manual Version 1 0 3 Page 40 Copyright 2011 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com 2 4 3 Making programs start automatically Af
52. lling the ViewPAC 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 vp 2000 Demo vh 2110 Basic Framework vp 2111 Basic Demo htm Readme txt VP 2000 VH 2000 Series C Language Based User Manual Version 1 0 3 Page 27 Copyright 2011 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com Step 2 Install the MiniOS7 Utility bios Utility 321 ee Liu Utility Ver 321 Setup 7 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 VP 2000 VH 2000 Series C Language Based User Manual Version 1 0 3 Page 28 Copyright 2011 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com 2 3 Boot Configuration Before you upload some programs to ViewPAC you need to enter the Init mode and disable the Write Protection Make sure the switch of the Unlock placed in the ON position and the switch of the Init placed in the ON position VP 2000 VH 2000 Ser
53. m Appendix C What is MiniOS7 File System MFS For VP 2111 module only MiniOS7 file system MFS offers a rugged alternative to mechanical storage systems Designed for NAND flash memory MFS implements a reliable file system with C language API for embedded data logger applications on MiniOS7 uUPAC 7186EX FD MiniOS7 File Y Stem MiniOS7 Family Products Using the MFS MiniOS7 File System library you can dynamically read write files from to the 64MB flash memory Many kinds of applications related to data logger can be implemented For example log analog signal values with timestamp log RS 232 485 communication data for analysis VP 2000 VH 2000 Series C Language Based User Manual Version 1 0 3 Page 115 Copyright 2011 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com gt Supported Product e uPAC 7186ED FD e iP 8441 FD P 8841 FD e VP 2111 gt Applications e Log data with timestamp e Log data and forward via the Ethernet User s program COM Port Functions I O Devices S VY VP 2000 VH 2000 Series C Language Based User Manual Version 1 0 3 Page 116 Copyright 2011 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com gt MES Specifications Item Description 2 disk A and B 12 bytes max case sensitive File operation Read modes Write Creates a new file to write data or overwrite a file if the file is alread
54. mp data EE_WriteProtect EE MultiRead 1 10 1 amp data2 Now data2 data 0x55 For more demo program about the EEPROM please refer to VP 2111 CD NAPDOS vp 2000 demo vp 2111 Basic Misc http ftp lcodas com pub cd 8000cd napdos vp 2000 demo vp 2111 basic misc VH 2110 CD NAPDOS vp 2000 demo vh 2110 Basic Misc http ftp lcodas com pub cd 8000cd napdos vp 2000 demo vh 2110 basic misc VP 2000 VH 2000 Series C Language Based User Manual Version 1 0 3 Page 97 Copyright 2011 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com 4 4 API for Flash Memory e The ViewPAC module contains 512 Kbytes of Flash memory e MiniOS7 uses the last 64K bytes the other parts of the memory are used to store user programs or data e 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 O x 8000 O x 9000 A Free 448 K bytes 0 x A000 MiniOS7 64 K bytes Total Size 512 K bytes O x BOOO O x C000 O x DOOO O x 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 VP 2000 VH 2000 Series
55. ni0S7_Utility chm runs B MiniOS7_Utility eve C MiniO0S 7_Utility ini uart dll VP 2000 VH 2000 Series C Language Based User Manual Version 1 0 3 Page 45 Copyright 2011 ICP DAS Co Ltd All Rights Reserved E mail service 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 This chapter is step by step guide on how to write your first ViewPAC program Hello World VP 2000 VH 2000 Series C Language Based User Manual Version 1 0 3 Page 46 Copyright 2011 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 ViewPAC 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 gt Turbo C Version 1 01 gt Turbo C Version 2 01 gt Borland C Versions 3 1 5 2 x gt MSC gt MSVC 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 nee
56. nstructions on how to connect to PC using an Ethernet connection Step 1 Turn the switch of the Unlock to ON position and the switch of Init to ON position Hub mes VP 2000 VH 2000 Series C Language Based User Manual Version 1 0 3 Page 35 Copyright 2011 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 New connection F2 Look jr Last Connection Alt F2 he Q ki e CtritF2 Size Type File Folder O FIRMWARE File Foldes EOS IMAGE File Foldes 7188xw IKB Cont Step 5 On the MiniOS7 Scan dialog box choose the module name from the list and then choose IP setting from the toolbar LE on IF setting VP 2000 VH 2000 Series C Language Based User Manual Version 1 0 3 Page 36 Copyright 2011 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 DHE c Dizable O E nable IF ttine success Do vou want to leave IP setting dialog VP 2000 VH 2000 Series C Language Based User Manual Version 1 0 3 Page 37 Copyright 2011 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com Step 8 Click the New connection function from the Connection menu MiniOS7 Utility Verion 3 1 7 3 33 Fi
57. nt 1 and point 2 in the figure below for VP 2111 module only gt The ViewPAC is equipped with multi serial ports to access the I 7K series 1 0 modules for a wide range of RS 485 network application as shown the point 3 in the figure below for VP 2111 module only gt The ViewPAC can connect to RU 87P2 4 8 to access the I 87k I O series modules through RS 485 as shown the point 4 in the figure below I 87K Module I 8K Module I 87K Module I 7K Module VP 2000 VH 2000 Series C Language Based User Manual Version 1 0 3 Page 89 Copyright 2011 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com The demo programs used for I 7K I 8k and I 87k can be divided into the following For I 8k and I 87k I O modules in slots please refer to VH 2110 CD NAPDOS vp 2000 demo vh 2110 Basic lO_in_ Slot http ftp icodas com pub cd 8000cd napdos vp 2000 demo vh 2110 basic io in s lot VP 2111 CD NAPDOS vp 2000 demo vp 2111 Basic lO_in_ Slot http ftp icodas com pub cd 8000cd napdos vp 2000 demo vp 2111 basic io in s lot For I 7K and l 87k I O modules is connected to the COM ports please refer to VH 2110 CD NAPDOS vp 2000 demo vh 2110 Basic 7K87K_for_COM http ftp icodas com pub cd 8000cd napdos vp 2000 demo vh 2110 basic 7k87k for com VP 2111 CD NAPDOS vp 2000 demo vp 2111 Basic 7K87K_for_COM http ftp icodas com pub cd 8000cd napdos vp 2000 demo vp 2111 basic 7k87k for
58. ompliant Front Panel gt STN LCD with Chinese Font gt Rubber Keypad with 24 Keys gt One 10 100M Ethernet Port gt 64 bit Hardware Serial Number for Software Protection gt Operating Temperature 15 55 C VP 2000 VH 2000 Series C Language Based User Manual Version 1 0 3 Page 8 Copyright 2011 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com 1 3 Specification VP 2111 VH 2110 0 Program Download Interface Compilers to create exe Files TC 1 01 Freeware TC 2 01 Freeware BC 3 1 5 2x MSC 6 0 MSC before version 1 5 2 CPU Module C O P SRAM Dual Battery Backup SRAM 80186 or compatible 16 bit and 80 MHz 768 KB 512 KB 512 KB for 5 years retention 512 KB 100 000 erase write cycles 64 MB NAND Flash 100 000 erase write cycles Flash Flash Disk EEPROM 16 KB Data Retention 40 years 1 000 000 erase write cycles NVRAM RTC Real Time Clock 31 bytes battery backup data valid up to 5 year Provide second minute hour date day of week month year 64 bit Hardware Serial Yes Number Watchdog Timers Yes 0 8 second Communication Ports Ethernet RJ 45 x 1 10 100 Base TX Auto negotiating Auto MDI MDI X LED indicators COMO Internal communication with the high profile 1 87K series modules in slots COM1 RS 232 to update firmware RXD TXD and GND non isolated COM2 RS 485 D2 D2 self tuner ASIC inside
59. one 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 1 0 port the kbhit must be called to check whether there is any data currently in the input buffer API for reading data from standard I O port 2 Getch After kbhit confirms that the input buffer contains data the Getch must be called to read data from the input buffer API for sending data to standard 1 0 port 3 Puts For sending a string Before sending data to standard 1 0 port the Puts must be called to send data to COM Port VP 2000 VH 2000 Series C Language Based User Manual Version 1 0 3 Page 83 Copyright 2011 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com 4 Putch For sending one character Before sending data to standard 1 0 port the Putch must be called to send data to COM Port API for showing data from standard 1 0 port 5 Print Functions such as Print in the C library allow data to be output from the COM port For example reading and receiving data through COM 1 include lt stdio h gt include vp2k h void main void int quit 0 data InitLib Initiate the ViewPAC library while quit if Kbhit Check if any data is in the input buffer data Getch Read data from COM1 Putch data Send data to COM1 if data q quit 1 If q is r
60. onnection Step 1 Turn the switch of the Unlock to ON position and the switch of Init to ON position Host PC VP 2000 VH 2000 Series C Language Based User Manual Version 1 0 3 Page 32 Copyright 2011 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com Step 3 Run the MiniOS7 Utility Step 4 Click the New connection function from the Connection menu QJ File New connection Looki Lit Connection Ak FZ Disconnect Ctrl F2 7 Po k bin Search Fi2 4 7 os p ess Step 5 On the Connection tab of the Connection dialog box select COM1 from the drop down list and then click OK ee Connection Park 110000 Cancel VP 2000 VH 2000 Series C Language Based User Manual Version 1 0 3 Page 33 Copyright 2011 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com Step 6 The connection has already established P MiniOS 7 Utility Verion 3 1 7 Li File D Connection Command Configuration Tools X Help Look in Co MiniOS7_ Utility Name Sel Te bin CQ FIRMWARE Name odified Connection Status Disconnected gt Connection F 2 VP 2000 VH 2000 Series C Language Based User Manual Version 1 0 3 Page 34 Copyright 2011 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com 2 4 1 2 Ethernet Connection Below are step by step i
61. ption 1 0 2 July 2010 Added information about installation and configuration PU mane July 2011 Deleted information about installation and configuration of VH 2111P VH 2211 VH 2311 Modified information about the development environment configuration in section 3 3 Modified information about the Flash Memory functions in section 4 4 Modified information about the application of RS 485 network in appendix E VP 2000 VH 2000 Series C Language Based User Manual Version 1 0 3 Page 130 Copyright 2011 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com
62. rating system MiniOS7 can boot up in a very short time 0 4 0 8 seconds It has a built in hardware diagnostic function and supports the full range of functions required to access all high profile 1 8K and l 87K series I O modules such as DI DO DIO Al AO Counter Frequency motion control modules etc Compared with traditional HMI PLC solutions ViewPAC reduces overall system cost space and gives you all the best features of HMIs and PLCs VP 2000 VH 2000 Series C Language Based User Manual Version 1 0 3 Page 6 Copyright 2011 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com 1 1 ViewPAC Family MiniOS7 Inside ViewPAC can be divided into two types according to their features gt VP 2111 gt VH 2110 ViewPAC Comparison The following table provides a specification comparison of ViewPAC model VH 2110 80 MHz 512 KB Dual Bateryackup SRAM 5128 o mesno ETS ws AE AS ES VP 2000 VH 2000 Series C Language Based User Manual Version 1 0 3 Page 7 Copyright 2011 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com 1 2 Features Main features of hardware and software Software Features gt MiniOS7 Embedded Operating System DOS like gt C language Based Software Development Toolkit gt Modbus Library Provided gt Hardware Diagnostic Functions gt Load Files via RS 232 or Ethernet Hardware Features gt 80186 80 MHz CPU 16 bit gt IP65 C
63. rograms for 64MB Flash Memory for VP 2111 module only L1 L2 L3 RUN LAN1 ninjan ES ES E NO ca es aa anan Folder Demo Explanation 64MB_Flash Gets How to get a string from a file in the 64MB flash memory Quality assurance program for the MiniOS7 File System Including function test read write performance test Puts How to write a string to a file in the 64MB flash MO Utility Utility for the MiniOS7 File System Operations Include ns Dir Read Write etc VP 2000 VH 2000 Series C Language Based User Manual Version 1 0 3 Page 73 Copyright 2011 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com gt Demo programs for expanded 1 0 Folder Demo Explanation 7K87K_ for COM User can use Com port to connect and control I 7K or l 87K modules ene 8410 8810 8411 8811 can use AO 22 26 AO 2226 for Com Com Com2 Com3 AO 024 for Com 8430 8830 8431 8831 CPU 40 and 80M can use Com3 Com4 VP 2000 VH 2000 Series C Language Based User Manual Version 1 0 3 Page 74 Copyright 2011 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com gt Demo programs for 1 0 slots For VP 2111 module only Folder Demo Explanation IO_in Si 8K_DI This demo program is used in 8K s DI module a 8K_ DO This demo program is used in I 8K s DO module OO Samara o 8K_ DIO This demo program is used in I 8K s DO module S80 manner 8050W is a 16 channel Universal
64. tep 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 Internet r Windows XP Professional VP 2000 VH 2000 Series C Language Based User Manual Version 1 0 3 Page 56 Copyright 2011 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com LI PR L o F Bic i Y kad J I A TANI WU Ud AN TENGIL cee wre wl VOU me CAII S U es ee T D Step 2 At the command prompt type TC and then press Enter CA fl x Microsoft Windows XP Version 5 1 26481 l i KC Copyright 19685 29881 Microsoft Corp C Documents and Settings fdministratoriTe Step 3 Select New from the File menu to create a new source file Edit search Run Compile Debus Opt ions Window cn AT Open F3 Save F2 o o S Save as Y ESS File Edit Search Run i Compile Debug Project HONAMERH CPF Options Window H Fi VP 2000 VH 2000 Series C Language Based User Manual Version 1 0 3 Page 57 TN NANTO Racar ar nn MAI ay a Step 4 Type the following code Note that the code is case sensitive include Demo basic Lib vp2k h Include the header file that allows vp2k lib functions to be used
65. ter upload programs on the ViewPAC if you need programs to start automatically after the ViewPAC start up it is easy to achieve it to create a batch file called autoexec bat and then upload it to the ViewPAC the program will start automatically in the next start up For example to make 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 P Untitled Notepad Seles File Edit Format View Help HELLO exe The file name Run the specified file P Untitled Notepad ME runexe Runexe Run the last exe file VP 2000 VH 2000 Series C Language Based User Manual Version 1 0 3 Page 41 Copyright 2011 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com Step 2 Upload programs to ViewPAC using MiniOS7 Utility For more detailed information about this process please refer to section 2 4 1 Establishing a connection A MiniOS Utility Verion 3 1 7 3 GH File D Connection de Command Configuration T2 Tools 4 Help x Look im 9 MiniOS _ Utility v Lock im Disk Name size Type No Name Size Modified D bin File Folder flo helloexe 139 929 2008 6 9 FIRMWARE File Folder Et autoexec 25 2005 8 9 05 IMAGE File Folder i Slicpdas 1K
66. tp fto lcpdas com pub cd 8000cd napdos vp 2000 demo vp 2111 64mb flas h VP 2000 VH 2000 Series C Language Based User Manual Version 1 0 3 Page 118 Copyright 2011 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com Appendix D I 8K and I 87K serial Modules For VP 2111 module only There are 3 slot to expand local 1 0 And the 1 0 modules can be parallel bus type high profile I 8k series and serial bus type high profile I 87k series The difference between them is Item I 8k Series I 87k Series Microprocessor Ne e 805 Communication interface Parallel bus DI latched function No Yes Counter input for digital input module No Yes JO0H Power on value NO Yes Safe value No Yes Programmable slew rate for AO module oo No Yes VP 2000 VH 2000 Series C Language Based User Manual Version 1 0 3 Page 119 Copyright 2011 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com Appendix E Application of RS 485 Network The RS 485 length can be up to 4000 ft or 1 2 km over a single set of twisted pair cables if the RS 485 network is over 4000 ft or 1 2Km the RS 485 repeater must be added to extend the RS 485 network VP 2000 VH 2000 Series C Language Based User Manual Version 1 0 3 Page 120 Copyright 2011 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com E 1 Basic RS 485 Network The basic component of the RS 485 network consist of a Mast
67. ual Version 1 0 3 Page 43 Copyright 2011 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com Step 2 Establish a connection For more detailed information about this process please refer to section 2 4 1 Establishing a connection Step 3 Click the Update MiniOS7 Image from the File menu A MiniOS Utility Verion 3 1 7 G File Connection 4a Command F Soe Testes T Tools Help f Rs P Update Minis Image Fi 2 Lock in Disk 4 l Hot List Ctrl D TE ou en Exit alt s Size TE No Name SE Fil E A LE Fil PA Ds M Las Te Fil i E an te gd Step 4 Select the latest version of the MiniOS7 OS image select Min 7 Image file Save nr O O5_Image D Ed vp2111_20090603 img My Recent ccume VP 2000 VH 2000 Series C Language Based User Manual Version 1 0 3 Page 44 Copyright 2011 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com Step 5 Click the OK MiniOS7 Utility Ferion 3 X Please wait a while for rebooting Step 6 Click the Info from the Command menu to check the version of the OS image MiniOS7 Utility Ferion 321 FS DiskTool F6 3 Sel Hane Size Modified a fe AULOEXEC 16 2005 7 1 Os Type p i CS FIRMWARE B VCE 323 04236 2008 7 2 05 IMAGE EEPROM A 7188euF4 Pack Disk ICpdas Erase Disk S load232 di Reset H EP Mi
68. view Here is a brief overview of the components gt VP 2000 VH 2000 Series LED Indicators SINLCD Y _ VP 2111 Fa E3 Ci gt J CJ O a C63 a 9 CEA VP 2000 VH 2000 Series C Language Based User Manual Version 1 0 3 Page 11 Copyright 2011 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com gt VP 2111 e Power In amp Frame Ground le j x 7 RS 232 485 RS232 RS489 gt VH 2110 RS232 RS232 RS455 COMS COMI CoM2 VP 2000 VH 2000 Series C Language Based User Manual Version 1 0 3 Page 12 Copyright 2011 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com 1 5 Dimension All dimensions are in millimeters gt VP 2000 VH 2000 Series Recommended Panel Cut Out Front View VP 2000 VH 2000 Series C Language Based User Manual Version 1 0 3 Page 13 Copyright 2011 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com gt VP 2000 Back View Left Side View Right Side View 135 3 Top View Bottom View L copiei pange aeo L VP 2000 VH 2000 Series C Language Based User Manual Version 1 0 3 Page 14 Copyright 2011 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com gt VH 2000 Back View Left Side View Right Side View Top View Bottom View 32 9 VP 2000 VH 2000 Series C Language Bas
69. y exit Append appends data to a file File handle 10 max for each disk For read mode the 10 file handles can all be used for reading operation on each disk Total 20 files can be opened for reading mode For write and append mode only 1 file handle can be used for writing operation on all disks Writing Yes verification Default is enabled Calling mfs_EnableWriteVerification and mfs_DisableWriteVerification can change the setting Automate file Yes system recovery If an unexpected reset or power loss occurs closed files and files opened for reading are never at risk Only data written since the last writing operation 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 Writing speed mfs_WriteFile 147 5 KB Sec verification enabled default 244 0 KB Sec verification disabled mfs_Puts 142 1 KB Sec verification enabled default 229 5 KB Sec verification disabled Reading speed mfs_ReadFile 734 7 KB Sec mfs_Gets 414 2 KB Sec VP 2000 VH 2000 Series C Language Based User Manual Version 1 0 3 Page 117 Copyright 2011 ICP DAS Co Ltd All Rights Reserved E mail service icpdas com Max length of 32767 bytes writing data Max length of 32767 bytes reading data gt Resources upload e MFS SDKs http ftp lcodas com pub cd 8000cd napdos vp 2000 demo vp 2111 basic lib e MFS Demos ht
Download Pdf Manuals
Related Search
Related Contents
Powermate PM0505622.18 Parts list リベットツール 取扱説明書 - ポップリベット・ファスナー Generating Finite Integral Relation Algebras Petit guide de présentation et de mode d`emploi du logiciel MAG Manual de usuario WETStar - WET Labs 過去の製品安全に関するお知らせ(一覧) 0120-054-321 0120-444 Manual do Usuário here L`ORAL A ICN Copyright © All rights reserved.
Failed to retrieve file