Hello all,I am having a hard time programming an action on a UR3 robot. When the robot is in a specific waypoint a sensor should be active so that the robot can continue it s movement. Sometimes, from different reasons that sensor is not active and the robot waits until it gets active. The problem starts from here. I need to program the robot that if the waiting time is longer than 5 seconds the robot pops up an error message. But if meanwhile the sensor gets active (in that 5 seconds of waiting) the robot continues the movement and doesn t pops up the error message. I tried to do that with a Loop sequence but I didn t get quite the best result.
The loop sequence was written like a negation. If the sensor is not active it starts looping. Example..Loop if sensor is not active: Wait 5 seconds Popup..If I don't check the "Chek continuously" option for the Loop, and the sensor gets active meanwhile (in that 5 second waiting time) the robot waits for the 5 seconds to pass, pops up the message, waits for a command from the operator (continue program/stop program), and only after that continues the movement. If I check the "Chek continuously" option for the Loop, and the sensor is gets active meanwhile it continues the movement without the popup.Thats okey. But if the 5 seconds waiting time pass, the Popup shows up, so the operator will now that the sensor is not active and he will place an object in front of it. But as the sensor gets active the robot starts moving but the popup is still on the screen. And i need to program the robot to move only after the operator has activated the sensor and pressed the Continue program command on the popup message.I also tried with a Loop in a Loop but I had the same results...Loop if sensor is not active Wait 5 seconds Loop if the sensor is not active Wait 1 second Popup ..
You're using the Loop function in an unusual way for me but why not. There is not an only one solution that's why I wanted to understand what you were doing.A Loop function is supposed to do one thing several times. The way you're programming it, you're doing the loop only once.What's happening is that as you're checking continuously the expression, as soon as you're expression is true, you're exiting your loop. As the popup function is inside the Loop, it's not active anymore and neither it's pausing function (the popup is still present on the screen because UR "created" it like this but I would say that it should disappear).You have several options to do what you want. First and inspired of what you've done is using two If statements with the first one "check expression continusly" :If sensor==false wait 5 secondsIf sensor==false PopupThe first if will wait 5 seconds or the sensor to turn on and the second if will popup only if the sensor is offThe second one using Loop function without "Chek continuously" option would be adding a new variable as a timer to countTimer=0Loop sensor==false and Timer<5 wait 0.1 seconds Timer=Timer+0.1If sensor==false Popup
Thank you very much for your help. With your help I managed to insert into the program what I needed to. I used the Loop with the time variable. I just made a little adjustment. Insted of the If I used another Loop for the pop up message. With the if function the operator could have pressed continue program without fixing the problem (activating the sensor), but with Loop the popup will reappear on the screen until the operator has activated the sensor.Thank you again for your help. It was very useful.
Hello all,
I am having a hard time programming an action on a UR3 robot. When the robot is in a specific waypoint a sensor should be active so that the robot can continue it s movement. Sometimes, from different reasons that sensor is not active and the robot waits until it gets active. The problem starts from here. I need to program the robot that if the waiting time is longer than 5 seconds the robot pops up an error message. But if meanwhile the sensor gets active (in that 5 seconds of waiting) the robot continues the movement and doesn t pops up the error message. I tried to do that with a Loop sequence but I didn t get quite the best result.