Showing results for 
Search instead for 
Did you mean: 

problems with array formatting

Go to solution

Hello All,


I'm currently having problems formatting/using an array to log data (well it's going to be saved in a .csv file, but I'm trying to use the array to get it all properly formatted for the .csv file for easy reading). It's probably something easy that I'm overlooking or not adding. If someone with more knowledge of labview (I've only worked a couple of months on/off with it) could guide me through the process of how to make my idea work, I'd be most appreciative.


I've attached the labview file so you can see a bit more what I'm trying to do and how I'm trying to approach it.


Also, if you need a bit more explanation just ask.



Many Thanks!

0 Kudos
Message 1 of 5
Accepted by Crushed

At first glance, it looks like you've made this more complicated than it has to be.


You've got a ton of controls and indicators which might be better handled as arrays or clusters.


For your immediate problem of the file write, you could just build a numeric array and then use the Write to Spreadsheet and select a comma as the separator.  The step where you are creating the spreadsheet string and then Writing to Text File is unnecessary.

Message 2 of 5

Much too complicated.  Your fp is too busy.  You can condense it by putting all your frequency controls into an array.  Why so many frequency settings.  Your case structure has 40 cases just for this!  I'm not sure what you are doing with the build array function.  I assume the array of string constants are supposed to be your header in the report.  This is not what the program does.  The data going to the write to text file function doesn't make any sense.  The initial build array function between the controls and the main build isn't needed.

Reese, (former CLAD, future CLD)

Some people call me the Space Cowboy!
Some call me the gangster of love.
Some people call me MoReese!
...I'm right here baby, right here, right here, right here at home
0 Kudos
Message 3 of 5

Well the idea with the many Voltage and Frequency controls were so that at each interval of a thermotron program we could program in a different Voltage and Frequency and we could have up to 40 different variations. I unfortunately do not have the experience with LabVIEW to do this any more efficiently. I'm also going to be writing to this file for almost 30 days. While I was reading through tutorials and such, I was told that opening and closing the file was rather inefficient of my program. So I guess I was trying to re-write what has already been written.


But if you guys could point me to some tutorials or knowledgebase pages to make my program more efficient (i.e. help with all those voltage and frequency controls) I'd be appreciative.


I'll also try out your guy's file suggestions. Since I've got a 3 second delay built into my program, I guess it doesn't really matter if it takes a long to time to open and close the file.



Thanks for the help!

0 Kudos
Message 4 of 5

Tutorial on Arrays and Clusters


There's other good stuff around the link page.  You might want to take a few hours and just browse around in the related tutorials.

Message 5 of 5