D_1 Posted April 24, 2015 Report Share Posted April 24, 2015 Hei, I have a cluster MAIN which has 2 clusters A and B that contains different controllers (bool,strings, integers, enum) and an array of clusters C that also contains different controllers. What I want to do, is to read from a INI file and save it into A, B cluster and in C array. I manage to write the values for A,B clusters, but with teh array C I have some problems. How or which is the best way to access the values from the INI file and save it into the C array which is a part of MAIN cluster. I have attached my code for the reading of the cluster A and B. Quote Link to comment
hooovahh Posted April 24, 2015 Report Share Posted April 24, 2015 If I understand what you want, you are doing it the hard way. Attached is a VI that reads and writes clusters to INI files. I just write the whole Main cluster and read the whole Main cluster using OpenG. Write Read Cluster.vi Quote Link to comment
D_1 Posted April 24, 2015 Author Report Share Posted April 24, 2015 (edited) Woooow,cool. But I want to build from different sections an array. What I am doing is this: In sections I am looking for a special character. If found him, I add an array element to the array C. Is it possible to have a different syntax for the INI file. Like this : [Cluster A] Numeric = "2,000000" Numeric 2 = "2,000000" String = "" [Cluster B] Numeric = "2,000000" Boolean = "FALSE" Boolean 2 = "TRUE" [Array Of Cluster C 1] Ring = "0" String = "a" [Array Of Cluster C 2] Ring = "0" String = "b" [Array Of Cluster C 3] Ring = "0" String = "c" And for comparison this is what Write Read Cluster.vi is giving with the same values: [Cluster A] Numeric = "2,000000" Numeric 2 = "2,000000" String = "" [Cluster B] Numeric = "2,000000" Boolean = "FALSE" Boolean 2 = "TRUE" [Main Cluster] Array Of Cluster C.<size(s)> = "3" Array Of Cluster C 0.Ring = "0" Array Of Cluster C 0.String = "a" Array Of Cluster C 1.Ring = "0" Array Of Cluster C 1.String = "b" Array Of Cluster C 2.Ring = "0" Array Of Cluster C 2.String = "c" Edited April 24, 2015 by D_1 Quote Link to comment
hooovahh Posted April 24, 2015 Report Share Posted April 24, 2015 Ahh yeah that wasn't clear. Still doable. Write each A and B clusters on their own, then iterate over all elements in the Cluster C writing them one at a time in a for loop, then do the reverse for the read. Write Read Cluster 2.vi Quote Link to comment
D_1 Posted April 24, 2015 Author Report Share Posted April 24, 2015 Thanks, you made my day Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.