NI Home
Cart Cart | Help
Hello Events Academic NI Developer Zone Support Solutions Products & Services Contact NI MyNI
You are here: 
NI Home > NI Developer Zone > NI Discussion Forums


Reply
Member
Szklanam
Posts: 49
0 Kudos

Re: Headers with Data Underneath

Also, if I have a string constant for the headers and a concatenation of strings for my data, how would I use the write to text approach? My setup before had one concatenation with both headers and data which was being written to a text file. Thanks for the help

Trusted Enthusiast
crossrulz
Posts: 4,035
0 Kudos

Re: Headers with Data Underneath

I'm having trouble visualizing what your problem is.  Can you post a snippet of your code and possibly some examples of what you are getting?

Member
Szklanam
Posts: 49
0 Kudos

Re: Headers with Data Underneath

I have posted examples of my output file and what I would like my output file to be like. As for the code, it's very hard to get only what I need without explaining a lot more. It's a huge code and this is only a small part. Lots of nested loops and whatnot. I have a concatenation of strings that are my headers, and a concatenation of strings that are my data values. I want to have a file that writes the headers once, and from then on appends just the data concatenation below it.

Knight of NI
Dennis_Knutson
Posts: 29,333
0 Kudos

Re: Headers with Data Underneath

Your snippet made no sense and your explanation of the problem makes no sense either. Since you obviously running some sort of acquisition in a loop, you simply have to create the header before the main loop starts. I'm sure this has been mentioned in many of the numerous other threads on this same issue.

Member
Szklanam
Posts: 49
0 Kudos

Re: Headers with Data Underneath

Now my problem is that I can get the headers to come out but only the last run of data is output. I don't get the other runs. It's appending but overwriting so I get one row of headers and one row of data instead of one row of headers and multiple rows of data.

Member
Szklanam
Posts: 49
0 Kudos

Re: Headers with Data Underneath

The top concatenation is the headers, the bottom concatenation is the data values. Does this clear things up?

Trusted Enthusiast
crossrulz
Posts: 4,035
0 Kudos

Re: Headers with Data Underneath

Something like this doesn't work?

 

Write to CSV with headers.png

Knight of NI
Dennis_Knutson
Posts: 29,333
0 Kudos

Re: Headers with Data Underneath


Szklanam wrote:

The top concatenation is the headers, the bottom concatenation is the data values. Does this clear things up?


It's clear that you need to take a LabVIEW tutorial. You just have to separate the writing of the header and the data. As mentioned, the header write is done once - either before the main loop or in a init state if you are using a state machine architecture. It should not be anywhere near where near where you are acquiring data and writing it.

Member
Szklanam
Posts: 49
0 Kudos

Re: Headers with Data Underneath

Crossrulz, when I tried this, my headers were not output, only the data was. Dennis, why do you think I'm on here? Of course I need tutorials, i'm still beginning, but any tutorial I've seen on loops and outputting data had nothing to do with this, hence the reason I wanted to ask here and get a quicker answer. I ended up writing the header inside the biggest loop I had but I had to write the data inside 4 other nested for loops. My data was in the wrong loop I guess, even though when I used the setup I had for this for my other file it worked perfectly. Thanks to all that helped

Active Participant nyc
Active Participant
Posts: 1,606
0 Kudos

Re: Headers with Data Underneath

[ Edited ]

Szklanam wrote:
Dennis, why do you think I'm on here? Of course I need tutorials, i'm still beginning, but any tutorial I've seen on loops and outputting data had nothing to do with this, hence the reason I wanted to ask here and get a quicker answer.

 

This forums is not tutorials. Neither is it a write-a-VI for you place.

 

You clearly do not understand the fundamentals of programming in LabVIEW. Until you make the effort to learning the basics of LabVIEW, you will continue to depend on others to do your work. Your problem is very basic. The fact that you can't do it properly says that you do not understand one of the basic concepts of LabVIEW.

 

 

By using this web site, you accept the Terms of Use for this web site. Please read these Terms of Use carefully before using any part of this site. Please go here for information on ni.com's copyright infringement policy.
My Profile | Privacy | Legal | Contact NI © 2011 National Instruments Corporation. All rights reserved.    |    E-Mail this Page E-Mail this Page