Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5

Can RoboDK read the temperature of a Kuka robot?

#1
I have a Kuka KR 20. I am running my robot in automatic mode and streaming commands using "RUNMODE_RUN_ROBOT" mode. The temperature of each motor is stored in the"$MOT_TEMP" Kuka system value. Is there a command to read this value in the Python roboDK library?
#2
Yes, it is possible to read KUKA variables by using the Driver parameter on a robot and the GET command (special parameter for the KUKA driver). You can try something like this:

Code:
value = robot.setParam("Driver", "GET $MOT_TEMP")
print(value)
#3
I just tried that code, but I am just getting an empty string. Here is my code:

Code:
# Import
import robodk.robolink as rl

# Establish a link with the simulator
global RDK
RDK = rl.Robolink(args="-SKIPMAINT") # -SKIPMAINT removes maintenance dialogs

# Retrieve the robot
global robot
robot = RDK.Item("KUKA KR 20 R1810")

# If a station is not open, then open one
if str(robot) == "RoboDK item (INVALID)":
RDK.AddFile("PythonTest9.rdk")
robot = RDK.Item("KUKA KR 20 R1810")

# Check if we are connected to the robot already
state, msg = robot.ConnectedState()

# Connect to the robot if we are not already connected
if state == -2:
print("Connecting to robot...")
status = robot.Connect()
if status == 0:
print("Robot connected")
else:
RDK.setRunMode(rl.RUNMODE_RUN_ROBOT)

# Print the temperature
temperature = robot.setParam("Driver", "GET $MOT_TEMP[1]")
print("The temperature is: '" + temperature + "'")
print(type(temperature))

# Close RoboDK
RDK.CloseRoboDK()
#4
Did you try with the apikuka.exe driver instead of the C3 bridge?

You should be able to get the full array back if you don't provide the index.
#5
Here is the log from RoboDK. The temperature value, 298, is showing up there.


Attached Files Thumbnail(s)

#6
Can you try with the latest version of RoboDK?

It should provide the string back through the setParam function.
#7
(06-19-2023, 08:51 PM)Albert Wrote:Can you try with the latest version of RoboDK?

It should provide the string back through the setParam function.

I am using the latest version my license covers: 5.3.2.

(06-19-2023, 08:25 PM)Albert Wrote:Did you try with the apikuka.exe driver instead of the C3 bridge?

You should be able to get the full array back if you don't provide the index.

I tried it without the index, but the robot did not return any values. There was also no value shown in the network log.
#8
Are you using the latest version of RoboDK?

Make sure to install the latest version while RoboDK is not running. Also, make sure to kill any process started by RoboDK that's running in the background (such as apikuka.exe).
#9
(06-20-2023, 10:57 AM)Albert Wrote:Are you using the latest version of RoboDK?

Make sure to install the latest version while RoboDK is not running. Also, make sure to kill any process started by RoboDK that's running in the background (such as apikuka.exe).

I am using RoboDK5.3.2和我使用的5.6.0版本RoboDK Python library.
#10
It should work with the latest version of RoboDK regardless of the RoboDK API version you use.




Users browsing this thread:
1 Guest(s)