05-31-2017 08:03 AM
Hello everyone,
I want to create a button that when I click one time, the number of a indicator will increase 1, I prefer to use the function FEEDBACK, and the vi should be able to run all the time.
Could someone give me an idea please?
Thank you!
Solved! Go to Solution.
05-31-2017 08:12 AM - edited 05-31-2017 08:15 AM
Use an event case for the button value change. Increment the value of the numeric indicator in that case, store it in a feedback node.
Place a while loop around the event structure. It will run forever. You might want to have a way to stop the execution
Is this homework?
05-31-2017 08:36 AM
Hello,
in order for your VI to work constantly,
You need a while loop.
Then you need an event structure, as a purpose of incrementing every time the button is pressed.
PS: add another event and place the Stop button inside of it, as a purpose to stop the loop.
Have fun programming in LabVIEW.
05-31-2017 08:42 AM
Hello Jeff,
Actually I am in a intership, I need to create a button with almost same effect which wil use to controle a stepper motor. Thank you so much for giving me ideals.
Thanks a lot!
05-31-2017 08:54 AM
Hello James,
Thank you for giving me idea, but I'm sorry that I maybe did't explain clearly my question. I want to create a button which I click one time and the number of a indicator will increase 1, then I re-click one time, the number increase 1. So I think that button is not the STOP Button, I'am sorry for that, could you please give me another idea? Maybe in using Feedback node or not?
Thanks a lot.
05-31-2017 09:00 AM
When using a loop, you should store your count in a shift register. The loop with an event structure is where to start.
05-31-2017 09:21 AM
Hello Li,
here is what you are looking for:
if you look carefully on my first post, you will notice on the upper left corner, that the selector label is 1 ( [1] “stop”: Value Change ) which means, this is the second case in the event (since the event starts with the index 0).
I already provided you some links, please read them first.
Then, follow these steps:
Go on the Front Panel and place a stop and an increment(OK) button,
Right Click>> Bolean >> OK Button (if you put your cursor on the OK, you can change the name to Increments)
Next you go on the Block Diagram, and type the following:
Ctrl+ Space >> Feedback Node
Ctrl+ Space >> Increment
Then you just have to create the events inside of the event structures.
Is the problem solved? Then please mark it as solved and hit the yellow star.
Have fun programming on LabVIEW.
PS: My welcome package to you
-MyRIO Project Essentials Guide (lots of good simple circuits with links to youtube demonstrations)
Learn NI Training Resource Videos
6 Hour LabVIEW Introduction
Self Paced training for students
Self Paced training beginner to advanced, SSP Required
LabVIEW Wiki on Training
05-31-2017 09:22 AM
Hello Jeff
Thank you for giving me idea, but I'm sorry that I maybe did't explain clearly my question. I want to create a button which I click one time and the number of a indicator will increase 1, then I re-click one time, the number increase 1. So I think that button is not the STOP Button, I'am sorry for that, could you please give me another idea? Maybe in using Feedback node or not?
Thanks a lot.
05-31-2017 10:17 AM - edited 05-31-2017 10:27 AM
There are a few ideas in there. Enjoy learning LabVIEW while you work on your internship!
Of course, for the simplistic truth meeting your exact requirements, the Feedback Node is totally unnecessary! (Use i)
05-31-2017 02:01 PM
Dilbert's Pointy-Haired Boss used an intern to flap his arms so the motion sensor on his office light would keep the light on.