Library for generating TDMS file format.
- Support for Little-Endian systems
- Support for integer, float, double, Boolean and string raw data
- Converting normal time and date to NI LabVIEW format
- Add library files to your project.
- Config
TDMS_config.h. - Define File, Channel Group and Channel object structures. For example:
TDMS_File_t FileTDMS;
TDMS_Group_t Group1;
TDMS_Channel_t Channel1Group1;- Create File, Channel Group and Channel objects. For example:
if (TDMS_InitFile(&FileTDMS) != TDMS_OK)
printf("Create file failed!");
if (TDMS_AddGroupToFile(&Group1,
&FileTDMS,
"Group 1 name") != TDMS_OK)
printf("Add Group failed!");
if (TDMS_AddChannelToGroup(&Channel1Group1,
&Group1,
"Channel 1 name",
TDMS_DataType_U8) != TDMS_OK)
printf("Add Channel 1 failed!");- Generate first part of file with
TDMS_GenFirstPartand save the out buffer on disk. - Add properties to File, Channel Group or Channel with
TDMS_AddPropertyToFile,TDMS_AddPropertyToGrouporTDMS_AddPropertyToChannelthen save the out buffer on disk. - Add data to Channels with
TDMS_SetChannelDataValuesor add data to all Channels of a Channel Group withTDMS_SetGroupDataValuesthen save the out buffer on disk.
To run the basic example, follow these steps:
- Clone the repository
git clone https://github.com/MahdaSystem/TDMS.git- Go to the example directory
cd ./TDMS/example/basic- Run the make command
make all- Run the example
./build/output.elf- The
.tdmsfile will be generated in thebuilddirectory