LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I initialize an array of clusters to known values?

Hi,

I'm trying to initialize an array of clusters (mixed data types) to known values at the start of my sub vi.

I'm using LabViews built in InitilizeArray sub vi. When I've used this routine to initialize a simple array of only one data type, say numerics then I can create a constant for the element value and wire this as an input along with a dimension size and then wire the output to my array and this works fine.

But when I try to do the same thing with an array of clusters I first of all wire the output of the InitializeArray vi to the array of clusters and right click on the element input of the initialize array vi to create a constant but it doesn't create a constant of the write data type (it creates just a numeric constant).

So instead I right click on the array itself and choose create constant, set the values to what I want and then try to wire this to the input of InitializeArray vi but I still get the broken wires as though I'm doing something wrong.
- see frame0 of the attached vi.

What am I doing wrong, how should an array of clusters be initialized?

Thanks,
Dave.
0 Kudos
Message 1 of 6
(2,839 Views)
I coudn't fully see your vi because their where a few missing vi's but i think this will solve your problem.

Instead of initialising a cluster array, i think its easy'r to create a shift register and create a constant at the input.
Further more i deleted your sequence structure and replaced the 'replace array subset' into 'insert into array'.
Also i replaced the local variable 'ResultsArray_Output' which you where using with index array, by a constant array cluster

Message Edited by Tristan on 04-26-2005 12:41 PM

0 Kudos
Message 2 of 6
(2,833 Views)
sorry i forgot to attach the picture i took.
0 Kudos
Message 3 of 6
(2,828 Views)
Hello,

Instead of extracting the first zero element from the vid array, you should take that out and connect it allone.
0 Kudos
Message 4 of 6
(2,819 Views)
Yes that's correct i forgot to remove that.
0 Kudos
Message 5 of 6
(2,817 Views)
I think that the problem is that the array has no element ... so when it extracts the first element colapsed ... if you also add one element into your constat array it also would work ...
0 Kudos
Message 6 of 6
(2,812 Views)