LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to find size of bundle?


hi all,
i am making a vi in which the input is a bundle containing unknown number of elements (string and double 1d and 2d arrays), i want to unbundle it and then write in matfile format, i need to know how many elements and the type of each element and then i can write them using a for loop and writing for each element.
please give me suggestion how to do it and if somebody has any example please attach.

thank you


0 Kudos
Message 1 of 11
(4,090 Views)
You can create an indicator for the cluster, create a property node for the indicator, select Controls[] and that will be a 1D array. Use the Array Size to tell you the size of the array. You can always hide the cluster indicator.
PaulG.
Retired
0 Kudos
Message 2 of 11
(4,081 Views)
hi
not sure i get u completely(new to labview)
also i have labview v8.0, if possible attach vi made in v8.0 or attach a jpg
thanks for responding


0 Kudos
Message 3 of 11
(4,073 Views)

hi
can u also tell me how to find out the  type of every element in bundle that is whether it is a 1d or 2d array of string or double
thanks a lot


0 Kudos
Message 4 of 11
(4,066 Views)
Hi,
 
I'm not sure if you already have the cluster made or not... but an easy way to find and display what is inside, is to right click the cluster icon on the back panel > create > indicator.  This will automatically configure the indicator so that it dispalys everything correctly.
 
Also if you need to see the elements individually, use the unbundle command.  Again to create indicators for each element of the unbundle, you can right click > create > indicator, like I have shown in the attached image.  This image demonstrates how to create an numeric indicator off of the array size module.
 
Hope that helps.
0 Kudos
Message 5 of 11
(4,061 Views)
hi,
as I want to write elements of the bundle in matfile - i have different vi for writing an array of string and double numbers-
if I unbundle i get all the elements of the bundle
i want to know how can i take the elements of the bundle one by one and determine their type and then send them to the corresponding vi?
if i can access then one by one in a loop and can determine their type then i can use a event structure to send each element to differnt vi
so i just need to know how to access one by one and find their type
i now have labview 8.2
thanks a lot for the help

0 Kudos
Message 6 of 11
(4,032 Views)
Okay I see what you mean now.  Well if all the clusters are the same (same order/configuration).  Then you might be able to use a cluster to array function, which will send all of your cluster elements into an array.  Then use a for loop to index each element of the cluster, which can be followed by a case statement, to access for the corresponding index, which will allow you to execute the appropriate action.
0 Kudos
Message 7 of 11
(4,029 Views)
Have a look at the image.  If I understand you correctly, then I think it should do what you're looking for.

If you need help with the code, let us know!




Message Edited by Will.D on 10-18-2006 01:35 PM

0 Kudos
Message 8 of 11
(4,021 Views)
hi Will,
i think your solution will work, can u please send me the vi
thanks a lot
bye

0 Kudos
Message 9 of 11
(4,015 Views)
Here it is in 8.2
0 Kudos
Message 10 of 11
(4,009 Views)