Program Examples:Advanced Interpolation

From SoftMC-Wiki
Revision as of 09:04, 20 October 2021 by EranKo (talk | contribs) (Created page with "{{Languages|Program_Examples:Group_Blending}} here is an example of using Advanced interpolation:   <pre>'--------------------------------------------------------------...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Language: English  • 中文(简体)‎

here is an example of using Advanced interpolation:

 

'------------------------------------------------------------------------------
' File:        AI.prg
' Purpose:     example of using Advanced Interpolation
' Version:     1.00
' Author:      Eran Korkidi
' History:     20.OCT.2021 - Created


dim shared ARR_LOC[4] as location of XYZR
program

dim i as long

ARR_LOC[1] = #{100,100,0,0}
ARR_LOC[2] = #{200,100,0,0}
ARR_LOC[3] = #{200,200,0,0}
ARR_LOC[4] = #{100,200,0,0}

Attach XYZR
XYZR.EN=1
XYZR.BlendingMethod=1
with XYZR 
    ModelEnable=1
    prfType=-1
    PassMethod = 1
    PassBufferMin = 1    
    PassBufferMax = 2
    PassBufferSize = 100
    PassBufferMax = 100
    PassBufferMin  = 90
    PassTranMinGap = 1e-3  ' very short movements (below 1mm), therefore we should chnage tge gap
    PassRotMinGap  = 1e-06 ' same way with angle     
end with
Move XYZR #{0,0,0,0} Vcruise=10
waitForMotion XYZR

Record AI_MOT.rec 10000 Gap = 1 RecData = Setpoint{1}, Setpoint{2}
RecordOn
sleep 100
    XYZR.BlendingMethod=3
    for i = 1 to 3
        Moves XYZR ARR_LOC[1] Vtran=100 Abs=1
        Moves XYZR ARR_LOC[2] Vtran=100 Abs=1
        Moves XYZR ARR_LOC[3] Vtran=100 Abs=1
        Moves XYZR ARR_LOC[4] Vtran=100 Abs=1
    next
    dopass XYZR
    sleep 100
    while XYZR.IsMoving
       Sleep 100
    end while
    sleep 100
RecordOff
recordClose


end program ' <MyTask>.prg