LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Write 1D Array of Waveforms to TDMS File

Hello, 


Big Noob here.

I am trying to write some data from a DAQmx task to a TDMS file. I am also trying to add a channel (Laser on) of 0 or 1 values to my TDMS when I have a front panel switch on. I tried creating an array of Waveforms. This results in an error for the TDMS write. Any advice will be appreciated. I have been trying for quite some time. Code examples would be great. Thank you. 

PB877_0-1692132603022.png

Thank You!

 

0 Kudos
Message 1 of 5
(942 Views)

You should attach the code so that we can reproduce and understand the issue better. Besides, you also didn't include the information on the error code.

-------------------------------------------------------
Applications Engineer | TME Systems
0 Kudos
Message 2 of 5
(926 Views)

Sorry I though I attached the code. There is not a specific error code. The tdms file just fails to generate. 

0 Kudos
Message 3 of 5
(870 Views)

Hi PB,

 

you still forgot to provide details on the error…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 5
(861 Views)

There are a lot of "quirks" in your provided code. It looks like you modified an example, which is good, but introduced some oddities.

  1. I don't use tasks, so what I say may be wrong, but typically in a task you define the range, sample rate, whether to save data, etc. You open a task and then change the sample rate to 1kHz. For a temperature task this seems a bit high. Not sure about the hardware, but does your sensor respond this fast? Suggest you do all the setting yourself or in the task. The sample rate should be defined in the task.
  2. You are using the built in logging features of DAQmx, but then saving the data manually. Use one or the other. Since you want to add data delete the logging function.
  3. Here is the source of your error, you wire the enum/ring from the DAQmx logging to the TDMS Open File function. These enum/rings are not the same. You need a different one for the TDMS function. Delete the input, then right click it, and choose Create Constant.
  4. Below is a quick mod that may/may not help. It can be greatly improved, but it's a start. (I assume you only have two channels of data.)

snip.png

0 Kudos
Message 5 of 5
(854 Views)