LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Using .ini Files Tutorial

Hi All,

I recently took the LV intermediate courses and I've been trying to incorporate some of the items we discussed into my program.  One of the topics we very briefy skimmed was .ini files.  In fact we didn't really go over them, but the instructor said that's the preferred method for initilizing variables etc.  I've got about 65 variables that need to be initilized to either 0, T/F, "  "(empty string), etc.  They are initilized either whenever we put a new unit on for test, restart a unit, or after a full test cycle (Little under 2 days for full test.)  We didn't really go over how to create the .ini or link it to labview.  I did explore some of the File I/O functions, but none talk about .ini useage that I could find.  May have missed them, but couldn't find the examples in LV either.

Anyone seen a good tutorial or have a simple program that shows how to use a .ini for the various data types LV uses?

(Or if anyone recommends not using this method why?  I suppose the instructors could be bias or just wrong?)
LV7.1, LV8.5, LV2014/15/16
0 Kudos
Message 1 of 4
(3,037 Views)

Under the main LV menu, select Find Examples > Fundamentals > File Input and Output > Read (or Write) Configuration Settings Files

That should give you a good start.

PaulG.
Retired
Message 2 of 4
(3,033 Views)
Its a good example and not too hard to follow.

What I noticed though is how large that program is and the subvi's called inside it.  What seems a bit crazy, its only init. 5 variables and the space that program takes up on the block diagram is already larger than manually init. now (and thats with the 65 or so variables!)

It seems as though it would be significantly easier just to send an initilized value into each control individually.

Am I missing something?  From that example it seems like a bad idea to go down that route...
LV7.1, LV8.5, LV2014/15/16
0 Kudos
Message 3 of 4
(3,020 Views)

If the init values never change, then you are correct.

If these can change with time, then the ini file is the way to go.*

Ben

*

I may post a Nugget on this a week from Sunday (provided my technique still works in LV 8.5).

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 4 of 4
(3,016 Views)