Delaying bglogic?

  • Hi,


    I'm trying to use bg-logic to recognize keys pressed on a simple keypad by the operator. BGlogic so that they can be used while the robot is doing something else (the idea is to mark next jobs as ready).


    It works haphazardly, and I suspect it's because the bglogic program is so fast it runs several times in one keypress.


    The program is simply like
    IF(DI[1]) THEN // if button 1 is pressed
    IF(DO[1]) THEN // see if button 1 lamp is already on and switch it
    DO[1]=Off
    ELSE
    DO[1]=On
    ENDIF
    ENDIF


    I tried to add WAIT but that's apparently not allowed in bglogic. I'm sure there's a better way to this...


    Petri

  • Place your Ad here!
  • You are correct that it is scanning multiple times while the button is pressed. What you need is a one shot. This is discussed in the BG Logic sticky at the top of this forum.


    Sent from my VS985 4G using Tapatalk

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account
Sign up for a new account in our community. It's easy!
Register a new account
Sign in
Already have an account? Sign in here.
Sign in Now

Advertising from our partners