LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

closing references YES or NO

Hi all
 
My program contains a cluster with 120 controls (string, Boolean and number). Is it too much?
 
I need visibility or invisibly all controls during the program sometimes. In attachment is a simple example how it is work.
Is using block "close reference" better for LabView? Is my solution fastest or exist any better solution?
 
Is situation different with VISA sessions? Is possible to don't using block "VISA close"?
 
... LabView 7.0
Ivanek#
0 Kudos
Message 1 of 7
(3,071 Views)

As you can see, 120 is not too much for LV to handle, but it isn't a convenient structure. One suggestion would be to take the four elements, place them in a cluster and place that cluster in an array. That way you can have 2 1D arrays or 1 2D array. Then, if you want to make all invisible, you can simply make the array invisible. This will take up less space, be easier to handle and will be faster.

You don't need to close the references unless you explicitly open them. They will be closed when the top level VI will be closed. You can also see that when you close them it doubles the time it takes the VI to run.

For VISA, you should definitely use VISA Close, but only when you finish communicating with the instrument. You don't need to do it in every loop.

___________________
Try to take over the world!
Message 2 of 7
(3,063 Views)
Thanks for advice.
 
I tried it. Its working fine, but I forgot remember one thing. For example I need make visible 10 clusters and the rest must be invisible.
 
When I used "initialize array" its ok, but the rest of first array (5 elements) is grayed and I need make it invisible.
 
How to do it? I mean is any proper for changing size of array (initialized and grayed 10+5 elements).
 
Ivanek#
0 Kudos
Message 3 of 7
(3,035 Views)
You can use the Number or Rows property for the array to determine how many rows will be visible.

___________________
Try to take over the world!
0 Kudos
Message 4 of 7
(3,030 Views)

Your situation looks highly regular, you are taking all the controls in the cluster not leaving out any at all.

Does it come out much faster setting the visibility in batches like you have done rather than the simplistic approach of running the control references into a for loop as many times as you have elements?

I have had mixed success using a large boolean indicator which is Transparent when True and the background color when False. It seems to be quite quick and you can play with setting the Z-Order of the controls at edit time to leave some visible and others not when the boolean is background color. Use the Square boolean from the Classic Controls sub panel.

0 Kudos
Message 5 of 7
(3,024 Views)
Thanks tst
 
Of course. This is the easiest 🙂 I totally forgot that property 🙂
 
Ivanek#
0 Kudos
Message 6 of 7
(3,014 Views)
Hi jbrohan
 
I don't understand. What do You mean "Z-Order". Have You any example?
 
Ivanek#
0 Kudos
Message 7 of 7
(3,010 Views)