LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

NI-DAQmx Analog out to Cluster how to convert to individual array elements

I am trying to decompose the cluster that comes from a single channel multiple point anolog input capture. What you get is a cluster that has the starting time, the time interval between samples and the actual analog input data points. What I want to do is after capture I want to have access to the data so I can make calculations on it. When I am done I want to write the data to a spreadsheet file. I can't seem to get the cluster to array function to wire up. I have tried every possible combination of functions and I can't get them to wire up eventhough the input type is a cluster. I have posted a screen shot of my code below.
 
I can get this to work with raw data using the express vi that writes to spreadsheet but I would like to know how to do this manually as well.
 
Perry
0 Kudos
Message 1 of 11
(3,526 Views)
You can't use Cluster to Array unless all of the elements in a cluster are the same data type. You should use the Get Waveform Components function. The item you want is the Y array.
0 Kudos
Message 2 of 11
(3,520 Views)
Ok that helps alot but I am having the same problem with the T0 cluster that the get waveform function produces. If I want to covert this t0 value to a string so I can wirte it to a file how do I do that?
 
Thanks for all your help
 
Perry
0 Kudos
Message 3 of 11
(3,512 Views)
The Format Date/String String function.
0 Kudos
Message 4 of 11
(3,509 Views)
Doesn't that just go and get a new date and time instead of using the one from the waveform data?
 
Perry
0 Kudos
Message 5 of 11
(3,500 Views)

Only if you don't wire up the input.

Message Edited by Dennis Knutson on 02-26-2007 02:20 PM

0 Kudos
Message 6 of 11
(3,498 Views)

I am attaching the two vi's that I am playing with. The first one works the second one tries to use an old file name and prompts me to replace the old one. The second one also does not write my data to the file.

Perry

0 Kudos
Message 7 of 11
(3,487 Views)
You don't understand how dataflow works with LabVIEW and an understanding of this is essential. Dataflow means that a function does not execute until all of the data wired to it is present. In your second file, you create the date/time for the header in the second frame of the sequence structure, when the frame completes, it passes out of the structure to the concantanate string function. This is then wired to the Write Characters to File Function which will now execute because all the data inputs are present. This is set to create a new file so it is executing after the Write to Spreadsheet File which is inside the sequence structure. You do not need the sequence structure at all. You do need to provide some dataflow between the Write Characters and the Write to Spreadsheet File. Here's a bit cleaner example of your code.
0 Kudos
Message 8 of 11
(3,484 Views)

Thanks Dennis

I have not done much Labview in the last year. I have to relearn a bunch of stuff every time I get back into it. I did the highlight execution thing and the sequence was really messing things up. You must work with Labview alot. This whole exercise is to relearn some old things and also learn some new stuff.

I have another small problem. My time data is being truncate to 3 sig figs when it writes to the spreadsheet file. I assume it is because of the single precision limitation of that write to spreadsheet function. Is there a way around this?

 

Perry

 

0 Kudos
Message 9 of 11
(3,472 Views)


I have another small problem. My time data is being truncate to 3 sig figs when it writes to the spreadsheet file. I assume it is because of the single precision limitation of that write to spreadsheet function. Is there a way around this?




Or maybe it's because you left the format input of Write To Spreadsheet File unwired. The default is %.3f and that gives you your 3 decimal places.
0 Kudos
Message 10 of 11
(3,467 Views)