LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How should I store constants for use between labview sessions?

Going back to the original post, it sounds like these coefficients are being used as calibration/scaling values. If such is the case you want to protect them and there is no way to do that with a text file. For data like that you should always use a database

BTW, another advantage of storing calibration data in a database is that if you do it correctly you can monitor how the calibration changes over time.

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 21 of 26
(1,399 Views)

@ijustlovemath wrote:

That makes sense. I was wondering how it might work should I compile it as an EXE.


It generally doesn't, as Nathand already pointed out. For one thing normal users don't have write access to the Program Files location anymore. Second, every Virus scanner worth its name will scream hell and fire if it detects an application trying to modify itself or any other executable file on the computer.

 

I would echo Mikes comment too. It can be pretty useful to have a history of calibration values for all kind of statistical analysis as well as maintenance of the hardware. However it does complicate the application considerably as now you also have to somewhere deploy some database server. A good low level compromise for this could be a local file based database such as using sqlite.

Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
Message 22 of 26
(1,387 Views)
Roflk, nice catch on the virus scanner. That didn't even cross my mind! I was thinking of doing a database, but I want this application to be deployable on its own, without much setup from the user. Does the labview runtime include ways to programmatically create and modify relational databases?
0 Kudos
Message 23 of 26
(1,362 Views)

I'm not sure if you can create them - I am sure there is a way - but if you use the Database Connectivity Toolkit, you can modify pretty much any database like SQL Server, Access, MySQL, etc.

0 Kudos
Message 24 of 26
(1,354 Views)

Lot of good suggestions here but you should start with a configuration file or a simple text file to store these values at a minimum. That makes your code more expandable for any future feature enhancements or saving other values you may have to add later. I almost always have a config file with my applications because there is always something that needs to be saved from one iteration of the program to the next.

PaulG.
Retired
0 Kudos
Message 25 of 26
(1,340 Views)

@ijustlovemath wrote:
Roflk, nice catch on the virus scanner. That didn't even cross my mind! I was thinking of doing a database, but I want this application to be deployable on its own, without much setup from the user. Does the labview runtime include ways to programmatically create and modify relational databases?

No of course not. Relational databases are the Porsche under the databases. They come each with their own management tools and most have a price tag too. 🙂

 

And a relational database is certainly a bit of overkill for simple calibration value management.

 

It doesn't mean that you can't create a database from within LabVIEW. Using the Database Toolkit or any of the several other available Database Interface Libraries out there, you can create databases using SQL statements that you send to the database driver. However this quickly gets very complicated and is in most cases not worth the hassle.

Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
0 Kudos
Message 26 of 26
(1,317 Views)