Devices > 
Sampling modes
 
 
 
Hardware timestamp

This is the best mode. The hardware has its own internal clock, and attaches a timestamp to each packet. The advantages are the uniqueness of each packet, and independence from communication spurts.

Hardware frequency

This is the second best time stamping mode. The sampling interval is known to be at a given fixed frequency. At the beginning of the communication, a time counter is started for the device. The hardware packet, upon arrival, is given the current timestamp for packets. This ‘current timestamp’ is then modified to reflect the receipt of a packet (augmented by one period of the device’s rate. To respect this, the data coming in from the hardware must be at a fixed rate. The hardware period used can be specified in the HardwarePeriod variable. An advantage is that Independent of communication spurts; a disadvantage is that the loss of one packet induces error for all of the following packets.

Auto Frequency

In the case of an unknown hardware frequency, the data coming in can be averaged and the period can be calculated. This is the same principle as in the case of ‘Hardware Frequency’, but with an unknown (and unspecified) frequency. Advantages: Semi-Independent of communication spurts; a disadvantage is that the loss of one packet induces error for all of the following packets, Requires evenly spaced data, Too many communication spurts may affect the quality of the reconstructed timestamps, Requires resampling of the data at a given rate.

Software Timestamp

This is a worst-case scenario, where no information can be obtained about the incoming data packets. When a hardware packet is received, the current time in MotionBuilder is assigned to it. The disadvantages is that data is subject to communication spurts.

Typical polled devices are pointing devices. It does not have its own sampling frequency, but makes available a value to be read. The sampling frequency is the frequency at which MotionBuilder polls the hardware.

if(mHardware.PollData())
{
// Data is not timestamped, get time from
 MotionBuilder
 evalTime = pDeviceNotifyInfo.GetLocalTime();  // Timestamp and punch new data in
 DeviceRecordFrame(evalTime,pDeviceNotify Info);
}