Reads the date and time values logged in a binary file. This function stores the date values in a dateTags array, and the time values in a timeTags array.
C/C++
int cbLogReadTimeTags(char* Filename, int StartSample, int Count, int* DateTags, int* TimeTags)
Visual Basic
Function cbLogReadTimeTags(ByVal Filename$, ByVal StartSample&, ByVal SampleCount&, ByRef Dates&, ByRef Times&) As Long
Filename
The name of the file to retrieve the information from.
StartSample
The first sample to read from the binary file.
Count
The number of samples to read from the binary file
DateTags
Receives the date value for each sample logged in the file. The dates are packed in the following format:
Byte 0: day
Byte 1: month
Byte 2-3: year
TimeTags
Receives the time value for each sample logged in the file. The times are packed in the following format:
Byte 0: seconds
Byte 1: minutes
Byte 2: hours
Byte 3: 0xff = 24hour format; 0x0 = AM; 0x1 = PM
The user is responsible for allocating the size of the DateTags and TimeTags arrays, and ensuring that they are large enough to hold the data that is returned. You can calculate the array allocation using the SampleCount value from cbGetSampleInfo().
int* dates = new int[SampleCount];
int* times = new int[SampleCount];
The figure below shows the layout of the DateTags array, and how the elements should be indexed.
where: n is (SampleCount> – 1)
Each sample has only one date. Use the following code fragment to access the elements of the DateTags array:
for (i=0; i<numberOfSamples; i++)
{
d = DateTagsArray[i];
}
The figure below shows the layout of the TimeTags array, and how the elements should be indexed.
where: n is (SampleCount – 1)
Each sample has only one time stamp. Use the following code fragment to access the elements of the TimeTags array:
for (i=0; i<numberOfSamples; i++)
{
t = TimeTagsArray[i];
}