03-07-2010 05:01 AM
Hello.
In my project i wanted to add a button with mechanical action "latch until release" to the main VI.
When i added the button, and set the mechanical action, i saved the VI, but when i push run (the run button is not broken) i got the next message:
Why is it??
03-07-2010 05:23 AM
It means that buttons with this behaviour (only switched when the mouse is down) cannot be used on a Real Time platform (since a mouse is normally not available on such platforms). Probably because it requires extra event driven code in UI handling.
Any reason you want this specific kind of behaviout on a RT program?
Ton
03-07-2010 06:11 AM
Hello.
Yes, there is a reason.
I have a motion system. I want to add two buttons: jog back and jog forward. and i want the motor moving while i'm holding one of the buttons until i release it.
Thanks
03-08-2010 09:49 PM
Hi Tacchi,
How are you reading from the button? If you use an event structure, you should be able to monitor both the push and release actions of a button without using the switch or latch until released behaviors. You can use the events generated by the mouse down and mouse up actions on each button to control the "output" of these buttons. Be sure to use a timeout event in addition if you're using the event structure in a loop that needs to continuously run.
01-20-2017 10:12 AM
Hello jareds,
I am not sure if you are available. This post was 7 years ago. I have the same problem. I want to move the motor while I am holding of button. I try to use structure case but I I want to send the signal with a button to the Motor.
Could you explain better how can I do with a structure case?
Thank you
A regard
Pedro
01-20-2017 12:20 PM
Read the button and store the value in a shift register or feedback node. If the new value and old value are the same, then you know the state of the button hasn't changed. If the values changed and it is now true, then send a Start command with your case structure. If the values changed and the new value is falso, then send a stop command with your case structure.