background image

 

 

 

int port=2;    /*to use COM2*/ 
int i; 

 
    InitLib();     /* Initiate the 7188xc library */ 

InstallCom(port, 115200L, 8, 0, 1);    /*install the COM2 driver*/ 
for(i=0; i<10; i++){ 

printCom(port, “Test %d\r\n”, i);    /*print data from COM2*/ 


RestoreCom(port);    /*uninstall the COM driver*/

 

 

4.6.2   To Use COM1/COM2 for an RS-485 Application 

COM1/COM2 is a 2-wire RS-485 COM Port, and includes the following 
2 pins: 

  D+: connect to the Data+ of the RS-485 network 
  D-: connect to the Data- of the RS-485 network 

 
COM1/COM2 is a half-duplex 2-wire RS-485 network and cannot be 
used in a full-duplex 4-wire application. It is designed to directly drive 
I-7000 series modules. 
 
Send/receive directional control in a 2-wire RS-485 network is very 
important. Therefore, the I-7188XC(D) is equipped with a Self-Tuner 
ASIC controller for all RS-485 ports, which will automatically detect and 
control the send/receive direction of the RS-485 network. In this manner, 
the application programmer does not have to worry about the 
send/receive direction control for the RS-485 network. 
 
 

4.6.3   To Send a Command to an I-7000 module 

The commands used for I-7000 series modules are very different from 
those of the I-7188XC(D), but commands can be sent from the 
I-7188XC(D) to a I-7000 module using the 

ToCom()

 function. 

 
 
 

I-7188XC Series User’s Manual(Ver.1.0, Apr/2007,7MH-21-10) ---

 

57

Содержание I-7188XC Series

Страница 1: ...he 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 f...

Страница 2: ...the environment variables of the system 36 3 3 4 Build and Execute the Program 38 4 Operating Principles 47 4 1 System Mapping 47 4 2 Debugging custom Programs using COM1 48 4 3 Using the Download Po...

Страница 3: ...ndix A What is MiniOS7 83 Appendix B MiniOS7 Utility and 7188XW 86 MiniOS7 Utility 86 7188XW 88 Appendix C Comparison Table 96 Appendix D Library Function List 97 Appendix E Compiling and linking 134...

Страница 4: ...nd the features of the controller Depending on the type of embedded firmware programs that are being developed and which I O Expansion Board the I 7188XC D can be used as a single versatile controller...

Страница 5: ...nterrupt and 1K QUEUE input output buffer Support for I O expansion bus interface Only one expansion board can be added Three Digital Input Channels Three Open collector output Channels Built in self...

Страница 6: ...o GND Off Voltage Level 3 5V DC to 30V DC For 20 C to 70 C 3 5V DC to 25V DC For 20 C to 75 C Digital Output Output Channels 3 Output Type Open collector Max Load Current 100mA Load Voltage 30V DC Max...

Страница 7: ...bus_e pdf X702X703 pdf MiniOS7 Utility MiniOS7_utility minios7_utility_V311 exe Readme html 7188xw exe The documents and software listed above can also be obtained from the ICP DAS website http ftp ic...

Страница 8: ...mended that you read the Readme html which can be found in the CD Napdos 7188XABC 7188XC The latest information available prior to shipping will be contained in this file I 7188XC Series User s Manual...

Страница 9: ...re Information 1 4 1 Schematics and Dimensions of the I 7188XC D Bottom View Front View DIN RAIL MOUNTING BRACKET Unit mm Side View Rear View Top View I 7188XC Series User s Manual Ver 1 0 Apr 2007 7M...

Страница 10: ...pansion board 2 X2 Connects to I O expansion board 3 X1 Connects to I O expansion board 4 DO3 Digital output 100mA 30V Max 5 DO2 Digital output 100mA 30V Max 6 DO1 Digital output 100mA 30V Max 7 DI3 D...

Страница 11: ...Pin Name Description 1 D1 DATA for RS 485 2 TXD Transmit Data 3 RXD Receive Data 4 N C No Connection 5 GND Signal ground for RS 232 6 N C No Connection 7 CTS Clear To Send RS 232 8 RTS Request To Sen...

Страница 12: ...1 4 3 Mounting the I 7188XC D 1 Din Rail Mounting 2 Stack Mounting I 7188XC Series User s Manual Ver 1 0 Apr 2007 7MH 21 10 12...

Страница 13: ...COM2 RS 485 DI 2 Channel 3 5V to 30V DO 3 Channel 100mA 30V 5 Digit LED Optional User defined Pin 3 pins SRAM 128K Flash Memory 256K Watchdog Circuit 10V to 30V Power Converter COM1 RS 232 RS 485 I 7...

Страница 14: ...88XCD VS D2 DI3 DO1 GND DO2 13 12 11 10 9 8 7 6 5 X2 X3 DO3 X1 4 3 2 1 Ext GND Ext 24V Connect the INIT pin to GND to disable autoexec bat COM1 2 3 4 5 6 7 8 9 TXD RXD N C GND N C CTS RTS DATA 1 DATA...

Страница 15: ...ce RXD TXD GND 7188XC 7188XCD COM1 Note There are 3 wires as follows Connect the RXD to the TXD of the RS 232 device Connect the TXD to the RXD of the RS 232 device Connect the GND to the GND of the R...

Страница 16: ...e are 5 wires as follows Connect the RXD to the TXD of the RS 232 device Connect the TXD to the RXD of the RS 232 device Connect the RTS to the CTS of the RS 232 device Connect the CTS to the RTS of t...

Страница 17: ...7188XC 7188XCD GND VS 10 9 8 7 14 13 12 11 Ext GND Ext 24V Ext GND Ext 24V COM1 COM2 Note The RS 485 interface can directly drive up to 256 I 7000 series modules without the need for a repeater I 7188...

Страница 18: ...ON State DI value as 0 OFF State DI value as 1 Relay Contact TTL CMOS Logic Open Collector Digital Output Wire Connection Input Type ON State DO value as 1 OFF State DO value as 0 Drive Relay Resista...

Страница 19: ...1 4 7 Mounting the I O Expansion Bus Before mounting After mounting I 7188XC Series User s Manual Ver 1 0 Apr 2007 7MH 21 10 19...

Страница 20: ...dows After all the software is copied to the Host PC the content of 7188XC folder should be as follows 7188XC Demo Demo programs for the I 7188XC D BC_TC Demo programs for the BC and the TC compiler M...

Страница 21: ...upply Vs GND Red LED 5 digit 7 SEG LED Connect to the COM Port of Host PC with download cable CA0910F Step 3 After applying the power the 5 digits of the 7 SEG LED will continuously show as follows Se...

Страница 22: ...Note Only the display version of the module will include a 5 digit 7 SEG LED I 7188XC Series User s Manual Ver 1 0 Apr 2007 7MH 21 10 22...

Страница 23: ...ad programs to the I 7188XC D the 7188xw exe file can also be used Refer to Appendix B MiniOS7 Utility and 7188XW for details of the program download procedure for 7188xw exe The program download proc...

Страница 24: ...2 Step 3 See if the MiniOS7 Utility connects with I 7188XC The connected icon is The disconnected icon is See here to know connection status I 7188XC Series User s Manual Ver 1 0 Apr 2007 7MH 21 10 24...

Страница 25: ...d file into module or draw the file to the right side I 7188XC D file list Host PC file list Step 5 Select the file and then press the right mouse button Choose the Run and press to execute the progra...

Страница 26: ...download operation Step 4 could be done The content of the Hello c file is as follows include 7188xc h Include the headers to use 7188xcl lib functions void main void InitLib Initiate the 7188xc libra...

Страница 27: ...mat of the image file name is TTYYMMDD img TT TYPE of product YY The year this image released MM The month this image released DD The day this image released Note The MiniOS7 image file contained on t...

Страница 28: ...r 1 2 Step 4 Press button and see the Build item to check the version number of the MiniOS7 The diagram is as follow 1 2 Note Besides using the MiniOS7 Utility to upgrade the MiniOS7 7188xw exe can al...

Страница 29: ...M1 InstallCOM2 IsCOM0 IsCOM1 IsCOM2 ToCOM0 ToCOM1 ToCOM2 ReadCom0 ReadCom1 ReadCom2 EEPROM WriteEEP ReadEEP EnableEEP ProtectEEP LED and 5 digit LED LedOn LedOff Init5DigitLed Show5DigitLedWithDot Fla...

Страница 30: ...he BC 3 1 compiler Special attention should be paid to the following items before using the compiler to develop custom applications Generate a standard DOS executable program Set the CPU to 80188 8018...

Страница 31: ...site The following instructions will help you to install the Turbo C version 1 01 compiler on a PC running a Windows operating system Step 1 Go to the CodeGear web site http dn codegear com museum Ste...

Страница 32: ...p 3 Click on the link for Turbo C version 1 01 as shown below to download the tcpp101 zip file When requested save the file to a safe location I 7188XC Series User s Manual Ver 1 0 Apr 2007 7MH 21 10...

Страница 33: ...alled on your machine By default this will extract the files to the C tctemp directory You may designate a different location Step 2 Once the files have been extracted exit the WinZip Self Extractor w...

Страница 34: ...default is A so you should enter C then press ENTER Step 5 3 Press ENTER again This will install the software from the directory tctemp Step 5 4 Press ENTER again This allows Turbo C to be installed...

Страница 35: ...Step 5 6 At this point the Turbo C version 1 01 compiler is installed in C TC which is where the tcc exe executable is also located I 7188XC Series User s Manual Ver 1 0 Apr 2007 7MH 21 10 35...

Страница 36: ...this is as follows Step 1 Right click on the My Computer icon on the desktop Under Windows XP the My Computer icon may be located in the start menu and choose Properties from the context menu Step 2...

Страница 37: ...p 4 Add the target directory to the end of the Variable value using a semi colon as a separator For example C TC BIN C TC INCLUDE Step 5 Click the OK button and then restart your computer in order for...

Страница 38: ...ompt window first Step 2 Type d and then press Enter to enter D drive letter Step 3 Type cd 7188XC_test and press Enter NOTE Assume there is a folder 7188XC_test built under d There is a 7188xc h and...

Страница 39: ...Step 5 1 Select New from the File menu Step 5 2 Type in following code Note that the code is case sensitive include 7188xc h void main void InitLib Print Hello world r n I 7188XC Series User s Manual...

Страница 40: ...amiliar with you may use it to type in the above code It should be noted that you cannot use a word processor application for this as you must use an application that saves in plain text such as notep...

Страница 41: ...Create a new project file prj Step 6 1 Type the name of the project file and then click the OK button Step 7 Add all necessary files to the project I 7188XC Series User s Manual Ver 1 0 Apr 2007 7MH 2...

Страница 42: ...d press Enter to search the file A area B area C area Step 7 2 Select the function library Type lib and press Enter in A area If the file you want is in B area moving the green block to choose the fil...

Страница 43: ...menus Step 10 Click on Options and select the compile menu item then set the Code generation options Step 10 1 Change the Memory model Small for 7188xcs lib large for 7188xcl lib I 7188XC Series User...

Страница 44: ...library directories By default the directories are same as the installation directory of the TC 1 01 Note The Include Directories specifies the directory that contains the standard include files The...

Страница 45: ...on Compile and select Make EXE file to make the project For instructions related to the downloading and execution of programs please refer to Section 2 3 I 7188XC Series User s Manual Ver 1 0 Apr 2007...

Страница 46: ...etailed information regarding compiling and linking related to the various C compilers TC BC MSC MSVC please refer to Appendix E Compiling and linking I 7188XC Series User s Manual Ver 1 0 Apr 2007 7M...

Страница 47: ...8 Interrupt No Interrupt mapping 0 Divided by zero 1 Trace 2 NMI 3 Break point 4 Detected overflow exception 5 Array bounds exception 6 Unused opcode exception 7 ESC opcode exception 8 Timer 0 9 Reser...

Страница 48: ...d cable between COM4 on the I 7188XC D and the COM Port of the Host PC refer to Section 2 2 for more details Switch on the power for the Host PC and execute the 7188xw exe Switch on the power for the...

Страница 49: ...PC standard input of I 7188XC D The monitor of the Host PC standard output of I 7188XC D In this way the I 7188XC D can read data from the keyboard and display it on the monitor Thus debugging a prog...

Страница 50: ...ble from the Host PC Step 3 Disconnect the INT pin from the GND pin of the I 7188XC D if they are connected Step 4 Switch on the I 7188XC D no standard input no standard output no debug information St...

Страница 51: ...eceives responses from the I 7188XC D Also shows how to use another COM Port or LED to show information to help debug a program COM_Port ToCom_In_Out Reads writes the byte data via the COM Port 4 6 IO...

Страница 52: ...ues Runprog Uses the Ungetch function to run another program Misc Watchdog Enables the Watchdog or bypasses the enabled Watchdog 4 9 7K87K_demo_for_com 7K87K_AI_for_Com 7K87K_DI_for_Com 7K87K_DIO_for_...

Страница 53: ...XC D timer function to send receive data to or from 7000 series modules XBoard These are demo programs for all I O expansion boards that are applicable to the I 7188XC D 4 12 I 7188XC Series User s Ma...

Страница 54: ...ed for the 80188 UART is very different from the 16C550 Interrupt handling on the 80188 is also very different from the 8259 on a PC Therefore the RS 232 application programs for PC are not executed i...

Страница 55: ...m the COM port the IsCom function should be used to check if any data has already been sent to the COM Port If yes then the ReadCom function should be used to read the data from input buffer of the CO...

Страница 56: ...e COM1 input buffer data ReadCom1 read data from COM1 ToCom1 data send data via COM1 if data q quit 1 if q is received exit the program RestoreCom1 uninstall the COM driver 4 6 1 To print from the COM...

Страница 57: ...n It is designed to directly drive I 7000 series modules Send receive directional control in a 2 wire RS 485 network is very important Therefore the I 7188XC D is equipped with a Self Tuner ASIC contr...

Страница 58: ...nation I 7000 modules delay by 1 byte to allow for setting time Step 4 The destination I 7000 modules echo the result string back to the I 7188XC D Note The delay time used in step 3 is only 1 byte I...

Страница 59: ...connect to an I 7000 module SendCmdTo7000 int iPort unsigned char cCmd int iChksum This function sends a command to an I 7000 series module If the checksum is enabled the function will add 2 bytes ch...

Страница 60: ...or touch screen in many applications Before attempting to use the LED the Init5DigitLed function must first be called then the Show5DigitLed function can be used to display data The code required to d...

Страница 61: ...to erase it To write an integer to segment 0xD000 offset 0x1234 of the Flash Memory the code is as follows int data 0xAA55 data2 char dataptr int dataptr2 InitLib Initiate the 7188xc library dataptr...

Страница 62: ...the EEPROM is limited to1 000 000 erase write cycles so it should not be changed frequently when testing The EEPROM can be erased written in a single byte so it is very useful in real world applicati...

Страница 63: ...1 10 1 data2 now data2 data 0x55 Note To write an integer to EEPROM the EE_WriteEnable function must be called twice in the same manner as writing data to NVRAM Refer to the demo programs in the CD Na...

Страница 64: ...e I 7188XC D to reboot The program must then ask the MiniOS7 to reset the watchdog timer then stop and return to the MiniOS7 command prompt Use the EnableWDT function to enable the watchdog timer or u...

Страница 65: ...brary if IsResetByWatchDogTimer do something here to check the system quit 0 EnableWDT while quit Refer to the demo programs in the CD Napdos 7188XABC 7188XC Demo BC_TC Misc folder for more informatio...

Страница 66: ...alled by hooked to INT 9 and will call any custom timer function The TimerOpen function is used to start the I 7188XC D timer and this function must be inserted at the beginning of the program The Tim...

Страница 67: ...Di2 and GetDi3 function can be used to read the states of the two DI channels For DI and DO wiring information please refer to Section 1 4 6 DI and DO Wire Connection The wiring for a DI DO applicatio...

Страница 68: ...DI s n r GetDi3 High Low Read the state of DI3 Do1 GetDo1 Read the state of DO1 Print DO1 s n r Do1 High Low if Do1 SetDo1High Set the DO1 to ON else SetDo1Low Set the DO1 to OFF Do2 GetDo2 Read the...

Страница 69: ...o parallel devices Lower cost compared to parallel devices Easier to design for isolated applications The serial interface of the I O expansion bus makes connecting to these serial devices very easy 4...

Страница 70: ...high 7 VCC PCB power supply 8 RESET Power up reset pulse active high 9 GND PCB ground 10 RESET Power up reset pulse active low 11 TO_0 CPU Timer output 0 can be used as a programmable D I O 12 TO_1 CP...

Страница 71: ...ways programmed as DO Changing this signal to other configurations will cause serious errors This signal to drive external serial can be used devices without any side effects J2 pin definition and des...

Страница 72: ...as follows Step 1 Remove the reconfiguration resistor as follows If DO3 is reconfigured remove R19 If DO2 is reconfigured remove R20 If DO1 is reconfigured remove R21 If DI3 is reconfigured remove R2...

Страница 73: ...size X002 Prototype Board X003 Self test I O Expansion Boards for DI and DO Board Description X100 8 DI channels X101 8 DO channels X102 2 Relay Output channels X103 7 DI channels X104 8 DI channels o...

Страница 74: ...oards for storage devices Board Descriptions X600 4M bytes NAND Flash X601 8M bytes NAND Flash X607 128K battery backup SRAM X608 512K battery backup SRAM Note Refer to I O Expansion Bus for 7188X 718...

Страница 75: ...eneral applications meaning that it can be used to replace a Host PC PLC or other special controllers Programming Tool TC BC MSC Debug Tool Via standard input output keyboard and monitor of a Host PC...

Страница 76: ...he PC sends commands to the 7000 series modules as output data If there are hundreds of 7000 series modules it will take the Host PC a long time to analyze and control these modules so the control pro...

Страница 77: ...00 series modules based on these control arguments The Host PC can then access the remote I 7188XC D regarding the following items Query and record the status of the remote system Download control arg...

Страница 78: ...of the PLC meaning that the PLC can access the 7000 series input modules as follows The I 7188XC D sends a command to the 7000 series input modules The I 7188XC D writes this data to the internal mem...

Страница 79: ...t data from the 7000 series modules can be displayed on a touch screen In addition the output from the 7000 series modules can be controlled from a touch screen I 7188XC Series User s Manual Ver 1 0 A...

Страница 80: ...0 settings Device A RS 232 Half duplex mode Synchronous way Slave state Baud Rate 9600 Channel 3 Frequency 915 968MHz SST 900 SST 2400 settings Device B C D RS 485 or RS 232 Half duplex mode Synchrono...

Страница 81: ...the I 7188XC D is an embedded controller and is programmable it can be used as a bridge between the SST 900 and any external devices such as a PLC a controller or other 7000 series modules I 7188XC Se...

Страница 82: ...RS 485 COM1 RS 232 COM4 RS 232 COM3 RS 232 7000 series modules COM1 The PLC can access the I O state of the 7000 series modules COM2 Directly controls the 7000 series input output modules COM3 MMICON...

Страница 83: ...able between MiniOS7 and ROM DOS as follows MiniOS7 ROM DOS Power up time 0 1 sec 4 5 sec More compact size 64K bytes 64K bytes Support for I O Expansion Bus Yes No Support for ASIC Key Yes No Flash R...

Страница 84: ...ile with the prescribed file number Filename Executes the file with the prescribed file name DELETE or DEL Deletes all files stored in the Flash Memory RESET Resets the CPU DIAG option Performs hardwa...

Страница 85: ...http ftp icpdas com pub cd 8000cd napdos minios7 document lib_man ual_for_7188xabc index htm I 7188XC Series User s Manual Ver 1 0 Apr 2007 7MH 21 10 85...

Страница 86: ...e Flash Memory Configure the COM port settings MiniOS7 utility location The MiniOS7 utility is located in the CD NAPDOS MINIOS7 UTILITY MiniOS7_utility folder on the CD or at http ftp icpdas com pub c...

Страница 87: ...I 7188XC Series User s Manual Ver 1 0 Apr 2007 7MH 21 10 87...

Страница 88: ...functions such as Getch Scanf and LineInput will allow the main control unit to read keyboard input from a Host PC 7188xw exe location The 7188xw exe is located in the CD Napdos MiniOS7 utility folder...

Страница 89: ...to memory Alt_E should be pressed only after the Press ALT_E to download file message is shown on the screen Alt_H Toggles between Hex ASCII display mode Alt_L Toggles between normal line mode In lin...

Страница 90: ...ABC folder or at http ftp icpdas com tw pub cd 8000cd napdos minios7 document lib_ manual_for_7188xabc on the web Downloading a file to the I 7188XC D controller using the 7188xw exe application Step...

Страница 91: ...Hello_C then press Enter Assume user copy the 7188XC folder to C drive letter Refer to Step2 in Sec 2 1 Step 5 Execute the 7188xw exe application as shown in the following figure I 7188XC Series User...

Страница 92: ...rogram Notes A description of the Hotkey functions is as follows F8 Download a file to FLASH Memory and then execute the program F9 Download a file to FLASH Memory F10 Download a file to SRAM and then...

Страница 93: ...sing the CA0910 cable Refer to the wiring diagram in Section 2 2 for details Step 2 Determine the latest version of the MiniOS7 image file The format of the image file name is TTYYMMDD img TT TYPE of...

Страница 94: ...the UPLOAD command then press ALT E after the Press ALT_E to download file message is shown on the screen Step 5 Type the image filename for example xc050628 img then press ENTER Step 6 Wait for the u...

Страница 95: ...written to the Flash Memory Step 8 It will take about 10 seconds to upgrade MiniOS7 After the update has finished the system will automatically reboot If this does not occur the system must be reboote...

Страница 96: ...isolation RS 485 with self tuner inside RS 485 with self tuner inside RS 485 COM3 RS 232 TxD RxD No COM No COM RS 232 TxD RxD COM4 RS 232 Txd Rxd No COM No COM RS 232 TxD RxD User defined pins 0 14 3...

Страница 97: ...until a single character is received from keyboard input Ungetch Returns a single character to the input buffer of COM1 Putch Sends a single character to COM1 Puts Sends a string to COM1 Scanf Retrie...

Страница 98: ...0 the function will return 1 0xFFFF Example include 7188xc h void main int quit 0 data InitLib Puts n rPress any key to show ASCII Q to quit n r while quit if Kbhit data Getch if data Q quit 1 Putch d...

Страница 99: ...ter on the screen Syntax void Putch int data Header include 7188xc h Description Data 0 to 255 If the data is 255 only the low byte will be sent Example Please refer to Kbhit for an example Puts Funct...

Страница 100: ...har fmt Header include 7188xc h Description This function is used instead of printf and the only difference between Print and printf is that Print does not convert the characters n to n r That is n on...

Страница 101: ...ed in the COM1 buffer ClearCom2 Clears all the data currently stored in the COM2 buffer ReadCom Reads the data from COM Port buffer The COM Port number is not assigned ReadCom1 Reads data from the COM...

Страница 102: ...i 10 i printCom port Test d n r i prints data to the COM Port while quit if IsCom port checks if any data is in the COM Port buffer data ReadCom port reads data from the COM Port buffer ToCom port dat...

Страница 103: ...7188xc h Description Uninstalls the driver for the COM Port The COM Port number is not assigned and can be modified using the port parameter port assigns the COM Port number Example Please refer to In...

Страница 104: ...Port buffer The COM Port number is not assigned Syntax int ReadCom int port Header include 7188xc h Description Reads data from the COM Port buffer The COM Port number is not assigned and can be modi...

Страница 105: ...n example ToCom Function Sends data to the COM Port The COM Port number is not assigned Syntax int ToCom int port Header include 7188xc h Description Sends data to the COM Port The COM Port number is...

Страница 106: ...Example Please refer to InstallCom for an example printCom1 Function Prints data from the buffer of COM1 Syntax int printCom_1 char fmt Header include 7188xc h Description Prints data from the buffer...

Страница 107: ...Function Sets the EEPROM to write enable mode Syntax void EE_WriteEnable void Header include 7188xc h Description Sets the EEPROM to write enable mode The EEPROM is in write protect mode by default EE...

Страница 108: ...ore writing data to the EEPROM After writing the data it is recommended that EE_WriteProtect be called to return the EEPROM to write protect mode Example Please refer to EE_WriteEnable for an example...

Страница 109: ...e found at CD Napdos minios7 document lib_manual_for_7188xabc index htm for more detailed information ReadNVRAM Function Reads data from the NVRAM Syntax int ReadNVRAM int addr Header include 7188xc h...

Страница 110: ...ess used to save the minute 0 59 data sec The address used to save the second 0 59 data Example include 7188xc h void main int year month day hour min sec wday InitLib SetDate 2006 1 12 sets the syste...

Страница 111: ...Date int year int month int day Header include 7188xc h Description year 2000 2080 month 1 12 day 1 31 Return Value On success returns NoError On error returns DateError 18 Example Please refer to Get...

Страница 112: ...correct weekday and set the RTC If SetDate is called it will also calculate the correct weekday and set the RTC However if SetWeekDay is called the function must calculate the correct weekday itself...

Страница 113: ...pplication developers can use these functions to write data to the Flash memory When writing data to the Flash memory data only be written from 1 to 0 and cannot be written from 0 to 1 So before writi...

Страница 114: ...tax int FlashWrite unsigned int seg unsigned int offset char data Header include 7188xc h Description seg 0xC000 0xD000 or 0xE000 offset 0 to 65535 0xffff data 0 to 255 8 bit data Return Value On succ...

Страница 115: ...yte of data from the Flash memory Syntax int FlashRead unsigned int seg unsigned int offset Header include 7188xc h Description seg 0xC000 0xD000 or 0xE000 offset 0 to 65535 0xffff Return Value FlashR...

Страница 116: ...tarts using a StopWatch channel StopWatchReset Resets the StopWatch value to 0 StopWatchStop Disables the StopWatch channel StopWatchPause Pauses the StopWatch StopWatchContinue Restarts the StopWatch...

Страница 117: ...open returns 1 Example include 7188xc h void main unsigned long time int quit 0 InitLib Print n rPress any key to start the timer Print n rthen Press 0 to Reset the timer 1 4 to insert a delay q to qu...

Страница 118: ...l TimerClose before exiting Return Value Always returns NoError Example Please refer to TimerOpen function for more detailed information TimerResetValue Function Resets the timer to 0 Syntax void Time...

Страница 119: ...of the CPU Syntax void Delay unsigned ms Header include 7188xc h Description Inserts a delay for a specific time interval The time unit is ms and uses the Timer 1 feature of the CPU ms the delay time...

Страница 120: ...channel Header include 7188xc h Description The system timer ISR will increment the StopWatch value by 1 in 1 ms intervals channel 0 7 a total of 8 channels Return Value On success returns NoError If...

Страница 121: ...StopWatch channel Syntax int StopWatchStop int channel Header include 7188xc h Description The system timer ISR will stop to increment the StopWatch value channel 0 7 a total of 8 channels Return Valu...

Страница 122: ...more detailed information StopWatchReadValue Function Reads the current StopWatch value Syntax int StopWatchReadValue int channel unsigned long value Header include 7188xc h Description The value rep...

Страница 123: ...0 value reads the CountDownTimer Print Test CountDown d r value if value 0 CountDownTimerStart 0 1000 restarts the CountDownTimer TimerClose CountDownTimerReadValue Function Reads the current value of...

Страница 124: ...a value Example include 7188xc h int Data 3 0 0 0 void MyTimerFun void custom timer function static int count 3 0 0 0 int i for i 0 i 3 i Print count d d r i count i count i if count 0 200 LCD lamp1...

Страница 125: ...the custom function The function cannot use an input argument and cannot return a value Example Please refer to InstallUserTimer function for a similar example EnableWDT Function Enables the WatchDog...

Страница 126: ...sh WDT must be called within 0 8s Print call Refresh WDT n r DisableWDT Disable the WDT The system will refresh the WDT Print Call DisableWDT n r DisableWDT Function Disables the WatchDog timer Syntax...

Страница 127: ...s been reset by the WatchDog Timer Syntax int IsResetByWatchDogTime void Header include 7188xc h Description Returns 0 when true Example Please refer to EnableWDT function for more detailed informatio...

Страница 128: ...or more detailed information Note The file system for MiniOS7 supports custom programs for reading files but does not support custom programs for writing files GetFileNo Function Gets the total number...

Страница 129: ...r the offset Example include 7188xc h static FILE_DATA far fdata file_data structure please see the file c for details char far fp_no void main int fileno i char fname 13 InitLib Initialize the Librar...

Страница 130: ...of the file information On error returns NULL Example Please refer to GetFilePositionByNo for more detailed information GetFileInfoByName Function Uses the file name to retrieve the file information S...

Страница 131: ...ex htm for more detailed information SendCmdTo7000 Function Sends a command to an I 7000 series module Syntax int SendCmdTo7000 int iPort unsigned char cCmd int iChksum Header include 7188xc h Descrip...

Страница 132: ...reak case 3 SendCmdTo7000 port 0104 0 Print x ON x break case 4 SendCmdTo7000 port 0108 0 Print x ON x break case 5 SendCmdTo7000 port 0110 0 Print x ON x break case 9 quit 1 Print quit break end of s...

Страница 133: ...7000 series modules for more details Example Please refer to SendCmdTo7000 for more detailed information ascii_to_hex Function Converts ASCII code to a hexadecimal value Syntax int ascii_to_hex char...

Страница 134: ...emo BC_TC Hello_C gotc bat tcc Ic tc include Lc tc lib hello1 c lib 7188xcl lib Method 2 Using the TC Integrated Environment Step 1 Execute TC EXE to run the TC 2 01 Integrated Environment Step 2 Edit...

Страница 135: ...nu Step 5 On the compiler options menu change the Memory model to Large and set the Code Generation to 80186 80286 as shown in the diagram below Step 6 Select Build all from the compile menu to build...

Страница 136: ...I 7188XC Series User s Manual Ver 1 0 Apr 2007 7MH 21 10 136...

Страница 137: ...g the BC Compiler The procedures for using the BC compiler is as follows Step 1 Execute the Borland C 3 1 Step 2 Create a new project file prj I 7188XC Series User s Manual Ver 1 0 Apr 2007 7MH 21 10...

Страница 138: ...3 Add all the necessary files to the project Step 3 1 Select the source file Step 3 2 Select the function library and then click the Done button I 7188XC Series User s Manual Ver 1 0 Apr 2007 7MH 21 1...

Страница 139: ...Step 4 Set the Code generation options Step 4 1 Change the Memory model to Large Step 5 Set the Advanced code generation options I 7188XC Series User s Manual Ver 1 0 Apr 2007 7MH 21 10 139...

Страница 140: ...Step 5 1 Set the Floating Point to Emulation and the Instruction Set to 80186 Step 6 Set the Entry Exit Code Generation option I 7188XC Series User s Manual Ver 1 0 Apr 2007 7MH 21 10 140...

Страница 141: ...Step 6 1 Set the DOS standard Step 7 Set the Debugger Options 7 1 Set Source Debugging to None I 7188XC Series User s Manual Ver 1 0 Apr 2007 7MH 21 10 141...

Страница 142: ...Step 8 Make the project I 7188XC Series User s Manual Ver 1 0 Apr 2007 7MH 21 10 142...

Страница 143: ...tch file called Gomsc bat using the text editor The source code The path for the function library The object file name NOTE C don t strip comments Gs no stack checking Fpa calls with altmath Fm map fi...

Страница 144: ...Step 3 A new executable file will be created if it is successfully compiled I 7188XC Series User s Manual Ver 1 0 Apr 2007 7MH 21 10 144...

Страница 145: ...ler are given as following Step 1 Run MSVC exe Step 2 Create a new project mak by entering the name of the project in the Project Name field and then select MS DOS application EXE as the Project type...

Страница 146: ...Step 3 Add the user s program and the necessary library files to the project Step 4 Set the Code Generation on the Compiler I 7188XC Series User s Manual Ver 1 0 Apr 2007 7MH 21 10 146...

Страница 147: ...Step 5 Change the Memory model to Large Step 6 Remove the xcr afxcr library from the Input Category I 7188XC Series User s Manual Ver 1 0 Apr 2007 7MH 21 10 147...

Страница 148: ...Step 7 Remove the OLOGO option from the miscellancous Category I 7188XC Series User s Manual Ver 1 0 Apr 2007 7MH 21 10 148...

Страница 149: ...Step 8 Rebuild the project I 7188XC Series User s Manual Ver 1 0 Apr 2007 7MH 21 10 149...

Страница 150: ...data for the same purpose It provides very strong protection against illegal copies Every legal user has a unique AsicKey and unique software library the user can self check this key or the software...

Отзывы: