Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
运行程序指导ion from API
#1
Hey guys,
We are trying to execute a specific instruction from a robot program using the python api. We looked at RunInstruction() but that didnt seem to be quite what we were looking for. We are iterating thru the list of instruction and just want to execute the move commands from the file. Here is the while loop that searches the program, but doesnt execute. Thanks
Code:
# Iterate through all the instructions in a program:
ins_id = 0
ins_count = prog.InstructionCount()
while ins_id < ins_count:
# Retrieve instruction
ins_nom, ins_type, move_type, isjointtarget, pose, joints = prog.Instruction(ins_id)
打印(ins_type)
#ins_type 0 is MoveJ or MoveL, MoveC =1
if ins_type <= 1:
# Select the movement instruction as a reference
prog.InstructionSelect(ins_id)

# Add a new program call
# prog.RunInstruction(ins_call, INSTRUCTION_CALL_PROGRAM)
TeachTar.RunCode()
while TeachTar.Busy():
pause(0.01)

# Advance one additional instruction as we just added another instruction
ins_id = ins_id + 1
ins_count = ins_count + 1

ins_id = ins_id + 1


Messages In This Thread
运行程序指导ion from API - byJacob- 02-05-2020, 05:16 PM
RE: Run Program Instruction from API - byAlbert- 02-05-2020, 06:55 PM
RE: Run Program Instruction from API - byJacob- 02-05-2020, 08:22 PM
RE: Run Program Instruction from API - byAlbert- 04-28-2020, 01:08 PM



Users browsing this thread:
1 Guest(s)