Announcement

Collapse
No announcement yet.

2 button questions

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • 2 button questions

    Hi -- I'm using Arduino, an adapter and Visi-Genie. I have 2 questions about buttons that I can't seem to sort out.

    1) User Button -- In the Reference Manual and User Guide it is suggested that a User Button has 4 states...

    "Buttons for 4D displays have 2 states when Momentary(Up and Pressed) and 4 states otherwise (Up, Up Pressed, Down and Down Pressed). User buttons can have more states, but these states can only be set by the host."

    I am trying/hoping to create a button that will let a user press and hold a button to 'jog' a motor as long as the button is held down, and stop moving when it is released. I can't figure out, or find a place in the User Button settings, nor additional info in the manuals that describes how this might be done.

    In my testing I can only seem to get an "OnChanged" event to report. What am I missing?

    2) Disable/gray-out Winbutton -- I have a winbutton to go back to a 'Home' screen/form on most of my forms. I also have motors that can be turned on/off by toggles on a given form. I am looking for a way to not allow the user to activate the 'Home' button until they have stopped any motors running on the form. Ideally I'd like a grayed-out version of the 'Home' button visible, but not useable until motors are stopped.

    I have seen a couple of posts that describe overlaying two buttons, exactly on top of each other (but not via Visi-Genie), or creating identical forms with a button displayed differently, or not shown at all. Is there a better or more elegant way to do this?

    Thanks,

    --Jon

  • #2


    1) Assuming you have Workshop 4.1.0.18 or above you need to set the momentary parameter to 'Both' and the onChanged parameter to Report. You will then get a message when the button is pressed and other one when it is released, how you cause that to 'repeat' is up to you.

    2) No, that is probably the best way to do this, another way, for what you have described is change the form using your controller, if the state is not correct for a form change a strings object to say 'Please turn off motors first' or somesuch.
    Mark

    Comment


    • #3


      Comment


      • #4


        Thanks Mark, the 'Both' field worked perfectly. And the added bonus is that as long as the button remains pressed, only two messages are created. Exactly what I needed since the ┬Áproc can go do what I need it to do (jog my motor) until released.

        For #2 I'm just trying some options with strings to see what makes the most sense.

        --Jon

        Comment

        Working...
        X