Creating a tappet track online with position-based tappets

How to create a tappet track online with position-based tappets:
  1. Create 3 instances
  • L_MC2P_TappetDataPos1 :
    ARRAY[0..1] OF L_MC2P_TappetDataPos;
  • L_MC2P_TappetRefFromStruct1 :
    L_MC2P_TappetRefFromStruct;
  • L_MC2P_TappetRegister1 :
    L_MC2P_TappetRegister;
  1. Create two tappets with FB L_MC2P_TappetDataPos1
  • Tappet 1:
    L_MC2P_TappetDataPos1[0].lrTappetOn := 90.0;
    L_MC2P_TappetDataPos1[0].lrTappetOff := 180.0;
  • Tappet 2:
    L_MC2P_TappetDataPos1[1].lrTappetOn := 270.0;
    L_MC2P_TappetDataPos1[1].lrTappetOff := 320.0;
  1. Create FB L_MC2P_TappetDataPos and instance of L_MC2P_TappetRefFromStruct1 at input itfTappetData :

L_MC2P_TappetRefFromStruct1(

xExecute:= TRUE,

sName:= 'Test',

eTappetType:= L_MC2P_TappetType.BidirectionalWay,

udiCamDataCount:= 2,

lrXStartPos:= 0.0,

lrXEndPos:= 360.0,

itfTappetData:= L_MC2P_TappetDataPos1[0],

xDone=> ,

xBusy=> ,

xError=> ,

eErrorID=> );

  1. Assign the instance of L_MC2P_TappetRefFromStruct1 to the input itfTappetTable of FB L_MC2P_TappetRegister1 :

L_MC2P_TappetRegister1(

Axis:= LM_Drive_i700,

xEnable:= ,

itfTappetTable:= L_MC2P_TappetRefFromStruct1,

lrOffset:= ,

lrHyterese:= ,

lrReactTimeOn:= ,

lrReactTimeOff:= ,

eValueSource:= MC_SOURCE.mcSetValue,

byDigitalOutputSel:= 1,

pFastIO_Out := ADR(FastIO_OutRef),

xSwitch=> ,

xBusy=> ,

xError=> ,

eErrorID=> );