LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Clock Rates and Periodic Data Logging

I cannot help with the TDMS stuff. It is not available on the platform I use, so I know nothing about it.

 

Lynn

0 Kudos
Message 11 of 18
(618 Views)

Hey,

 

No problem, I can make a new forum post if that is the road I go down. Is there a different method you would suggest?

 

-Lyric

0 Kudos
Message 12 of 18
(617 Views)

TDMS is probably faster than many other file formats from what I have read.

 

You could write to a spreadsheet file.  This is just a text file with columns separated by tabs and rows by carriage returns.  You could use the array manipulation functions to create an array with the AI, counter, and timestamp data and then write that with the Array to Spreadsheet File VI. Or you could convert everything to strings and use string manipulation functions to get any format you want.  Then write that formatted string to a text file.  You could use a combination of Format into File for the timestamp and counter data and Array to Spreadsheet File for the AI data.

 

Write to Binary File will accept any data type (meaning it will take the cluster). The data can only be read by the matching Read from Binary File and you must know the exact data type which was written to recover the data.

 

Lots of choices.

 

Lynn

0 Kudos
Message 13 of 18
(612 Views)

Hey,

 

So I feel like I've come a very long way in understanding how to accomplish what I'm trying to do. I'm very very very close. I am down to a couple of, hopefully basic issues.

 

The TDMS file attached had a "Write Time" of 2 seconds, and an "Idle Time" of 5 seconds. I forget what I had the clock rate at, I don't think it was 5000, as it shows now, but it could have been.

 

Anyways, as you can see I don't have an equivalent amount of data in my five columns. I realize that only the Analog DAQmx task has a specific timing attached to it, but I was under the impression that one timing source dictated the loop time. This is clearly not the case. In theory, I would like to have multiple points of data per cycle, not ~30 cycle jumps in time and cycle count and a mass of data that I no longer have anything to plog against.

 

What am I missing? Should I start a new topic on this?

 

-Lyric

Download All
0 Kudos
Message 14 of 18
(600 Views)

Hey,

 

Quick update. I hooked up a second function generator to a PFI port on my DAQ and made a sample clock for each channel type (AI and CI), then pointed both clocks at the same port. Bingo, I have the same number of samples in each column, and the data looks correct.

 

So lesson learned: you can use the same external clock, but not the same internal clock for different channel types. Neat trick.

 

--Lyric

0 Kudos
Message 15 of 18
(569 Views)

One issue regarding the quantity of data read is that you have the Analog Read Number of Samples per Channel set to -1 which means read all available samples.  If you set that to a specific number of samples such as 100, then you would get that many on each iteration of the loop.  The counter returns only one data point. In this examples you would get 100 analog samples and 1 count sampe on each iteration.

 

Why do you have two Read cases in the lower loop?  Which one actually executes?  I did not think this was possible.  How did you do it?

 

Lynn

0 Kudos
Message 16 of 18
(558 Views)

Hey Lynn,

 

This is my latest VI, I have sample clocks on both the AI and CI now. Also, I only have one read case on the consumer loop. Thanks for all your help in getting here!

 

-Lyric

0 Kudos
Message 17 of 18
(551 Views)

Lyric,

 

I still see"Initialize"

"Read", Default

"Read"

 

On the case selector in the lower loop. The "Read", Default case has the Flush Queue function.

 

Lynn

0 Kudos
Message 18 of 18
(545 Views)