Create Linear Motion Statement in Python

Forum Forums Visual Components 4.0 Robot Programming Create Linear Motion Statement in Python

Visual Components Essentials has been officially released, download link

Be sure to read the Forum Rules and Guidelines before start using the Forum.

This topic contains 2 replies, has 2 voices, and was last updated by  Fredrik 10 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #1807

    Fredrik
    Participant

    I’m trying to create linear motion statements with python.

    It creates the statements in the program with correct position and everything (tool, base, etc), but when I double click on the statement the robot doesn’t move to its location.

    Below is part of the code I’m using, what is wrong?

     

    Program = executor.Program
    Routine = Program.findRoutine(‘XCAL’)
    if Routine != None:
    Program.deleteRoutine(Routine)
    Routine = Program.addRoutine(‘XCAL’)

    …… some other code here…….

    count += 1
    sName = “XCAL%d” % count
    Statement = Routine.addStatement(VC_STATEMENT_LINMOTION)
    Statement.Base = Base1
    Statement.Tool = controller.Tools[0]
    PositionFrame = Statement.createPosition(sName)
    PositionFrame.PositionInReference = TargetPos

    #2005

    Ralle
    Participant

    Hi Fredrik,

    you don’t have to create a new position. When adding a new LIN statement the list ‘Positions’ has already an item that have to be used for the target definition.

    ….
    Statement.Tool = controller.Tools[0]
    PositionFrame = Statement.Positions[0]
    PositionFrame.PositionInReference = TargetPos    ….

    BR/Ralle

     

    #2038

    Fredrik
    Participant

    <p style=”text-align: left;”>Hi Ralle,</p>
    <p style=”text-align: left;”>Thanks for your comment, now it works like a charm</p>
    <p style=”text-align: left;”>BR</p>
    <p style=”text-align: left;”>Fredrik</p>

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.