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

About AddFile error

#1
I wrote a test.py as following:

from robodk.robolink import *          # import the robolink library
RDK = Robolink(args='/NOUI')
#RDK = Robolink()
item = RDK.AddFile(r'C:\Car20231108.rdk')

robot = item.Item('Doosan Robotics M0617')
target = item.Item('Target112')
robot.MoveJ(target)
targetJoints= robot.getJoints()


And I opened test.py in IDLE 3.7.4 and tried to run test.py. There was a error as follows:

==================== RESTART: C:\RoboDK\Python37\test.py ====================
Starting C:/RoboDK/bin/RoboDK.exe

EXECUTING:"/NOUI":...
RoboDK is Running...
Traceback (most recent call last):
  File "C:\RoboDK\Python37\test.py", line 4, in <module>
    item = RDK.AddFile(r'C:\RoboDK\001_Wjf_Practices\07_2023_11_08\Cabinet20231108.rdk')
  File "C:\RoboDK\Python37\lib\site-packages\robodk\robolink.py", line 1765, in AddFile
    newitem = self._rec_item()
  File "C:\RoboDK\Python37\lib\site-packages\robodk\robolink.py", line 829, in _rec_item
    buffer = self.COM.recv(8)
ConnectionResetError: [WinError 10054] An existing connection was forcibly closed by the remote host
>>>

Would you please help me?  Thanks.

I wrote a test.py as following:

from robodk.robolink import * # import the robolink library
RDK = Robolink(args='/NOUI')
#RDK = Robolink()
item = RDK.AddFile(r'C:\Car20231108.rdk')

robot = RDK.Item('Doosan Robotics M0617')
target = RDK.Item('Target112')
robot.MoveJ(target)
targetJoints= robot.Joints().list()

f = open("C:\RoboDK\Python37\demofile2.txt","w")
mystr= ""
for i in range(len(targetJoints) - 1):
mystr =mystr + str(targetJoints[i]) + ","

mystr =mystr + str(targetJoints[i])

f.write(mystr)
f.close()


And I opened test.py in IDLE 3.7.4 and tried to run test.py. There was a error as follows:

==================== RESTART: C:\RoboDK\Python37\test.py ====================
Starting C:/RoboDK/bin/RoboDK.exe

EXECUTING:"/NOUI":...
RoboDK is Running...
Traceback (most recent call last):
File "C:\RoboDK\Python37\test.py", line 4, in <module>
item = RDK.AddFile(r'C:\RoboDK\001_Wjf_Practices\07_2023_11_08\Cabinet20231108.rdk')
File "C:\RoboDK\Python37\lib\site-packages\robodk\robolink.py", line 1765, in AddFile
newitem = self._rec_item()
File "C:\RoboDK\Python37\lib\site-packages\robodk\robolink.py", line 829, in _rec_item
buffer = self.COM.recv(8)
ConnectionResetError: [WinError 10054] An existing connection was forcibly closed by the remote host
>>>

Would you please help me? Thanks.

I wrote a test.py as following:

from robodk.robolink import * # import the robolink library
RDK = Robolink(args='/NOUI')
#RDK = Robolink()
item = RDK.AddFile(r'C:\Car20231108.rdk')

robot = RDK.Item('Doosan Robotics M0617')
target = RDK.Item('Target112')
robot.MoveJ(target)
targetJoints= robot.Joints().list()

f = open("C:\RoboDK\Python37\demofile2.txt","w")
mystr= ""
for i in range(len(targetJoints) - 1):
mystr =mystr + str(targetJoints[i]) + ","

mystr =mystr + str(targetJoints[i])

f.write(mystr)
f.close()


And I opened test.py in IDLE 3.7.4 and tried to run test.py. There was a error as follows:

==================== RESTART: C:\RoboDK\Python37\test.py ====================
Starting C:/RoboDK/bin/RoboDK.exe

EXECUTING:"/NOUI":...
RoboDK is Running...
Traceback (most recent call last):
File "C:\RoboDK\Python37\test.py", line 4, in <module>
item = RDK.AddFile(r'C:\Car20231108.rdk')
File "C:\RoboDK\Python37\lib\site-packages\robodk\robolink.py", line 1765, in AddFile
newitem = self._rec_item()
File "C:\RoboDK\Python37\lib\site-packages\robodk\robolink.py", line 829, in _rec_item
buffer = self.COM.recv(8)
ConnectionResetError: [WinError 10054] An existing connection was forcibly closed by the remote host
>>>

Would you please help me? Thanks.
#2
Do you have the same behavior if you remove the -NOUI option?

You can also check if the API is running properly here:
  1. Select Tools-Options
  2. Select the Other tab
You should see a message towards the top of the window saying Server running at 127.0.0.1:20500
  




Users browsing this thread:
1 Guest(s)