User`s manual

Dynamic C Users Manual digi.com 341
A.3 Global Variables
These variables may be read by any Dynamic C application program.
dc_timestamp
This internally-defined long is the number of seconds that have passed since 00:00:00 January 1, 1980,
Greenwich Mean Time (GMT) adjusted by the current time zone and daylight savings of the PC on which
the program was compiled. The recorded time indicates when the program finished compiling. The follow-
ing program will use dc_timestamp to help calculate the date and time.
printf("The date and time: %lx\n", dc_timestamp);
main(){
struct tm t;
printf("dc_timestamp = %lx\n", dc_timestamp);
mktm(&t, dc_timestamp);
printf("%2d/%02d/%4d %02d:%02d:%02d\n",
t.tm_mon,t.tm_mday,t.tm_year + 1900, t.tm_hour,t.tm_min,
t.tm_sec);
}
OPMODE
This is a char. It can have the following values:
0x88 = debug mode
0x80 = run mode
SEC_TIMER
This unsigned long variable is initialized to the value of the real-time clock (RTC). If the RTC is set cor-
rectly, this is the number of seconds that have elapsed since the reference date of January 1, 1980
. The
periodic interrupt updates SEC_TIMER every second. This variable is initialized by the Virtual Driver
when a program starts.
MS_TIMER
This unsigned long variable is initialized to zero. The periodic interrupt updates MS_TIMER every milli-
second. This variable is initialized by the Virtual Driver when a program starts.
TICK_TIMER
This unsigned long variable is initialized to zero. The periodic interrupt updates TICK_TIMER 1024
times per second. This variable is initialized by the Virtual Driver when a program starts.