Author Topic: Jumping past a wait command if the conditions not satisfied after a given time  (Read 451 times)

0 Members and 1 Guest are viewing this topic.

Offline JMan1

  • Newbie
  • *
  • Thank You
  • -Given: 4
  • -Receive: 0
  • Posts: 9
Hello All!

This may be very simple but I am new to programming and thus seek an expert opinion!

I have a program that currently waits for two RI to become on before going to the next step, however sometimes they never become ON but its still safe to continue to the next step if the operator at the PLC- HMI says so.

So what I want to do is be able to WAIT RI[2]=ON AND RI[4]=ON  or after 5 sec pass then make DO[1]= ON to the PLC so that the operator can see an alert on the HMI and then press continue if its safe to do so which will give the robot the signal to end the wait ignoring that the RIs are still off and continue onto the next line.

Maybe this can be done with background logic? I am not sure. Currently wishing the SKIP CONDITION wasnt only a motion option and could be put on a WAIT command.

Thanks!  :yesyesyes:

Offline stare284

  • Full Member
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 31
  • Posts: 181
WAIT RI[2]=ON AND RI[4]=ON, Timeout, LBL[1]

Offline Nation

  • Hero Member
  • *****
  • Thank You
  • -Given: 22
  • -Receive: 204
  • Posts: 774
  • Typical robot error message.
    • www.SynapticRobotics.com
Don't forget to set the timeout value from either the system config screen, or via the $TIMEOUT system var. The system var is in hundredths of seconds, so 5 seconds would be a setting of 500.

Offline alive15

  • Newbie
  • *
  • Thank You
  • -Given: 5
  • -Receive: 0
  • Posts: 38
WAIT RI[2]=ON AND RI[4]=ON, Timeout, LBL[1]

By adding LBL [1] at the end, the program automatically jumps to this label? Or do you need to include "Jump LBL[1]" ?

Offline stare284

  • Full Member
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 31
  • Posts: 181
You do not need to add the JMP LBL it will go to the specified LBL when the desired time is reach or if the conditions are met it will proceed to the next line in the program.

Offline JMan1

  • Newbie
  • *
  • Thank You
  • -Given: 4
  • -Receive: 0
  • Posts: 9
Thank you all for your input!

What I ended up doing, after I learned that you can type mixed logic wait commands  is this;

1: DO[1]=ON to start a timer of 5 seconds on the PLC
2: WAIT (RI[2]=ON AND RI[4]=ON OR DI[1]=ON) so I can bypass using a signal from the PLC
3: DO[1]=OFF

So with this if the timer runs out on the PLC and DO[1] still = OFF then it could pop up a warning on to the operator at the HMI to check the tool and then if all is safe they can press continue at which point the PLC provides DI[1]= ON thus allowing the wait to be ended and DO[1] to = OFF.

Hope that makes sense!  :beerchug: Thanks again!