LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Help!!!! How do I save my data/inputs into an array without hardcoding so that when I re-open my block diagram or start a new run I don't lose them?

For example, in this picture/front panel below I would like to save the names you see when I re-open the block diagram or start a new run. Does anyone know any how this should be accomplished? I explored some property nodes and couldn't find a way to do that. 

Capture.PNG

 

This below is what I am getting when I re-open LabView:

Capture.PNG

 

I also attached a new block diagram just in case someone wants to see what I am working with. I am creating a login page basically. 

0 Kudos
Message 1 of 5
(1,532 Views)

Save the data to a configuration file of some sort (ini, JSON, etc.) when the run is over and/or when something changes.  On start up, load up the data from the configuration.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 2 of 5
(1,527 Views)

Saving them to a simple text file would work in this case.

 

Take a look at the Read and Write Delimited Spreadsheet vi

 

Csrapture.PNG 

========================
=== Engineer Ambiguously ===
========================
Message 3 of 5
(1,519 Views)

The previous replies are correct. A configuration file as I have come across them means what information do I want to get initialized at load/runtime and what do I want to save off when I'm done if I changed what I initially loaded in.  

 

I will try to work up an example if I can tonight. The first thing that comes to my mind is you have some file your VI will load outside of any looping when it first starts running.

 

I am partial to .ini files so it would be a file like

 

[UserNames]

user1=Altenbach

user2=David

user3=Christian

 

Once you have a filepath that your VI can read in from you can read each name in and assign it to the array indicators before your program does anything else. So it would end up looking like

 

Start -> Open File Path -> Initialize State -> Read in Names from your file -> Update Indicator Values -> Do Some Stuff -> On Shutdown write current indicator values back to the same file if you want the list to update.

 

An initialize state that runs first could be a good place to do this.

 

I hope that helps I haven't got to do much LabVIEW lately so I will have to go tinker with it myself. It is essentially a File I/O question so learning the basics of that will get you most the way there. The specifics of when and where to load, save, and update indicators will depend on how you plan to set everything up and what states you have.

0 Kudos
Message 4 of 5
(1,500 Views)

They do have some File IO examples in LabVIEW as well as in their online trainings if you have access to those. 

FyreTitan_0-1646851023947.png

 

0 Kudos
Message 5 of 5
(1,468 Views)