MX Foundation 4
Device Timebase

The device timebase is normally used when time correlation with other non-MAXT equipment is not necessary. This timebase is the most accurate (down to 10 ns accuracy).

Example

The example below shows how to set the device timebase mode.

int main()
{
HMXF_SERVER server;
HMXF_DEVICE device;
uint64 timebase, timer;
uint64 count;
uint32 rc;
char *p;
// Connect to services and initialize environment
rc = mxfServerConnect("0.0.0.0", "", "", FALSE, &server);
if (!rc)
// Initialize the server.
rc = mxfSystemInit(server);
if (!rc)
{
// Set timebase to 64-bit microseconds
rc = mxfSystemTimeBaseSet(server, MXF_TIMEBASE_DEVICE_USEC);
if (!rc)
{
rc = mxfSystemTimeBaseGet(server, &timebase);
switch (timebase)
{
case MXF_TIMEBASE_DEVICE_USEC:
p="MXF_TIMEBASE_DEVICE_USEC";
break;
case MXF_TIMEBASE_COMPUTER_USEC:
p="MXF_TIMEBASE_COMPUTER_USEC";
break;
case MXF_TIMEBASE_IRIGB_USEC:
p="MXF_TIMEBASE_IRIGB_USEC";
break;
case MXF_TIMEBASE_DEVICE_NSEC:
p="MXF_TIMEBASE_DEVICE_NSEC";
break;
case MXF_TIMEBASE_COMPUTER_NSEC:
p="MXF_TIMEBASE_COMPUTER_NSEC";
break;
case MXF_TIMEBASE_IRIGB_NSEC:
p="MXF_TIMEBASE_IRIGB_NSEC";
break;
}
if (!rc)
printf("Time base was set to '%s'\n", p);
}
}
// Get the device handle.
rc = mxfSystemDeviceAllGet(server, MXF_DEVICE_ALL, 1, &count, (HMXF_DEVICE*)&device);
if (!rc)
{
rc = mxfDeviceTimerGet(device, &timer);
printf("Current timer value is %lld %s\n", timer, timebase<=MXF_TIMEBASE_IRIGB_USEC ? "us" : "ns");
}
}
Updated 10/23/2023