07-14-2009 09:26 PM
07-14-2009 09:34 PM
There is no way you can "create" individual controls or indicators on a front panel programmatically. (If you could, how would you instruct LabVIEW where to wire the data?) What you can do is create an array of knobs and an array of meters. Then you can programmatically define how many knobs and meters are active, and even how many show up at once on the front panel.
By using Index Array or Replace Array subset, you will be able to get or set the value of a particular element of the knob or meter arrays.
07-14-2009 09:50 PM
Hello Ravens,
Thanxs for your reply. Ravens can you pls say the procedure how to create an array of knobs and array of meters and programmatically to define how many knobs and meters are active. Because Iam finding difficulty to classify the channels in to Rx type and Tx type and assign a knob or meter to them.
Thank you,
Shanth.
07-14-2009 10:53 PM
See attached.
Since I don't have your Excel library VI's, I just turned what would have come out of Excel into an Array constant.
07-14-2009 11:38 PM
Raevns,
If i want to connect the o/p of the Rx channel's to Meter's in order to display its value where should i do this in the same way for knob if i want to set the knob at some point and connect it to channel how should i do this.
For example if we take the first row Voltage -> Tx a knob is assigned to this right. If i set this knob to some value of 24V the output should be connected to a channel. How should I assign the knob to my channel
And if we take Current ->Rx if Iam reading this as 10 amps how should i connect to the meter and specify that this particular meter is for current and the other one is for speed the next is for Air pressure.
Thank you,
Shanth.
07-15-2009 09:50 PM
07-15-2009 10:25 PM - edited 07-15-2009 10:28 PM
You are not going to be able to set different scales for each knob. That is because arrays consist of common elements where all properties are in common except for the value of the element. The Min/Max range is one of those properties.
There are some possibilities, but they require more complicated structures. One is to use a cluster. But the problem with a cluster is that you can't programmatically control how many elements you have in that cluster. Though you could predefine a cluster that has more than enough copies of controls then you think you'll need. Then you can set the properties of each element of the cluster individually including whether the element is shown or not. (You create a cluster of 10 knobs. But if you only need 5 in an instance, then you hide the other 5.)
You could create an array of clusters. Each cluster contains one instance of a knob. Then you could programmatically get to an element of the cluster array. Go into that cluster and set the properties of the knob which is an element of it. This is a much more complicated hierarchy. I don't have a good example of exactly how to do that. But if you search the forums, I think you'll find examples of where it has been done before.
When working with arrays, if you need to get the value of a particular element of the array, then you use the index array function. If you need to change the value of a particular element of an array (like an indicator meter) then use the Replace Array Subset function. Maintain the current status of the arrays from iteration to iteration of your while loops using shift registers.
07-15-2009 10:35 PM
Ravens,
Can you pls help me out with a code reading and writing the values to the knobs and meters.
Thank you,
Shanth.