LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Arrays into ini files ?

I want to write an ini file, which should contain ,beside controls, also arrays.
This seem to be impossible, or am I wrong?
Does anyone had such a problem in the past, and maybe a solution?
I know I could seperate the whole array or cluster, but that needs a lot of space and makes it confusing.

Thanks a lot. ALEX

see attached file
0 Kudos
Message 1 of 7
(5,890 Views)
Hi,
unfortunately, you can't directly save a multi-element item in a .ini file. You have two options - convert it to a string using typecast, and store some information to say what type the array was, or use a separate datalog file, where you store the filename used in the .ini file.
Attached are the save and retrieve .vi's used by the typecast method.

Hope that helps

S.
// it takes almost no time to rate an answer Smiley Wink
Download All
Message 2 of 7
(5,890 Views)
For small arrays, the other thing you could do is write a key that says how many elements are in the array and then write that number of keys - each with a unique name such as item1, item2, etc. A loop would be used to write and read the individual elements and using a format to string to create the key names.
0 Kudos
Message 3 of 7
(5,890 Views)
Nice hint, I will give it a try.
Thanks a lot.
ALEX
0 Kudos
Message 4 of 7
(5,890 Views)
Great help, saves me a lot of time.
I always love answers with attached files, *smile*.
Yes it helps a lot.

greetings ALEX
0 Kudos
Message 5 of 7
(5,890 Views)
I have saved the contents of a listbox - a one dimensional array of strings - to an ini file by using the Array to Spreadsheet String VI. I use a comma as the delimiter.
When reading the ini file, use the Spreadsheet String to Array VI.
0 Kudos
Message 6 of 7
(5,890 Views)
I have saved similar things to an' ini file' by using the Array to Spreadsheet String VI, but
adding a header to it so it can be looked at with excel much better. It can be used for
documentation as well.
When reading the ini file, read the first line and use the Spreadsheet String to Array VI
afterwards.
Urs
ben c schrieb:

> I have saved the contents of a listbox - a one dimensional array of
> strings - t
> I use a comma as the delimiter.
>
0 Kudos
Message 7 of 7
(5,890 Views)