LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Scrolling via Boolean Control

Tbob -

I'm taking your advice on using that visible control to hide the popup windows....but when I go to that visible command it shows as a control not something I can send a false input into - see photo

Also, when trying to use the mechanical action of latch, its not letting me when I use local variables to initialize the button as you had in the previous example.




LV7.1, LV8.5, LV2014/15/16
0 Kudos
Message 31 of 38
(1,656 Views)

Right click on the property node and select Change All to Write.  The little black arrow on the right side will move to the left side, and you can send a value to it.

Labview does not allow local variables for latching switches.  Right click on the boolean control and select Mechanical Action - one of the non-latch types, like Switch when Pressed.  You will have to put code to make it False again once a user has clicked on it.  Create a local variable of the control.  Then you can wire a False constant to it.  If you look at my examples, you will see that I do this at the beginning of the code to reset the button.

- tbob

Inventor of the WORM Global
0 Kudos
Message 32 of 38
(1,643 Views)
Here is the code for that reverse popup (essentially just hiding)....well I can get the button to hide when I click it but not the whole front page...

Also I have to take the button out of the tab control - I guess to keep the button in there....first find the tab control, then the same code right after but looking for the individual button to modify?

Maybe you see the problem in here with the hiding?
LV7.1, LV8.5, LV2014/15/16
0 Kudos
Message 33 of 38
(1,631 Views)
You have nothing in your code to show/hide the front panel.  The Visible property node is only for the control.  You need to create a Front Panel property node for the subvi and write a True/False value to it to show/hide the front panel.  Look at my original example and look for the FP.Open property.  Add this to your code.
- tbob

Inventor of the WORM Global
0 Kudos
Message 34 of 38
(1,623 Views)
Tbob,

I've got about 60 indicators that will need to be updated on the main Vi as the subvi updates....some are text, some are just boolean etc.  Is there an easier/quicker way to do that than include 60 or so sections of  code like that?
LV7.1, LV8.5, LV2014/15/16
0 Kudos
Message 35 of 38
(1,618 Views)

Make an array of the 60 control/indicator labels.  Put the code to find the reference in a For Loop.  Wire the array of labels into the For Loop with indexing enabled.  This will make the For loop execute as many times as there are elements in the array.  Wire the reference found to the For Loop right edge with indexing enabled.  Now you will have an array of all references to your controls.  You can use Search Array to find the index number of a label in the label array, and use this index number to get the proper reference from the reference array for writing to a value node.  See picture.  Be sure to enable indexing only at places shown.

Message Edited by tbob on 10-17-2006 09:55 AM

- tbob

Inventor of the WORM Global
0 Kudos
Message 36 of 38
(1,616 Views)
Just to make sure -

Red Circle - What control is this?  I'm having trouble finding it.  I saw that it outputs a 1D array into the "Search 1D Array", every control I want to search for and update from the subvi, has to be listed in that vertical array listing (shown by numeric on top, stop on the bottom)

Blue Circle - Both "Stop" and "Numeric" are both controls on the subvi - specified by reference made before it....so all additional controls I'm searching for go into the while loop, while stop stays on the outside (and isn't really needed to run - the program shouldn't ever be shutdown).  If this is the case I have a series of those search 1D arrays, each with a different while loops?

Green Circle - Data type going into the function is a 0....what happens if the data type is boolean for a few buttons (status led's), a ring for another(test unit run in mode - low medium high etc), and a few text indicators for another (test unit serial number).


LV7.1, LV8.5, LV2014/15/16
0 Kudos
Message 37 of 38
(1,604 Views)

You really need to learn how to use the Help files to find answers on how these functions work.  I cannot take the time to continue to write your code for you, I have work to do also.  But I will answer your questions this time:

Read Circle:  This is an array constant, found on Array palette.  Drop an empty array on block diagram.  Then drop an empty string constant (found on String palette) into the Array constant (literally inside the box).  Expand the array by dragging the outermost handles (point to lower edge, you will see the handles).  Type in all your labels one at a time.  Read the help files on Arrays and Array Constants.

Blue Circle:  Whenever you need to reference a control/indicator, use the Search 1D array and wire in the label name.  They all can be placed anywhere you need to access the controls/indicators.  Notice the output is a numeric.  It is the index number of the position of this label inside the array of labels created in the red circle.  This index is always wired into the Index Array function so you can get the right reference (teal wire).  The reference always wires to a property node (value).  So for each subvi control/indicator you need to read or write to, you need a Search 1D Array, an Index Array, and a property node.  Read help files on Array functions and Property Nodes.

Green Circle:  This is a Variant to Data function.  Put in a variant (Value property nodes of References are always a variant because labview doesn't know what data type to expect).  Since you know what data type it is, wire a like data type into the top of this function.  It doesn't matter what the value is, just as long as the data type is the same as the control/indicator type.  For a boolean, wire in a True or False constant.  For a string, wire in an empty string, etc...  For an enum or a ring or such, create a constant where the actual control is located, cut and paste the constant to the top of the Variant to Data function.  Read help files on Variant functions.

In each of these cases, you can get answers from the help files.

 

- tbob

Inventor of the WORM Global
0 Kudos
Message 38 of 38
(1,596 Views)