Robot driver - Limit for program_id??- Printable Version +- RoboDK Forum (//www.sinclairbody.com/forum) +-- Forum: RoboDK (EN) (//www.sinclairbody.com/forum/Forum-RoboDK-EN) +--- Forum: RoboDK API (//www.sinclairbody.com/forum/Forum-RoboDK-API) +——线程:机器人司机——限制program_id ? ?(/Thread-Robot-driver-Limit-for-program-id) |
Robot driver - Limit for program_id??-DavidG-06-01-2019 Hi, I am using the customisable section of the robot driver:
Code:
CASE 13
Code:
if len(sys.argv)>1:
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? RE: Robot driver - Limit for program_id??-DavidG-06-04-2019 Here is a minimum working example for my problem. The RDK project is attached, the relevant section of the robot driver looks like this:
Code:
CASE 13
The program id that is to be called has to be edited manually in the python script. The routine works fine up to a program id of 1000000 (including). If I call
Code:
robot.RunInstruction('Program 1000001', INSTRUCTION_CALL_PROGRAM)
RE: Robot driver - Limit for program_id??-Albert-06-07-2019 You can see that COM_VALUE1 is defined as a REAL (KUKA KRC type of variable). This means it is a floating point variable (32 bits). This type of variable can hold 6 up to significant digits: https://en.wikipedia.org/wiki/Single-precision_floating-point_format However, you can take advantage of the decimal values and pass additional information if required (no need to multiply your value. RoboDK was rounding the value to the nearest integer but we've updated RoboDK to allow passing decimal values for a function call (latest version required). I recommend you to update RoboDK and use floating point values. Even if RoboDK will remember a 64 bit double, the KUKA controller will receive a 32 bit floating point value. RE: Robot driver - Limit for program_id??-DavidG-06-11-2019 Hi Albert, thanks a lot for solving this puzzle. I really did not see that I am dealing with floats here. The reason why I used this procedure
Code:
(Value*1000)+20000000
Maybe it would be a nice and powerful feature if you could change the structure of the program call to something like:
Code:
robot.RunInstruction('program id','optional argument',INSTRUCTION_CALL_PROGRAM)
Thanks for your great support. |