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

I want to generate a program from a file (gcode) in which is stored diferent positions. I have no problem to generate the program but i have it with the speed of the script run-time.
I tested the following instructions, but these not makes (much) effect:
- program.ShowInstructions(False)
- RDK.Render(False)
- program.ShowTargets(False)

and, also i've tried setPoses but there is no diference.

If I generate the program with the machining tool RoboDK generates the robotprogram inmediatly. But i need to add some signals, velocity changes,...

Another solution/function to increase the speed of processing?
The API is an order of magnitude slower compared to our robot machining tools when importing from an NC or an APT file. The speed of the RoboDK API is also limited depending on the programming language you use. For example, Matlab and Python are slow compared to C++ or C#.

I recommend you one of the following options:
  • Use the RoboDK API in C++, C# or .NET if you are using Matlab or Python
  • Consider developing your application as a plugin interface. The plugin interface allows you to create a plugin in RoboDK and you have direct access to the API via a C++ interface (this option is much faster than using the C++ API)
  • Customize your APT program to integrate additional commands to change speeds, Digital Outputs, program calls, etc. I attached a sample APT sample file showing additional commands that RoboDK takes into account to generate a program.
$$ This line is a comment

$$ Fast move to X,Y,Z (uses RoboDK rapid speed, 1000 mm/s by default, you can change it in Program Events)
GOTO 0 0 100

$$ Define the cutter:
$$ CUTTER/ Diameter (D), Radius (Rc), (ignored), (ignored),  (ignored),  (ignored),  Length
$$ RoboDK will automatically create a cutter if you activate:
$$ Tools-Options-CAM-Automatically create cutters
CUTTER/ 4,  1,  3,  2,  0,  0, 20

$$ Provoke a tool change event such as SetTool(2) (default event settings)
$$ RoboDK will automatically split to one program per tool if you activate:
$$ Tools-Options-CAM-Automatically set one project per tool

$$ set the TCP speed:

$$ move to X,Y,Z,i,k,k
GOTO / 0 0 0 0 0 1

$$ move to X,Y,Z,i,k,k
GOTO / 100 0 0 0 0 1

$$ Next line is a program call
CALL ProgramCall

$$ Next line is a program passing parameters, for example, XYZ values
$$ The macro shows an example to simulate the movement: C:/RoboDK/Library/Macros/
$$ This file needs to be added to the RoboDK station
CALL CallNC(100,0,-25)

$$ move to X,Y,Z,i,k,k
GOTO / 100 0 0 0 0 1

$$ move to X,Y,Z,i,k,k
GOTO / 0 0 0 0 0 1

$$ Next line is a raw input line (supported with a new release next week)
CODE RawLine;

PPRINT Turning Digital Output 12 to ON

PPRINT Pause 5 seconds

PPRINT Turning Digital Output 12 to OFF

PPRINT Wait Digital Input 12 to turn OFF
$$ Inputs and outputs are simulated using station variables
$$ for example, using the API you can call:
$$ RDK.setParam('IO_12',1)

$$ You can also have a timed out wait:

Users browsing this thread:
1 Guest(s)