LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

cluster into array

Hi, hope that you all can help.

Apparently I have Numeric control and String control and a OK button on the front panel. When the user click on the OK button, it will store the numeric and string value (a cluster) into 2D array. Then if the user click again on the OK button, it will append the second record (cluster of numeric and string) into the second index of the same 2D array. May I know how can I do that?

I know I need to create a cluster containing those 2 controls but how can I put those two values into an array?

Kindly post one simple example for me.. Thanks....
0 Kudos
Message 1 of 13
(4,365 Views)
Hi 222,

Are you sure you need a 2D array ?

Find a quick example attached with 1D array, if for your application you really need a 2D array, just right click the array indicator and constant (in the diagram) to add a dimension.

Hope this helps 😉

We have two ears and one mouth so that we can listen twice as much as we speak.

Epictetus

Antoine Chalons

0 Kudos
Message 2 of 13
(4,360 Views)
Thanks for the example. Ya, I really need 2D array as my thougth is to view the data (cluster of numeric and string) into table / multicolumn listbox. The system doesn't allow me to wire the cluster into a 2D array. Find the jpg file for example..
I think your example doesn't help me much here, but thanks though. Do you all have any idea on how to solve my problem here? Thanks
0 Kudos
Message 3 of 13
(4,355 Views)
yep... you have a broken wire because you a cluster is not an array.

if you want to add a cluster into an array, you first have to create a cluster (containing your numeric and your string or whatever you want) on the front panel then drag it into a empty array.

then on the diagram, when you want to add an element the array (in this case the cluster containing your numeric and your string is an element) you have use the "build array" function (see pisture).

If you want to display the "2D array" in a listbox, have a look at the new example 😉

Hope this will match your needs !

We have two ears and one mouth so that we can listen twice as much as we speak.

Epictetus

Antoine Chalons

Download All
Message 4 of 13
(4,351 Views)

I would suggest this:

Create a cluster on the frontpanel. Each time the add-button is pressed, convert all data from the cluster to strings and build an array. This array can be appended to a 2D-array, as a table needs a 2D string array and nothing else.

You can't wire a 2D array of clusters to a table.

Thomas

Using LV8.0
--------------------------------------------------------------------
Don't be afraid to rate a good answer... 😉
--------------------------------------------------------------------
Message 5 of 13
(4,340 Views)
This is exactly what the second example (add to listbox.vi) does.

😉

We have two ears and one mouth so that we can listen twice as much as we speak.

Epictetus

Antoine Chalons

0 Kudos
Message 6 of 13
(4,340 Views)
If so, well done..
 
I just had a brief look at the png-file.
Using LV8.0
--------------------------------------------------------------------
Don't be afraid to rate a good answer... 😉
--------------------------------------------------------------------
0 Kudos
Message 7 of 13
(4,336 Views)
Hi,
No worries Thomas ;), "les grands esprits se rencontrent" :D. the png file was just to demonstrate how works the "build array" function ; in reply of 222's picture (direct link cluster to array => broken wire)

I see you're moving from LV7 to LV8.. In my companywe are about to start migrating, is it painfull or quite smooth ?
Do you know if there are any threads about the migration on NiZone or other LabVIEW forums ?

We have two ears and one mouth so that we can listen twice as much as we speak.

Epictetus

Antoine Chalons

0 Kudos
Message 8 of 13
(4,333 Views)

Well up to know I just changed one testrig, but without any problems, I'd almost say in opposite - the new Install builder is a great tool as you can read in
this thread I started:

http://forums.ni.com/ni/board/message?board.id=170&message.id=164285&view=by_date_ascending&page=1

I also found some new features very useful (Splitter, Radio-Buttons). The only thing I'm not yet used to is the new structure of the palettes (or I'm to silly to change it ;)).
 
I also took some libraries I've made over to LV8.0, which led me to code some improvements.
 
So all told I think LV8.0 is much better and I hope the other testrigs are also that easy to migrate. Unfortunately I don't know about any other thread on migrating from LV7.x to LV8.0.
 
Thomas
Using LV8.0
--------------------------------------------------------------------
Don't be afraid to rate a good answer... 😉
--------------------------------------------------------------------
Message 9 of 13
(4,327 Views)
thanks for your kindness..... ya this really help me ...
0 Kudos
Message 10 of 13
(4,302 Views)