RoboDK Forum
INTP-311 (RDK_S3, 507) Uninitialized dat- 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)
+--- Thread: INTP-311 (RDK_S3, 507) Uninitialized dat (/Thread-INTP-311-RDK-S3-507-Uninitialized-dat)



INTP-311 (RDK_S3, 507) Uninitialized dat-torayeff-08-18-2021

I have the following code, which connects to the real Fanuc robot. Everything works, but at the end, the program in the robot controller ends with the error code:INTP-311 (RDK_S3, 507) Uninitialized dat
Code:
import robolink
import robodk
import sys
import numpy as np

robot_name = "Fanuc LR Mate 200iD/4S"
robot_file = "Fanuc-LR-Mate-200iD-4S.robot"
connection_params = {
"robot_ip": "192.168.1.100",
"port": 2000,
"remote_path": "md:/",
"ftp_user": "anonymous",
"ftp_pass": "",
}

rdk = robolink.Robolink(args=["-EXIT_LAST_COM", "-NOUI", robot_file])

robot = rdk.Item(robot_name)

robot.setConnectionParams(
robot_ip = connection_params["robot_ip"],
port=connection_params["port"],
remote_path=connection_params["remote_path"],
ftp_user=connection_params["ftp_user"],
ftp_pass=connection_params["ftp_pass"],
)

connection = robot.ConnectSafe()

robot.Joints()
robot.MoveJ([0, 0, 0, 0, 0, 0])
robot.MoveJ([0, 0, -30, 0, 0, 0])
robot.MoveJ([0, 0, -30, 10, 0, 0])
robot.MoveJ([0, 0, 0, 0, 0, 0])

if not robot.Busy():
rdk.CloseRoboDK()

Every time I need to fix the error using a teach pendant and start a cycle with Auto mode. How can I avoid this error at all?


RE: INTP-311 (RDK_S3, 507) Uninitialized dat-Jeremy-08-19-2021

I don't know the Fanuc driver well enough to help on this one, but I forwarded this post.

Jeremy


RE: INTP-311 (RDK_S3, 507) Uninitialized dat-Phillip-08-19-2021

The current implementation of the driver errors out when the socket is disconnected, so it errors out at the end when robodk and by extension the driver is closed.


RE: INTP-311 (RDK_S3, 507) Uninitialized dat-torayeff-08-19-2021

(08-19-2021, 01:29 PM)Phillip Wrote:The current implementation of the driver errors out when the socket is disconnected, so it errors out at the end when robodk and by extension the driver is closed.

Many thanks! This is confirmed!

By the way, may I drive your attention to this thread//www.sinclairbody.com/forum/Thread-online-programming-a-fanuc-R30-iB-Mate-plus-gripper?pid=5149#pid5149.

It seems a problem for at least three users in this forum.

The question is:

How to call external programs/macros in the robot controllers from RoboDK?

I have tried the following code without success:

Code:
connection = robot.ConnectSafe()

rdk.setRunMode(robolink.RUNMODE_RUN_ROBOT)
程序= rdk.AddProgram(“项目”)
program.setRunType(robolink.PROGRAM_RUN_ON_ROBOT)

# I expect this line set R[52]=6, but it does not
program.RunInstruction('Program(6)', robolink.INSTRUCTION_CALL_PROGRAM)

Best,
Agajan


RE: INTP-311 (RDK_S3, 507) Uninitialized dat-Albert-08-19-2021

You should change this line:
Code:
program.RunInstruction('Program(6)', robolink.INSTRUCTION_CALL_PROGRAM)

For this:
Code:
program.RunInstruction('Program 6', robolink.INSTRUCTION_CALL_PROGRAM)

It is important to have a space so the number 6 is passed as the parameter for most drivers.

Also, more recent versions of the Fanuc driver support calling named programs without passing parameters, so you should be able to do this with a Fanuc robot:
Code:
program.RunInstruction('NamedProgram', robolink.INSTRUCTION_CALL_PROGRAM)
Note that this is not supported with all drivers.


RE: INTP-311 (RDK_S3, 507) Uninitialized dat-torayeff-08-19-2021

[attachment=2496 Wrote:Albert pid='10121' dateline='1629387498']You should change this line:
Code:
program.RunInstruction('Program(6)', robolink.INSTRUCTION_CALL_PROGRAM)

For this:
Code:
program.RunInstruction('Program 6', robolink.INSTRUCTION_CALL_PROGRAM)

It is important to have a space so the number 6 is passed as the parameter for most drivers.

Also, more recent versions of the Fanuc driver support calling named programs without passing parameters, so you should be able to do this with a Fanuc robot:
Code:
program.RunInstruction('NamedProgram', robolink.INSTRUCTION_CALL_PROGRAM)
Note that this is not supported with all drivers.

Many thanks for this. I was struggling with it for a couple of days now! Now it works! This one works for me (named program):
Code:
robot = rdk.Item(robot_name)

robot.setConnectionParams(
robot_ip = connection_params["robot_ip"],
port=connection_params["port"],
remote_path=connection_params["remote_path"],
ftp_user=connection_params["ftp_user"],
ftp_pass=connection_params["ftp_pass"],
)

connection = robot.ConnectSafe()
robot.RunInstruction('HAND_TOG', robolink.INSTRUCTION_CALL_PROGRAM)

If I call:

Code:
robot.RunInstruction('Program 7', robolink.INSTRUCTION_CALL_PROGRAM)

I receive thePROGRAM_7(notice the underscore) inDATA KAREL Vars(see the attachment)