Author Topic: Creating a while loop using URscript  (Read 565 times)

0 Members and 1 Guest are viewing this topic.

Offline DictatorAdm

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 1
Creating a while loop using URscript
« on: February 21, 2018, 01:51:05 PM »
Hey all,

I'm pretty new to UR and industrial robotics in general.
I'm working with a UR10 which gets its commands from a separate PC, using a python script to connect to the robot using the socket module.
When sending "basic" commands like move this works just fine, however I'm having trouble getting if statements and while loops to work.
Right now when I try to create a while loop it seems to run as if it's not there and just execute the code within the loop as well as after it, only going through it once.

This site, http://www.zacobria.com/universal-robots-knowledge-base-tech-support-forum-hints-tips/, provided some information on how to program the robots using UR script, but when they mention if and while statements all they do is redirect to the page for setting up a server-client installation and make no mention of how to create these statements even on that page.

I'm not using PolyScope GUI for programming at all right now and I'm trying to keep it that way.

So in summary: How do I create if and while statements using a python script to send commands to the robot?
Thanks in advance