02-18-2009 04:12 PM
All--
I have spent the last 2+ hours looking at examples and forum posts and can't find what I need. I have a sub vi that gets a number. Based on the number the subvi enters one of 3 cases. The output of the sub vi is an indicator light and a numeric value. Each case has property nodes that change the caption above the numeric indicator and the color of the led indicator. The sub vi works correctly. How do I get the indicators on the main vi front panel to change when the sub vi indicators change. Please be specific. Don't tell me to create a reference and pass the data to the front panel indicator because that doesn't make any sense to me. This is the first time I trying to use references and right now I'm just not getting it. Thanks in advance for the help.
ssmith
Solved! Go to Solution.
02-18-2009 04:56 PM
ssmith490D wrote:All--
I have spent the last 2+ hours looking at examples and forum posts and can't find what I need. I have a sub vi that gets a number. Based on the number the subvi enters one of 3 cases. The output of the sub vi is an indicator light and a numeric value. Each case has property nodes that change the caption above the numeric indicator and the color of the led indicator. The sub vi works correctly. How do I get the indicators on the main vi front panel to change when the sub vi indicators change. Please be specific. Don't tell me to create a reference and pass the data to the front panel indicator because that doesn't make any sense to me. This is the first time I trying to use references and right now I'm just not getting it. Thanks in advance for the help.
ssmith
Well I am afraid to do what you want you will have to use references and property nodes to accomplish it. I have attached two VI's (LV 8.6) they should help you out. have a look at them and if you have any more questions then please let me know
02-18-2009 06:21 PM
The thing to remember is that a control reference is like a handle that allows you to interact with a control. Every control has properties that you access through a property node. When you wire the reference to the property node, the node reconfigures itself to give you access the properties that are associated with that specific control. One of the properties that you can set or read is the Value property. There are others that can do things like change the color of the text in string controls or modify the strings that appear in a listbox. With a reference you can also invoke methods that can do things like get an image of the control.
So... you need to create a reference and pass the data to the front panel indicator. (Sorry, I couldn't resist).To do this, right click on the indicator on the main VI and from the popup menu select Create>Reference. Pass this reference to the subVI as you would any other piece of data. Inside the subVI, where you want to change the indicator's value, wire the reference to a property node, now right click on the property node and select Select Property>Value. Finally wire to the property the value that you want to appear in the indicator.
Mike...
02-18-2009 07:41 PM
Hmmm... have you considered creating a reference and passing it the subvi?
(I couldn't resist either).
In all seriousness, it isn't that hard. Just remember to use a property node with the property set to value. I use this frequently with VI's that have lots of indicators where the updates happen way down in a subVI.
02-19-2009 08:08 AM
Thank you all for the comic relief. LOL. I didn't mean that I didn't want to use a reference, because I know that I do. I just don't know how. I'll try Mike's instructions and let you know how I make out, or follow with more questions. Thanks a lot!!
ssmith
02-19-2009 09:13 AM
I've created the reference as you said, NP. Does the front panel indicators have to be wire now?? I have attached a jpeg that shows the section of the main VI and the subvi called Wind Alert. Open the sub vi and you'll see that the property nodes don't have a terminal for the reference wire from the indicator reference. How do I fix that? Thanks.
ssmith
02-19-2009 09:24 AM
You don't have a reference control in the subVI. A simple way is from the block diagram of the main VI, drag the reference to the front panel of the subVI. Then you can go to the block diagram of the subVI and right click on the reference and select Create>Property - whatever.
Don't forget to wire the reference control of the subVI to the connector pane so that you can wire the main's reference to the subVI.
02-19-2009 09:59 AM
Let me get this straight. So the property nodes inside the sub vi I posted have to be created from the reference(from the main vi FP indicators) not the indicators in the sub vi, which is what I've done. Is that right??
ssmith
02-19-2009 10:06 AM
02-19-2009 10:07 AM - edited 02-19-2009 10:12 AM
Yes that is correct. Since I see now that you could not open my VI's (you could have posted your LV version) her are some pics of the front panel and the block diagram.