(Page 18 of 69 in this chapter) Version
adiGetTimeStamp
Description
- Converts an event timestamp to a count of the seconds elapsed since January 1, 1970.
Note: This function is not supported on a QX 2000 board. If this function is called using a QX 2000 board, CTAERR_FUNCTION_NOT_AVAIL is returned. Use ctaGetTimeStamp instead (CT Access 4.0 only).
Prototype
- DWORD adiGetTimeStamp ( CTAHD ctahd,
DWORD msgtime,
unsigned long *timesec,
unsigned *timems )
- ctahd CTA context handle returned by ctaCreateContext.
- msgtime The event time stamp.
- timesec Pointer to returned seconds.
- timems Pointer to returned milliseconds.
Return Values
Events
- None.
Details
- This function converts an event timestamp to a count of the number of seconds elapsed since 00:00:00 January 1, 1970. The msgtime is the CTA_EVENT timestamp value, which is in millisecond units with a 10-millisecond resolution. This function converts the msgtime into timesec seconds and timems milliseconds since midnight 1/1/70.
Note: Because the event timestamp is 32 bits, it wraps every 232 milliseconds (about 49 days). adiGetTimeStamp assumes the event occurred within 24 days.
Example
#include <time.h>
void myShowTime( CTAHD ctahd, CTA_EVENT *event )
{
struct tm *ptime;
unsigned long timesec;
unsigned timems;
adiGetTimeStamp( ctahd, event->timestamp, ×ec, &timems );
ptime = localtime( ×ec );
printf( "%02d:%02d:%02d.%03d\n",
ptime->tm_hour, ptime->tm_min, ptime->tm_sec, timems );
}
(Page 18 of 69 in this chapter) Version
Want to send us feedback on our documentation? Email: Tech_Pubs@nmss.com
Copyright © 2000, Natural MicroSystems, Inc. All rights
reserved.