LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Config file creation - This is insane!

I am successfully creating and reading a config file with the method shown on the attached jpeg. It works fine, but that seems like a lot of code to write 7 scalers and read them. I'm probably overlooking something simple. Can someone give this a look and tell me if that's the "correct" way of doing it?
Richard






0 Kudos
Message 1 of 9
(3,649 Views)
"Broken Arrow" wrote in message
news:<506500000008000000CA490000-1021771306000@exchange.ni.com>...
> I am successfully creating and reading a config file with the method
> shown on the attached jpeg. It works fine, but that seems like a lot
> of code to write 7 scalers and read them. I'm probably overlooking
> something simple. Can someone give this a look and tell me if that's
> the "correct" way of doing it?

If you think it's tough with 7, try it with 50 or so ;). Send me an email
and I have some examples that will help you simplify things. The trick is
basically to use references.

Best regards,
Justin Goeres
0 Kudos
Message 2 of 9
(3,651 Views)
Justin, how do I find your email address within the forum?
Richard






0 Kudos
Message 6 of 9
(3,650 Views)
"Broken Arrow" wrote in message
news:506500000005000000977A0000-1021771306000@exchange.ni.com...
> Justin, how do I find your email address within the forum?

Should be able to just do a "reply via email."

Or you could just use jgoeres@indioNOSPAMsystems.com. 😉

(remove the NOSPAM part)
0 Kudos
Message 7 of 9
(3,649 Views)
Broken Arrow wrote:
>
> I am successfully creating and reading a config file with the method
> shown on the attached jpeg. It works fine, but that seems like a lot
> of code to write 7 scalers and read them. I'm probably overlooking
> something simple. Can someone give this a look and tell me if that's
> the "correct" way of doing it?

One approach would be to store multiple parameters on one line.
You then have fewer keys:

RinseSettingQuantities=bkPulses,bkDuration, ...
RinseSettingValues=5,30.0, ...

That could be easier, especially if you always write or read all values
to the file at one time.

Best, Mark
Message 3 of 9
(3,649 Views)
You can joining your scalers into array and then writing these values inside for-loop. There are two ways - you can storing item names for ini file in the separate array, or getting item names from properties.
See attached files.
Download All
Message 4 of 9
(3,649 Views)
Excellent idea. I rarely consider using arrays due to hearing and reading that you should keep your data "as flat as possible", but there's got to be a trade off eventually. I'm using 7 keys to read/write 7 scalers - your examble uses one!
Richard






0 Kudos
Message 5 of 9
(3,649 Views)
I am wondering if you can explain how you code your example above..."Storing multiple parameters on one line". Also I am trying to store an array of value, can you suggest an easy way of doing this.

Thanks
0 Kudos
Message 8 of 9
(3,649 Views)
YES THAT'S INSANE! 😉

Take a look at the Variant Configuration File IO library of the OpenG Toolkit. This library allows you to simply wire a cluster of data into a single VI, and the data names of the cluster elements will be used as the INI entry keys names. You can download this library (named variantconfig) here. variantconfig has some dependencies on other libraries of the toolkit, so you should probably just download "all_packages".

Good luck,

-Jim
0 Kudos
Message 9 of 9
(3,649 Views)