06-10-2013 08:18 AM
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?
Solved! Go to Solution.
06-10-2013 08:58 AM
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.
06-10-2013 09:09 AM - edited 06-10-2013 09:16 AM
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.
06-10-2013 10:09 AM
any ideas?
06-10-2013 10:31 AM - edited 06-10-2013 10:32 AM
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.
06-10-2013 10:52 AM
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.
06-10-2013 11:07 AM - edited 06-10-2013 11:12 AM
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?
-DP
06-10-2013 11:11 AM - edited 06-10-2013 11:17 AM
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.
06-10-2013 11:19 AM
06-10-2013 11:21 AM
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...