LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

If true condition for a button in labview

No, I want the resistance be control. So We enter the initial value , & the amount to increase each time the loop runs and loop runs for T period ( I haven't added this part). Here is my code so far

 

0 Kudos
Message 11 of 26
(1,364 Views)

Move the Resistance control outside the loop and wire it to the initiation for the shift register. Other than that I think you have the right idea. Clean up your wires - you can't see exactly where each wire leads and this can lead to subtle bugs. For example, looking at your code, in your false case check that what you are wiring to the output tunnel is correct. It looks like right now it is actually wired to Resistance To Add, which will make it reset to that number whenever the Up button is not on. I don't think that's what you want, though I'm not sure.

 

Also, why is the Up button a typedef? Did you do that on purpose because you are planning to customize it later? If not, you don't need it to be one.

Message 12 of 26
(1,354 Views)

For some reason my case structure never gets executed!

0 Kudos
Message 13 of 26
(1,351 Views)

Why do you think it's never being executed?

0 Kudos
Message 14 of 26
(1,349 Views)

When I run the program , resistance doesnt increase when I press the button.

0 Kudos
Message 15 of 26
(1,345 Views)

That's because you are not writing to the Resistance from within the loop. I see you added a new indicator called New Resistance. That's perfect, just move it to inside the loop if you want it to update before the loop finishes.

Message 16 of 26
(1,342 Views)

Also, just to note, it increases very quickly since there is no wait in the loop. I would recommend adding a wait to the loop and/or looking at what altenbach said earlier about latching booleans.

Message 17 of 26
(1,340 Views)

This is with new value inside the loop..still nothing..

0 Kudos
Message 18 of 26
(1,338 Views)

Sorry, I should have been more clear. You also need to wire it to where you want it to update from. So, use the wiring tool to click on the wire coming from the output tunnel of your case structure and into the output tunnel of the shift register. Wire this branched wire into your indicator.

Message 19 of 26
(1,334 Views)

Ahhh..I finally see something 🙂 One problem though..I want each time I push the button this iteration happens . Currently once the button is true it keeps adding until I turn off the button

0 Kudos
Message 20 of 26
(1,328 Views)