01-25-2016 02:42 PM
Is there any way to reduce the ammount of clutter on my Block Diagram when needing to Enable and Disable controls while tests are running? I know that I can place the case statement in a SubVI, but am looking for the best recommended method for reducing the clutter by listing all of the references. Using LabVIEW 2015.
Below is a small example of what I am talking about, there will be only more references to add as the VI devlops.
Thanks,
Kellen
Solved! Go to Solution.
01-25-2016 02:48 PM
You can programmatically generate an array of references to controls/indicators on the front panel if you'd like and filter through them in some way. This is a lot of back-end work though just to save some block diagram room.
The easiest way is just to use clusters on your front panel as much as possible. You can easily cluster your panel in a smart way so that you can disable sections of controls with ease.
Cheers
--------, Unofficial Forum Rules and Guidelines ,--------
'--- >The shortest distance between two nodes is a straight wire> ---'
01-25-2016 02:48 PM
Here are are couple of VIs I wrote (last saved in 2014) to get a reference to every control and indicator in a VI. If needed, you could add more filtering by using the Label property and comparing it to an inclusion or exclusion list.
01-25-2016 03:35 PM
When you say that I can clustor FP items, say that I did, and that I have a group of controls such as the ones below in a clustor. I still have to generate reference constants, that are then placed into clustors. And if I want to disable them I would then have to bundle each reference into the clustor, and then unbundle and disable each control individually. I am betting that I am really missing the point here and would love further explanation.
Thanks,
Kellen
My main problem is not being able to place actual refrences in a Clustor.
01-25-2016 03:43 PM - edited 01-25-2016 03:45 PM
@rkmadse wrote:
When you say that I can clustor FP items, say that I did, and that I have a group of controls such as the ones below in a clustor. I still have to generate reference constants, that are then placed into clustors. And if I want to disable them I would then have to bundle each reference into the clustor, and then unbundle and disable each control individually. I am betting that I am really missing the point here and would love further explanation.
Thanks,
Kellen
My main problem is not being able to place actual refrences in a Clustor.
You're thinking about the carriage, when I'm talking about the horse. Your front panel items can be in a cluster and then you can use the cluster's reference to disable the whole thing. See:
You will get a slightly different looking front panel between the two options if you use Disabled and Grayed Out because when you gray out the whole cluster, the edges gray. When you gray out single items in the cluster, the edges of the cluster remain normal.
Cheers
--------, Unofficial Forum Rules and Guidelines ,--------
'--- >The shortest distance between two nodes is a straight wire> ---'
01-25-2016 03:44 PM - edited 01-25-2016 03:47 PM
I basically store my control references in a cluster and when I need to disable/enable them, I unbundle the references I need and build them into an array. Then I pass the array to a subVI that does the enabling / disabling.
There are some other suggestions here:
01-25-2016 03:45 PM
If I have a lot of controls I put them into a cluster. Then I just wire the cluster into the SubVI such as "Enable during test" "Enable during setup" and so on. The cluster will have to start with constants, which you fill in with the actual references at the initialization of your program.