LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

show indicator from subvi

Hello
 
I am very new in programming with labview. I have a problem showing property of a boolean indicator of a Subvi in a mainvi. The Subvi contains a while loop where the property of the indicater is set.
I have attached the two files in Labview-version 8.0.
The problem is that the property of the indicator of the main vi only changes at the seconed time. The reason for the problem is clear. The property of the indicator is set only once in the beginning and not continuous. Can somebody complete the attached vi´s with the necessary functions so that I can comprehend it. May be I can solve the problem with a global variable or a reference. I tryed a lot but my skills in programming are not so gut.
 
Thank you for your help
Download All
0 Kudos
Message 1 of 6
(3,205 Views)
I'm not entirely sure if I've got the right end of the stick with this, but I've attached a couple of VI's that might help, and just really tidy up what you've already done, but whether they solve your problem or not is another thing.
 
David Clark
CLA | CTA
Genesee Technologies Ltd
Hampshire, England
Download All
0 Kudos
Message 2 of 6
(3,182 Views)
You have to make a global variable in the subvi and wire that to the boolean.now copy that global variable

In the main Vi paste the the global variable in a while loop so that it gets refreshed and gets the latest data.
0 Kudos
Message 3 of 6
(3,172 Views)

No need for a global variable and a global by itself would not work anyway. You just have to understand data flow. Your code that checks the value of the numeric only runs once. At the same time that this code runs, the subVI starts and changes the value of the numeric but the comparison is already done and will not repeat until you stop the VI and run it again. If you put a while loop around the comparison code, your alarm indicator will be updated as soon as the subVI executes.

Message Edited by Dennis Knutson on 08-09-2007 01:39 PM

0 Kudos
Message 4 of 6
(3,156 Views)

Thank you all for your replies

@davidpcl : The VI´s you gave to me could help me a lot. But by using these vi´s one other problem was generated.

I want to open thes SubVi several times by the MainVi. The problem ist the correct parameterization of especially the stop-button. With the parameterization you gave me I could not use it several times in the MainVi.

Can somebody give me a help?

I attached the two new fiels.

Download All
0 Kudos
Message 5 of 6
(3,126 Views)
I'm still not entirely sure what you're trying to achieve - you may need to expand a bit, but realised straight away that the problem you were having calling the VI twice was because you hadn't un-registered the events. I've also added a reinitialize to default for the stop button.
 
Hope that helps in some way,
David Clark
CLA | CTA
Genesee Technologies Ltd
Hampshire, England
0 Kudos
Message 6 of 6
(3,115 Views)