LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Clustering a bunch of inputs...sensibly.

Solved!
Go to solution

Hi All,

 

I've written in VI to run a lot of set-points for two instruments (a temperature controller and an electromagnet) running concimitantly. The steps of each program need to be fairly precise. I've managed to do it but I cannot help but feel like there must be a better way...because what I've done seems ridiculous. I've included two images; one of the front pannel and one of the block diagram. Any suggestions?

 

Thanks,

LV-2017
Download All
0 Kudos
Message 1 of 4
(2,256 Views)

@Potticary wrote:

Any suggestions?


Yes, embed (don't attach) the image if you must post an image (a VI is better):

2

 

Usually, you'd try to:

 

a) use an array in some way to organize the values. Or

b) use VI server to get the values by control reference and label.

 

And then use for loops to automate things.

 

You're quite right that your current solution is not desirable.

 

 

Message 2 of 4
(2,238 Views)
Solution
Accepted by topic author Potticary

I'd suggest an array of clusters. Each element could have Setpoint, Time, and Current. I'd make that into a typedef, then make an array of that type. Then you can handle an arbitrary number of setpoints. I wouldn't use a 2D array for this, though it would definitely work. Using a 1-D array with named sub-elements is much, much easier to handle than a 2D array, as with the 2D array you have to manually index everything with "magic numbers".

 

clustersfp.png      clusters.png

 

Edit: I just realized the naming could be a little confusing, "Setpoint" is the name of the control on the front panel, which  I probably could've named better. It's also the name of one element within the cluster. Sorry for potential confusion.

0 Kudos
Message 3 of 4
(2,193 Views)

Wonderful, worked beautifully.

LV-2017
0 Kudos
Message 4 of 4
(2,148 Views)