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

Kuka Robot and IO calls.

#1
Hi,

I am using the PythonAPI to control the robot using online programming using the kukabridge driver.

I am trying to implement a function to pause the robot when a user opens a door connected to a digital input.

Process 1 is commanding the robot as usual.

Process 2 is reading DI1 and calling robot.pause or setting other parameters as necessary.

I am having two problems here, and not sure if they are related.

First, reading the digital input in a look seems to mess up the robot driver somehow. If I am running the following code in process 2, I get a bunch of TargetReachErrors which I have not seen in any other circumstances.

Code:
while True:  
print(robot.setParam("Driver", "GET $IN[1]"))
time.sleep(0.2)


Second, none of the other DI API calls like waitDI or getDI seem to work for me. You could imagine a better implementation of the loop above just waiting for a signal.

Looks like some other people have had issues related to this API: https://robodk.com/forum/Thread-getDI-io...UKA-driver
#2
Hi Rick,
Let's start figuring out what the problem is.
First of all, we need to run the kukabridge driver in interactive mode:
Code:
user@ubuntu:~$ cd ~/RoboDK/bin
user@ubuntu:~/RoboDK/bin$ export LD_LIBRARY_PATH="$(pwd)/lib"
user@ubuntu:~/RoboDK/bin$ ./kukabridge
Now kukabridge should be ready to execute commands. Let's check this with the OPTION command:
Code:
OPTION
SMS:Working...
reconnectLimit = -1
connectTimeout = 0
dataTimeout = 0
keepAliveInterval = 0
SMS:Ready
Connect to the robot with the command CONNECT <ip> [port] [number_of_robot_axes]:
Code:
CONNECT 192.168.0.108 7000 6
SMS:Connecting
Connected
SMS:Working...
SMS:Ready

Now we can query the value of a variable with the command GET <variable_name> and set the new value with the command SET <variable_name> <new_value>:
Code:
GET $AXIS_ACT
SMS:Working...
RE:{E6AXIS: A1 0.0, A2 0.0, A3 0.0, A4 0.0, A5 0.0, A6 0.0, E1 0.0, E2 0.0, E3 0.0, E4 0.0, E5 0.0, E6 0.0}
SMS:Ready

SET $OV_PRO 25
SMS:Working...
RE:OK
SMS:Ready

GET $OV_PRO
SMS:Working...
RE:25
SMS:Ready
Now let's check the operation of the digital input status query command, GETDI <input_number>:

Code:
GETDI 1
SMS:Working...
RE:FALSE
SMS:Ready
GETDI 1 is equivalent to the command GET $IN[1]

Next, we need to make sure that you are using the latest version of KRL program (RoboDKsync543.src).
You can find it in the archive at: https://robodk.com/doc/drivers/Connect-K...RoboDK.zip
In addition, the kukabridge can automatically upload the program into your control system.
In this case, you need to delete your RoboDKsync???.src file from the control system beforehand so that the kukabridge will definitely write the correct version. Use the command CONFIGURE [FORCE] (be careful with the FORCE option, it will cause the $config.dat file to be automatically modified):
Code:
CONFIGURE
SMS:Working...
Requesting robot program state
Current robot program state is #P_FREE
Reading current configuration ($config.dat)
Read complete, updating configuration
Configuration requires no updates
Checking existence of program file (RoboDKsync543.src)
Program file does not exists
Writing program file to robot system
Configuration is complete
SMS:Ready

Now check the command WAITDI <input_number> <condition_value>.
For example, if we expect TRUE on input 1, the command will be written as: WAITDI 1 1, and if we expect FALSE, it will be written as: WAITDI 1 0:
Code:
WAITDI 1 0
SMS:Working...
SMS:Ready

Please perform the above steps and tell us about your results.

Best regards,
Dmitry.
#3
Thanks Dmitry, I will try this out when I get a chance, probably next week.
  




Users browsing this thread:
1 Guest(s)