LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Update Indicator from SubVi in Main Vi

I tried the above, but it doesn't work. Can someone please show me what am I doing wrong? I have attached the Vis. Cheers

Download All
0 Kudos
Message 11 of 24
(4,461 Views)

@Oligarlicky wrote:

As it's shown above, the feedback node gets reinitialized every time you click the white run arrow. Try deleting the constant false and it should change to be globally initialized.


He wants his output toggled while the VI is running, rather than through stop/run of his VI, deleting initialization constant won't serve the purpose.

 

 

 

--------------------------------------------------------

New Controls & Indicators made using vector graphics & animations? Click below for Pebbles UI


0 Kudos
Message 12 of 24
(4,456 Views)

@lsbu wrote:

I tried the above, but it doesn't work. Can someone please show me what am I doing wrong? I have attached the Vis. Cheers



You have made this way too complicated than it needs to be... Do you need to have so many separate boolean controls? Can't use an Array of Boolean? Your entire functionality can be done using a small block-diagram.

 

You forgot to attach your D_TRAILER.vi.

 

-BTC

--------------------------------------------------------

New Controls & Indicators made using vector graphics & animations? Click below for Pebbles UI


0 Kudos
Message 13 of 24
(4,451 Views)

The Main (Actual.vi) will keep running, the sub vi will keep running or not, I am not sure, I guess it won't keep running as it only runs when called, I have not put any while or any other loop there. I also get the numeric indicator updated in the main vi, so I am assuming the sub vi stops running once called and it outputs the data. All what is left is to get an led toggled in the main vi.

 

What I am trying to do:

In my final program, I will have 16 buttons belonging to one set. I will have 8 sets of these. Every set will toggle its led and output a number. An event will be created in the main vi, based on which led is toggled, it will do something.

0 Kudos
Message 14 of 24
(4,443 Views)

Please ignore the D_Trailer, I just want to handle one button and then will replicate the concept. D_Trailer is suppose to be essentially the same as A_Trailer. I have attached a cleaned up Vi this time. Cheers

Download All
0 Kudos
Message 15 of 24
(4,438 Views)

When I press one of the buttons on A_Trailer or if I press E on actual, it toggles "Pressed" on both actual and on A_Trailer. Is that not what you want? Try it a few cycles.

0 Kudos
Message 16 of 24
(4,432 Views)

Its much faster for me to show it in a new VI, I have it attached.  Please go through LabVIEW tutorials and relevant help topics as these are very basic items, if you didn't understand something then you'd truly have to first learn a little bit of LabVIEW development.

 

Pretty much you'd just duplicate Array Value change case (again, you'd have to use LabVIEW help to figure that out, or you could take LabVIEW classes from NI) and update functionality according to how you want.  (Instead of toggling "Pressed" LED, you actually want to have it ON if any of the button is pressed and OFF otherwise, which is what VI I attached does).

 

Good luck.

-BTC

(Not sure what LabVIEW version you're using, zip file has one in 2012 and the other in 2014.)

 

Actual.png

--------------------------------------------------------

New Controls & Indicators made using vector graphics & animations? Click below for Pebbles UI


0 Kudos
Message 17 of 24
(4,414 Views)

Thanks a lot. I will go through it. I appreciate your time in doing this for me.

For now, my VI started working fine (as attached in my last post), but when I add A_Trailer and its copy as D_Trailer, the behaviour becomes erratic. It needs some unspecified time before button press to work as normal. (Only button E & Z work in Actual.vi) 

Download All
0 Kudos
Message 18 of 24
(4,406 Views)

Maybe try running through main with the highlight execution on. When you press something on A, the D subVI is still running and is going to hold up your while loop in the main. Maybe A and D should each have their own loops.

0 Kudos
Message 19 of 24
(4,397 Views)

Hi BTC, I am on 2011 version, so cannot open your Vi. Not sure why my Labview is spitting out 2014 version

0 Kudos
Message 20 of 24
(4,394 Views)