How to assign a variable base frame to a program

  • I have a single program that is able to run using either of two base frames. How do I code it so that the BASE FRAME is a variable that I can assign one of the two values??




    ;FOLD LIN P2 CONT Vel=2 m/s CPDAT1 Tool[10]:t_penTH Base[5]:w_tri1TH ;%{PE}


    ;FOLD Parameters ;%{h}


    ;Params IlfProvider=kukaroboter.basistech.inlineforms.movement.old; Kuka.IsGlobalPoint=False; Kuka.PointName=P2; Kuka.BlendingEnabled=True; Kuka.MoveDataName=CPDAT1; Kuka.VelocityPath=2; Kuka.CurrentCDSetIndex=0; Kuka.MovementParameterFieldEnabled=True; IlfCommand=LIN


    ;ENDFOLD


    $BWDSTART = FALSE


    LDAT_ACT = LCPDAT1


    FDAT_ACT = FP2


    BAS(#CP_PARAMS, 2.0)


    SET_CD_PARAMS (0)


    LIN XP2 C_Dis C_Dis


    ;ENDFOLD


    ;FOLD LIN P3 CONT Vel=2 m/s CPDAT2 Tool[10]:t_penTH Base[5]:w_tri1TH ;%{PE}


    ;FOLD Parameters ;%{h}


    ;Params IlfProvider=kukaroboter.basistech.inlineforms.movement.old; Kuka.IsGlobalPoint=False; Kuka.PointName=P3; Kuka.BlendingEnabled=True; Kuka.MoveDataName=CPDAT2; Kuka.VelocityPath=2; Kuka.CurrentCDSetIndex=0; Kuka.MovementParameterFieldEnabled=True; IlfCommand=LIN


    ;ENDFOLD


    $BWDSTART = FALSE


    LDAT_ACT = LCPDAT2


    FDAT_ACT = FP3


    BAS(#CP_PARAMS, 2.0)


    SET_CD_PARAMS (0)


    LIN XP3 C_Dis C_Dis


    ;ENDFOLD


    ;FOLD LIN P4 CONT Vel=2 m/s CPDAT3 Tool[10]:t_penTH Base[5]:w_tri1TH ;%{PE}


    ;FOLD Parameters ;%{h}


    ;Params IlfProvider=kukaroboter.basistech.inlineforms.movement.old; Kuka.IsGlobalPoint=False; Kuka.PointName=P4; Kuka.BlendingEnabled=True; Kuka.MoveDataName=CPDAT3; Kuka.VelocityPath=2; Kuka.CurrentCDSetIndex=0; Kuka.MovementParameterFieldEnabled=True; IlfCommand=LIN


    ;ENDFOLD


    $BWDSTART = FALSE


    LDAT_ACT = LCPDAT3


    FDAT_ACT = FP4


    BAS(#CP_PARAMS, 2.0)


    SET_CD_PARAMS (0)


    LIN XP4 C_Dis C_Dis


    ;ENDFOLD


    ;FOLD LIN P5 CONT Vel=2 m/s CPDAT4 Tool[10]:t_penTH Base[5]:w_tri1TH ;%{PE}


    ;FOLD Parameters ;%{h}


    ;Params IlfProvider=kukaroboter.basistech.inlineforms.movement.old; Kuka.IsGlobalPoint=False; Kuka.PointName=P5; Kuka.BlendingEnabled=True; Kuka.MoveDataName=CPDAT4; Kuka.VelocityPath=2; Kuka.CurrentCDSetIndex=0; Kuka.MovementParameterFieldEnabled=True; IlfCommand=LIN


    ;ENDFOLD


    $BWDSTART = FALSE


    LDAT_ACT = LCPDAT4


    FDAT_ACT = FP5


    BAS(#CP_PARAMS, 2.0)


    SET_CD_PARAMS (0)


    LIN XP5 C_Dis C_Dis


    ;ENDFOLD


    ;FOLD LIN P6 CONT Vel=2 m/s CPDAT5 Tool[10]:t_penTH Base[5]:w_tri1TH ;%{PE}


    ;FOLD Parameters ;%{h}


    ;Params IlfProvider=kukaroboter.basistech.inlineforms.movement.old; Kuka.IsGlobalPoint=False; Kuka.PointName=P6; Kuka.BlendingEnabled=True; Kuka.MoveDataName=CPDAT5; Kuka.VelocityPath=2; Kuka.CurrentCDSetIndex=0; Kuka.MovementParameterFieldEnabled=True; IlfCommand=LIN


    ;ENDFOLD


    $BWDSTART = FALSE


    LDAT_ACT = LCPDAT5


    FDAT_ACT = FP6


    BAS(#CP_PARAMS, 2.0)


    SET_CD_PARAMS (0)


    LIN XP6 C_Dis C_Dis


    ;ENDFOLD

  • kwakisaki

    Approved the thread.
  • Hi Fubini

    I moved the value of BASE_DATA[8] into a place holder BASE_DATA[30], the updated BASE_DATA[8] with the value from BASE_DATA[12]. as shown below.


    program executed correctly, positions relative to BASE_FRAME[12]


    BASE_DATA[30]=BASE_DATA[8]

    BASE_DATA[8]=BASE_DATA[12]


    At the end of the routine, I moved the original data back to BASE_FRAME[8] as shown below.


    BASE_DATA[8]=BASE_DATA[30]

    program executed correctly, positions relative to the BASE_FRAM[8]


    Is there any issues that you can see that can't


    Thanks


    Pete

  • I moved the value of BASE_DATA[8] into a place holder BASE_DATA[30], the updated BASE_DATA[8] with the value from BASE_DATA[12]. as shown below.

    If you want to use Inline Forms, this is a workable approach. Although I would assign one BASE_DATA to be used by the program, then at the top of the program always re-write that Base from one of my two "permanent" Bases, rather than moving Base data back and forth:

    Code
    SWITCH nWhatBaseDoIWantToUse
    CASE 5:
      BASE_DATA[1] = BASE_DATA[5]
    CASE 6:
      BASE_DATA[1] = BASE_DATA[6]
    DEFAULT:
      ; Unsupported value
      HALT
    ENDSWITCH

    So all the Inline Form points would be programmed to use Base 1, but Base 1 will only ever be set equal to either Base 5 or Base 6.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account
Sign up for a new account in our community. It's easy!
Register a new account
Sign in
Already have an account? Sign in here.
Sign in Now