LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

write to measurement file change headers names

Solved!
Go to solution
Highlighted

hi guys,

I am using an agilent 34972a to measure temperatures. I have 55 channels and I want to write my results in a file. I use the write to measurement file command but when I open the file that's been created, I get untitled,untitled1...etc for headers. Can U plz help me?? I want to rename those names to the names of my thermocouples. Thanks in advance

0 Kudos
Message 1 of 20
(3,183 Views)
Highlighted

Hi.  I'm using an Agilent 34972a to measure temperatures and collecting the data with Matlab, whose code I refuse to show you.  The output file has "untitled", "untitled1", etc. for headers.  Can you please help me?

 

What would you say to such a request?  How about "How can I possibly help you if you don't show me exactly what you are doing so I can understand what you did wrong?  Also, would you be happy if I sent you a picture of my Matlab code, requiring you to type in the hundreds of lines in order to test it?  [I think the answer would be "No"].

 

Attach your Code.  Make sure that the files have the extension .VI, not .PNG, or .JPG.  If you have a lot of files (say, in a LabVIEW Project), compress the file containing the Project (or VIs) and attach the .ZIP file.  Then we can see what you did, and can suggest ways to improve your code.

 

Bob Schor

0 Kudos
Message 2 of 20
(3,171 Views)
Highlighted

you are absolutely right. I am sorry. here is my code It has agilent and NIDAQ at the same block diagram.

0 Kudos
Message 3 of 20
(3,162 Views)
Highlighted

Thanks.  Now I can get some idea of what you are doing.  In particular, I see you are using a lot of Express VIs, which tend to "hide the details" (and, often, bury them).  I don't use Write to Measurement File, myself, but noticed on its Help page, under Signals, the following Note:  "To change or customize how a signal name displays, use the Set Dynamic Data Attributes Express VI."  Yet another Express VI.

 

You are also using a lot of Dynamic Wires (the black-or-dark-blue checkered wire running all through your Block Diagram).  These are also "information-hiding" (or, as I prefer to think of them, "information-obscuring") elements that NI provides to "make LabVIEW easier for beginners".

 

If you are serious about learning to use LabVIEW, I recommend trying to, as much as possible, avoid both Express VIs and Dynamic Wires except for the simplest, most routine types of tasks (and, in these cases, two or three "ordinary" DAQ/LabVIEW functions will probably do the trick, anyway).

 

Bob Schor

0 Kudos
Message 4 of 20
(3,148 Views)
Highlighted

@chris_kal wrote:

hi guys,

I am using an agilent 34972a to measure temperatures. I have 55 channels and I want to write my results in a file. I use the write to measurement file command but when I open the file that's been created, I get untitled,untitled1...etc for headers. Can U plz help me?? I want to rename those names to the names of my thermocouples. Thanks in advance

 

 Doh I just scrolled down and see the Agilent vi

 

I don't see where you are writing your headers

-------------------------------------------------------------------
Unfortunately, most readers of this Forum, including some real Experts, have not mastered the skill of being able to read the code that Posters fail to post. If we cannot see "what you did wrong", we are unable to tell you how to fix it. (Bob Schor 28 August 2018)
0 Kudos
Message 5 of 20
(3,134 Views)
Highlighted

I want to write them and I don't know how 😞 or what I am doing wrong 

0 Kudos
Message 6 of 20
(3,118 Views)
Highlighted
Solution
Accepted by topic author chris_kal

@chris_kal wrote:

I want to write them and I don't know how 😞 or what I am doing wrong 


Okay first off you need to forget the "Write to measurement file" Express vi. Express vi's are intended for those half day LabVIEW sales pitches  seminars, to show how fast you can just throw something together. But as you see they are not very useful when it comes down to it.

 

 

Writing to a file with column headers is a multi step process.

  1. Open a file
  2. Write headers (text) to file
  3. write data (numeric) to file (repeat until done)
  4. Close file

Here is an example of steps 1 and 2

create1.PNG

You have to now pass that file reference to the rest of your program (use a shift register)  

 

Step 3 can be accomplished with this VI I wrote a long time ago, it takes a numeric array and appends a timestamp then writes them to one line of a tab delimited text file. These files can then be imported into Excel with ease. I will attach this vi. Note the file reference input is used.

create2.PNG

Inside it just formats the time stamp and does this:

create4.PNG

 

Step 4. When you are all done you have to close the file.

create3.PNG

 

 

-------------------------------------------------------------------
Unfortunately, most readers of this Forum, including some real Experts, have not mastered the skill of being able to read the code that Posters fail to post. If we cannot see "what you did wrong", we are unable to tell you how to fix it. (Bob Schor 28 August 2018)
Message 7 of 20
(3,113 Views)
Highlighted

Thank you so much for your instant response All of you guys. I will try it on Monday in uni and let u know. Thaaaaanks a lot 🙂 🙂 

 

0 Kudos
Message 8 of 20
(3,100 Views)
Highlighted

First of all thank you for answering so fast!!! As far as i can understand the "array numeric" are my data from the agilent. i totally understand the steps 1 and 2 but i cant understand how u create ur file and where it's saved in the pc. can u plz help me? i am new to labview and i use it for my thesis to measure temperatures for an experiment and i am kinda lost. thanks

 

Chris

0 Kudos
Message 9 of 20
(3,092 Views)
Highlighted

@RTSLVU wrote:

Here is an example of steps 1 and 2

create1.PNG 


I would strongly suggest to replace the above code with "array to spreadsheet string", using an array of header strings (which you often already have) as input. The default delimiter will give you the identical result, including the termination.

 


@RTSLVU wrote:

Inside it just formats the time stamp and does this:

create4.PNG 


Can you explain the reason to use a format of %S here? I don't get it.

 


LabVIEW Champion. It all comes together in GCentral GCentral
What does "Engineering Redefined" mean??
0 Kudos
Message 10 of 20
(3,084 Views)