&ACCESS RVO2
&REL 16
&PARAM TEMPLATE = C:\KRC\Roboter\Template\vorgabe
&PARAM EDITMASK = *
DEF MoveToJointSet( )
;FOLD INI
  ;FOLD BASISTECH INI
    GLOBAL INTERRUPT DECL 3 WHEN $STOPMESS==TRUE DO IR_STOPM ( )
    INTERRUPT ON 3 
    BAS (#INITMOV,0 )
  ;ENDFOLD (BASISTECH INI)
  ;FOLD USER INI
  INTERRUPT ON 5  ; our 'estop' in the SA Robot interface
  ;ENDFOLD (USER INI)
;ENDFOLD (INI)

; Move to Commanded Joint Set
;FOLD Move to Commanded Joint Set
  InMoveFcn = TRUE
  $BWDSTART=FALSE
  ;PPDAT.VEL = jtVelocityPct
  ;PPDAT.ACC = jtAccelerationPct
  PDAT_ACT=PPDAT
  FDAT_ACT=FPDAT
  BAS(#PTP_PARAMS,jtVelocityPct)
  BAS(#ACC_PTP,jtAccelerationPct)
  ;BAS(#PTP_PARAMS,100)
  ;S ?B010?,T ?B1010?
  PAXIS.A1=joints[1]
  PAXIS.A2=joints[2]
  PAXIS.A3=joints[3]
  PAXIS.A4=joints[4]
  PAXIS.A5=joints[5]
  PAXIS.A6=joints[6]
  PTP PAXIS
;ENDFOLD
; Inform the RAC that the motion is complete
SendMotionComplete()

END