LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to change 'untitled' in 'write to measurement file' block

Hello, when i use the write to measurement file function I can open up the data file as a txt. The data is shown in columns just like i want, but i want to change the column titles from Untitled1, Untitled2 etc... to something else. I dont see how to do this.
 
     Thanks
 
        - Dan
0 Kudos
Message 1 of 19
(7,264 Views)
The "Write to Measurement File" VI/ExpressVI is typically used in conjunction with a Waveform or Signal data type from a DAQmx source.  Things like the channel name and the channel units are parameters that you setup using Measurement and Automation Explorer (MAX) per channel/task.  If you are wiring something along the lines of a 2d array of Double data type then you will not get the extra information such as the head names from the "Write to Measurement File" VIs.

If you have to use a 2d array of Double, one option is to do the handy work yourself and flatten the data to a tab deliminted string, insert/concat a row of headers, and then save the text file.

I recommend you learn about the Waveform and Signal data types in LabVIEW and go that route.  Those two data types are what a LOT of subVIs that come with LabVIEW take as input and in some ways can really simplify your programming.


Message Edited by Nickerbocker on 11-30-2007 05:33 PM
0 Kudos
Message 2 of 19
(7,258 Views)
Oh that clears it up now...
 
So basically it depends on my data type input. I am using dynamic data type input now.
 
 
      Thanks for the reply,
 
          - Dan
0 Kudos
Message 3 of 19
(7,241 Views)
Hi Dan,
 
You can also use the Get or Set Waveform Attribute function to get or set the channel name for a particular waveform datatype. This would in turn change the column titles you mentioned in your original post.
Message 4 of 19
(7,208 Views)

I am using the the DAQmx Read vi as source for Write To Measurement File, and I am having the same problem.  Task/Channels are setup in MAX alright, and the headers were written correctly with channel names when I was using the DAQ Assistant to read measurements, but for sufficient control I had to switch to the DAQmx Read vi and do it manually - this is what caused the "Untitled" columns.  

 

There's gotta be an easy way to do this!

0 Kudos
Message 5 of 19
(6,579 Views)
Message 6 of 19
(6,568 Views)

Here is the only way I can figure, and this is using the Set Dynamic Data Attributes express vi.  Basically, I have 5 channels setup under a task in MAX, and since I'm not using the DAQ Assistant express vi (which, btw, can't access an existing task, as it only selects channels to create a new task), my tasknames don't get bundled in that nice little "Dynamic Data" wire.  Hence the Untitled column headers in what is written, and unnamed signals anywhere else its used.  Its a shame that we have such a convenient way to write a measurement file, but DAQread.vi is unable to output dynamic data.

 

This is the only way I could think of to make it work; It's real simple, but looks real messy in the midst of my rat's nest of wires and vi's.  For every single channel you want to name, it seems you will need a separate instance of this Set Dynamic Data Attributes.  

0 Kudos
Message 7 of 19
(6,551 Views)

Don't know why you would say that's the only way when I gave you an alternative. Did you even try it? Did you do a search of the board for this 'problem'. The above solution does work and it was the way it was done before that silly express VI was created.

0 Kudos
Message 8 of 19
(6,543 Views)

braber,

 

I think you also might be getting stuck on this one because you were configuring the DAQ Read to return DBL instead of Waveform datatype. After configuring it to return waveforms, follow Dennis' suggestion.

 

Regards,

Message 9 of 19
(6,517 Views)

Did not notice that at all. Good catch.

0 Kudos
Message 10 of 19
(6,514 Views)