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.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Reading/Writing to csv file

Solved!
Go to solution

Hello,

This may be a really dumb and obvious question, but I have only been working with LabVIEW for two days.  I am trying to retrieve data from a .csv file and display it to a front panel.  I have been able to do this, but what I want to do is retrieve the values, then put those values into an array, then allow the user to adjust those values, and click on a button and save the file back to the same file that the values were pulled from.  I can read the values into an array and display them fine, and I am able to take an array and write it back to the file, but I need a way to be able to use just one array that is displayed on the front panel.  Basically, what I am trying to say is that I want to get a snapshot of a .csv file and display it on the front panel where the user can adjust the numbers from the file, and re-write them back to the .csv file and close the front panel.  Is there an easy way to do this?  I appologize if this is not clear or it has been answered on here before.  Remember, I am new to this whole thing!

Thanks in advance.

0 Kudos
Message 1 of 9
(4,123 Views)

Have you looked at the table control? It is a 2D array of strings. You can use read from spreadsheet file and save to spreadseet file.

=====================
LabVIEW 2012


0 Kudos
Message 2 of 9
(4,120 Views)

It looks like it is reading the csv file into the table control just fine, but I still cannot adjust the numbers coming in on the front panel.  The table control that I am using only has an input.  I just ran a parallel wire coming off of that into a case statement with the write to spreadsheet file constrained by the accept button.  I have attached my screenshot.  I'm sure this isn't how to do it, but can you advise?

0 Kudos
Message 3 of 9
(4,107 Views)

hi,

Actually You are using while loop... So actually the data will get create new files continuously...Better try for event structure...

0 Kudos
Message 4 of 9
(4,083 Views)
Solution
Accepted by topic author brok264102

If you want the user to be able to change values, you need a control and not an indicator. The problem has nothing to do with loops. If you were to change it to a control and write to a local variable, everything should work.

Message 5 of 9
(4,071 Views)

ya, Dennis is right...

What ever be the input, user give is not reach inside the while loop... So better make it as a control and update the values inside the loop using a local vaiable...

0 Kudos
Message 6 of 9
(4,060 Views)

No. The local is wriiten to outside the loop and the control is read inside - no locals inside.

0 Kudos
Message 7 of 9
(4,058 Views)

I got it....

0 Kudos
Message 8 of 9
(4,051 Views)

Looks like that got it.  Thanks alot for the help!

0 Kudos
Message 9 of 9
(4,010 Views)