11-07-2014 10:54 AM
I don't have Diadem so until I get around to writing a Labview program to read and parse my captured data, I'm testing my application's logging by opening the TDMS files in Excel. One oddity I'm running into is a channel I have defined as TDMS_UInt32 is showing up in Excel with data type DT_DOUBLE. My application is going to be capturing data for months at a crack at a 10 Hz sample rate so I'm trying to minimize the size of my data in the TDMS file. Fortunately, this particular channel will only register every 2 minutes or so but I'd like to get to the bottom of it anyway.
Channel setup code (StrokesChannel is the one coming up with the wrong type, the others appear as intended e.g. DT_FLOAT, DT_LONG, DT_SHORT, etc):
// Add channels to groups TDMS_AddChannel(LogFile[actuator].CurrentPositionGroup, TDMS_Float, CG1_CH1_NAME, "", "", &LogFile[actuator].CurrentChannel); TDMS_AddChannel(LogFile[actuator].CurrentPositionGroup, TDMS_Int32, CG1_CH2_NAME, "", "", &LogFile[actuator].PositionChannel); TDMS_AddChannel(LogFile[actuator].TemperatureGroup, TDMS_Int16, CG2_CH1_NAME, "", "", &LogFile[actuator].Temperature1Channel); TDMS_AddChannel(LogFile[actuator].TemperatureGroup, TDMS_Int16, CG2_CH2_NAME, "", "", &LogFile[actuator].Temperature2Channel); TDMS_AddChannel(LogFile[actuator].StrokesGroup, TDMS_Timestamp, CG3_CH1_NAME, "", "", &LogFile[actuator].StrokesTimestampChannel); TDMS_AddChannel(LogFile[actuator].StrokesGroup, TDMS_UInt32, CG3_CH2_NAME, "", "", &LogFile[actuator].StrokesChannel);
The channel writing code triggers every 10 seconds and reads from a thread safe queue to try and keep write buffers a reasonable size as recommended in the docs. Strokes is defined as a uInt32 array which matches the type I've assigned the channel:
if(CurrentRead) TDMS_AppendDataValues(LogFile[actuator].CurrentChannel, CurrentBuffer, CurrentRead, 0); if(PositionRead) TDMS_AppendDataValues(LogFile[actuator].PositionChannel, PositionBuffer, PositionRead, 0); if(Temp1Read) TDMS_AppendDataValues(LogFile[actuator].Temperature1Channel, Temp1Buffer, Temp1Read, 0); if(Temp2Read) TDMS_AppendDataValues(LogFile[actuator].Temperature2Channel, Temp2Buffer, Temp2Read, 0); if(StrokeRead) { TDMS_AppendDataValues(LogFile[actuator].StrokesTimestampChannel, StrokeTimestamp, StrokeRead, 0); TDMS_AppendDataValues(LogFile[actuator].StrokesChannel, Strokes, StrokeRead, 0); }
Is what I'm seeing just a quirk of the excel importer or did I set up the channel incorrectly? Attached is a set of captured data along with the Excel import.
11-10-2014 03:26 AM
I have no solution to your problem but you can look into your TDMS file with:
I had many problesms with the Excel add on for TDMS and made better experience with the TDMS viewer above.
Regards
Andrej