12-29-2014 03:54 PM
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
12-29-2014 04:04 PM
@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.
12-29-2014 04:11 PM - edited 12-29-2014 04:13 PM
@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
12-29-2014 04:22 PM
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.
12-29-2014 04:31 PM
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
12-29-2014 04:41 PM - edited 12-29-2014 04:45 PM
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.
12-29-2014 05:16 PM - edited 12-29-2014 05:22 PM
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.)
12-29-2014 05:41 PM
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)
12-29-2014 05:49 PM
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.
12-29-2014 05:50 PM
Hi BTC, I am on 2011 version, so cannot open your Vi. Not sure why my Labview is spitting out 2014 version