I have a UR10e and a Keyence LJ-V7000 saeries laser profiler, both connected to a PLC. The UR10e adapter picks up the PLC scanner. I have a Keyence program made but I’m not sure how to pull the data from the Keyence controller and have the data populate variables in Polyscope. I am thinking a Python script but I’m not proficient in Python programming. Anyone done anything similar in the past?
I tend to like using the EthernetIP protocol, but you’d have to make sure the profiler supports EthernetIP. Then you just use a basic copy instruction on the PLC to take the data from the Profiler into one of the GP registers on the UR. From there you can just use the normal robot script to write the robot register to a variable.
Hi Eric! I know what bits to use for the Keyence.
For the UR10e, would I just use the TCP position bits?
This is something I pulled off one of the AI websites for the Python program since I have no experience with it.
import rtde.rtde as rtde
import rtde.rtde_config as rtde_config
ROBOT_IP = "192.168.1.17" # Replace with your robot's IP address
ROBOT_PORT = 30004 # Default RTDE port
# Path to the RTDE configuration file
CONFIG_FILE = "control_configuration.xml"
# Load the RTDE configuration
config = rtde_config.ConfigParser(CONFIG_FILE)
output_names, output_types = config.get_recipe("output")
# Connect to the robot
con = rtde.RTDE(ROBOT_IP, ROBOT_PORT)
con.connect()
# Get the output recipe
con.send_output_setup(output_names, output_types)
# Start the RTDE data exchange
con.send_start()
try:
# Read data from the robot
data = con.receive()
if data is not None:
# Example: Read a specific register value (e.g., register 0)
robot_register_value = data.actual_q[0] # Replace 'actual_q' with the appropriate field
print(f"Robot Register Value: {robot_register_value}")
except KeyboardInterrupt:
print("Program interrupted by user.")
finally:
# Stop the RTDE data exchange and disconnect
con.send_pause()
con.disconnect()
Would something like this work? Would I need to upload RTDE libraries to the robot?
Thanks for all the help!
Is your ultimate goal to control the robot with live data from the profiler? Keep in mind the robot does not run on Python. You have to call functions written there from XMLRPC, or else stream it via socket from an external source like a PC.
Personally, I never have had much success with the RTDE, it always seems overly complicated, and introduced a lot of failure points that I couldn’t debug or understand.
If you’re able to read the data from the Keyence profiler into the PLC, then you’re already almost done. At the bottom of the page I linked above, there is an EDS file for the UR robot. Import that as a new ethernet device, and just use a copy instruction to map the data from Keyence to Robot. Once you do that, the robot has access to the profiler data on whatever integer, float, etc register you chose to map it to. You’re free to do whatever you want with it right there in robot script.