LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Adding new data column

Solved!
Go to solution

Hey guys, I have a novice question for ya. I'm reading 4 analog channels and writing all four of them to a file in four columns. A part of my program is counting the number of digital (TTL) highs and indicating a "cycle count" with a shift register. I'd like to put this "cycle count" as a new column in my data file, alongside the other 4, preferably in the first column. I've tried to wire the count directly to the measurements VI, but it's not separating it into it's own column... any ideas?

0 Kudos
Message 1 of 17
(3,508 Views)

Use a double to DDT found in express VI.  Wire Cycle count to that (maybe include an integer to double to get rid of coercion dot).  If you want it first, make it the first signal in the combine signal function. Hopefully that works.  Note your signal has much more information than your one value.  In the configuration of DBL to DDT make sure to select single scalar.  In this case only one value will appear for x many values associated with your waveform.  See Snippet attached for what code should look like as I have described.

0 Kudos
Message 2 of 17
(3,475 Views)

I wired it as you described...It's still putting the values of the cycle count between the other 4 channels in the data file. It's not a clean column. It has gaps between the numbers as it did before. Hmm. 

0 Kudos
Message 3 of 17
(3,462 Views)

any ideas?

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

You need to have the same number of samples for the count as you do for the analog inputs.  So you need to get the number of samples in a channel waveform and create an array of that size for you cycle count.


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 5 of 17
(3,429 Views)

ok, I just tried what you suggested Cross. I thought it was a timing issue! But it didn't seem to work. Now it's putting random 0.0s in my data and the count doesn't appear to be assending at all.

0 Kudos
Message 6 of 17
(3,414 Views)

That's because crossrulez has connections to "initialize array" icon switched... cycle count goes on top connection and length of array goes on bottom connection on left hand side... see attached image...  I still don't believe that's what you want as cycle count won't change even in this case...  you'll see a straight line of same cycle count all the way - aren't you wanting to show cycle count go up?

 

cyclecountsnippet.png

 

-DP

--------------------------------------------------------

New Controls & Indicators made using vector graphics & animations? Click below for Pebbles UI


Message 7 of 17
(3,400 Views)

Yes, I just noticed this as well, ok now I'm getting the correct cycle count in the data file, but the data from the cycle count is still jumping over into the columns of the other channel! I have the DDT set to 1d array of multiple channels...I'm assuming this is correct.

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

Could you please post what your data file now looks like and what changes you made to your vi?

 

-DP

--------------------------------------------------------

New Controls & Indicators made using vector graphics & animations? Click below for Pebbles UI


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

Yes, the cycle count does go up in cross' case. I'm trying to collect a sine wave and I have a cycle counter. I want to output the count of the current data being measured to my file... so it would look something like this...

 

1   xxx  xxx  xxx

1   xxx  xxx  xxx

1   xxx  xxx  xxx

2   xxx  xxx  xxx  

2   xxx  xxx  xxx

2   xxx  xxx  xxx

3   xxx  xxx  xxx

3   xxx  xxx  xxx

3   xxx  xxx  xxx

 

The x's being my analog channels and the left most column is my cycle count...

0 Kudos
Message 10 of 17
(3,382 Views)