RoboDK Forum
Python code to PRG- Printable Version

+- RoboDK Forum (//www.sinclairbody.com/forum)
+-- Forum: RoboDK (EN) (//www.sinclairbody.com/forum/Forum-RoboDK-EN)
+ - - -论坛:通用RoboDK问题(//www.sinclairbody.com/forum/Forum-General-questions-about-RoboDK)
+--- Thread: Python code to PRG (/Thread-Python-code-to-PRG)



Python code to PRG-quinten-04-23-2019

Hi,

Were having problems generating a program from a python code.

Everytime we try to generate a python script to a .prg, we get an output file on scite but it doesn't show any movements or targets.

It does show the module and the proc but no movement commandos.


RE: Python code to PRG-Jeremy-04-25-2019

Can you provide what you did so that we can take a look at it and help you?

Jeremy


RE: Python code to PRG-quinten-04-26-2019

(04-25-2019, 06:08 AM)Jeremy Wrote:Can you provide what you did so that we can take a look at it and help you?

Jeremy

Hi,

Sorry for the late response, this is the code used.

The robot is a ABB 6400 sc4 teachpendant.

Code:
# ----------------------------------------------------------------------
# simple test 1
# PB 01 01 2019
# ----------------------------------------------------------------------

from robolink import * # API to communicate with RoboDK
from robodk import * # basic matrix operations
import random
import time

# interaction through Robolink()
RDK = Robolink()

# get the robot item:
robot = RDK.Item('', ITEM_TYPE_ROBOT)
# robot = RDK.Item('ABB IRB 6400R 2.8 200 Base')

# ================================================================

# get the home target and the welding targets:
home = RDK.Item('Home')

# move the robot to home, then to the center:
#robot.MoveJ(home)

# Set the speed to 50 mm/s
robot.setSpeed(4)

for i in range(4):
robot.setJoints([ 0, 90, -90, 0, 0, 0 ])
#robot.moveL([ 0, 90, -90, 0, 0, 0 ])
pause(1)
robot.setJoints([ 22, 50, -90, 0, 0, 0 ])
pause(1)

#robot.moveJoints([ 44, -24, -90, 52, 54, 180 ])

#pause(3)

# robot.MoveJ(home)

When generating program is gives us a mod & proc but otherwise completely empty file.



RE: Python code to PRG-Jeremy-04-26-2019

Can you also send me your .rdk file.

I just want to work in the same environment as you. It will be faster for me to help.