03-31-2017 07:37 AM
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
Solved! Go to Solution.
03-31-2017 07:46 AM
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
03-31-2017 07:57 AM
you are absolutely right. I am sorry. here is my code It has agilent and NIDAQ at the same block diagram.
03-31-2017 08:23 AM
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
03-31-2017 10:34 AM - edited 03-31-2017 10:38 AM
@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
03-31-2017 02:19 PM
I want to write them and I don't know how 😞 or what I am doing wrong
03-31-2017 03:05 PM - edited 03-31-2017 03:11 PM
@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.
Here is an example of steps 1 and 2
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.
Inside it just formats the time stamp and does this:
Step 4. When you are all done you have to close the file.
04-01-2017 03:25 AM
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 🙂 🙂
04-01-2017 12:27 PM
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
04-01-2017 12:58 PM - edited 04-01-2017 02:14 PM
@RTSLVU wrote:
Here is an example of steps 1 and 2
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:
Can you explain the reason to use a format of %S here? I don't get it.