LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

2d array to cluster array How do I insert a 2d string array into a cluster array?

Solved!
Go to solution

I have a cluster with 4 string elements 3 are string constants and 1 is a string combo box.

I can save the cluster array to file without any issues. 

Now I want to read the saved file back in the cluster array.

How do I insert a 2d string array into a cluster array?

 

 

0 Kudos
Message 1 of 12
(4,995 Views)

ofcourse, this is a 1D...you can maipulate to 2D and use a 'for loop' to index individually

 

Example_VI.png

 

 

2D....

Example_VI.png

0 Kudos
Message 2 of 12
(4,986 Views)
Solution
Accepted by topic author rcard53762

@rcard53762 wrote:

I have a cluster with 4 string elements 3 are string constants and 1 is a string combo box.

I can save the cluster array to file without any issues. 

Now I want to read the saved file back in the cluster array.

How do I insert a 2d string array into a cluster array?

 

 


It would be helpfull to have an example of what the actual cluster array look like with typical data. A way to do this is by saving the content of the cluster array as a configuration file (extension .ini) and then use the OpenG Variant Configuration File VIs to save and retrieve data to/from the configuration file. You can get these VIs from the VI Package Manager.

 

Here is an example. Also attached is the generated config file.

cluster array.png

 

Ben64

0 Kudos
Message 3 of 12
(4,961 Views)

Thanks for the help.

0 Kudos
Message 4 of 12
(4,929 Views)

writing the cluster array to config file is working fine .but when i read it,i am getting null string cluster array .

when i check the config file actual data is present,but reading config file giving me an null string.

0 Kudos
Message 5 of 12
(4,877 Views)

Make sure that the Section and Key inputs are the proper name.  You can verify that by using the Get Key and Section Names VIs.

 

You can also wire something to the "default value" which will be the output if it the key does not exist.

 

Also this Discussion Thread has been marked as solved, therefore you might get a better discussion by starting a new thread specifically regarding your issue with reading the config file.

 

Regards,

M. Whitaker
ni.com/support
0 Kudos
Message 6 of 12
(4,852 Views)

@venaktesh wrote:

writing the cluster array to config file is working fine .but when i read it,i am getting null string cluster array .

when i check the config file actual data is present,but reading config file giving me an null string.


You need to show us how you are writing the file and how you are reading it back. Please attach some code.

0 Kudos
Message 7 of 12
(4,846 Views)

Here,i have attached my code for both writing and reading config file along with written config file.

0 Kudos
Message 8 of 12
(4,830 Views)

These are images, not code. Please attach the VIs instead. Thanks.

0 Kudos
Message 9 of 12
(4,823 Views)

Did you set the constant labels of the the Account info Cluster to be the same as in the file (Name, Designation, DOB ...)? Also, I don't think you can put a space in a key name (as in EMAIL ID). Replace the space by an underscore (EMAIL_ID)

 

Ben64

0 Kudos
Message 10 of 12
(4,800 Views)