ICP DAS USA I-7188XB Series User Manual page 112

Hide thumbs Also See for I-7188XB Series:
Table of Contents

Advertisement

Header:
#include "7188xb.h"
Description: Writes one byte of data to the NVRAM.
addr: 0-30.
data: One byte of data (0-255).
If the data>255, only the low byte will be written to the
NVRAM.
Return Value: On success, returns NoError.
On error, returns the AddrError (-9).
Example:
Please refer to "ReadNVRAM()" for more detailed
information.
GetTime()
Function:
Retrieves the system time from the RTC.
Syntax:
void GetTime(int *hour, int *minute, int *sec);
Header:
#include "7188xb.h"
Description: hour: The address used to save the hour (0-23) data.
minute: The address used to save the minute (0-59)
sec: The address used to save the second (0-59) data.
Example:
#include "7188xb.h"
void main()
{
int year, month, day, hour, min, sec, wday;
InitLib();
SetDate(2006,1,12); /*sets the system date for the RTC*/
SetTime(15,35,50); /*sets the system time for the RTC*/
SetWeekDay(4); /*sets the system day of the week for the RTC*/
GetDate(&year,&month,&day); /*reads the system date from the RTC*/
GetTime(&hour,&min,&sec); /*reads the system time from the RTC*/
wday=GetWeekDay();
Print("Date=%02d/%02d/%04d(%d) Time=%02d:%02d:%02d\n\r",
month,day,year,wday,hour,min,sec);
}
SetTime()
Function:
Sets the system time to the RTC
Syntax:
int SetTime(int hour,int minute,int sec);
Header:
#include "7188xb.h"
I-7188XB Series User's Manual(Ver.1.0, Apr/2007, 7MH-020-10 ) --- 112
data.

Advertisement

Table of Contents
loading

Table of Contents