Testing positional variable

Good Afternoon everyone! I’m still new to UR and I’m trying to figure out what I would assume to be an easy issue.

I’m trying to have a digital output turn on if the robot is in a specified location. This will send a signal to the plc to tell it, it’s safe to start the program.
I want it to turn on DO1 when it’s in position “start” and have DO1 turn off while it’s not in position “start”.
I can’t figure out how to do the logic comparison check to turn on DO1

I can’t quite figure out how to test if it’s in the position or not. I’ve tried about as much as I could and can’t get it to work. It gives me a variety of errors.

I don’t have pictures at the moment as I didn’t think about it at the moment.

Any help would be greatly helped!! Thank you all so much in advance!

Sounds like you’re referencing Cubes or Zones as some other robots call them. Basically just an imaginary zone in space, and when the robot’s TCP is inside this imaginary zone, turn on a digital output? Is that correct?

Something like this?

Hey, thank you so much for your response!!

I think the idea of using the TCP could work, my only worry is if the robot pathing moves through that point, it could turn the DO on when I’m not wanting it too. I do like this idea, and I tried it, but again I was worried it could trigger when I’m not wanting it too.

Is there a way to turn on a digital output if the robot is on Home? I created a waypoint “Start” and I want to turn on a digital output when the robot is at the waypoint and waiting for a signal from the plc to start.

Let me know what you think and thank you again for your reply!!

Hmm so maybe I’m still not grasping your desire here. The cubes using the TCP like I mentioned utilized threads and positional monitoring to turn on outputs anywhere in the program, as long as the TCP is in a certain point. This is handy since it uses quite a bit of code and compacts it down to a simple UI.

However, your fear of triggering the output when you DON’T want it on implies that there are specific instances when you DO want it on. In which case, wouldn’t you just manually turn it on when your program gets to that point? What am I missing here?

MoveJ Start_Waypoint
Set Digital_output_1 True
Wait PLC_Output True
Set Digital_output_1 False
MoveJ somewhere_else

Just move to your start position or your home position or whatever and then turn the output on and wait for the PLC start signal.

Hey sorry if I’m not explaining it clearly.

My goal is:

  1. robot rests at home position
  2. when the robot is in home position it turns on Digital out 1 (makes it true)
  3. when the robot receives signal (Digital Input 1) from PLC it runs the subprogram
    3A) Digital Input 1 is from the PLC
    3A) in order for the start signal from the PLC, the appropriate sensor must be on and the robot must be in home position. This will make the rung true and send the signal to Digital Input 1
  4. after the subprogram it rests at home waiting for Digital Input 1 to turn on

When the robot is not in Home I want Digital Output 1 to be off while it is performing the subprogram. But then when the robot returns to Home after completing the subprogram, Digital Output 1 turns back on telling the PLC the robot is in Home position and is waiting for the sensor to become true to send the start signal back to the robot to do the subprogram again.

This way if the sensor becomes true while the robot is performing the subprogram it doesn’t break the program, the work piece will remain at the sensor while the robot is finishing the subprogram, and then when the robot goes back to Home, that PLC rung becomes true and the robot repeats the subprogram.

I hope this explains it a bit more. again, like your first suggestion i could hard code it manually but im sure there is a better way.

Thanks.

Yeah this is all I would do to accomplish this. Let your PLC do the determination of the sensor and deciding when to start the robot. Then just have the robot turn its handshaking signal on and off during its run. Is there any issue with this implementation?

Alternatively you could utilize the Safe Home outputs and just take one line of the dual channel output into your PLC:

Okay I’ll give it a shot early next week! thank you!