LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to increment array that contains two clusters whose visibility is controlled by a visible property node and selected by a radio button.

I am trying to use a property node: visible in order to enable or disable one of two clusters. These clusters are in a larger cluster and this larger cluster is in an array. The two clusters are controlled by a radio button (one labeled transistor and the other diode). When diode is selected, the corresponding diode parameters cluster should be visible and when transistor is selected, the corresponding transistor parameters cluster should be visible. In the mean time, the cluster of the device that is not selected should not be visible. There are at least 45 elements in the array (but not more than 45). Data is entered into each cluster (diode or transistor data) for each element in the array via the increment/decrement. The problem is when you select the first radio button (transistor) and enter data, when you increment the array for a new device selection, since a visible property node was used on the cluster, a loop is created where a new cluster is trying to be shown, but the old cluster is also trying to be shown (because it is the one referenced by the property node. How do I get rid of this loop and still be able to increment the array and keep my data intact for future use? Attached is the vi
0 Kudos
Message 1 of 14
(4,233 Views)

You could try something like this.  However, if you know how to use an xcontrol, that would be a better way to implement the above functionality so that these UI characteristics are not a part of your main VI.  The problem with the above VI is that you're looping every 100 ms just to update your UI.

Also, try using the "disabled" property node, instead of the "visible" one.  That way, the user will still see the options he has but they will be grayed out.

Message Edited by Sudhir Gopinath on 06-25-2007 04:45 PM

S G
Certified LabVIEW Architect, Certified TestStand Architect, Certified Professional Instructor
Message 2 of 14
(4,224 Views)
I really appreciate the help on this. I would like to make this as trivial as possible for the user. What is an xcontrol and how do you use it?
0 Kudos
Message 3 of 14
(4,213 Views)
An XControl is basically a custom control that you create and that will have the behaviors that you program into it.  If you create an XControl with the above behavior, then you will basically drop an XControl instead of a control into any block diagram, and it will enable and disable the clusters as required without you adding any code.  In fact, it will behave as required even when your VI is in edit mode.
 
Here's an intro to XControls:
 
I'd recommend XControls only to people who already have experience using event structures.
 
S G
Certified LabVIEW Architect, Certified TestStand Architect, Certified Professional Instructor
0 Kudos
Message 4 of 14
(4,204 Views)

Actually, I looked at my code again and realized that the timeout event structure was a relic from something else I was trying with your code.  Putting a timeout inside that while loop is not necessary at all.

Take a look at the VI I've attached now.  It is simpler and does the same thing.

S G
Certified LabVIEW Architect, Certified TestStand Architect, Certified Professional Instructor
0 Kudos
Message 5 of 14
(4,201 Views)
I tried to get the disable function to work, but how do you do a not for the disable. Take a look at the attached code.  I am not sure how to do a "not" for the one that is not suppose to be disabled. Without this it didn't seem to work.
0 Kudos
Message 6 of 14
(4,197 Views)
The disabled property is a number and not a boolean which is why you could not "NOT" it.  Place your cursor over the "disabled" property node, and you will see a description of the property in the context help window (CTRL-H).  Passing in a 0 will enable it, passing in a 2 will disable and gray it.  1 will disable it without graying it out (this is a state I rarely use.)
 
Take a look at my attached VI.

Message Edited by Sudhir Gopinath on 06-25-2007 05:58 PM

S G
Certified LabVIEW Architect, Certified TestStand Architect, Certified Professional Instructor
0 Kudos
Message 7 of 14
(4,192 Views)
Why do you not place the disabled functions inside the case structure? Also, I originally wanted to perform the disable and enable on a tab control with a cluster in two tabs, instead of a cluster alone. Is this possible? In addition, is there a way to always make at least one of the items selected? Right now when you run the program, in order to select the transistor radio button, you first have to select the diode radio button and then the transistor radio button is available. Thanks for the help. I'm a newbie at labview and I'm trying to figure out the does and don'ts and the cans and can'ts.

Message Edited by rlg50 on 06-26-2007 08:57 AM

0 Kudos
Message 8 of 14
(4,171 Views)
I am also trying to figure out the best way to not allow the user to have data in both a diode and a transistor cluster. If you can give me a tip on this I will try it and post what I accomplished. Thanks.
0 Kudos
Message 9 of 14
(4,164 Views)

I place the disable outside the case structure to reduce the size of the code.

You cannot spread a single cluster across 2 tabs.  You could have 2 tabs with a cluster each.  Or a cluster that contains a tab.

I am not sure why you have to select the diode mode, and then the transistor mode.  I noticed the same thing too.

S G
Certified LabVIEW Architect, Certified TestStand Architect, Certified Professional Instructor
0 Kudos
Message 10 of 14
(4,159 Views)