LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Automatically changing size of an array

I am trying to make a simple interface for a three phase watt meter that others can use for data logging.

 

It needs to be flexible as possible so users can choose what measurements are taken and in what order.

 

I have two arrays of controls, one for function and one for element.

 

These will be feeding a for loop that contains the vi to get each individual measurement from the meter.

 

Is there a way to make sure these arrays contain the same number of active elements?

 

Better yet how can I make it so each time someone adds a function the corresponding "element" element of the "element" array becomes active.

 

I am also open to better ways of doing this...

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 1 of 5
(3,139 Views)

Your block diagram only contains a pair of controls.  No code.

 

Was that the VI you meant to attach?

 

I would make an array of typedef'd clusters.  The cluster would contain your function and your element.  Both of those would also be typedefs.  See attached.  Take the "element and function" typedef and put it into an array.  That will guarantee that you have the same number of active elements for both.

 

d

Message Edited by DianeS on 03-25-2010 03:51 PM
Download All
Message 2 of 5
(3,136 Views)

DianeS wrote:

Your block diagram only contains a pair of controls.  No code.

 

Was that the VI you meant to attach?


 

I did not attach the sub vi because it is instrument specific.

 

Unless you have a Yokogawa WT230 it's not going to do you much good.

 

But here you go...

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 3 of 5
(3,129 Views)
Give my suggestion a try, it should do exactly what you want based on what I saw in your code.  Wire the array of clusters to your loop and auto-index, the way you do now.  Inside the loop, use the "unbundle by name" function to access the function and element.
0 Kudos
Message 4 of 5
(3,127 Views)

DianeS wrote:
Give my suggestion a try, it should do exactly what you want based on what I saw in your code.  Wire the array of clusters to your loop and auto-index, the way you do now.  Inside the loop, use the "unbundle by name" function to access the function and element.

Thanks, I think that is going to work.

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 5 of 5
(3,121 Views)