LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Scrolling via Boolean Control

When you create a property node for an object, if you right click on the lower section, a list of properties will appear.  Just select the property you want to use.  Different objects will have a different list of properties.  For instance, a property node for a vi reference will have a list containing such items as Front Panel, Controls[ ] (the brackets means it is an array), and such.  Properties of a control include visible, value, label, etc...  Once you create the property node and select a property from the list, you can right click and select Help for xxx, where xxx is the property, to see a description of that property.
- tbob

Inventor of the WORM Global
Message 11 of 38
(1,590 Views)
I Tested out that program and it worked fine, but when changing the path of the vi, to a vi other than the 2 you included, why wouldn't they open?

"The Vi is not in a state compatible with this operation" was the error on the node connected to the changed path to the other sub Vi.
LV7.1, LV8.5, LV2014/15/16
0 Kudos
Message 12 of 38
(1,584 Views)
If I wanted to display that indicator in one of those sub vi's (The counter) inside the main program while either hidden or visible - how would I modify that?

I tried taking the subvi into the main (the little subvi in the top corner dragged down into main) - and connected a wire from the control into an indicator I made up in main - but it wouldn't run the program when I did that....


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

I can use any subvi I want, and I have no problem here.  Attach your code and maybe I can find something.  Zip the main and all subvi's. 

To display a subvi indicator, you can create a reference and a property node to get the indicator value and wire it to another indicator on your main.  Open vi reference, wire to Panel property node, wire that to All Objects [ ] property node, and search the array for a label that matches your indicator label.  Wire that to a control property node to get the value.  This is very similar to the way I write a value to a subvi control (boolean Stop button) in my example.

- tbob

Inventor of the WORM Global
Message 14 of 38
(1,563 Views)
Sorry, I gave you the wrong info.  Indicators are listed under the Controls[ ] property, not All Objects as I had mentioned.  Controls[ ] is a list of all controls and indicators on a front panel.  All Objects is a list of controls, indicators, and decorations.
 
Also, the error message you were getting could be due to the subvi's already running before starting the main.  Make sure the subvi's are not running in the background.
- tbob

Inventor of the WORM Global
Message 15 of 38
(1,561 Views)
I copied the picture in of your code, the 2 circled areas in blue I think are the parts confusing me.

The larger circle I assume is the one your talking about for making the indicator referenced to the other file.  Is that method making a custom button?  The application I will be using this for will be to use LED's from my subvi's that will be popping up to show the status of certain areas. (If test cycle complete a green indicator will show for that stand, if failed, red, etc.), Also I'll have to have a ring connected that is having its position incremented everytime a new setting is sent out to the test unit.

Also in regards to being able to pop up other vi's -  for some reason its working when I remove the 2 things that are circled in blue, and just use the code squared in green (including the whole loop with event structure), with the other parts in, I get an error....maybe its searching for that stop and not finding the indicator?
LV7.1, LV8.5, LV2014/15/16
0 Kudos
Message 16 of 38
(1,549 Views)
it gives me an error as well that might be because im on a mac tho
0 Kudos
Message 17 of 38
(1,530 Views)
First of all, you can see that I don't call the subvi's by putting their icons anywhere on the block diagram.  I call them by using a property node (the one with Wait until done in it).  I said this just in case you also have the subvi icon somewhere on the block diagram.  You should not call the same subvi using both methods.
 
To explain the blue circles:  The Panel node opens a property to the subvi front panel.  The Controls node gets all controls and indicators appearing on the subvi front panel.  Its output is an array of references to all the controls and indicators.  The loop looks at one reference at a time from the array, and gets its label.  Since the control I am interested in is labeled "stop", I compare the obtained label to "stop".  If there is a match, I pass this reference out of the loop and stop the loop.  The reference wire then goes to the area of the second blue circle, the Value node.  I can wire in a True or False (since the control is a boolean) to this node and the wired value will be sent to the subvi's stop control.  I do this so that when the main program stops, the True constant inside the main while loop gets passed to each subvi's stop button.  This causes each subvi to stop when the main stops.  If you don't do this, the two subvi's will keep on running even after the main is stopped.  If the subvi's are not being displayed, they remain running in memory, using up CPU resources, and you have no way to stop them except to kill their processes in task manager.  This is just the way I designed the examples.  You can design another method to stop the subvi's if you wish.
 
To cause a subvi LED to pop up, do like in my example below.  You can right click on the value property node and select Change All to Read.  Wire the value output to an indicator on your main front panel.  You can use a Visible property node for the main indicator to make it become visible or to hide it, thus making it appear to pop up.  Don't try to make the subvi's indicator pop up unless you want the entire subvi front panel to appear.  You can't make just one indicator of a subvi pop up, you must display the entire front panel.  Of course you could make the front panel hide everything except the indicator you want to show.  But is is better to just get the value from the subvi indicator and wire it to a main vi indicator.
 
I hope this clears things up.  Don't forget to add code to stop the subvi, as in my previous example (blue circles).
 

Message Edited by tbob on 10-12-2006 11:12 AM

- tbob

Inventor of the WORM Global
Message 18 of 38
(1,529 Views)
tbob - you have no idea how much help you've been thanks a bunch!

You know I don't want to keep abusing the whole generosity thing...but you know I'm playing around with my newer Vi - which uses that method to popup other programs and have 2 more probably easier questions for you....

1) Is it possible to specify which tab to go into if your subvi, is set up as a tabular control?  For example I have one station...runs 2 test units...both units have to be ran in the same Vi....so there's 4 tabs in that subvi, for 2 units...I'm wanting to popup the window for both units, but starting on different tabs when they pop up...sound possible?

2)  how would that program be modified so that the show/hide boolean button in your main vi, would also show up and be connected in a subvi.  This so you don't have to actually move the subvi window in order to hide it.  (The subvi's i'm using take up the whole screen and are really sluggish to move around with all that is going on inside them.)
LV7.1, LV8.5, LV2014/15/16
0 Kudos
Message 19 of 38
(1,517 Views)

1)  A tab is one of the controls that should be obtained with the Controls [ ] property node.  Check the tab's label in the subvi, assign it a label if there is none.  Use this label to get the reference to the tab.  Use a Value property node for the Tab control just like you would with a boolean control.  Write a 0 to the Value node for the first tab, 1 for the second tab.  I think the Tab control values are U32.  Send the tab selection before you open up the window.

2)  It would be best to include a hide button on the subvi front panel itself.  Create a Visible property node for the subvi in the subvi block diagram.   Use an event structure to send a False to the Visible node when the hide button is clicked.  The subvi front panel will disappear and the main, which was in the background, will re-appear.  You may have to make the mechanical action for the hide button to a Latch type so that it can revert back to its normal state automatically after being read.  Same for the show button in the main.  Otherwise you would click the show button, it would become true, and the subvi would be shown.  Then when the subvi was hidden again, the main would still be showing a true for the show button when it should be false.  Latch mechanical action will take care of this.

- tbob

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