LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

VI to leave fields blank rather then with values

Hello,

 

What I am trying to do is modify the code from an exercise to suit my needs.

 

I am having It write to an access database which It does in stock example form.  But what I wanted to do was add another column, and populate my own data within.

The column that I added is grayed out and when I attempt to run the program It gives me errors.  Also, when I delete the data in the fields, save and close, they are there when I open the file back up.  It is the same with the directory file which can get annoying constantly selecting the file path over and over.

 

Anyone out there have a solution for this?

 

Thank you

-

0 Kudos
Message 1 of 4
(2,259 Views)

The problem you are having in regards to the data you deleted reappearing when you open up the application and with the directory file not changing are the same problem. Labview stores a "default" value for all of your controls and indicators. When an application is opened up, the "default" value is restored.

 

 

For example if you enter 5 in a number control, save the vi, close it and reopen it it will turn back into 0.

However if you enter 5, right click on the control and select "Data Operations -> Make Current Value Default" it will then stay a 5 when you restart the application.

 

If you want to just change a value once so that you don't have to reenter it, use the above example. But if you want your application to show up exactly as it appeared when you last close the application, you will need to use some data storage to store the values and reload them when you restart the application.

 

If this is what you want to do, try reading THIS WHITEPAPER.

 

The problem you are having with "grayed out" columns has to deal with the way labview handles the absence of data. When you add a column there isn't any data in it yet. When you try to access this data, Labview doesn't know what to do because there isn't any data to access. You can either capture these errors and handle them in your code or you can put in "dummy data". For example dummy data for a number control might be "0". Dummy data for a string control might be a space character.

 

0 Kudos
Message 2 of 4
(2,242 Views)

@BFeigum wrote:

Dummy data for a string control might be a space character.

 



Default "dummy" data for a string control would be better off by an empty string rather than a space character.

0 Kudos
Message 3 of 4
(2,233 Views)

Thank you for the help, got it taken care of!

0 Kudos
Message 4 of 4
(2,202 Views)