We currently control a Fanuc M-10iD/12 robot arm through ROBODK connection made from the PC.
We excute mainprog to control DO105 and triggered off the macro prog(group mask 1,*,*,*,*,*,*,*) of robot then use RDK.RunProgram('myprog',wait_for_finished=True), wait for DI 108 signal on when macro prog completed, it triggered off DI 108 signal and return to mainporg, continue to execute other actions while it excutes point6, we always have unexpected error:
Alarm:
INTP-105 (RMACRO02,1) Run request failed
PROG-040 Already locked by other task
I think it's an erro caused by group mask, checked several possible information and solution but cannot solve it
is it possible to get your advice / comment to solve this issue?
The macro prog is a visual software irvision 3DV from Fanuc.
Attached is the macro program documentation.
And complete mainprog:
We excute mainprog to control DO105 and triggered off the macro prog(group mask 1,*,*,*,*,*,*,*) of robot then use RDK.RunProgram('myprog',wait_for_finished=True), wait for DI 108 signal on when macro prog completed, it triggered off DI 108 signal and return to mainporg, continue to execute other actions while it excutes point6, we always have unexpected error:
Code:
print("point6")
current_pose = robot.Pose()
new_pose = current_pose * transl(0,0,100)
robot.setPose(new_pose)
robot.MoveJ(new_pose)
INTP-105 (RMACRO02,1) Run request failed
PROG-040 Already locked by other task
I think it's an erro caused by group mask, checked several possible information and solution but cannot solve it
is it possible to get your advice / comment to solve this issue?
The macro prog is a visual software irvision 3DV from Fanuc.
Attached is the macro program documentation.
And complete mainprog:
Code:
from robolink import *
from robodk import *
from robodk import robomath
from robodk.robolink import *
from robodk.robomath import *
import keyboard
RDK = Robolink()
item = RDK.Item('base')
itemlist = RDK.ItemList()
robot = RDK.ItemUserPick('Fanuc M-10iD/12', ITEM_TYPE_ROBOT)
while True:
success = robot.Connect()
time.sleep(3)
status, status_msg = robot.ConnectedState()
if status != ROBOTCOM_READY:
print("robot not ready")
else:
break
RDK.setRunMode(RUNMODE_RUN_ROBOT)
robot.setSpeed(100)
c=0
while True:
#"""
robot.setDO(105,1)
time.sleep(0.5)
robot.setDO(105,0)
time.sleep(0.2)
print("point1")
prog = RDK.Item('myprog',ITEM_TYPE_PROGRAM)
print("point2")
RDK.RunProgram('myprog',wait_for_finished=True)
#"""
print("結束fanuc控制權回到python")
target = robot.Pose()
print("point3")
robot.setDO(106,0)
time.sleep(0.2)
print("point5")
robot.MoveJ([85.513,-14.088,-43.344,-178.804,-132.483,-50.564])
time.sleep(0.2)
print("point6")
current_pose = robot.Pose()
new_pose = current_pose * transl(0,0,100)
robot.setPose(new_pose)
robot.MoveJ(new_pose)
c+=1
print(f"count:{c}")
if keyboard.is_pressed('q'):
break