LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

To save data into an array according 2 labels

I need to save the Data into an ARRAY.
And I need to save it according 2 labels: GROUP name and ELEMENT name.
 
Suppose that I have following:
--------------------------------------
1. Several GROUPS of Data like this:
 
    ER-1234
    ER-3245
    ER-4786
    ER-9080
 
2. Each GROUP has the following ELEMENTS:
 
    A, Bi, Pb, Sn, Sn, Cr, Ni, Ca, ...., Al
 
   So it would be like
 
    ER-1234: A, Bi, Pb, Sn, Sn, Cr, Ni, Ca, ...., Al
    ER-3245: A, Bi, Pb, Sn, Sn, Cr, Ni, Ca, ...., Al
    ER-4786: A, Bi, Pb, Sn, Sn, Cr, Ni, Ca, ...., Al
    ER-9080: A, Bi, Pb, Sn, Sn, Cr, Ni, Ca, ...., Al
 
 3. An each ELEMENT has DATA that I need to save, BUT! that I need to be able to get it by specifying the group and the element.
 
    A:
         2,3   2,4    2, 8,   2,8 
         2,2   2,3    2, 7,   2,6
         2,1   2,6    2, 6,   2,7 
         2,5   2,4    2, 5,   2,3
 
How can I save the ELEMENT "A" Data with the label of the GROUP and the ELEMENT into an array?
I will need to be able to get the DATA again when specifying the Group and the Element.
 
 
Thanks for the help!
 
Best regards,
 
Amaloa.
0 Kudos
Message 1 of 6
(2,932 Views)

Hello,

If I understood correctly, you just want a 2D array for storing your data and two index for the row and column. See the attached example.

Software developer
www.mcm-electronics.com





PORTUGAL
0 Kudos
Message 2 of 6
(2,922 Views)
Have you looked into making your group and elements into Type-Def. enums. If you do that then you can use an enum with the Group and Element name to index a 2d array.

For example, the Group would be an Enum like:

0       ER-1234
1       ER-3245
2       ER-4786
3       ER-9080

and the Elements
0      A
1      Bi, etc

Then to index Group ER-3245, Element A would be index row 1, column 0.

And if you need to save an array as the data, you can make a cluster of numbers, then make an array of clusters.


0 Kudos
Message 3 of 6
(2,921 Views)

Hi,

Thanks for the reply.

Could you please show me how to do and use an "Type-Def. enums"?

I tried to find an example, But! I did not succeed.

Note: The solution to my problem would be to use the Type-Def enums as you wrote before.

Thanks again for the help!!!

As.

0 Kudos
Message 4 of 6
(2,877 Views)
Jorge, thanks for your feedback. The .vi you sent helped.
 
Steven, I will wait for your feedback.
 
Thanks!
 
As.
 
 
0 Kudos
Message 5 of 6
(2,875 Views)
A type-def. is just a custom control. From most LabView windows select File > New >  Then select custom custom control, under Other Files (in 8.5) Put an Enum on the Front panel, edit the entries to what you want, make sure "Type-Def" is selected from the drop down menu on the toolbar and save the file as a .ctl. You can then place the custom Enum as a control, constant or display in other VI's by selecting "Select a VI" or "Select a Control" from the functions palette, then navigating to your custom control.

Hope this helps.

0 Kudos
Message 6 of 6
(2,863 Views)