From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
08-09-2011 12:19 PM
I am trying to break away from the "Write to measurement file.VI" and trying to learn to use the other File I/O VIs to customize my data. Above is a simple VI I made to fool around with the settings of different File I/O VIs, though there are 2 things I can't seem to figure out how to make it do.
1) I need a way to break up the data into columns, so that instead of storing 1 long string into the A1 box, the B1, C1, etc boxes can be used.
2) I also need a way to break up the data into rows, so that I could eventually get something that looks like the following (assuming I threw in a for loop structure in the block diagram)
08-09-2011 12:53 PM - edited 08-09-2011 12:55 PM
I applaud your desire to move away from the high-level Express VI type things, and stepping away from the drums long enough to do some LabVIEW.
Try Write To Spreadsheet File. It may be a VI, but look inside - it uses the lower level stuff - just arranged in a way to make doing what you want to do very easy. It even does "housekeeping" for you.
Write the "header" first, then in a loop, write your data, as this example demonstrate.
08-09-2011 01:22 PM
Or try editing the format string to format the data the way you want. This outputs 3 dbls as *.CSV
08-09-2011 02:37 PM
OP: Jeff's response more directly answers your question, since your question was "format into file" help.
Personally, I've always found setting the file position to be an extra, unnecessary step since the functionality exists for free in Write To Spreadsheet File.
Pick your medicine!
08-09-2011 03:45 PM
I've always found setting the file position to be an extra, unnecessary step since the functionality exists for free in Write To Spreadsheet File
Setting to end is easy enough. With just 1 dtat type the write to spreadsheet file does offer some advantage. But what about mixed data types? The write to spreadsheet then reqiers a bunch of scan from string - build arrays to convert the data.
08-09-2011 03:59 PM
@Jeff Bohrer wrote:
[...]
But what about mixed data types? The write to spreadsheet then reqiers a bunch of scan from string - build arrays to convert the data.
Granted. I could have probably saved a VI or two in the past by not using Write to Spreadsheet. It's all about choosing the right function for the job, and not just grabbing what you're comfortable with. In the OP's case, either solution is good.