03-25-2010 03:33 PM
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...
03-25-2010 03:41 PM - edited 03-25-2010 03:51 PM
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
03-25-2010 03:53 PM
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...
03-25-2010 03:55 PM
03-25-2010 04:09 PM
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.