LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

time tdms

Solved!
Go to solution

Hello,

 

I am writing a script that uses a DAQmx function to take in voltage data, then writes the data to a TDMS file. I have a running elapsed time header as well. I would like to write an additional channel keeping the running time for each sample, but do not know how. Can someone help me?

 

 

Thanks,

 

Mmoon

0 Kudos
Message 1 of 17
(3,573 Views)
Accessing via mobile. Not able to view attached code.
If I my memory works file the channel input tdms write is scalar. You can use for loop with different channel names and write Tue data.

I can provide with more feasible if you can able to explain much better in steps as I am not able to view your code
----------------------------------------------------------------------------------------------------------------
Palanivel Thiruvenkadam | பழனிவேல் திருவெங்கடம்
LabVIEW™ Champion |Certified LabVIEW™ Architect |Certified TestStand Developer

Kidlin's Law -If you can write the problem down clearly then the matter is half solved.
-----------------------------------------------------------------------------------------------------------------
0 Kudos
Message 2 of 17
(3,555 Views)

The thing is that the elsapsed time will just be the sample rate multiplied by the sample number (with the first sample being Sample 0).  So you could just use the Ramp Pattern(under Signal Processing->Signal Generation) to create the array of times for you and then you just write that to a new channel in the group.  So the only two things you need to know is the sample rate (available via a DAQmx Timing property node) and the number of samples logged (I know there is a TDMS property you can read to get this, I just don't remember what it is right now).


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 3 of 17
(3,546 Views)

Get Waveform Time Array might help too.  You can read your channel as a waveform, then use this function which will return an array of times, one for each sample taken.  It's essentially what crossrulz described but in a single already written function.

0 Kudos
Message 4 of 17
(3,542 Views)

Ok now my issue is that this is creating a new channel with a group for time values, not appending a new group in the already established DAQmx channel. How can I fix this/am I implementing my code correctly?

 

0 Kudos
Message 5 of 17
(3,534 Views)
Solution
Accepted by topic author Mmoon

You are not even writing to a TDMS file.  You need to write to the TDMS file after the acquisition is complete.  All of the information is available to add your time channel.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 6 of 17
(3,504 Views)

Unfortunately I am having trouble with the DAQmx timing node, it won't give me an option to use SampClk.Rate and I do not know why.

0 Kudos
Message 7 of 17
(3,445 Views)

I figured out my issue. Thank you for all of your help!

0 Kudos
Message 8 of 17
(3,441 Views)

Actually now I am confused, my timing node only takes in 1000 values for time going to 1.00 seconds, how do I edit this to run continuously?

0 Kudos
Message 9 of 17
(3,432 Views)

There is an input to the DAQmx Timing VI for the acquisition type (on the top of the VI).  Set that from Finite Samples to Coninuous.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 10 of 17
(3,426 Views)