Hi,
I am using the customisable section of the robot driver:
As Albert suggested to me I am using the program id to transfer data to the robot controller ( Related thread ), thanks again for that clue. Unfortunately there seems to be a limit for the program id. Here is my code snippet:
[url=https://robodk.com/forum/Thread-Python-Specific-post-processor-and-run-mode-for-machining-project][/url]
Basically, if I use something like
robot.RunInstruction('Program 20', INSTRUCTION_CALL_PROGRAM)
everything works fine. But if I try to pass on a much bigger value like
robot.RunInstruction('Program 2000000', INSTRUCTION_CALL_PROGRAM) or (as in my actual application)
robot.RunInstruction('Program 20000000', INSTRUCTION_CALL_PROGRAM)
the robot controller receives either 0 or something useless, the response is odd. I checked the data types on the robot side to see if it can handle the value, but KUKA integers can handle 2^31-1.
Do you have an explanation for that issue? Does RoboDK have a limit here?
I am using the customisable section of the robot driver:
Code:
CASE 13
;----- Run program COM_VALUE1 ---------
; (to trigger from RoboDK: use robot.RunCodeCustom("program id", INSTRUCTION_CALL_PROGRAM)
program_id = COM_VALUE1
Code:
if len(sys.argv)>1:
ExtValue = float(sys.argv[1])
if ExtValue != 0:
ExtInt = int(ExtValue*1000+20000000)
ExtProgID = str(ExtInt)
robot.RunInstruction(ExtProgID, INSTRUCTION_CALL_PROGRAM)
Basically, if I use something like
robot.RunInstruction('Program 20', INSTRUCTION_CALL_PROGRAM)
everything works fine. But if I try to pass on a much bigger value like
robot.RunInstruction('Program 2000000', INSTRUCTION_CALL_PROGRAM) or (as in my actual application)
robot.RunInstruction('Program 20000000', INSTRUCTION_CALL_PROGRAM)
the robot controller receives either 0 or something useless, the response is odd. I checked the data types on the robot side to see if it can handle the value, but KUKA integers can handle 2^31-1.
Do you have an explanation for that issue? Does RoboDK have a limit here?