background image

 

I-7188XA Series User’s Manual ( Ver1.2, Feb/2014, 7MH-019-10 ) ---

 

127 

Description: channel: 0-7, a total of 8 channels. 

count: the amount of time to be counted. 

Return Value: On success, returns NoError(). 

If the channel is out of range, returns ChannelError 
(-15). 

 

Example: 

#include <7188xa.h> 
void main(void) 

unsigned long value; 
int quit=0; 
InitLib(); 
Print("\n\rTest the CountDownTimer..."); 
Print("\n\rPress 'q' to quit\n\r"); 
TimerOpen(); 
CountDownTimerStart(0,1000);  /*use the CountDownTimer*/ 
while(!quit){ 

if(Kbhit()&&(Getch()=='q')) quit=1; 
CountDownTimerReadValue(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 the CountDownTimer(count). 
Syntax: 

int CountDownTimerReadValue(int channel,unsigned 
long *value);

 

Header: 

#include ”7188xa.h” 

Description:  If  the return value is 0, it means that  the time has 

expired. 

channel: 0-7, a total of 8 channels. 
value: a pointer to the location where the value is to be 

stored. 

Return Value: On success, returns NoError(). 

If  the  channel is out of range,  returns  ChannelError 

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

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

Страница 2: ...1 01 33 3 3 2 Install Turbo C version 1 01 35 3 3 3 Set the environment variables of the system 38 3 3 4 Build and Execute the Program 40 3 4 Building project on 64 bit platform 48 4 Operating Princi...

Страница 3: ...7 An Application Using 4 COM Ports 2 85 Appendix A What is MiniOS7 86 Appendix B MiniOS7 Utility and 7188XW 89 MiniOS7 Utility 89 7188XW 91 Appendix C Comparison Table 100 Appendix D Library Function...

Страница 4: ...Expansion Board for the I 7188XA D which can be used to expand the features of the controller Depending on the type of embedded firmware programs that are being developed and which I O Expansion Board...

Страница 5: ...S 485 port of 3000V 64 bit internal hardware unique serial number COM driver supports both interrupt and 1K QUEUE input output buffer Support for I O expansion bus interface Only one expansion board c...

Страница 6: ...232 Program download port Ethernet Port No Digital Input Input Channels 2 Contact Dry On Voltage Level Connect to GND Off Voltage Level Open Digital Output Output Channels 2 Output Type Open collector...

Страница 7: ...oftware on the website is identical to the companion CD The iobus_e pdf file that is provided in the CD Napdos 7188XABC Xboard Document folder and the I O Expansion Bus for 7188X 7188E User s Manual c...

Страница 8: ...Ver1 2 Feb 2014 7MH 019 10 8 Before continuing it is recommended that you read the Readme html which can be found in the CD Napdos 7188XABC 7188XA The latest information available prior to shipping w...

Страница 9: ...eries User s Manual Ver1 2 Feb 2014 7MH 019 10 9 1 4 Hardware Information 1 4 1 Schematics and Dimensions of the I 7188XA D Top View Rear View Side View Unit mm DIN RAIL MOUNTING BRACKET Front View Bo...

Страница 10: ...block is as follows Pin Name Description 1 DO1 Digital output 100mA 30V Max 2 DO2 Digital output 100mA 30V Max 3 DI1 Digital input 3 5V 30V 4 DI2 Digital input 3 5V 30V 5 TXD4 TXD pin for COM4 RS 232...

Страница 11: ...e JP6 to select RS 485 3 TXD Transmit Data Use JP6 to select RS 232 D1 DATA for RS 485 Use JP6 to select RS 485 4 DTR Data Terminal Ready RS 232 5 GND Signal ground for RS 232 6 DSR Data Set Ready RS...

Страница 12: ...I 7188XA Series User s Manual Ver1 2 Feb 2014 7MH 019 10 12 1 4 3 Mounting the I 7188XA D 1 Din Rail Mounting 2 Stack Mounting...

Страница 13: ...80188 40 CPU or compatible RTC NVRAM COM2 RS 485 3000V isolation COM3 RS 232 COM4 RS 232 COM1 RS 232 RS 485 Selected using JP6 EEPROM 2K 5 Digit LED Optional DI 2 Channels 3 5V to 30V DO 2 Channels 10...

Страница 14: ...3 labelled GND to pin 7 of the I 7188XA D Connect the DB 9 of the download cable to the PC COM1 2 3 4 Port RI CTS RTS DSR GND DTR TXD COM Port of the PC D2 Init RXD3 7188XA 7188XAD VS D2 TXD3 GND GND...

Страница 15: ...232 Port 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 RS 232 device RI CTS RTS DS...

Страница 16: ...ect 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 the RS 232 device Connect the...

Страница 17: ...Manual Ver1 2 Feb 2014 7MH 019 10 17 Using a 9 wire RS 232 Port Note The COM1 pin assignment of the I 7188XA D is the same as the Host PC The settings for JP6 on the I 7188XA D is as follows 5 6 COM1...

Страница 18: ...ectly drive up to 256 I 7000 series modules without the need for a repeater When using COM1 as an RS 485 COM Port the settings for JP6 on the I 7188XA D is as follows 5 6 COM1 RS 232 default 1 2 232 G...

Страница 19: ...DO wire connection Digital Input Wire Connection Input Type 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 Sta...

Страница 20: ...I 7188XA Series User s Manual Ver1 2 Feb 2014 7MH 019 10 20 1 4 7 Mounting the I O Expansion Bus Before mounting After mounting...

Страница 21: ...niOS7 utility folder to the PATH directory for example C Windows After all the software is copied to the Host PC the content of 7188XA folder should be as follows 7188XA Demo Demo programs for the I 7...

Страница 22: ...D Vs can be in a range from 10V to 30V DC Step 3 After applying the power the 5 digits of the 7 SEG LED will continuously show as follows If the non display version of module is being used please cont...

Страница 23: ...I 7188XA Series User s Manual Ver1 2 Feb 2014 7MH 019 10 23 Note Only the display version of the module will include a 5 digit 7 SEG LED...

Страница 24: ...ownload Note Instead of using the MiniOS7 Utility to download programs to the I 7188XA D the 7188xw exe file can also be used Refer to Appendix B MiniOS7 Utility and 7188XW for details of the program...

Страница 25: ...I 7188XA Series User s Manual Ver1 2 Feb 2014 7MH 019 10 25 Step 3 See if the MiniOS7 Utility connects with I 7188XA The connected icon is The disconnected icon is 2 See here to know connection status...

Страница 26: ...ep 4 Select the file to load from left side and click to load file into module or draw the file to the right side Step 5 Select the file and then press the right mouse button Choose the Run and press...

Страница 27: ...window NOTE The 7188xw window has to be closed and then the download operation Step 4 could be done The content of the Hello c file is as follows include 7188xa h Include the headers to use 7188xal li...

Страница 28: ...Step 1 Get the latest version of MiniOS7 image file The format 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 th...

Страница 29: ...29 Step 3 It will take about 10 seconds for the upgrade to finish If the MiniOS7 was updated successfully a Confirm action dialog box will appear Step 4 Press button and see the Build item to check th...

Страница 30: ...eries User s Manual Ver1 2 Feb 2014 7MH 019 10 30 Note Besides using the MiniOS7 Utility to upgrade the MiniOS7 7188xw exe can also be used Refer to Appendix B MiniOS7 Utility and 7188XW for download...

Страница 31: ...s lib 7188xal lib files as follows Function description Example COM port InstallCOM1 InstallCOM2 InstallCOM3 IsCOM1 IsCOM2 IsCOM3 ToCOM1 ToCOM2 ToCOM3 ReadCom1 ReadCom2 ReadCom3 EEPROM WriteEEP ReadEE...

Страница 32: ...compiler as the libraries provided have been created using the BC 3 1 compiler Special attention should be paid to the following items before using the compiler to develop custom applications Generate...

Страница 33: ...urbo C 1 01 compilers can be downloaded from the Borland website 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...

Страница 34: ...188XA Series User s Manual Ver1 2 Feb 2014 7MH 019 10 34 Step 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 locati...

Страница 35: ...Self Extractor window you do NOT need WinZip installed 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 ha...

Страница 36: ...he drive where the unzipped file is located The 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 E...

Страница 37: ...I 7188XA Series User s Manual Ver1 2 Feb 2014 7MH 019 10 37 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...

Страница 38: ...dd C TC to your executable search path The easiest way to do 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 st...

Страница 39: ...oose the variable Path and then click on the Edit button Step 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 Cli...

Страница 40: ...tions NOTE You must close the original MS DOS command prompt window first Step 2 Type d and then press Enter to enter D drive letter Step 3 Type cd 7188XA_test and press Enter NOTE Assume there is a f...

Страница 41: ...Ver1 2 Feb 2014 7MH 019 10 41 Step 5 Create a source file c Step 5 1 Select New from the File menu Step 5 2 Type in following code Note that the code is case sensitive include 7188xa h void main void...

Страница 42: ...name Hello C Note If you have a text editor you are familiar 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...

Страница 43: ...er s Manual Ver1 2 Feb 2014 7MH 019 10 43 Step 6 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 Ope...

Страница 44: ...ck the Add button If not moving the green block to C area and press Enter to search the file Step 7 2 Select the function library Type lib and press Enter in A area If the file you want is in B area m...

Страница 45: ...10 45 Step 9 Click on Options and select Full 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 7188xas...

Страница 46: ...Directories to enter the TC 1 01 include and library directories By default the directories are same as the installation directory of the TC 1 01 Note The Include Directories specifies the directory t...

Страница 47: ...t Make EXE file to make the project For instructions related to the downloading and execution of programs please refer to Section 2 3 For more detailed information regarding compiling and linking rela...

Страница 48: ...t compiler like BC3 1 or TC 3 0 to build MiniOS7 project on Windows 64 bit platform like Windows 7 or Windows 8 it will prompt up an error message to show compatibility problem for 64 bit platform Ple...

Страница 49: ...88 COM4 0XFF10 to 0XFF18 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 exce...

Страница 50: ...yed Power off the Host PC and I 7188XA D Connect the download cable between COM4 on the I 7188XA D and the COM Port of the Host PC refer to Section 2 2 for more details Switch on the power for the Hos...

Страница 51: ...on the Host PC to setup this bridge The keyboard of the Host PC standard input of I 7188XA D The monitor of the Host PC standard output of I 7188XA D In this way the I 7188XA D can read data from the...

Страница 52: ...Step 2 Switch off the I 7188XA D and remove the download cable from the Host PC Step 3 Disconnect the INT pin from the GND pin of the I 7188XA D if they are connected Step 4 Switch on the I 7188XA D...

Страница 53: ...v_COM The PC sends commands to the I 7188XA D and receives responses from the I 7188XA D Also shows how to use another COM Port or LED to show information to help debug a program ToCom_In_Out Reads wr...

Страница 54: ...tes a value to the NVRAM value will automatically increase by 1 Top Mem Demonstration of the AllocateTopMemory function Misc Reset Restores the initial values Runprog Uses the Ungetch function to run...

Страница 55: ...control the 5 digit 7 segment LED Demo97 Shows how to use the DelayMs function to switch the LED ON or OFF Demo98 Shows how to use the I 7188XA D timer function to send receive data to or from 7000 s...

Страница 56: ...a 3 wire RS 232 TXD RXD GND 9 wire RS 232 TXD RXD GND RTS CTS DCD DTR DSR RI The programming required for the 16C550 is very different from the 80188 UART Interrupt handling on the 80188 is also very...

Страница 57: ...an be read from the COM Port sent to the COM Port printed from the COM Port and so on Before reading data from the COM port the IsCom function should be used to check if any data has already been sent...

Страница 58: ...sed for all COM Ports and printCom1 2 3 4 can be sued for individual ports Before using the printCom function the InstallCom function must first be called The code is shown below if data q quit 1 if q...

Страница 59: ...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 d...

Страница 60: ...tination I 7000 modules execute the command Step 3 The destination 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 7...

Страница 61: ...nt iPort unsigned char cCmd long lTimeout int iChksum After calling the SendCmdTo7000 function the ReceiveResponseFrom7000_ms function can be called to retrieve a response from an I 7000 series module...

Страница 62: ...I 7188XA Series User s Manual Ver1 2 Feb 2014 7MH 019 10 62 5 6 COM1 RS 232 1 2 232...

Страница 63: ...e very useful in real world applications and can be used to replace a monitor or touch screen in many applications Before attempting to use the LED the Init5DigitLed function must first be called then...

Страница 64: ...ytes The user should decide whether to write to the block or to erase it To write an integer to segment 0xD000 offset 0x1234 of the Flash Memory the code is as follows Reading data from the Flash Memo...

Страница 65: ...as backup for at least 10 years The features of the RTC are as follows BIOS support for RTC time and data MiniOS7 supports RTC time and date Seconds minutes hours date of the month Month day of the we...

Страница 66: ...changed frequently when testing The EEPROM can be erased written in a single byte so it is very useful in real world applications The I 7188XA D has 2K bytes of EEPROM memory containing 8 blocks and e...

Страница 67: ...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 Napdos 7188XABC 7188XA Demo BC_TC Memory fo...

Страница 68: ...program does not refresh the watchdog timer every 0 8 seconds it will cause the I 7188XA D to reboot The program must then ask the MiniOS7 to reset the watchdog timer then stop and return to the MiniO...

Страница 69: ...efer to the demo programs in the CD Napdos 7188XABC 7188XA Demo BC_TC Misc folder for more information main InitLib Initiate the 7188xa library if IsResetByWatchDogTimer do something here to check the...

Страница 70: ...timer function of the library is linked to associated with called by hooked to INT 9 and will call any custom timer function The TimerOpen function is used to start the I 7188XA D timer and this funct...

Страница 71: ...n SetDo1Off SetDo2On and SetDo2Off functions can be used to control the two DO channels and the GetDi1 and GetDi2 functions can be used to read the states of the two DI channels For DI and DO wiring i...

Страница 72: ...ormation int Do1 Do2 InitLib Initiate the 7188xa library Print DI1 s n r GetDi1 High Low Read the state of DI1 Print DI2 s n r GetDi2 High Low Read the state of DI2 Do1 GetDo1 Read the state of DO1 Pr...

Страница 73: ...ese serial devices are as follows Smaller size compared to parallel devices Lower cost compared to parallel devices Easier to design for isolated applications The serial interface of the I O expansion...

Страница 74: ...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 CPU Time...

Страница 75: ...ll onboard serial devices so it is always 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 s...

Страница 76: ...4 12 2 I O Expansion Boards I O Expansion Boards for prototyping and testing Board Description X000 Prototype Board Small size X001 Prototype Board Large size X003 Self test I O Expansion Boards for...

Страница 77: ...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 Man Machine Interface MMICON PC...

Страница 78: ...and generates some output data The 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...

Страница 79: ...trol arguments The Host PC can then access the remote I 7188XA D regarding the following items Query and record the status of the remote system Download control arguments to the remote I 7188XA D The...

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

Страница 81: ...s Manual Ver1 2 Feb 2014 7MH 019 10 81 In this way the input 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...

Страница 82: ...lication SST 900 SST 2400 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 Ha...

Страница 83: ...019 10 83 Baud Rate 9600 Channel 3 Frequency 915 968MHz As the I 7188XA 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...

Страница 84: ...he 7000 series modules COM2 Directly controls the 7000 series input output modules COM3 MMICON is used as the local MMI COM4 The PC is used to monitor and record the system data PC PLC MMICON SST 900...

Страница 85: ...nks to the remote Host PC COM2 Directly controls the 7000 series input output modules COM3 The TOUCH 200 is used as the local MMI COM4 The Card reader is used as a standard input device TOUCH 200 Touc...

Страница 86: ...pecific functions for the I 7188XA D Below is a comparison table 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...

Страница 87: ...the Flash Memory of the I 7188XA D RUN fileno Executes the file with the prescribed file number Filename Executes the file with the prescribed file name DELETE or DEL Deletes all files stored in the F...

Страница 88: ...I 7188XA Series User s Manual Ver1 2 Feb 2014 7MH 019 10 88 http ftp icpdas com pub cd 8000cd napdos minios7 document lib_man ual_for_7188xabc index htm...

Страница 89: ...tions Upgrade the MiniOS7 image Download program files to the Flash Memory Configure the COM port settings MiniOS7 utility location The MiniOS7 utility is located in the CD NAPDOS MINIOS7 UTILITY Mini...

Страница 90: ...I 7188XA Series User s Manual Ver1 2 Feb 2014 7MH 019 10 90 1 2...

Страница 91: ...I 7188XA D module using the Host PC keyboard Three standard input library functions such as Getch Scanf and LineInput will allow the main control unit to read keyboard input from a Host PC 7188xw exe...

Страница 92: ...he date on the Host PC Alt_T Set the time of the RTC to the time on the Host PC Alt_E Used to download a file to memory Alt_E should be pressed only after the Press ALT_E to download file message is s...

Страница 93: ...ion please refer to the index htm file in the CD Napdos MiniOS7 document Lib_Manual_For_7188XABC folder or at http ftp icpdas com tw pub cd 8000cd napdos minios7 document lib_ manual_for_7188xabc on t...

Страница 94: ...7MH 019 10 94 Step 4 Type cd c 7188XA Demo BC_TC Hello Hello_C then press Enter Assume user copy the 7188XA folder to C drive letter Refer to Step2 in Sec 2 1 Step 5 Execute the 7188xw exe application...

Страница 95: ...press Enter Step 7 Press F8 to download the Hello exe file to the I 7188XA D and execute the program Notes A description of the Hotkey functions is as follows F8 Download a file to FLASH Memory and t...

Страница 96: ...ndividual files cannot be selected for deletion Step 10 Press Alt X to quit the MiniOS7 Upgrading MiniOS7 using the 7188xw exe application Step 1 Connect the I 7188XA D to the COM Port of the Host PC...

Страница 97: ...icpdas com pub cd 8000cd napdos 7188xabc 7188xa os_image Step 3 From the Host PC go to the directory where the image file is stored then execute the 7188xw exe application to connect the Host PC to th...

Страница 98: ...the I 7188XA D command line The OS will check the image file stored in the SRAM and then display the version information If the image file is correct it will be written to the Flash Memory Step 8 It w...

Страница 99: ...I 7188XA Series User s Manual Ver1 2 Feb 2014 7MH 019 10 99 Step 9 Type the ver command to check the MiniOS7 version number...

Страница 100: ...control or RS 485 COM2 RS 485 with internal self tuner 3000V 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...

Страница 101: ...currently available in the input buffer of COM1 Getch Waits until a single character is received from keyboard input Ungetch Returns a single character to the input buffer of COM1 Putch Sends a singl...

Страница 102: ...urn value is the next data in the buffer If the next data is 0 the function will return 1 0xFFFF Example include 7188xa h void main int quit 0 data InitLib Puts n rPress any key to show ASCII Q to qui...

Страница 103: ...r an example of Getch Putch Function Displays a single character on the screen Syntax void Putch int data Header include 7188xa h Description Data 0 to 255 If the data is 255 only the low byte will be...

Страница 104: ...r to the printf function in the C language Syntax int Print char fmt Header include 7188xa h Description This function is used instead of printf and the only difference between Print and printf is tha...

Страница 105: ...ata currently stored in the COM Port Buffer The COM Port number is not assigned ClearCom1 Clears all the data currently stored in the COM1 buffer ClearCom2 Clears all the data currently stored in the...

Страница 106: ...assigned and can be modified using the port parameter port assigns the COM port number baud Baud Rate the default Baud Rate for the I 7188XA D is 115200 Example include 7188xa h void main int quit 0 d...

Страница 107: ...it if IsCom1 checks if any data is in the COM1 buffer data ReadCom1 reads data from COM1 ToCom1 data sends data to COM1 if data q quit 1 if q is received exit the program RestoreCom1 uninstalls the dr...

Страница 108: ...port number Example Please refer to InstallCom for an example IsCom1 Function Checks whether there is any data stored in the buffer of COM1 Syntax int IsCom1 void Header include 7188xa h Description C...

Страница 109: ...signs the COM Port number Example Please refer to InstallCom for an example ClearCom1 Function Clears the data currently stored in the buffer of COM1 Syntax int ClearCom1 void Header include 7188xa h...

Страница 110: ...ta from the COM Port buffer The COM Port number is not assigned and can be modified using the port parameter Produces a formatted output similar to printf from the standard C library Example Please re...

Страница 111: ...XABC ind ex htm for more detailed information EE_WriteEnable Function Sets the EEPROM to write enable mode Syntax void EE_WriteEnable void Header include 7188xa h Description Sets the EEPROM to write...

Страница 112: ...ite protect mode by default EE_WriteEnable must be called before writing data to the EEPROM After writing the data it is recommended that EE_WriteProtect be called to return the EEPROM to write protec...

Страница 113: ...eader file and the user manual on the enclosed CD which can be found at CD Napdos minios7 document lib_manual_for_7188xabc index htm for more detailed information ReadNVRAM Function Reads data from th...

Страница 114: ...r The address used to save the hour 0 23 data minute The address used to save the minute 0 59 data sec The address used to save the second 0 59 data Example include 7188xa h void main int year month d...

Страница 115: ...tDate Function Sets the system date to the RTC Syntax int SetDate int year int month int day Header include 7188xa h Description year 2000 2080 month 1 12 day 1 31 Return Value On success returns NoEr...

Страница 116: ...date command to set the date the MiniOS7 will calculate the 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 ca...

Страница 117: ...emaining space can be used to store custom programs or data Application developers can use these functions to write data to the Flash memory When writing data to the Flash memory data only be written...

Страница 118: ...000 FlashErase will do nothing FlashWrite Function Writes one byte of data to Flash memory Syntax int FlashWrite unsigned int seg unsigned int offset char data Header include 7188xa h Description seg...

Страница 119: ...Error will occur After calling FlashErase data can be written again FlashRead Function Reads one byte of data from the Flash memory Syntax int FlashRead unsigned int seg unsigned int offset Header inc...

Страница 120: ...1 ms and uses the Timer 1 feature of the CPU StopWatchStart Starts using a StopWatch channel StopWatchReset Resets the StopWatch value to 0 StopWatchStop Disables the StopWatch channel StopWatchPause...

Страница 121: ...urn Value On success returns NoError If the Timer is already open returns 1 Example include 7188xa h void main unsigned long time int quit 0 InitLib Print n rPress any key to start the timer Print n r...

Страница 122: ...If the program has called the OpenTimer function it must call TimerClose before exiting Return Value Always returns NoError Example Please refer to TimerOpen function for more detailed information Ti...

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

Страница 124: ...esets the StopWatch value to 0 Syntax int StopWatchStart int channel Header include 7188xa h Description The system timer ISR will increment the StopWatch value by 1 in 1 ms intervals channel 0 7 a to...

Страница 125: ...ore detailed information StopWatchStop Function Disables the StopWatch channel Syntax int StopWatchStop int channel Header include 7188xa h Description The system timer ISR will stop to increment the...

Страница 126: ...ns ChannelError 15 Example Please refer to StopWatchStart for more detailed information StopWatchReadValue Function Reads the current StopWatch value Syntax int StopWatchReadValue int channel unsigned...

Страница 127: ...r while quit if Kbhit Getch q quit 1 CountDownTimerReadValue 0 value reads the CountDownTimer Print Test CountDown d r value if value 0 CountDownTimerStart 0 1000 restarts the CountDownTimer TimerClos...

Страница 128: ...n The function cannot use an input argument and cannot return a value Example include 7188xa 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...

Страница 129: ...fun void Header include 7188xa h Description fun A pointer to the custom function The function cannot use an input argument and cannot return a value Example Please refer to InstallUserTimer function...

Страница 130: ...a delay for more than 0 8s Reset the system RefreshWDT Refresh 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 DisableW...

Страница 131: ...nformation IsResetByWatchDogTime Function Checks if system has been reset by the WatchDog Timer Syntax int IsResetByWatchDogTime void Header include 7188xa h Description Returns 0 when true Example Pl...

Страница 132: ...cument lib_ manual_for_7188xabc index htm for more detailed for more detailed information Note The file system for MiniOS7 supports custom programs for reading files but does not support custom progra...

Страница 133: ...char huge data type must be used to retrieve the file data for the offset Example include 7188xa h static FILE_DATA far fdata file_data structure please see the file c for details char far fp_no void...

Страница 134: ...index 0 Return Value On success returns the starting address of the file information On error returns NULL Example Please refer to GetFilePositionByNo for more detailed information GetFileInfoByName F...

Страница 135: ...und at CD Napdos minios7 document lib_manual_for_7188xabc index htm for more detailed information SendCmdTo7000 Function Sends a command to an I 7000 series module Syntax int SendCmdTo7000 int iPort u...

Страница 136: ...x ON x break case 2 SendCmdTo7000 port 0102 0 Print x ON x break 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...

Страница 137: ...On error returns an Error code Refer to the use manuals for I 7000 series modules for more details Example Please refer to SendCmdTo7000 for more detailed information ascii_to_hex Function Converts AS...

Страница 138: ...information please refer to CD 8000 NAPDOS 7188XABC 7188XA Demo BC_TC Hello_C gotc bat tcc Ic tc include Lc tc lib hello1 c lib 7188xas lib Method 2 Using the TC Integrated Environment Step 1 Execute...

Страница 139: ...lecting the project name from the Project menu Step 5 On the compiler options menu change the Memory model Small for 7188xas lib large for 7188xal lib and set the Code Generation to 80186 80286 as sho...

Страница 140: ...I 7188XA Series User s Manual Ver1 2 Feb 2014 7MH 019 10 140...

Страница 141: ...88XA Series User s Manual Ver1 2 Feb 2014 7MH 019 10 141 Using 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...

Страница 142: ...8XA Series User s Manual Ver1 2 Feb 2014 7MH 019 10 142 Step 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 b...

Страница 143: ...ies User s Manual Ver1 2 Feb 2014 7MH 019 10 143 Step 4 Set the Code generation options Step 4 1 Change the Memory model Small for 7188xas lib large for 7188xal lib Step 5 Set the Advanced code genera...

Страница 144: ...I 7188XA Series User s Manual Ver1 2 Feb 2014 7MH 019 10 144 Step 5 1 Set the Floating Point to Emulation and the Instruction Set to 80186 Step 6 Set the Entry Exit Code Generation option...

Страница 145: ...I 7188XA Series User s Manual Ver1 2 Feb 2014 7MH 019 10 145 Step 6 1 Set the DOS standard Step 7 Set the Debugger Options 7 1 Set Source Debugging to None...

Страница 146: ...I 7188XA Series User s Manual Ver1 2 Feb 2014 7MH 019 10 146 Step 8 Make the project...

Страница 147: ...ven as following Step 1 In the source file folder create a batch file called Gomsc bat using the text editor NOTE C don t strip comments Gs no stack checking Fpa calls with altmath Fm map file G1 186...

Страница 148: ...I 7188XA Series User s Manual Ver1 2 Feb 2014 7MH 019 10 148 Step 3 A new executable file will be created if it is successfully compiled...

Страница 149: ...Using MSVC Compiler The working steps to use MSVC 1 50 compiler 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 fiel...

Страница 150: ...I 7188XA Series User s Manual Ver1 2 Feb 2014 7MH 019 10 150 Step 3 Add the user s program and the necessary library files to the project Step 4 Set the Code Generation on the Compiler...

Страница 151: ...I 7188XA Series User s Manual Ver1 2 Feb 2014 7MH 019 10 151 Step 5 Change the Memory model Small for 7188xas lib large for 7188xal lib Step 6 Remove the xcr afxcr library from the Input Category...

Страница 152: ...I 7188XA Series User s Manual Ver1 2 Feb 2014 7MH 019 10 152 Step 7 Remove the OLOGO option from the miscellancous Category...

Страница 153: ...I 7188XA Series User s Manual Ver1 2 Feb 2014 7MH 019 10 153 Step 8 Rebuild the project...

Страница 154: ...se 16 bit compiler like BC3 1 or TC 3 0 to build MiniOS7 project on Windows 64 bit platform like Windows 7 or Windows 8 it will prompt up an error message to show compatibility problem for 64 bit plat...

Страница 155: ...it version on a 64 bit OS The download page is here http sourceforge net projects dosbox files dosbox 0 74 DOSBox0 74 win32 installer exe down load Note Strongly recommend installing DOSBox as adminis...

Страница 156: ...onments settings 1 Make sure the demo file path for example D MiniOS7 hello hello_c 2 Make sure the BC Bin file path for example D BC Bin 3 Use mount command to mount the disk driver for example mount...

Страница 157: ...I 7188XA Series User s Manual Ver1 2 Feb 2014 7MH 019 10 157 Step 4 Press Project to open project Press Compile to build the project...

Страница 158: ...I 7188XA Series User s Manual Ver1 2 Feb 2014 7MH 019 10 158...

Страница 159: ...to set the path and launch the BC demo project We can make a batch file as below for demo program and save this batch file to path D when Driver D is mounted as local directory and change to d After...

Страница 160: ...it can download Free TurboC 3 0 from website Download Free turboc zip from following link http www bestfreewaredownload com download t free turbo c freeware flggsdpz html After unzip the turboc zip an...

Страница 161: ...I 7188XA Series User s Manual Ver1 2 Feb 2014 7MH 019 10 161 Below snap shots are steps for install TC 3 0...

Страница 162: ...I 7188XA Series User s Manual Ver1 2 Feb 2014 7MH 019 10 162...

Страница 163: ...I 7188XA Series User s Manual Ver1 2 Feb 2014 7MH 019 10 163 After installed the TC 3 0 then set the Environment Path and change to demo path to run TC compiler IDE...

Страница 164: ...I 7188XA Series User s Manual Ver1 2 Feb 2014 7MH 019 10 164...

Страница 165: ...th proe the use of illegal copies It is the most low cost protection mechanism the I 7188XA D currently has 2 AsicKey The I O expansion bus supports AsicKey The AsicKey equips a complex machine for va...

Страница 166: ...ion 2 Modify Storage Temperature specification Original 40 C to 80 C New 30 C to 80 C 3 Modify Humidity specification Original 0 to 90 New 10 to 90 RH non condensing 1 2 February 2014 1 Add section 3...

Отзывы: