SPOT(MoveType, POINT_DATA, SGEQ_ParamData, SGRS_ParamData) 焊接控制時(shí)序
DEF SPOT (MoveType:IN, PointData:IN, SGEQ_ParamData:IN, SGRS_ParamData:OUT )
MoveType:移動(dòng)類型? PTP
PointData: 焊點(diǎn)的數(shù)據(jù):
SG_POINT_Default={Name[]"SG1",GNumber 1,Thickness 0.0,ThicknessTol 0.0,ForceProfile[]"none",ForceMode #SINGLE,Force 0.0,WeldTime 0.0,Force2 0.0,Comp#NO,Path 2.30000,PrNumber 1,MoveApprox TRUE,MaxRestart 5,Cont#NO,KeepForceAtWelding FALSE}
SGEQ_ParamData: 平衡控制的數(shù)據(jù)
CASE #MEDIUM
EEQ_PAct.MODE = EQMode
EEQ_PAct.TimeExpectedFactor = 75
EEQ_PAct.Push_ThresholdFactor = 100
EEQ_PAct.Push_ReduceTorqueFactor = 100
SGEQ_StartForceFactor =100
SGRS_ParamData: 暫時(shí)不用
SPOT準(zhǔn)備點(diǎn):
retry = FALSE 初始化變量重試功能
IF(SG_MaxRestart== 0)THEN SG_MaxRestart=3
SG_MaxRestart = ServoGun[1].MaxRestart=3重復(fù)次數(shù)
RetryMaxReached = TRUE ?重試達(dá)到的最大
ELSE
RetryMaxReached = FALSE
ENDIF
NewStart = FALSE
SpotSteps=checkwear ?檢查磨損步
REPEAT? 開(kāi)始執(zhí)行循環(huán)
IF((retry) AND (SpotSteps == endSpot))THEN
重試功能被激活, SpotSteps == endSpot在結(jié)束步
RetryMaxReached = SpotCountRetry()重復(fù)計(jì)數(shù)重試>3重試達(dá)到的最大
SpotSteps = checkwear 去檢查磨損步
retry = FALSE 關(guān)閉重試
ENDIF
SWITCH SpotSteps
CASE checkwear 檢查磨損
SGL_HandleCheckWear(SGL_CheckWear(), SpotSteps, checkNoPartIn, checkNoPartIn, 0, endspot, errorRetry, RetryMaxReached)
檢查電極是否滿足要求,正常情況去下一步checkNoPartIn
IF(SpotSteps == errorRetry)THEN? 如果需要去錯(cuò)誤重試步
retry = TRUE ?激活重試
ENDIF
CASE checkNoPartIn 檢查沒(méi)有零件
IF(ServoGun[SG_ActiveGunNumber].CompType == #AIR)THEN
設(shè)置規(guī)定CompType #EQUALIZING平衡技術(shù),因此這段程序不執(zhí)行
SG_DECL_COMP_INTERRUPT (PointData.Comp,PointData.Cont)
ENDIF
IF(SGL_ReadIn(SG_NoPart,FALSE))THEN
SG_NoPart=0, 讀入E0=0,檢驗(yàn)位SGL_ReadIn反饋false
SG_NoPart_ER = TRUE
SG_MainErrorHandlTyp = #MainWithNotify
returnUnused = SGE_MainAndSubmitMsg_ER (FALSE)
SpotSteps = reposition 去返回原位
ELSESGL_ReadIn反饋false執(zhí)行下一步檢查槍力
SpotSteps = checkGunForceLim 執(zhí)行下一步檢查槍力
ENDIF
CASE checkGunForceLim 檢查槍力極最小限值
CONTINUE
IF(NOT ((SG_GunForce)<=$FORCE_LIM[(6+SG_ExtaxActive)]))THEN
SG_ExtaxActive=1 激活的外部軸1$FORCE_LIM 力最小極限值,這段的意思是給入的力值不能小于系統(tǒng)極限值.
SpotSteps = checkGunForceMax去檢查力是否超出最大值
ELSE? 如果小于最小值
SG_ForceLowerFlim_ER=TRUE ?小于最小值故障報(bào)警
SG_MainErrorHandlTyp = #MainWithDlg
SpotSteps =SGL_DlgAnsOrMsgLineSel(FALSE, reposition,,RetryMaxReached)? ?需要跳到回到原位步
ENDIF
CASE checkGunForceMax? 檢查槍力是否超出最大值
CONTINUE
IF(NOT ((SG_GunForce)>$FORCE_MAX[(6+SG_ExtaxActive)]))THEN
SG_ExtaxActive=1 激活的外部軸1$FORCE_MAX 力最大極限值,這段的意思是給入的力值不能大于系統(tǒng)極限值.
SpotSteps = checkSpinTime 去檢查旋轉(zhuǎn)時(shí)間步
ELSE?? 否則
SG_ForceHigherFmax_ER=TRUE大于最大值故障報(bào)警
SG_MainErrorHandlTyp = #MainWithDlg
SpotSteps = SGL_DlgAnsOrMsgLineSel (FALSE, reposition,,RetryMaxReached)需要跳到故障復(fù)位步
ENDIF
CASE checkSpinTime ;檢查旋轉(zhuǎn)時(shí)間-機(jī)器人旋轉(zhuǎn)選項(xiàng)已啟用(機(jī)器人沒(méi)有使用此功能)
IF(SG_RobospinInstalled) AND SGRS_Active AND NOT (SGRS_ParamData.SpinTyp== #OFF)THEN
SG_RobospinInstalled=FALSE 控制器沒(méi)有安裝機(jī)器人旋轉(zhuǎn).因此以下程序很多將不執(zhí)行.
IF(SGRS_ParamData.SpinAngle == 0)THEN
SGRS_ParamData.SpinTyp = #OFF
SGRS_AngleZero_ER = TRUE
SG_MainErrorHandlTyp = #MainWithNotify
returnUnused =SGE_MainAndSubmitMsg_ER (FALSE)???
ENDIF
IF((SGRS_ParamData.SpinTimeSource == #WELDTIMER) AND (SGRS_ParamData.SpinTyp== #DURING))THEN
SGRS_ParamData.SpinTime = 0
FOR i = 1 TO(SG_ForceCountMax-1);多力驗(yàn)證
IF(SG_PointForcesTime[i] < 10)THEN;檢查時(shí)間是以秒還是毫秒為單位?????????? SG_PointForcesTime[i] =SG_PointForcesTime[i] * 1000
ENDIF
SGRS_ParamData.SpinTime =SGRS_ParamData.SpinTime + SG_PointForcesTime[i]
ENDFOR
SGRS_ParamData.SpinTime =SGRS_ParamData.SpinTime + SGRS_ParamData.TimeOffset
IF NOT (SGRS_ParamData.SpinTime < 0 )THEN
SpotSteps =ActivateTorqSafety
ELSE
SGRS_TimeToLow_ER=TRUE
SG_MainErrorHandlTyp = #MainWithDlg
SpotSteps =SGL_DlgAnsOrMsgLineSel (FALSE, reposition,,RetryMaxReached)
ENDIF?????
ELSE
SpotSteps =ActivateTorqSafety
ENDIF
ELSE? 如果沒(méi)有使用運(yùn)轉(zhuǎn)功能就去下一步“啟動(dòng)焊接安全”
SpotSteps = ActivateTorqSafety
ENDIF?
CASE ActivateTorqSafety?啟動(dòng)焊接安全
SGL_TorqueOn ()? 扭矩檢查扭矩,用以保護(hù)槍設(shè)置極限機(jī)器人扭矩值
SpotSteps = resetCompensation 去重置補(bǔ)償步
CASE resetCompensation?重置補(bǔ)償,跳過(guò)
IF(ServoGun[SG_ActiveGunNumber].CompType== #AIR)THEN
SGL_SetCompOut(TRUE,PointData.Comp) CompType=#EQUALIZING平衡技術(shù)
ENDIF
SpotSteps = PrepareMoveToForce 去準(zhǔn)備移至力值步
CASE PrepareMoveToForce?準(zhǔn)備移至力值
CONTINUE
INTERRUPTDECL SG_Interrupt21 WHEN $SG_PART_DETECTED[6+SG_ExtaxActive] == TRUE DO SG_SetPartDetected()
激活中斷零件檢測(cè), $SG_PART_DETECTED[7]外部軸7軸的零件檢測(cè),被認(rèn)為檢測(cè)到零件
SG_PartDetected= FALSE零件檢測(cè)
SGL_SaveSetSoftend (SG_PartThickness-SG_PartThicknessTol)
SG_ConstSpeed=SGL_SPEED_CALC(SG_GunForce,MoveType,TRUE)
速度計(jì)算(焊鉗給入力值,運(yùn)動(dòng)類型PTP, 激活)
SGM_CALCULATE_POINTS(SG_GunForce,#WELD) 點(diǎn)計(jì)算和設(shè)定最大扭矩
IF SG_DEBUG_MeasureForce THEN
returnUnused = SGL_ForceMeanVal(TRUE)
ENDIF
SpotSteps = MoveToForce
CASE MoveToForce? 移動(dòng)到力量
IF(SG_ForceTraceEnable)THEN強(qiáng)制跟蹤沒(méi)有啟用SG_ForceTraceEnable=FALSE
SG_StartForceTrace(SG_ActiveGunNumber)啟動(dòng)力追蹤
ENDIF
SG_StopReaction = FALSE?停止反應(yīng)
-------開(kāi)啟中斷----------
INTERRUPTON SG_Interrupt1? ; 禁止重新定位
INTERRUPTON SG_Interrupt9 ; 停止按鈕
INTERRUPTON SG_Interrupt21 ; 檢測(cè)分割
SG_ReposActive = FALSE 重復(fù)定位不啟動(dòng)
SGM_MOVE_TO_FORCE(SG_GunForce, MoveType, #WELD, SGEQ_ParamData, SGRS_ParamData)? 移動(dòng)到焊接軌跡點(diǎn)并帶力移動(dòng)進(jìn)行夾緊
SGL_MaintenanceCounter(SG_ActiveGunNumber)維護(hù)計(jì)數(shù)器
SpotSteps = WaitPartDetected? 等待零件檢測(cè)到給到下一步
SGL_TimerControl(SG_TimerFCTRL,#TRestart)? 開(kāi)啟時(shí)間監(jiān)控
CASE WaitPartDetected? 等待零件檢測(cè)到
IF((SGEQ_ParamData.MODE<>#OFF) AND (SGEQ_Active==TRUE) AND SGEQ_ActivePointCond)THEN
SGEQ_ParamData.MODE = EQMode,平衡控制激活,活動(dòng)點(diǎn)號(hào)SGEQ_ActivePointCond=FALSE
IF(($TIMER[SGEQ_TimerFixPos] * 0.001)> SGEQ_CurrentParameters.TIME_EXPECTED)THEN
SGEQ_StartFreeze = TRUE? 開(kāi)始凍結(jié)
ENDIF
ENDIF
IF(SG_PartDetected)THEN 如果檢測(cè)到零件,通過(guò)中斷程序檢測(cè)零件
SpotSteps = ContPosChckFandThick 去檢查厚度步
ELSE? 如果沒(méi)有檢測(cè)到零件
CONTINUE
IF(($MODE_OP == #T1) OR? ($OV_PRO < 50))THEN
TimeResult =SG_TimeoutTimePartDetec * 5.0
SG_TimeoutTimePartDetec 1750.0
ELSE 如果不是T1模式,速度沒(méi)有小與50
TimeResult =SG_TimeoutTimePartDetec
ENDIF
---超時(shí)報(bào)警-----
IF($Timer[SG_TimerFCTRL] >= TimeResult)THEN
如果T33>=1750.0/875
SG_NoPartDetected_ER = TRUE 沒(méi)有找到零件故障
SG_MainErrorHandlTyp = #MainWithDlg 手動(dòng)復(fù)位報(bào)警提示
$FORCE[(6+SG_ExtaxActive)] = 0 ;力控制關(guān)閉
SGEQ_StartFreeze = TRUE
SGEQ_Stop()焊鉗移動(dòng)關(guān)閉
IF(NOT RetryMaxReached)THEN 如果沒(méi)有達(dá)到最大重復(fù)次數(shù)
SWITCH( SGE_MainAndSubmitMsg_ER(RetryMaxReached))
CASE 1?? 通過(guò)提示信息反饋,是要重焊,還是去下一點(diǎn)
是->重試最后一點(diǎn)
SpotSteps = errorRetry 去錯(cuò)誤重試步
retry = TRUE
CASE 2; 不->繼續(xù)開(kāi)槍->下一點(diǎn)
SpotSteps = disableForceMode 去關(guān)閉力模式
ENDSWITCH
ELSE 如果沒(méi)有到達(dá)最大重復(fù)步,就去
SpotSteps = SGL_DlgAnsOrMsgLineSel (false, disableForceMode,,RetryMaxReached)監(jiān)控計(jì)算步
ENDIF
ELSE如果沒(méi)有超時(shí)就再去等待零件檢測(cè)步
SpotSteps = WaitPartDetected
ENDIF
ENDIF
CASE FastVectorMoveOff?快速矢量移動(dòng)關(guān)閉步
ActivateFastVMVOff()? 確認(rèn)焊接快速夾緊
SpotSteps = ContPosChckFandThick 連續(xù)位置檢查零件厚度
CASE ContPosChckFandThick??連續(xù)位置檢查零件厚度
SG_TriggerEnd=FALSE?? 觸發(fā)結(jié)束
IF(SGM_ChkForcePartThick(SGEQ_ParamData,TRUE,RetryMaxReached))THEN?? 如果計(jì)算零件厚度正確
SpotSteps = ForceReached 去力達(dá)到
ELSE 如果厚度不正確
SG_MainErrorHandlTyp = #MainWithDlg 需要手動(dòng)復(fù)位
CONTINUE
IF(($MODE_OP == #T1) OR ($MODE_OP == #T2))THEN
CONTINUE
$FORCE[(6+SG_ExtaxActive)] = 0 ;關(guān)力控制
ENDIF
IF(NOT RetryMaxReached)THEN 如果沒(méi)有到達(dá)力重復(fù)最大值
SWITCH( SGE_MainAndSubmitMsg_ER(RetryMaxReached))
主要并提交故障信息
CASE 1?? ; 是->重試最后一點(diǎn)
SpotSteps = errorRetry
retry = TRUE
CASE 2? ;否->繼續(xù)開(kāi)槍->下一點(diǎn)
SpotSteps = disableForceMode去關(guān)閉力模式步
ENDSWITCH
ELSE 如果可以計(jì)算步信息
SpotSteps = SGL_DlgAnsOrMsgLineSel (false, disableForceMode,,RetryMaxReached)
ENDIF
ENDIF
CASE ForceReached力達(dá)到
IF SG_DEBUG_MeasureForce THEN ?測(cè)量力診斷暫時(shí)不用
returnUnused = SGL_ForceMeanVal(FALSE)
ENDIF
IF( SGW_PrepAndStartWeld(#WaitForReady,NewStart)== 1 )THEN
開(kāi)始焊接 ,焊接結(jié)束后
SpotSteps = detectWeldEnd檢測(cè)焊接結(jié)束
ELSE 如果焊接不合格
SG_TimerErrorHandlTyp = #TimerWithDlg 故障報(bào)警類型
CONTINUE
IF(($MODE_OP == #T1) OR ($MODE_OP == #T2))THEN
如果是在T1模式或者T2模式
CONTINUE
$FORCE[(6+SG_ExtaxActive)] = 0 ;關(guān)力控制
ENDIF
SGEQ_Stop() 關(guān)閉焊鉗平衡移動(dòng)
;水位檢查
error_Water =SGE_WaterguardChecker()流量檢測(cè)
IF(NOT RetryMaxReached)THEN 如果沒(méi)有重試達(dá)到的最大值
IF error_Water THEN? 水錯(cuò)誤
Result =SGE_MainAndSubmitMsg_ER(RetryMaxReached)
進(jìn)入機(jī)器人故障提示對(duì)話框報(bào)錯(cuò): 重試達(dá)到的最大
ELSE
Result =SGE_WeldTimerMsg_ER(RetryMaxReached)
ENDIF
SWITCH Result
CASE 1?? ; yes -->重試
returnUnused = SG_ResetError_IWT(#ResetDefault)恢復(fù)默認(rèn)
SpotSteps = errorRetry? 去故障重試步
retry = TRUE
CASE 2; no -->繼續(xù)開(kāi)槍->下一點(diǎn)
returnUnused = SG_ResetError_IWT(#ResetDefault)恢復(fù)默認(rèn)
SpotSteps = disableForceMode
ENDSWITCH
ELSE
SpotSteps = SGL_DlgAnsOrMsgLineSel ((NOT error_Water), disableForceMode,,RetryMaxReached)
ENDIF
ENDIF
CASE detectWeldEnd 檢測(cè)焊接結(jié)束
SG_WriteLogbook(SG_ProgramNumber, FALSE, SGEQ_ParamData)寫(xiě)日志書(shū)
IF(SG_RobospinInstalled AND (SGRS_ParamData.SpinTyp==#DURING) AND SGRS_Active)THEN;SG_RobospinInstalled=false機(jī)器人運(yùn)行, SpinTyp= #OFF SGRS_Active=TRUE 不使用機(jī)器人旋轉(zhuǎn)
IF SGEQ_ActivePointCond THEN
IF $VMSTATE.ACTIVE THEN
SGEQ_STOP()??????????????
WAIT FOR ($VMSTATE.ACTIVE ==FALSE)????
ENDIF??????????????
ENDIF??????????????
SGRS_RoboSpinTurn($POS_ACT_MES,MoveType, PointData, SGRS_ParamData) ;開(kāi)始機(jī)器人旋轉(zhuǎn)的轉(zhuǎn)彎運(yùn)動(dòng)
TimerResult = SGg_ResultWeldEnd
NewStart = SGg_NewStart
ELSE? 不使用機(jī)器人旋轉(zhuǎn)就執(zhí)行下面的程序
TimerResult = SGW_GetWeldEndSignal(NewStart)E785焊接完成FK
獲取焊接結(jié)束信號(hào)(重新開(kāi)始)
ENDIF
IF( TimerResult == 1)THEN? ;焊接控制器無(wú)錯(cuò)誤
RoboSpinBySPS = FALSE ?機(jī)器人旋轉(zhuǎn)
RoboSpinBySPS = SGL_ReadIn(SG_StartRoboSpin,TRUE)
SG_StartRoboSpin=0 ,沒(méi)有使用機(jī)器人旋轉(zhuǎn)????
IF(SG_RobospinInstalled AND (SGRS_ParamData.SpinTyp==#AFTER) ANDSGRS_Active AND RoboSpinBySPS)THEN(不使用)
-焊接后機(jī)器人旋轉(zhuǎn)-SG_RobospinInstalled=FALSE SpinTyp= #OFF ,SGRS_Active=TRUE,RoboSpinBySPS = FALSE
IF(SGRS_AktCounter[SG_ActiveGunNumber] <= SGRS_TurnCount)THEN
SGRS_HelpGunForce =((100-SGRS_ParamData.PercentForce)/100)* SG_GunForce
SGRS_GunForce =SGRS_HelpGunForce
IF(SGRS_GunForce < $Force_LIM[6+SG_ExtaxActive])THEN
;目標(biāo)力小于力的極限值
SGRS_GunForce = $Force_LIM[6+SG_ExtaxActive]+1
SGRS_ForceLim_ER = TRUE
returnUnused = SGE_MainAndSubmitMsg_ER (FALSE)
ENDIF
$FORCE[(6+SG_ExtaxActive)] = SGRS_GunForce ?旋轉(zhuǎn)力760
PTP $POS_ACT? 執(zhí)行當(dāng)前位置
waitfor TRUE
IF SGEQ_ActivePointCond THEN
IF $VMSTATE.ACTIVE THEN
SGEQ_STOP()??????????????
WAITFOR($VMSTATE.ACTIVE == FALSE)????
ENDIF??????????????
ENDIF??????????????
SGRS_RoboSpinTurn($POS_ACT_MES,MoveType, PointData, SGRS_ParamData);開(kāi)始RoboSpin的轉(zhuǎn)彎運(yùn)動(dòng)
SGRS_RoboSpinSetOpenPos()
IF($MODE_OP == #AUT) OR ($MODE_OP== #EX)THEN
SGRS_AktCounter[SG_ActiveGunNumber] = SGRS_AktCounter[SG_ActiveGunNumber] + 1
ENDIF
ENDIF????
ENDIF??????
焊接合格后:去禁用力模式步
SpotSteps = disableForceMode, disableForceMode=140去禁用力模式步
IF(SG_RobospinInstalled AND (SGRS_ParamData.SpinTyp==#DURING) AND SGRS_Active)THENSpinTyp=OFF 機(jī)器人旋轉(zhuǎn)暫時(shí)沒(méi)有使用
; 焊接計(jì)時(shí)器沒(méi)有錯(cuò)誤,將新的起點(diǎn)設(shè)置為打開(kāi)噴槍
SGRS_RoboSpinSetOpenPos()
ENDIF
ELSE焊接控制器錯(cuò)誤,焊接不合格
SG_TimerErrorHandlTyp = #TimerWithDlg
SGEQ_Stop()?? 關(guān)閉平衡控制
IF(NOT RetryMaxReached)THEN
SWITCH( SGE_WeldTimerMsg_ER(RetryMaxReached))
CASE 1?? ; 是,重試地點(diǎn),并帶有新的槍口關(guān)閉功能
SpotSteps = errorRetry? 去錯(cuò)誤重試步
retry = TRUE
returnUnused = SG_ResetError_IWT(#ResetDefault)
CASE 2?? ; 不->繼續(xù)開(kāi)槍->下一點(diǎn)
returnUnused = SG_ResetError_IWT(#ResetDefault)
SpotSteps = errorRetry
retry = FALSE
CASE 3?? ?僅重試焊縫而無(wú)需打開(kāi)和關(guān)閉
returnUnused = SG_ResetError_IWT(#ResetWithRetry)
SpotSteps = ForceReached
DEFAULT
REPEAT
MsgNotify("Unexpectedanswer from weld timer, program running must be stopped.")焊接計(jì)時(shí)器的意外應(yīng)答,必須停止程序運(yùn)行
HALT
UNTIL FALSE
ENDSWITCH
ELSE
SpotSteps =SGL_DlgAnsOrMsgLineSel (TRUE, disableForceMode,,RetryMaxReached)? ---計(jì)算步去力關(guān)閉步
ENDIF
ENDIF
CASE disableForceMode 關(guān)閉力模式
IF(SG_PointDataAct.KeepForceAtWelding)THEN
KeepForceAtWelding=FALSE保持焊接力
RESET_TORQUE_LIMITS(6+SG_ExtaxActive)復(fù)位扭矩極限E1焊鉗
waitsec 0.0
ENDIF
CONTINUE
$FORCE[(6+SG_ExtaxActive)] = 0 ;關(guān)斷力控制
CONTINUE
;$APO.CPTP=1
INTERRUPTOFF SG_Interrupt1? ; 禁用抑制重新定位
INTERRUPTOFF SG_Interrupt9 ; 停止按鈕
INTERRUPTOFF SG_Interrupt21
SpotSteps = reposition?去回到原位步
CASE errorRetry? 錯(cuò)誤重試
INTERRUPTOFF SG_Interrupt1? ; 禁用抑制重新定位
INTERRUPTOFF SG_Interrupt9 ; 停止按鈕
INTERRUPTOFF SG_Interrupt21
$FORCE[(6+SG_ExtaxActive)] = 0 ;關(guān)斷力控制
IF(SG_PointDataAct.KeepForceAtWelding)THEN
保持焊接力KeepForceAtWelding =false
RESET_TORQUE_LIMITS(6+SG_ExtaxActive)重置扭矩極限
waitsec 0.0
ENDIF
TRIGGERWHENDISTANCE= 1 DELAY= 0 DO SGL_ResetSoftEnd(SG_ActiveGunNumber)PRIO=-1
因?yàn)橛泻附庸收?重新移動(dòng)到打開(kāi)位置
IF((ServoGun[SG_ActiveGunNumber].CompType==#EQUALIZING) AND (SGEQ_ParamData.Mode<>#OFF) AND (SGEQ_Active==TRUE))THEN
CompType=#EQUALIZING使用平衡控制. MODE = EQMode,平衡控制激活
SGEQ_Stop();如果上次嘗試仍將其關(guān)閉,請(qǐng)關(guān)閉矢量移
SGL_MoveToPos(SGEQ_StartPoint,SGEQ_StartPoint,#NO,#SG_LIN)
ELSE
SGL_MoveToPos(P_APPROX,P_APPROX,#NO,MoveType)
ENDIF
----X軸沒(méi)有補(bǔ)償
IF ServoGun[SG_ActiveGunNumber].XCompActive THEN? XCompActive=FALSE
SWITCH MoveType
CASE #SG_PTP, #SG_LIN ,#SG_CIRC
SGL_MoveToPos(SG_Startpoint,SG_Startpoint,#NO,#SG_LIN)
CASE #SG_SPTP, #SG_SLIN ,#SG_SCIRC
SGL_MoveToPos(SG_Startpoint,SG_Startpoint,#NO,#SG_SLIN)
ENDSWITCH
ENDIF
SpotSteps = reposition?去回到原位
CASE reposition? 回到原位
SGL_TorqueOff()? 轉(zhuǎn)矩控制關(guān)閉
IF((ServoGun[SG_ActiveGunNumber].CompType==#EQUALIZING) AND (SGEQ_ParamData.Mode<>#OFF) AND (SGEQ_Active==TRUE))THEN
SGEQ_Stop();停止焊槍平衡控制.如果上次嘗試仍將其關(guān)閉,請(qǐng)關(guān)閉向量移動(dòng)
ENDIF
IF(ServoGun[SG_ActiveGunNumber].CompType == #AIR)THEN
焊鉗平衡控制不使用空氣控制 CompType==#EQUALIZING
SWITCH SG_ExtaxActive
CASE 1
IF(SG_ClosingAxDir<0)THEN
IF($AXIS_ACT.E1>=SG_TriggerCompPos)THEN
SGL_COMPENSATOR()???????????????????
ELSE???????????????????????????????????
INTERRUPTON SG_Interrupt11
ENDIF
ELSE??
IF($AXIS_ACT.E1<=SG_TriggerCompPos)THEN
SGL_COMPENSATOR()
ELSE
INTERRUPTON SG_Interrupt11
ENDIF
ENDIF
CASE 2
IF(SG_ClosingAxDir<0)THEN
IF($AXIS_ACT.E2>=SG_TriggerCompPos)THEN
SGL_COMPENSATOR()???????????????????
ELSE???????????????????????????????????
INTERRUPTON SG_Interrupt11
ENDIF
ELSE??
IF($AXIS_ACT.E2<=SG_TriggerCompPos)THEN
SGL_COMPENSATOR()
ELSE
INTERRUPTON SG_Interrupt11
ENDIF
ENDIF
CASE 3
IF(SG_ClosingAxDir<0)THEN
IF($AXIS_ACT.E3>=SG_TriggerCompPos)THEN
SGL_COMPENSATOR()???????????????????
ELSE???????????????????????????????????
INTERRUPTON SG_Interrupt11
ENDIF
ELSE??
IF($AXIS_ACT.E3<=SG_TriggerCompPos)THEN
SGL_COMPENSATOR()
ELSE
INTERRUPTON SG_Interrupt11
ENDIF
ENDIF
CASE 4
IF(SG_ClosingAxDir<0)THEN
IF($AXIS_ACT.E4>=SG_TriggerCompPos)THEN
SGL_COMPENSATOR()???????????????????
ELSE???????????????????????????????????
INTERRUPTON SG_Interrupt11
ENDIF
ELSE??
IF($AXIS_ACT.E4<=SG_TriggerCompPos)THEN
SGL_COMPENSATOR()
ELSE
INTERRUPTON SG_Interrupt11
ENDIF
ENDIF
CASE 5
IF(SG_ClosingAxDir<0)THEN
IF($AXIS_ACT.E5>=SG_TriggerCompPos)THEN
SGL_COMPENSATOR()???????????????????
ELSE???????????????????????????????????
INTERRUPTON SG_Interrupt11
ENDIF
ELSE??
IF($AXIS_ACT.E5<=SG_TriggerCompPos)THEN
SGL_COMPENSATOR()
ELSE
INTERRUPTON SG_Interrupt11
ENDIF
ENDIF
CASE 6
IF(SG_ClosingAxDir<0)THEN
IF($AXIS_ACT.E6>=SG_TriggerCompPos)THEN
SGL_COMPENSATOR()???????????????????
ELSE???????????????????????????????????
INTERRUPTON SG_Interrupt11
ENDIF
ELSE??
IF($AXIS_ACT.E6<=SG_TriggerCompPos)THEN
SGL_COMPENSATOR()
ELSE
INTERRUPTON SG_Interrupt11
ENDIF
ENDIF
ENDSWITCH
ENDIF
SpotSteps = endSpot?步結(jié)束
ENDSWITCH
UNTIL((SpotSteps == endSpot) AND ((retry == FALSE) OR (RetryMaxReached)))
結(jié)束循環(huán)控制的條件: 在結(jié)束步并且沒(méi)有重復(fù),或者重復(fù)次數(shù)達(dá)到最大值
編輯:黃飛
?
評(píng)論
查看更多