LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Add headings to writing file

I am reading in Data through a serial port and would like to display the data while simultaniously writing it to a file.

As far as displaying, I figured that out.
 
The problem I am having is writing to a file. When I do so, it only writes one line of data and then stops writing.
I attached my VI in hopes someone can see whats going on (although it is kinda messy ;-))
 
The other problem I am having, is I cannot attach headings to any of my signals (I am not sure how to).
I am using the File I/O Assistant. Where it says "Headings", i selected only one heading for the whole file.
However, LabVIEW doesn't know what each signal is unless I tell it, and I'm not sure where to tell it.
 
Thanks for your help,
Cory


Message Edited by Cory K on 07-25-2008 10:59 AM
Cory K
0 Kudos
Message 1 of 19
(3,272 Views)

OK, so I forgot to attach the file

Smiley Tongue

Cory K
0 Kudos
Message 2 of 19
(3,271 Views)
You have no file write functions in that file and there is no such function as the File I/O Assistant.
0 Kudos
Message 3 of 19
(3,263 Views)
Hi cory,
           Can you post ur vi for lv 8.0? or a screen shot? R u using a loop for indexing all the values?
Message 4 of 19
(3,261 Views)

Sorry, I attached the older file.
Here is the one with the File I/O

 

* I can't attach a screen shot because it won't all fit in one shot.

Cory K
0 Kudos
Message 5 of 19
(3,254 Views)
You've got almost exactly the same issue as this from earlier today. The Write Measurement file should not, imho, be used when your original data is not dynamic and you need column headers. Here's a simple mod that uses the Write to Spreadsheet File twice. Once for the headers and again in the loop to write the data. If would be even more efficient to use the Write to Text File since Write to Spreadsheet (like Write to Measurement) opens and closes the file each time.
Message 6 of 19
(3,236 Views)
Thanks Dennis.
That actually made it easier and simpler.
 
Cory K
0 Kudos
Message 7 of 19
(3,227 Views)
Well, now I am getting the headings, and no data.
I suspect it might have to do with the "Append to File" option on the Write Spreadsheet function.

Any recommendations?
- Cory
Cory K
0 Kudos
Message 8 of 19
(3,212 Views)
Well, I was correct in thinking that the Append to File option was messing with things.
Here are the three types of things that are being written
1) Comments
2) Headings
3) Data
 
Now, my goal for writing this file is:
1
2
3
3
3
3
3......
 
What I am getting is
1
2
3
1
2
3
1
2
3.......
 
Any suggestions?
 
- Cory
Cory K
0 Kudos
Message 9 of 19
(3,202 Views)
I never really looked at the overall code structure and I now see that the way you are using the while loop is a little strange. It appears that the loop only iterates once unless there is an error. So, if you are calling this from another VI, then the behavior you are seeing is expected. Move the header creation to the top level. Move the VISA Configure Serial Port and VISA Close to the top level. Since the loop only iterates once, why do you want the while loop at all?
Message 10 of 19
(3,196 Views)