LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

soft buttons

I would like to mimic soft buttons found in oscilloscopes and other such instruments wherein you press a button and a few options come up on the inside of the oscilloscope screen. you press the button alongside the option and the relevant code executes.
Any ideas on how to do it in LV 6i?
regards,
ananth
0 Kudos
Message 1 of 8
(3,361 Views)
I would use a while loop with a shift register (initialized as a string). Inside that a case statement to build a state machine (shift register connected to selector in case). I use a VI that returns the name of which button was pressed on the panel. Using this, I can choose what the button does based on what "state" the program is in (in the case statement). Some buttons will just choose what the next state is (by feeding the name out to the shift register), and some buttons can perform actions.

I hope that that is not too confusing. I built a real quick and dirty example. All it does is change from state to state, but the buttons could do something if you wanted. Just run the "Soft Buttons" Vi from the library.

Rob
0 Kudos
Message 2 of 8
(3,361 Views)
hi rob.. thanks for the answer... but the code you put here does not run. There is some problem with the VIs in the library. need help on them.They are not being found by the main vi ( soft buttons.vi)
any help is a blessing.
thanks
ananth( for balaji)
0 Kudos
Message 3 of 8
(3,361 Views)
Very strange. What VI isn't being found? I downloaded this .LLB from here onto another machine that doesn't have all of the VIs and had no problem at all. Do you have to manually tell LabVIEW where to find the VIs?

Rob
0 Kudos
Message 4 of 8
(3,361 Views)
Rob,

I can't open it either. I says that it can't find Get Boolean.vi. Even if you point to the correct file it won't work. I even tried opening Get Boolean.vi by itself and a window came up saying that it couldn't find Get Boolean.vi, strange huh?

What version of LV was it written in?

Brian
0 Kudos
Message 5 of 8
(3,361 Views)
very true.. exactly what happened with me. I have LV 6i I think the version is 6.0 not 6.0.2.. BTW did anybody update to 6.0.2 and have problems? I did and many function palettes were empty.
thanks in advance
regards,
ananth( for balaji )
0 Kudos
Message 6 of 8
(3,361 Views)
Interesting. I will try to recreate it. I am using LabVIEW 6.0.2. I just loaded the VI and used the Save As to see where it was picking up the VIs from. 2 of them came from my "standard" libraries. I wonder how many other libraries I've created for projects are that messed up. I create the development distribution libraries to keep all of the used VIs together for each project.

Anyway, I have manually recreated the library and checked the locations when loading and here is the new Soft Buttons library. Again, it's not very sophisticated, but it sort of does the trick. Hope this works.

Rob
0 Kudos
Message 7 of 8
(3,361 Views)
The VI works now, except that Check Buttons.vi crashes LabVIEW on my machine every time I try to close it...

Brian
0 Kudos
Message 8 of 8
(3,361 Views)