RoboDK Forum
Can RoboDK read the temperature of a Kuka robot?- Printable Version

+- RoboDK Forum (//www.sinclairbody.com/forum)
+-- Forum: RoboDK (EN) (//www.sinclairbody.com/forum/Forum-RoboDK-EN)
+--- Forum: General questions about RoboDK (//www.sinclairbody.com/forum/Forum-General-questions-about-RoboDK)
+--- Thread: Can RoboDK read the temperature of a Kuka robot? (/Thread-Can-RoboDK-read-the-temperature-of-a-Kuka-robot)



Can RoboDK read the temperature of a Kuka robot?-petsven-06-19-2023

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?


RE: Can RoboDK read the temperature of a Kuka robot?-Albert-06-19-2023

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)



RE: Can RoboDK read the temperature of a Kuka robot?-petsven-06-19-2023

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()



RE: Can RoboDK read the temperature of a Kuka robot?-Albert-06-19-2023

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.


RE: Can RoboDK read the temperature of a Kuka robot?-petsven-06-19-2023

Here is the log from RoboDK. The temperature value, 298, is showing up there.


RE: Can RoboDK read the temperature of a Kuka robot?-Albert-06-19-2023

Can you try with the latest version of RoboDK?

It should provide the string back through the setParam function.


RE: Can RoboDK read the temperature of a Kuka robot?-petsven-06-19-2023

(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.


RE: Can RoboDK read the temperature of a Kuka robot?-Albert-06-20-2023

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).


RE: Can RoboDK read the temperature of a Kuka robot?-petsven-06-20-2023

(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.


RE: Can RoboDK read the temperature of a Kuka robot?-Albert-06-20-2023

It should work with the latest version of RoboDK regardless of the RoboDK API version you use.