Home
WinCon-8000 SDK Ras Dial User Guide
Contents
1. 6 3 5 LCD_DisplayNumber Description After calling either the LCD_SetNumber or LCD_ClrNumber it is necessary to call LCD_DisplayNumber to display number on the the LCD panel Syntax void LCD DisplayNumber void Parameter None Return None 66 Publication May 2013 Ver 1 00 G 4511 Series User Manual 6 3 6 LCD SetNumber Description Display one number on the specified position Syntax void LCD SetNumber int Line int Offset int Number Parameter Line One of two line numbers 1 to 2 Offset Cursor position 1 to 5 Number Display number Return None Example LCD_SetNumber 1 1 0 LCD_SetNumber 1 2 1 LCD_DisplayNumber 67 Publication May 2013 Ver 1 00 G 4511 Series User Manual 6 3 7 LCD ClrNumber Description Clear the displayed number by one character position Syntax void LCD GlrNumber int Line int Offset Parameter Line One of two line numbers 1 to 2 Offset Cursor position 1 to 5 Return None Example LCD ClrNumber 2 3 LCD DisplayNumber 68 Publication May 2013 Ver 1 00 G 4511 Series User Manual 6 3 8 LCD_CIrScrn Description Clear the LCD panel Syntax void LCD_ClrScrn void Parameter None Return None 69 Publication May 2013 Ver 1 00 G 4511 Series User Manual 6 3 9 LCD_StandByMode Description Enter the stand by mode and it can be terminated by either LCD_NormalMode or other
2. pi Transfer E amp nelude Directories a ri En ri A pal a pat rl Publication May 2013 Ver 1 00 81 G 4511 Series User Manual Step8 After finishing all the parameters setting click the Compile build all toproduce the execution file name TEST exe CATC BIN IC EXE o EE Edit Search Run Debug Project Options Window ay Lines D Rebuild all files Step9 Copy the file 7188XW exe into the MyDemo folder Then double click the 7188XW exe file The 7188XW exe can be found in the Osimage folder And G 4511 series COM1 connected to the PC RS 232 14 COM1 115200 N 8 1 DIR C MyDemo jol x Current set Use COM1 115288 N 8 1 AutoRun Autodownload files None Current work directory C MyDemo iginal haudrate 1200 uP 45aa gt 82 Publication May 2013 Ver 1 00 G 4511 Series User Manual Step10 Key the command load in the 7188xw exe program Then follow the hint command to press Alt E and input the file name TEST exe to download the execution file urrent set Use COM1 115288 N 8 1 AutoRun Autodownload files None uP 4584 gt 1load File wili save to A42E G66B StartAdd gt AGBH 42EA Press ALT_E t desmtond filet Input filename TEST exe Step11 After finishing the download procedure key in the command run to implement the execution file TEST exe Autodo
3. return the current working directory Return Returns TRUE if a valid path was returned in path otherwise no if the current working directory could not be found Note Return buffer must contain enough space to hold the full path 57 Publication May 2013 Ver 1 00 G 4511 Series User Manual 6 2 14 PC Get Attributes e Description Get File Attributes Give a file name Return the directory entry attributes associated with the entry One or more of the following values will be or ed together BIT Nemonic 0 ARDONLY 1 AHIDDEN 2 ASYSTEM 3 AVOLUME 4 ADIRENT 5 ARCHIVE Syntax BOOLEAN pc get attributes char path byte p_return Parameter Path The file path in MMC SD card p_return Return the directory entry attributes Return Returns TRUE if successful otherwise it returns FALSE and get_errno returns one of these values PENOENT Example byte attribs if oc_get_attributes test test1 txt amp attribs if attribs 8 ARDONLY Print File is ARDONLY if attribs amp AHIDDEN Print File is AHIDDEN if attribs amp ASYSTEM Print File is ASYSTEM if attribs amp AVOLUME Print File is AVOLUME 58 Publication May 2013 Ver 1 00 G 4511 Series User Manual if attribs amp ADIRENT Print File is ADIRENT if attribs amp ARCHIVE Print File is ARCHIVE if attribs amp ANORMAL Print File is ANORMAL 59 Publication May 2013 Ver 1 00 G 4511
4. void LCD LineRestore int Line Parameter Line One of four line numbers 0 to 4 Return None 75 Publication May 2013 Ver 1 00 G 4511 Series User Manual 6 3 15 LCD_GetLibDate Description Gets the create date of funciton library Syntax void LCD_GetLibDate unsigned char LibDate Parameter LibDate Gets the create date of funciton library Return None 76 Publication May 2013 Ver 1 00 G 4511 Series User Manual 6 3 16 LCD GetLibVersion Description Get the version number of function library Syntax unsigned LCD_GetLibVersion void Parameter None Return Return the current version number 77 Publication May 2013 Ver 1 00 G 4511 Series User Manual Chapter 7 Program Download Procedure Here it is considered that how to build an execution file and how to run this program on the G 4511 series Library Description Remark G4500 LIB G 4511 and DI O Al functions GPRS LIB GPRS functions MMC_FS4 LIB MMC SD functions TCP DM32 LIB Ethernet functions LCD LIB LCD functions Step1 Create a folder name MyDemo in the C disk and copy the lib folder and users program into the MyDemo folder PRO SPO HAC BRE IAM RAD OG BO ws Bam M ac gt Jass Gre XR ANKLE I SAAR I A EAE AR 78 Publication May 2013 Ver 1 00 G 4511 Series User Manual Step2 Run the TC 1 01development Click the Pr
5. 0 G 4511 Series User Manual Chapter 3 Application architecture 3 1 Hydrologic Wind Monitoring Application Flow Meter Wind Meter a m Lead Acid Battery Cell Phone 3 2 Car Monitor Tracking System Cell Phone 10 Publication May 2013 Ver 1 00 G 4511 Series User Manual 3 3 Redundancy Communication system Primary Ethernet Sensor amp Applicatio Server 5i Data base G 45 1 1 Server POS lt Second 11 Publication May 2013 Ver 1 00 G 4511 Series User Manual Chapter 4 Hardware 4 1 Pin Assignments G 4511 D 2G G 4511P D 2G GPRS Ree j Front View DIP switch RUN Lock INIT 4 LED Indicators LED Indicators Oma Oss gt Oo errs crre crre GPS CN2 Pin Assignment ar _ pn s pns aono me pm a5 FR ma Pinas Pins ano fats m 32 m2 naa ins on piotat input men Pin u2 DI CN1 Pin Analog Input 0 20 mA d ji oo au m m DA mau owe nLoomon 19 ns ooz am RLNO_ Pin 18 ma jooi pm Doo comiRs232 RTS _Pin 16 ee Tomas Tx01 Pin 14 a a Power Input DC VS spn Pin 3 BAT VS 12V Lead Acid Front View 10 30 Voc in 2_ BAT GND Battery I a omar ena ne rome Gouna SIM Card 12 Publication May 2013 Ver 1 00 G 4511 Series User Manual 4 2 Hardwar
6. 1 1 V m Low Voltage reconnect Voltage 12 6 V How to use please refer to the figure s wire connection below and MCU2 library demo code pa These devices will power off when the system is in Low m017 48 Voltage Protect or Deep Sleep Mode CN1 Pin Assignment RNC Pin 24 mcu2 output Rlcommemnd Pin 002 me R LNO Pin 18 18 Ping DO1 Pin oo COM1 RS 232 peas eefe COM2 RS 485 pea eHe eea arna hoe 1 BEN El ne lm ser 21 Publication May 2013 Ver 1 00 G 4511 Series User Manual 5 2 How to choose the Battery This section will discuss how to choose a suitable battery for your system Because the alive time of the system is depending on your system power consumption and your battery capacity we will calculate with some conditions below gt Examplet Wind Meter 24V Power Supply 12V Lead Acid Battery Conditions m The system has a 24V external power Mm It must work in 2 week when the external power is shut down m The system transmits the data to the server every 10 minutes 1 minute for full work and 9 minutes for sleeping m Power consumption of deep sleep mode is 7 2 mMA 12V m Average power consumption of full work is 245 mA 12V Calculation 1 Average power consumption 245 x 1 10 7 2 x 9 10 31 mA 31 mA x 24 hours x 14 days 10416 mAh We may choose 12V 14Ah Lead Acid Battery for this sy
7. 1 Pin Assignments eneneenennennennen 12 4 2 Hardware Dimensions 13 4 3 Operation Mode Switch eeene 14 4 4 LED IndicatorS uu enen en nn 15 4 5 Wire Connection 16 4 6 Wake up from Sleep mode e0ee0eer ern 18 4 7 WiStallatlON u 19 Chapter 5 Power Saving and Charger 20 5 1 Power Saving s s ers ala 20 5 2 How to choose the Battery 23 5 3 How to choose the Solar Panel 23 Chapter 6 Function Introduction 28 6 1 IO Library Function Definition and Description 28 6 1 1 KOSI Mit nenne 29 6 1 2 X3051I0_GetLibVersion eeenenen 30 6 1 3 X305I0_Read_AD_CalibrationGain 31 6 1 4 X305I0_Read_AD_CalibrationOffset 32 6 1 5 X30510 ANAL G IN sn siss n ni ee 33 6 1 6 X30510 Read All Dl ccc cscsscssssessssseseseeeeaees 34 6 1 7 X305I0_Read_One_D nneenennn 35 6 1 8 X30510 Write All DO 00 0 0 36 6 1 9 X305IO Write One DO e e0eean err 37 2 Publication May 2013 Ver 1 00 G 4511 Series User Manual 6 1 10 X305I0_Read_All_DO eeeenne 38 6 1 11 X305l0_Read_One_DO nneenennnn 39 6 1 12 X305I0_AnalogIn_S
8. Bm with external LNA Acquisition Time Hot start Open Sky 2 s typical Cold start Open Sky 36 s typical Protocol Support NMEA 0183 version 3 01 Protection Effective i 80 61 mm x 14 37 80 61 mm x 14 37 display mm W x H mm W x H area General 93 mm x 70 mm x Module 93 mm x 70 mm x 1 6 mm W xH x Dimension 1 1 6 mm W x H x T Expected life is Expected life is more than a more than 100 000 Life Time 100 000 hours hours under normal under normal operation operation Power reverse polarity protection Frame Ground Protection ESD Surge EFT Hi Pot Power Requirement 10 Voc 30 Voc Max Voltage of Solar Panel must less 30V Power Consumption Sleep 7 MA 12Voc Idle 75 mA 24 Voc Data Link 150 400 mA peak 24 Voc Battery 12V Lead Acid Battery Charging Voltage Voltage of Power Input must be over 16V LED Indicators System Red GSM Yellow GPS Green Charging Fault Green Red Casing Metal Dimensions 47 mm x 142 mm x 168 mm Wx Lx H Installation DIN Rail and Wall mount 8 Publication May 2013 Ver 1 00 G 4511 Series User Manual Operating 20 70 C 15 55 C 20 70 C 15 55 C Temperature Storage 40 80 C 20 70 C 40 80 C 20 70 C Temperature Humidity 5 90 RH non condensing 9 Publication May 2013 Ver 1 0
9. G 4511 Series User Manual G 4511 Series User Manual Warranty All products manufactured by ICP DAS are warranted against defective materials for a period of one year from the date of delivery to the original purchaser Warning ICP DAS assumes no liability for damages consequent to the use of this product ICP DAS reserves the right to change this manual at any time without notice The information furnished by ICP DAS is believed to be accurate and reliable However no responsibility is assumed by ICP DAS for its use or for any infringements of patents or other rights of third parties resulting from its use Copyright Copyright 2013 by ICP DAS Co LTD All rights reserved worldwide Trademark The names used for identification only may be registered trademarks of their respective companies 1 Publication May 2013 Ver 1 00 G 4511 Series User Manual Tables of Content Chapter 1 Introduction eee erna 5 Chapter 2 Hardware specifications 6 2 1 G 4511 2G Series 6 2 2 G 4511 2G Specifications enenn 7 Chapter 3 Application architecture 10 3 1 Hydrologic Wind Monitoring Application 10 3 2 Car Monitor Tracking System 0 0 00 10 3 3 Redundancy Communication system 11 Chapter 4 Hardware nennen 12 4
10. G G 4511PD 2G 6 Publication May 2013 Ver 1 00 G 4511 Series User Manual 2 2 G 4511 2G Specifications COM ports CPU 80 MHz internal microprocessor SRAM Flash 512K 512K real time clock watchdog timer NVRAM 31 bytes battery backup data valid up to 10 years EEPROM 16 KB retention gt 40 years 1 000 000 erase write cycles COM1 5 wire RS 232 COM2 RS 485 Ethernet Frequency Band 10 100 Base TX Ethernet controller GSM 850 900 1800 1900 MHz GPRS connectivity GPRS class 10 8 GPRS station class B SMS Input Channel MT MO CB Text and PDU mode 3 Input Type Source Dry Type Common Ground Off Voltage Level 1 V max On Voltage Level 3 5 30 V Isolated Voltage Non isolated Output Channel 3 Output Type 3 Open Collector Sink NPN Load Voltage 30 VDC max Load Current 100 mA max Isolated Voltage Non isolated Input Channel 8 Resolution 12 bit Input Range Type 0 20 mA Sample Rate 1 KHz max Read one channel Accuracy 2 LSB 0 0097 mA Isolated Voltage 2500Vrms 3000Dc to DC Output Channel 1 Type Form C Input Range 2A 30 Vdc 0 25 A 250 Vac Mechanical typ 108 operations endurance 7 Publication May 2013 Ver 1 00 G 4511 Series User Manual Support Channels 32 Tracking up to 159 dBm with external LNA Sensitivity Cold start up to 146 d
11. If 1 is returned get errno will return one of these values PEBADF Invalid file descriptor PENOSPC Write failed Presumably because of no space 49 Publication May 2013 Ver 1 00 G 4511 Series User Manual 6 2 6 Get_ErrNo Description Get error code Syntax int get_errno void Parameter None Return 2 gt PENOENT File not found or path to file not found 9 gt PEBADF Invalid file descriptor 13 gt PEACCESS Attempt to open a read only file or a special directory 17 gt PEEXIST Exclusive access requested but file already exists 22 gt PEINVAL Seek to negative file pointer attempted 24 gt PEMFILE No file descriptors available too many files open 28 gt PENOSPC Write failed Presumably because of no space 30 gt PESHARE Open failed do to sharing 31 gt PEDVICE No Valid Disk Present 32 gt PEBADDIR DELTREE Directory structure corrupt 50 Publication May 2013 Ver 1 00 G 4511 Series User Manual 6 2 7 PC_lseek e Description Move file pointer Syntax long pc_lseek PCFD fd long offset int origin Parameter fd file desc offset offset value origin PSEEK_SET offset from begining of file PSEEK CUR offset from current file pointer PSEEK_END offset from end of file e Return If success Returns new offset value otherwise 1 If 1 is returned get_errno will return one of these values PEBADF Invalid file descript
12. LineResto re sinn asian 75 6 3 15 LED GethibDate u 6S SIGE 76 6 3 16 LCD_GetLibVersion neeenennn 77 Chapter 7 Program Download Procedure 78 3 Publication May 2013 Ver 1 00 G 4511 Series User Manual Publication May 2013 Ver 1 00 G 4511 Series User Manual Chapter 1 Introduction The G 4511 series are M2M Machine to Machine Power Saving PAC with a cellular transceiver and Solar Charger It can be used in hydrologic monitoring or mudslide monitoring system With optional GPS model the G 4511 can also be a GPS tracking system for vehicle management system or maritime system The features of G 4511 series Solar Charger 2G module Ethernet interface optional GPS module 3 digital inputs 3 digital outputs 8 analog inputs 1 relay 1 RS 232 and 1 RS 485 port That can be used in various application fields to transfer data over GPRS SMS Ethernet or serial bus The G 4511 series built in MiniOS7 provide the same development environment with 1 7188 1 7186 series It is easier for I 7188 l 7186 users to apply the G 4511 series N WY GPS Satellite Solar Panel Lead Acid Battery 2 r oO a Warning N In Sensors Monitoring 5 Publication May 2013 Ver 1 00 G 4511 Series User Manual Chapter 2 Hardware specifications 2 1 G 4511 2G Series Le 6 4511P 26 G 4511 2G G 4511D 2G G 4511P 2
13. S and BAT GND to the 12V Lead Acid Battery Plug Ethernet cable Install GPS Antenna Oe n Host PC iz Connect COM1 to Host PC Insert SIM Card Install 2G Antenna Operation Mode Switch Insert SD Card Connect to Power or Solar Panel Connect to 12V Lead Acid Battery 19 Publication May 2013 Ver 1 00 G 4511 Series User Manual Chapter 5 Power Saving and Charger 5 1 Power Saving gt Sleep Mode this mode will shut down 7186 CPU all I O 3DI 3DO 8Al exclude MCU2 I O and GPS but GSM module still works m Power Consumption 17 18 mA 12V mM How to awake G 4511 1 Sleeping Time is finished 2 Trigger U2 Dl connect U2_DI to GND read U2_DI as 0 3 make a phone call to G 4511 gt Deep Sleep Mode This mode will shut down all interface but exclude MCU2 I O m Power consumption 7 8 mA 12V mM How to awake G 4511 1 Sleeping Time is finished 2 Trigger U2 Dl connect U2_DI to GND read U2_DI as 0 20 Publication May 2013 Ver 1 00 G 4511 Series User Manual gt Low Voltage Protection Default value is enabled and you can disable this function by your program This function will prevent the battery to over discharging When the voltage of the battery is less 11 1V G 4511 will go into Low Voltage Protect Mode that will turn off all system power And then G 4511 will wake up if the voltage of the battery is over 12 6V after charging m Low Voltage disconnect Voltage 1
14. Series User Manual 6 2 15 PC_Set_Attributes e Description Set File Attributes Given a file or directory name set the directory entry attributes associated with the entry One or more of the following values may be or ed together BIT Nemonic 0 ARDONLY 1 AHIDDEN 2 ASYSTEM 5 ARCHIVE Syntax BOOLEAN pc set attributes char path byte attributes Parameter Path The file path in MMC SD card attributes Set the directory entry attributes e Return Returns TRUE if successful otherwise FALSE and get_errno will return one of these values PENOENT Couldn t find the entry PENOSPC Write failed Example byte attribute char fname test1 test1 txt attribute ARDONLY AHIDDEN pc_set_attributes fname attribute 60 Publication May 2013 Ver 1 00 G 4511 Series User Manual Function definition 6 3 LCD Library Function Definition and Description Description LCD_Init Initialize the library LCD_BackLight_On Turn on the LCD backlight LCD_BackLight_Off Turn off the LCD backlight LCD_ShowText Display one character on the LCD panel LCD_DisplayNumber Display number on the the LCD panel LCD_SetNumber Display one number on the specified position LCD_ClrNumber Clear the displayed number by one character position LCD_ClrSern Clear the LCD panel LCD_StandByMode Enter the stand by mode LCD_NormalMode Restore the LCD to normal mod
15. X30510 GetlLibVersion void Parameter None Return Version Number 30 Publication May 2013 Ver 1 00 G 4511 Series User Manual 6 1 3 X30510 Read AD _ CalibrationGain Description Read the A D Calibration Gain Syntax float X305I0_Read_AD_CalibrationGain void Parameter None Return Calibration Gain of the AD channels 31 Publication May 2013 Ver 1 00 G 4511 Series User Manual 6 1 4 X305I0_Read_AD_CalibrationOffset Description Read the A D Calibration Offset Syntax float X305I0_Read_AD_CalibrationOffset void Parameter None Return Calibration Offset of the AD channels 32 Publication May 2013 Ver 1 00 G 4511 Series User Manual 6 1 5 X3051IO_Analogin Description Read the value from the assign Al channel Syntax float X30510 Analogln int iChannel Parameter iChannel 0 7 gt chO ch7 Return 0 0mA 20 0mA 33 Publication May 2013 Ver 1 00 G 4511 Series User Manual 6 1 6 X305I0_Read_All_DI Description Read all DI values of the G 4511 Syntax int X3051O_Read_All_DI void Parameter None Return 0x00 0x07 Example When DIO Ground DI1 Open DI2 Open value X30510 Read All DI value 0x6 34 Publication May 2013 Ver 1 00 G 4511 Series User Manual 6 1 7 X305I0 Read One DI Description Read the value from the assign DI channel Syntax int X30510 Read One Dl int iChannel Param
16. battery capacity is low battery voltage state we don t work in this state We use 90 battery capacity to calculate Double check the battery capacity 22Ah x 90 x 1000 19800 mAh gt 16430 4 mAh gt We will choose a 12V 22Ah Lead Acid Battery for this system 2 Please refer Table 5 2 2 to choose the battery for other report freq Table 5 uency 2 2 s ne Average power power consumption of 14 days eport Frequenc p 1 7 consumpt ion mAh 12V Every minute 424 142464 No Sleep 24 Publication May 2013 Ver 1 00 G 4511 Series User Manual 5 3 How to choose the Solar Panel This section will discuss how to choose a suitable solar panel for your system The power of solar panel must be more than the power consumption of the system and we will calculate with some conditions below gt Things you must know before you calculate m Charging voltage must be more than 16V m Max Charge Current 2A mM Sun hours an average value If the average daily solar radiation of the area is 3 kW m the sun hours of this area is 3 hours gt Example Server e Solar Panel 4511 G 4511 2G Ty es 12V Lead Acid Battery Conditions m Power consumption of deep sleep mode is 7 2 mMA 12V m Average power consumption of the system is 245 mA 12V m The system transmits the data to the server every 10 minutes 1 minute for full work and 9 minutes for sleeping Mm Sun hours is 4 hours day m Us
17. e LCD_GotoPosition Move the cursor to the specified position LCD_CursorDisplay Set the Cursor display status LCD_LineReverse Select one of four line and reverse the display LCD_LineRestore Select one of four line and restore the display LCD_GetLibDate Gets the create date of funciton library LCD_GetLibVersion Gets the version number of function library 61 Publication May 2013 Ver 1 00 G 4511 Series User Manual 6 3 1 LCD_Init Description Initialize parameters about LCD functions in the library Syntax void LCD_Init void Parameter None Return None 62 Publication May 2013 Ver 1 00 G 4511 Series User Manual 6 3 2 LCD_BackLight_On Description Turn on the LCD backlight Syntax void LCD_BackLight_On void Parameter None Return None 63 Publication May 2013 Ver 1 00 G 4511 Series User Manual 6 3 3 LCD_BackLight_Off Description Turn off the LCD backlight Syntax void LCD_BackLight_Off void Parameter None Return None 64 Publication May 2013 Ver 1 00 G 4511 Series User Manual 6 3 4 LCD_ShowText Description Display one character on the LCD panel and the cursor will right shifted by one character position automatically Syntax void LCD_ShowText uchar Text Parameter Text Display character Return None 65 Publication May 2013 Ver 1 00 G 4511 Series User Manual
18. e Dimensions e G 4511 2G Series MYIA PIS WIH M JA UO0J4 mala MEG ww yun MIA PIS 497 MALA doy Wk malA WONOg 13 Publication May 2013 Ver 1 00 G 4511 Series User Manual 4 3 Operation Mode Switch Operation Mode Switch BUN OS can execute autoexec bat Flash can be read write OS can execute autoexec bat LRun Flash is read only lock Kr OS can not execute autoexec bat Flash can be read write DIP switch SIM Card RUN Lock INIT Publication May 2013 Ver 1 00 G 4511 Series User Manual 4 4 LED indicators LED Indicators C N A O GSM O ys Charge Without GPS _ O Q raur With GPS There are three LED indicators to help users to judge the various conditions of G 4511 The description is as follows SYS Red System LED is programmable GSM Yellow The modem LED can indicate the status of 3G module Modem normal Modem fail Off Blanking 3 sec or Always On GPS Green Option The GPS LED can indicate the status of GPS module GPS Fail Search GPS Receive GPS data Always off Always on Blanking 1 sec Charging Green Charging status indicator Charging Not Charging Always On Always OFF Fault Red Charging Fault indicator Normal Fault Always OFF Always ON Pub
19. etChannel 40 6 1 13 X305I0_AnalogIn_Hex 0eeeennsenennenenenn 41 6 1 14 X305I0_AnalogIn_HexTorFloat 42 6 2 MMC SD Library Function Definition and Description 43 62 1 PG ES ame 44 6 22 PO Open a seinen 45 6 23 PC Read na entalten 47 6 2 4 PC Nr 48 6 2 5 PC 610883 2 lesen 49 6 2 6 Gel EHNO nassen eis 50 602 7 Seekarten IE 51 6 2 8 PG MA Dit rauan a Sa a la 52 6 2 9 PC RMD use 53 62 10 PE deliree nassen tie ii 54 62V PC MV nern el PR UR STR coats 55 62 12 PC ISDIR ae 56 52 13 PC PWA an na ars E 57 6 2 14 PC_Get_Attributes 00200000000000eeseenneesnennneensesnensnenne 58 6 2 15 PC Set Attributes rr 60 6 3 LCD Library Function Definition and Description 61 6 3 T ELCD Nu een 62 6 3 2 LCD B ckLight Osaka a 63 6 3 3 LCD_BackLight_Off eeeeeenne 64 6 3 4 L6EDEShowIeXt Heer ae Roe ia 65 6 3 5 LCD_DisplayNumber een 66 6 3 6 LCD SEINUMDEP si s ansa Ra 67 6 3 7 LCD CirNumben ance ieee ot Sai 68 63 8 LED Eirsern u a essen 69 6 3 9 LCD StandByMode e 0e00eeeeenrenrrr renna 70 6 3 10 LCD NormalMode 0 ee rr 71 6 3 11 LCD GotoPosition 0 rr 72 6 3 12 LOD CursorbDis play 24 ee 73 6 3 13 LCD LineReverse 00 00 0 0 neee erase 74 6 3 14 LCD
20. eter iChannel 0 2 gt chO ch2 Return Return 1 gt open Logic high level 3 5V 30V Return 0 gt close to GND Logic low level OV 1V 35 Publication May 2013 Ver 1 00 G 4511 Series User Manual 6 1 8 X30510 Write All DO Description Write to all DO values of the G 4511 series Syntax void X305IO0 Write All DO int iOutValue Parameter iOutValue 0x0 0x7 Return None Example X305IO_Write_All_ DO 6 After function execute DOO OFF DO1 ON DO2 ON 36 Publication May 2013 Ver 1 00 G 4511 Series User Manual 6 1 9 X30510 Write One DO Description Write the specific value to the assign DO channel Syntax void X305I0_Write_One_DOflint iChannel int iStatus Parameter iChannel 0 2 gt chO ch2 iStatus 1 gt Status is ON iStatus 0 gt Status is OFF Return None 37 Publication May 2013 Ver 1 00 G 4511 Series User Manual 6 1 10 X305I0_Read_All_DO Description Read all DO values of the G 4511 series Syntax int X3051O_Read_All_ DO void Parameter None Return 0x0 0x7 Example When DOO OFF DO1 ON DO2 ON Value X305IO_Read_All_ DO Value 0x6 38 Publication May 2013 Ver 1 00 G 4511 Series User Manual 6 1 11 X30510 Read One DO Description Read the state from the assign DO channel Syntax int X30510 Read One DO int iChannel Parameter iChannel 0 2 gt chO ch2 Return Retu
21. function Syntax void LCD StandByMode void Parameter None Return None 70 Publication May 2013 Ver 1 00 G 4511 Series User Manual 6 3 10 LCD_NormalMode Description Restore the LCD to normal mode when it is in the stand by mode Syntax void LCD_NormalMode void Parameter None Return None 71 Publication May 2013 Ver 1 00 G 4511 Series User Manual 6 3 11 LCD GotoPosition Description Move the cursor to the specified position Syntax void LCD_GotoPosition int Line int Offset Parameter Line One of four line numbers 1 to 4 Offset Cursor position 1 to 8 Return None 72 Publication May 2013 Ver 1 00 G 4511 Series User Manual 6 3 12 LCD CursorDisplay e Description Set the Cursor display status Syntax void LCD_CursorDisplay int Display int Blink Parameter Display Cursor display on off 1 Display on 0 Display off Blink Character blink on off 1 Display on 0 Display off Return None 73 Publication May 2013 Ver 1 00 G 4511 Series User Manual 6 3 13 LCD LineReverse Description Select one of four line and reverse the display Syntax void LCD LineReverse int Line Parameter Line One of four line numbers 0 to 4 Return None 74 Publication May 2013 Ver 1 00 G 4511 Series User Manual 6 3 14 LCD LineRestore Description Select one of four line and restore the display Syntax
22. gnored All file access is binary PO_TEXT Ignored PO_RDONLY Open for read only PO_RDWR Read write access allowed PO_WRONLY Open for write only PO_CREAT Create the file if it does not exist PO_EXCL If flag has PO_CREAT PO_EXCL and the file already exists fail and set get_errno to PEEXIST PO_TRUNC Truncate the file if it already exists PO_NOSHAREANY Fail if the file is already open PO_NOSHAREWRITE Fail if the file is already open for write Mode PS IWRITE Write permitted PS_IREAD Read permitted Always true anyway e Return Returns a non negative integer to be used as a file descriptor for calling po_read po write po seek po flush po_truncate and po close otherwise it returns 1 and get errno Example 45 Publication May 2013 Ver 1 00 G 4511 Series User Manual This example below would show to open test1 file and set the file allowing read or write char fname test1 test1 txt pc_ertfs_init pc_open fname word PO_BINARY PO_RDWR PO_CREAT PO_APPEND word PS_IWRITE PS_IREAD 46 Publication May 2013 Ver 1 00 G 4511 Series User Manual 6 2 3 PC_Read Description Read bytes from a file Syntax int pc_read PCFD fd byte buf word count Parameter fd file desc buf data buf Count data length Return Returns the actual number of bytes read or Oxffff on error If the return value is Oxffff get_errno will return o
23. ing 10W solar panel Calculation 1 m Solar panel Max current 10 w 12 V 0 833 A 833 mA m Usually the charging current may be effected by many factor like angle building and other environment factor etc Here we use 1 2 Max current to calculate 25 Publication May 2013 Ver 1 00 G 4511 Series User Manual m 1 2 Max Current 833 2 416 mA m Average current 416 x 4 24 69 mA hr m Refer to Table 5 3 2 We can know Average power consumption is 31 mA for this system refer to Table 5 3 2 or section 5 2 gt We can know 10W solar Panel is suitable for this system because 69 gt 31 Table 5 3 1 Solar panel Max Current 1 2 Current Sun hours Average Current for a day W mA mA mA hr 10 833 416 4 69 20 1666 833 4 138 30 2500 1250 4 208 40 3333 1666 4 277 50 4166 2083 4 347 Table 5 3 2 Average power power consumption of 14 days consumption mAh 12V Every minute 245 82320 No Sleep Report Frequency 26 Publication May 2013 Ver 1 00 G 4511 Series User Manual Things you must know about sun hours Usually the sun hours is variable with the season You need use the Min sun hours to calculate and choose the solar panel and the battery For example if the sun hours of month is like the figure below you must use 2 2 hours to calculate but not 6 7 hours T 6 sun hours hour p M w gt 1 oO
24. leted Return Returns TRUE if the directory was successfully removed If FALSE is returned get_errno will return one of these values PENOENT Directory not found or path to file not found PEACCES Not a directory not empty or in use PENOSPC Write failed 54 Publication May 2013 Ver 1 00 G 4511 Series User Manual 6 2 11 PC_MV Description Renames the file oldpath to newname Fails if newname is invalid already exists or oldpath is not found Syntax BOOLEAN pc_mv char name char newname Parameter Name the file oldpath Newname New the file name Return Returns TRUE if the file was renamed otherwise FALSE If FALSE is returned get_errno will return one of these values PENOENT Directory not found PEEXIST File or directory already exists PENOSPC Write failed Example if foc_mv TEXT LETTER TXT TEXT NEWLETTER TXT Print Can t rename LETTER TXT n 55 Publication May 2013 Ver 1 00 G 4511 Series User Manual 6 2 12 PC_IsDir Description Test if a path is a directory Syntax BOOLEAN pc_isdir char path Parameter Path The file path in MMC SD card Return Returns TRUE if path points to a valid existing directory otherwise FALSE 56 Publication May 2013 Ver 1 00 G 4511 Series User Manual 6 2 13 PC_Pwd Description Return the current working directory Syntax BOOLEAN pc_pwd char drive char path Parameter Drive Path
25. lication May 2013 Ver 1 00 G 4511 Series User Manual 4 5 Wire Connection gt Digital Input Wire Connection ON State OFF State DI value as 0 DI value as 1 Q px Input Type Relay Contact SE Relay Close 2 GND Relay Open Q GND gt ID gt Q D TTL CMOS Logic Logic Level Low Logic Level High Logic GND v amp GND Logic GND Q GND D or 2 ps Open Collector A le oND gt Digital Output Wire Connection ON State OFF State Input Type DO value as 1 DO value as 0 Q popwr DOPWR Drive Relay D DOx DOx Q GND GND ir Q popwr DOPWR Resistance Load j QD DOx DOx QD GND GND 16 Publication May 2013 Ver 1 00 G 4511 Series User Manual gt Current Input Wire Connection 19 ax gt Relay Wire connection Relay Output ON Relay Output OFF 17 Publication May 2013 Ver 1 00 G 4511 Series User Manual 4 6 Wake up from Sleep mode 1 When G 4511 was in sleep mode you can connect the Pin U2 DI MCU2 DI to GND to awaking G 4511 from sleep mode 2 You will read U2 DI as 0 when you connect U2 DI to GND WS leno 18 Publication May 2013 Ver 1 00 G 4511 Series User Manual 4 7 Installation 1 Install 2G Antenna 2 Plug in the normal SIM card Before apply the SIM card confirm it is OK by mobile phone 3 Connect the DC VS and DC GND to the power supply or Solar Panel 4 Connect BAT V
26. month 27 Publication May 2013 Ver 1 00 G 4511 Series User Manual Chapter 6 Function Introduction Function definition 6 1 IO Library Function Definition and Description Description X30510_Init Initial I O X30510_GetLibVersion Get X30510 LIB Version X30510 Read AD CalibrationGain Read AD Calibration Gain X30510 Read AD CalibrationOffset Read AD Calibration Offset X305I0_Analogin Read value from assign Al channel X30510 Read All DI Read All DI X30510 Read One DI Read the value form assign DI channel X305I0O Write All DO Write All DO X30510 Write One DO Write the value to the assign DO channel X305I0 Read All DO Read All DO state X30510 Read One DO Read the DO state form the assign DO channel X30510 Analogln SetChannel Set the Al channel that users want to read X30510 Analogln Hex Read the value from the specific A D channel 12 bits X30510 Analogln HexToFloat Transfer the Al value from 12 bits to float 28 Publication May 2013 Ver 1 00 G 4511 Series User Manual 6 1 1 X30510 Init Description Initial X30510 Syntax int X3051O_Init void Parameter None Return Return value 0 gt SUCCESS lt gt 0 gt error 29 Publication May 2013 Ver 1 00 G 4511 Series User Manual 6 1 2 X3051IO_ GetLibVersion Description Get X30510 Lib Version Syntax unsigned
27. ne of the following PEBADF Invalid file descriptor PENOSPC Write failed Presumably because of no space Example char fname test1 test1 txt PCFD out fd char bff 129 pc_ertfs_init out_fd pc_open fname word PO_BINARY PO_RDWRIPO_CREAT PO_APPEND word PS_IWRITE PS_IREAD pc_read out_fd bff 512 47 Publication May 2013 Ver 1 00 G 4511 Series User Manual 6 2 4 PC_Write Description Write Bytes to a file Syntax int pc_write PCFD fd byte buf word count Parameter fd file desc buf write data buf Count data length Return Returns the actual number of bytes read or Oxffff on error If the return value is Oxffff get_errno will return one of the following PEBADF Invalid file descriptor PENOSPC Write failed Presumably because of no space Example This example will open test1 file and set read write is allowed And write a data char fname test1 test1 txt PCFD out fd char bf 129 bff 129 long testcnt 0 int len pc_ertfs_init out_fd pc_open fname word PO_BINARY PO_RDWR PO_CREAT PO_APPEND word PS_IWRITE PS_IREAD len sprintf bf Line 09lu r n testent pc_write out_fd bf len 48 Publication May 2013 Ver 1 00 G 4511 Series User Manual 6 2 5 PC Close Description Close a file Syntax int pc close PGFD fd Parameter fd file desc Return Returns 0 if all went well otherwise 1
28. oject Open project create new IT Si elp Enter directory path and file mask Step3 Use the Add function to add the library file into MyDemo project 79 Publication May 2013 Ver 1 00 G 4511 Series User Manual Step4 Following the step3 add another library and TEST C into MyDemo project w CATCIBINVTC EXE l ek ompile Debug NTC BINMA PRJ Step5 Click the Options Compiler Code generation to set the compile mode to the large mode Click More to set the Floating point and Instruction Set parameters The Emulation and 80186 will be used respectively Then click OK button to save the configuration Options efines Meee ER Ny LEE Fi Help me Point er Convention Instruction Set 1 Debug info in OBJs gt a Bah 80 Publication May 2013 Ver 1 00 G 4511 Series User Manual parameter Here ing Click the Option Debugger to set the Source Debugg select the None for the Source Debugging Step6 Full menus piler Transfer Make Com t w ironmen VE lt E M r Size K bytes ogram Heap SE en A inspector options set Here parameter tory Irec Output Di to set the Output D irectories ion D k the Opt MyDemo Clic the C Step7 parameter tory Irec for the iler
29. or PEINVAL Seek to negative file pointer attempted 51 Publication May 2013 Ver 1 00 G 4511 Series User Manual 6 2 8 PC_MKDir Description Create a subdirectory Syntax BOOLEAN pc mkdir char name Parameter Name Name of directory to be created Return Returns TRUE if the subdirectory was created otherwise FALSE If FALSE is returned get_errno will return one of these values PENOENT Directory not found PEEXIST File or directory already exists PENOSPC Write failed Example pc_mkdir USR LIB 52 Publication May 2013 Ver 1 00 G 4511 Series User Manual 6 2 9 PC_RMDir Description Delete the directory specified in path Fails if path is not a directory is read only or is not empty Syntax BOOLEAN pc rmdir char name Parameter Name Name of directory to be deleted Return TRUE if the directory was successfully removed otherwise FALSE If FALSE is returned get_errno will return one of these values PENOENT Directory not found PEACCES Not a directory not empty or in use PENOSPC Write failed 53 Publication May 2013 Ver 1 00 G 4511 Series User Manual 6 2 10 PC_deltree Description Delete the directory specified in name all subdirectories of that directory and all files contained therein Fail if name is not a directory is read only or is currently in use Syntax BOOLEAN pc deltree char name Parameter Name Name of directory tree to be de
30. rn 1 gt ON Return 0 gt OFF 39 Publication May 2013 Ver 1 00 G 4511 Series User Manual 6 1 12 X305IO_Analogin_SetChannel Description Set the specific Al channel that users want to read Syntax int X30510 Analogln SetChannel unsigned iChannel Parameter iChannel 0 7 gt chO ch7 Return Return 0 gt Set up success Return 1 gt Set iChannel number error 40 Publication May 2013 Ver 1 00 G 4511 Series User Manual 6 1 13 X3051IO_Analogin_Hex Description Read the value of the assign Al channel assigned by X30510 Analogln SetGhannel function Syntax int X30510 Analogln Hex void Parameter None Return After Read assign Al channel value Example X3051I0 Analogin SetChannel 0 Set channel 0 X3051I0 Analogln Hex 41 Publication May 2013 Ver 1 00 G 4511 Series User Manual 6 1 14 X305I0_AnalogIn_HexToFloat Description Set the Al value from 12 bits to float format Syntax float X30510 Analogln HexToFloat int iValue Parameter A value want to 12 bits transform float Return The transferred Al value by float format Example Set the channel 0 to read and then transform the value to float float AdValue X305IO_AnalogIn_SetChannel 0 AdValue X30510 Analogln HexToFloat X30510 Analogln Hex 42 Publication May 2013 Ver 1 00 G 4511 Series User Manual 6 2 MMC SD Library Function Definition and Description Function defini
31. stem Because 10 battery capacity is low battery voltage state we don t work in this state We use 90 battery capacity to calculate m Double check the battery capacity 14Ah x 90 x 1000 12600 mAh gt 10416 mAh gt We will choose a 12V 14Ah Lead Acid Battery for this system 22 Publication May 2013 Ver 1 00 G 4511 Series User Manual 2 Please refer Table 5 2 1 to choose the battery for other report frequency Table 5 2 1 Average power power consumption of 14 days consumption mAh 12V Every minute 245 82320 No Sleep Report Frequency gt Example2 d M 7017 M 7055 Modbus Server tas Em 24V Power Supply 12V Lead Acid Battery Conditions m The system has a 24V external power Mm It must work in 2 week when the external power is shut down m The system transmits 3 Modbus devices data to the server every 10 minutes 1 minute for full work and 9 minutes for sleeping 23 Publication May 2013 Ver 1 00 G 4511 Series User Manual The system will power off all modbus devices by MCU2 Relay Output when it s in Deep Sleep Mode Power consumption of deep sleep mode is 7 2 mA 12V Average power consumption of full work is 424 mA 12V Calculation 1 Average power consumption 424 x 1 10 7 2 x 9 10 49 mA 424 mA x 24 hours x 14 days 16430 4 mAh We may choose 12V 22Ah Lead Acid Battery for this system Because 10
32. tion Description PC_Ertfs_Init Configure ERTFS drive letter device mapping and initialize device drivers PC_Open Open a file PC_Read Read bytes from the file PC_Write Write Bytes to the file PC_Close Close the file and flush the file allocation table Get_ErrNo Get Error code PC_lseek Move file pointer PC_MKDir Create a subdirectory PC_RMDir Delete a directory PC_deltree Delete a directory tree PC_MV Rename a file or directory PC_IsDir Test if a path is a directory PC_Pwd Return the current working directory PC_Get_Attributes Get File Attributes PC_Set_Attributes Set File Attributes Note Before using these functions users must format the MMC SD card as FAT16 from the PC 43 Publication May 2013 Ver 1 00 G 4511 Series User Manual 6 2 1 PC Ertfs Init Description Configure ERTFS drive letter device mapping and initialize device drivers Syntax BOOLEAN pc ertfs init void Parameter None Return Return value True gt success Fail gt NO SUCCESS 44 Publication May 2013 Ver 1 00 G 4511 Series User Manual 6 2 2 PC_Open e Description Open Create the file from MMC SD card with the specific mode Syntax PCFD pc_open char name word flag word mode e Parameter Name The file path in MMC SD card Flag PO_APPEND Seek to eof on each write PO_BINARY I
33. wnload files None uP 4588 gt 1load File will save to A42E G06B StartAddr gt ABBG 42EA Press ALT_E to download filet Input filename TEST exe Load file TEST exe total 275 blocks Transfer time is 12 266806 seconds uPp 4598 gt run 83 Publication May 2013 Ver 1 00 G 4511 Series User Manual Version Record Version By Date Description 1 0 0 Malo 2013 05 24 84 Publication May 2013 Ver 1 00
Download Pdf Manuals
Related Search
Related Contents
V52 Cámara Termográfica Poderosa y Portátil - SVB International Banner SSB User Manual Manual de uso Fregadora Industrial Eureka E46 Specifications ジャパンベストレスキューシステム(2453) GDH300-- Wireless Calling Management System Copyright © All rights reserved.
Failed to retrieve file