LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

write to measurement file change headers names

Solved!
Go to solution
Highlighted

so u suggest that i wire my data in the "array port of the array to spreadsheet" command and then do the rest?? open/create file, write to file and close??? 

0 Kudos
Message 11 of 20
(835 Views)
Highlighted

@chris_kal wrote:

so u suggest that i wire my data in the "array port of the array to spreadsheet" command and then do the rest?? open/create file, write to file and close??? 


Yes.

 

(... except for the word "then", which implies an execution order. You can open/create the file before, in parallel, or after you do the "array to spreadsheet string" thing. The rest will fall into place as long as you use data dependencies. Only close after you write the header and the data)


LabVIEW Champion. It all comes together in GCentral GCentral
What does "Engineering Redefined" mean??
0 Kudos
Message 12 of 20
(832 Views)
Highlighted

I also found that, but when I am putting it inside my while loop it doesn't work. I couldn't make it with ur way altenbach. Do u also know how to have a column with time in front of all my values?? like:

1,000

2,000

3,000

4,000

.

.

.

0 Kudos
Message 13 of 20
(811 Views)
Highlighted

i found it 🙂 thaaaaanks a lot 🙂 🙂 🙂 🙂  thanks RTSLVU and all of you for answering 🙂

 

 

CHRIS

0 Kudos
Message 14 of 20
(807 Views)
Highlighted

@altenbach wrote:

 


@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.

 

I am using the "Write Text File vi so I need strings...

 

%S simply converts the numeric to a string without changing the number in anyway.  Way back when I first started programming in LabVIEW 5.1 this was the only way I could figure out how to avoid the rounding that using %f appeared to be causing. LIke so many things these days I probably don't need to do that anymore, just like the timestamp formatting the that VI also does.

 

@altenbach wrote:
@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.

Yes I know, but I find this while looking more cumbersome easier to edit. Moving from cell to cell in an array is a pain in the ass.

 

Now just do a little sub-vi like this to format the headers...

head.png

This allows me to quickly change, add, or, remove headers by editing one line of text.

 

-------------------------------------------------------------------
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 15 of 20
(804 Views)
Highlighted

Please, can someone give me a print or VI file of the solution in a older version? I work in a computer that has NI LabVIEW 2014, so I can't open the solution (which is in 2016 version).

 

Thanks for the attention!

0 Kudos
Message 16 of 20
(440 Views)
Highlighted

@ThiagoKuerten wrote:

Please, can someone give me a print or VI file of the solution in a older version?


To get a "print", you can print the above image. To get a VI, just recreate the code. It is simple enough and should not look any different in 2014. Is there any part you don't recognize?


LabVIEW Champion. It all comes together in GCentral GCentral
What does "Engineering Redefined" mean??
0 Kudos
Message 17 of 20
(435 Views)
Highlighted

Yes, I'm working with LabVIEW a short time ago, and now it's my first experience with measurement file's creation. So I would like to get a VI to see and learn about each diagram blocks that I need to use.

0 Kudos
Message 18 of 20
(421 Views)
Highlighted

Hi RTSLVU,

 

Could I trouble you for some dumbing-down of your excellent File I/O explanation for my benefit?

 

The code snippet I wrote in WTMFile.png works well to acquire and save the required data.

 

Great, except, I still do not understand how to change the column headers from Untitled, Untitled 1, etc., to a meaningful names i.e. PSU Monitor, Temp Monitor.

 

I really like the first-principles way you suggest of ditching the Express VI and using low-level File I/O commands, however, I got stuck on Step 3.

 

So, might you be inclined to describe how to write headers through the Express VI or elaborate a bit more on your method?

 

I've hit a wall using the Write To Measurement File Express VI, with respect to how segment headers are handled, as most of the web "advice" just regurgitates the  NI help file information and I haven't been able to integrate the Forum solutions on this subject.

 

Thanks for any time you might have to help.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Download All
0 Kudos
Message 19 of 20
(230 Views)
Highlighted

Well as I said lose the Express VI, although I am pretty sure you can set the headers in the Express VI. But I don't know how to do that as I have been using LabVIEW before the inception of Express VI's and never found the need for them. Frankly to me Express VI's are not intended for "production" use they are only there for those 2 hour LabVIEW sales pitches seminars to show managers how fast you can just throw something together in LabVIEW.

 

This is what your program should be doing

 

  1. Open a file
  2. Write header strings to file
  3. Enter acquisition loop
  4. Take measurements
  5. Write one line of measurements to file
  6. IF NOT "done" GOTO 4
  7. Exit of acquisition loop
  8. Close file
  9. End  
-------------------------------------------------------------------
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 20 of 20
(226 Views)