Roles No Roles
Full Name Louis Bergeron
Company (optional) Robotiq
You may also use the Modbus TCP server in the UR controller. Registers 128-255, for example, are for a general purpose. You may use pymodbus to build a simple python program like this to write desired X and Y values.
from pymodbus.client.sync import ModbusTcpClient as ModbusClientimport logginglogging.basicConfig()log = logging.getLogger()log.setLevel(logging.DEBUG)##Connect to the IP adresse of the robot controllerclient = ModbusClient('192.168.0.102', port=502)client.connect()##Writting desired x position in register 128rq = client.write_register(128, 100)rr = client.read_holding_registers(128,1)assert(rq.function_code < 0x80) # test that we are not an errorprint rr.registers#Writting desired y position in register 129rq = client.write_register(129, 40)rr = client.read_holding_registers(129,1)assert(rq.function_code < 0x80) # test that we are not an errorprint rr.registersclient.close()The UR program may look like this to read values from the register and place them in variables. the variables will then be visible in the variable tab. In the following program, the MoveL are relative to a feature. The robot goes to 0, 0, 0 and then goes to 0.1, 0.04, 0ProgramRobot ProgramMoveLmy_pos≔p[0,0,0,0,0,0]my_pospos_x≔read_port_register(128)pos_y≔read_port_register(129)my_pos=pos_x/1000my_pos=pos_y/1000my_pos
We've had some questions during the last weeks regarding cabling our products on the KUKA IIWA robot and how to pass cabling inside the robot's arm. KUKA added some new media flange options so I decided to make an update about it.Two-Finger GripperThe 2-Finger Gripper uses RS485 signal requiring a twisted pair to pass through the arm. If you would like to install our 2-Finger Gripper on IIWA, there are no possibilities on IO pneumatic, Touch pneumatic, and IO valve pneumatic media flanges. Cabling will have to pass on the outside of the robot's arm.On the other hand, if you have the electrical, touch electrical, IO electrical and pneumatic media flange you may use this trick posted by Catherine to send the RS485 signal through the arm. Once cabling reaches the robot controller, you may use our universal controller to convert the RS485 signal to your choice of Fieldbus. EtherCAT will be a good choice to connect it to the KUKA Controller.Three-Finger GripperEtherCATSince the Gripper has its own universal controller inside it, it may output directly the Fieldbus you want. The best choice will be to use the 3-Finger Gripper with EtherCAT communication protocol. With this option, you will be able to pass the cabling through the inside of the robot's arm on every media flange option of IIWA. We offer special cabling in order to do this connection easily.Other real-time Ethernet protocolIf you need another real time ethernet protocol like Modbus TCP, Ethernet/IP or Profinet, you will have to pass the cable on the outside of the arm on IO pneumatic, Touch pneumatic, and IO valve pneumatic. The electrical media flange will handle all the real time ethernet protocol easily but Touch electrical and IO electrical will require custom connection to pass it through the arm. You will not be able to use the X2 connector on these cases because it's a dedicated EtherCAT communication connector.DeviceNet and Can OpenIf you need to use DeviceNet or CAN open, the only possible option will be to manage it on the outside of the robot's arm on all media flange options.
If you have any questions feel free to post below!
I'll suggest you program your loop in a script file as a new function. Placing this script file in the beginning of your UR program will allow you to use your own function everywhere in a neat way. As an example, I've programmed a new min/max prompt function in a script file. Then I simply use this new function anywhere I need it in the program.
This new operator prompt function is made for an integer but you can do the same for a floating point variable. By changing the function request_integer_from_primary_client with request_float_from_primary_client.
Is it something like this you're looking for?