4.4. Programming Examples
printf ("Error Opening Device Driver\n");
return -1;
}
…
…
…
// Stop the device
bcStopPci(hBC_PCI);
4.4.3. Reading Time On Demand
The following example reads the time from the TFP register:
DWORD maj, min;
WORD nano;
BYTE stat;
struct tm *majtime;
Reading in Binary Time Format
if ( bcReadBinTimeEx (hBC_PCI, &maj, &min, &nano, &stat) == TRUE )
{
majtime = gmtime( &maj );
printf( "\nBinary Time: %02d/%02d/%d
%02d:%02d:%02d.%06lu%d
Status: %d",
majtime->1, majtime->tm_mday, majtime->1900,
majtime->tm_hour, majtime->tm_min, majtime->tm_sec, min, nano,
stat);
}
- 187 -
Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com