12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367 |
- #include "global.h"
- #if PENG_WEI_CHANG_MACHINE
- unsigned long cSlowPusle;
- unsigned char bStartOnceTime,bOnceProcess;
- unsigned short cWorkCnt;
- unsigned char TryCnt = 0;
- unsigned short cTbCnt = 0;
- unsigned char ZhuangLiaoOkFlg = 0;
- unsigned char SongLaTouOkFlg = 0;
- unsigned char FirstStartFlg = 0;
- unsigned char cBackFlg = 0;
- static long save_limit_pos;
- void QDCT_ManualAction(void);
- void QDCT_JiaLianAction(void);
- void QDCT_AutoStepAction(void);
- void QDCT_TableAction(void);
- void QDCT_Motor(void);
- void QDCT_CheckStart(void);
- void QDCT_SL_Step(void);
- void QDCT_XiaQieAction(void);
- void QDCT_AlarmProtect(void);
- void QDCT_ZLT_Step(void);
- void QDCT_TuiLian(void);
- void QDCT_ExtiActionX31(void)
- {
- if(cSeBiaoEn && !cSeBiaoOk)
- {
- cSeBiaoEn = 0;
- cSeBiaoOk = 1;
- SetRemainLength(X_AXIS,QDCT_SEBIAO_LENGTH,10);
- }
- }
- //故障报警
- void QDCT_SetAlarmCode(unsigned alarm_code)
- {
- SetAlarmCode(QDCT_ALARM_ADDR,alarm_code);
- QDCT_bAlarmStop = 1;
- }
- //初始化动作
- void QDCT_InitAction(void)
- {
- float buff_pulse,buff_dist;
-
- buff_pulse = QDCT_PARAM_CYCLE_PULSE;
- buff_dist = QDCT_PARAM_CYCLE_LENGTH;
- XGearRatio = buff_pulse/buff_dist;
- QDCT_SZ_OUT = QDCT_MOTOR_DISEN;
- }
- void QDCT_Action(void)
- {
- QDCT_AlarmProtect();
- QDCT_CheckStart();
- QDCT_TuiLian();
- QDCT_ZLT_Step();
- QDCT_TableAction();
- QDCT_SL_Step();
- QDCT_JiaLianAction();
- QDCT_XiaQieAction();
- QDCT_Motor();
- QDCT_ManualAction();
- QDCT_AutoStepAction();
- }
- void QDCT_AlarmProtect(void)
- {
- dwRealPos = GetPos(X_AXIS);
- if(QDCT_PARAM_BACK_ALARM_MODE)
- { //感应后限模式
- if(!bRunning)
- {
- if(QDCT_BACK_LIMIT_IN_UP)
- {
- if(X_DRV && (QDCT_bMotorBack) || (QDCT_MotorStep != 0)) //到后限不能再后退但可以点前进
- {
- QDCT_bMotorBack = 0;
-
- AxisEgmStop(X_AXIS);
- QDCT_JD_OUT = 0;
- QDCT_SetAlarmCode(QDCT_BACK_LIMIT_ALARM);
- }
- }
- }
- else
- {
- if(QDCT_BACK_LIMIT_IN_UP)
- {
- AxisEgmStop(X_AXIS);
-
- QDCT_JD_OUT = 0;
- QDCT_SetAlarmCode(QDCT_BACK_LIMIT_ALARM);
- }
- }
- }
- else
- {
- if(QDCT_GO_LIMIT_IN_UP) //数控后限模式
- {
- save_limit_pos = dwRealPos;
- SetData32bits(200,save_limit_pos);
- }
-
- if(QDCT_PARAM_MAX_BACK_LENGTH < (dwRealPos - save_limit_pos))
- {
- if(!bRunning)
- {
- if((QDCT_MotorStep == 0) && X_DRV && QDCT_bMotorBack) //到后限不能再后退但可以点前进
- {
- QDCT_bMotorBack = 0;
- AxisDecStop(X_AXIS);
- QDCT_JD_OUT = 0;
- QDCT_SetAlarmCode(QDCT_BACK_LIMIT_ALARM);
-
- }
- }
- else
- {
- AxisDecStop(X_AXIS);
- QDCT_JD_OUT = 0;
- QDCT_SetAlarmCode(QDCT_BACK_LIMIT_ALARM);
- }
- }
-
- }
-
-
- if(bRunning)
- {
- if(!QDCT_NO_ZIPPER_CHECK_IN)QDCT_SetAlarmCode(QDCT_NO_ZIPPER_ALARM);
- }
- }
- void QDCT_JiaLianAction(void)
- {
- if(QDCT_JZ_IN_UP && QDCT_GO_LIMIT_IN)
- {
- QDCT_YD_OUT = 0;
- QDCT_TL_OUT = 0;
- }
-
- if(QDCT_JiaLianStep == 1)
- {
- QDCT_JD_Delay = dwTickCount + QDCT_PARAM_JD_DELAY;
- QDCT_JiaLianStep = 2;
- }
- else if((QDCT_JiaLianStep == 2) && (dwTickCount >= QDCT_JD_Delay))
- {
- QDCT_JD_OUT = 1;
- QDCT_JD_Delay = dwTickCount + QDCT_VAVLE_ERROR_TIME;
- QDCT_JiaLianStep = 3;
- }
- else if(QDCT_JiaLianStep == 3)
- {
- if(QDCT_JZ_IN)
- {
- QDCT_JD_Delay = dwTickCount + QDCT_PARAM_KL_DELAY;
- QDCT_TL_OUT = 0;
- QDCT_YD_OUT = 0;
- QDCT_JiaLianStep = 4;
- }
- else if(dwTickCount >= QDCT_JD_Delay)
- {
- QDCT_SetAlarmCode(QDCT_JD_ALARM);
- }
- }
- else if(QDCT_JiaLianStep == 4)
- {
- if(QDCT_PARAM_KL_TIME)
- {
- QDCT_JiaLianStep = 5;
- }
- else
- {
- QDCT_JiaLianStep = 7;
- }
- }
- else if((QDCT_JiaLianStep == 5) && (dwTickCount >= QDCT_JD_Delay))
- {
- QDCT_KL_OUT = 1;
- QDCT_JiaLianStep = 6;
- QDCT_JD_Delay = dwTickCount + QDCT_PARAM_KL_TIME;
- }
- else if((QDCT_JiaLianStep == 6) && (dwTickCount >= QDCT_JD_Delay))
- {
- QDCT_KL_OUT = 0;
- QDCT_JiaLianStep = 7;
- }
- else if((QDCT_JiaLianStep == 7))
- {
- QDCT_JiaLianStep = 0;
- }
- }
- //自动动作
- void QDCT_AutoStepAction(void)
- {
-
- if(bRunning)
- {
- if(QDCT_AutoStep == 1)
- {
- QDCT_AutoStep = 2;
- QDCT_ZhenDongStep = 1;
- if(QDCT_ZhuangLiaoStep == 0)QDCT_ZhuangLiaoStep = 1;
- }
- else if((QDCT_AutoStep == 2) && (dwTickCount >= QDCT_AutoDelay))
- {
- QDCT_AutoStep = 3;
- }
- else if(QDCT_AutoStep == 3)
- {
- if(QDCT_MotorStep == 0)
- {
- QDCT_MotorStep = 61;
- ZhuangLiaoOkFlg = 0;
- QDCT_AutoStep = 4;
- }
- }
- else if(QDCT_AutoStep == 4)
- {
- QDCT_AutoStep = 5;
- }
- else if(QDCT_AutoStep == 5)
- {
- if(QDCT_ZhuangLiaoStep == 0)QDCT_ZhuangLiaoStep = 1;
- QDCT_AutoStep = 6;
- }
- else if(QDCT_AutoStep == 6)
- {
- if(QDCT_ZhuangLiaoStep == 0)
- {
- QDCT_AutoStep = 7;
- }
- }
- else if(QDCT_AutoStep == 7)
- {
- QDCT_AutoStep = 8;
- }
- else if(QDCT_AutoStep == 8)
- {
- QDCT_AutoStep = 9;
- }
- else if(QDCT_AutoStep == 9)
- {
- if(QDCT_MotorStep == 0)
- {
- QDCT_AutoStep = 10;
- }
- }
- else if(QDCT_AutoStep == 10)
- {
- QDCT_AutoStep = 11;
- }
- else if(QDCT_AutoStep == 11)
- {
- if((QDCT_MotorStep == 0) && (QDCT_ZhuangLiaoStep == 0)) //
- {
- if(QDCT_SEBIAO_MODE)
- QDCT_MotorStep = 1;
- else
- QDCT_MotorStep = 30;
- QDCT_AutoStep = 12;
- }
- }
- else if(QDCT_AutoStep == 12)
- {
- if(QDCT_MotorStep == 0)
- {
- ZhuangLiaoOkFlg = 0;
- if(QDCT_ZhuangLiaoStep == 0)QDCT_ZhuangLiaoStep = 1;
- QDCT_AutoStep = 13;
- }
- }
- else if(QDCT_AutoStep == 13)
- {
- QDCT_AutoStep = 14;
- }
- else if(QDCT_AutoStep == 14)
- {
- if(bStartOnceTime)
- {
- bStartOnceTime = 0;
- cBackFlg = 1;
- QDCT_AutoStep = 0;
- bRunning = 0;
- }
- else
- {
- if(QDCT_XiaQieStep == 0)
- {
- QDCT_XiaQieStep = 1;
- QDCT_AutoStep = 15;
- }
- }
- }
- else if(QDCT_AutoStep == 15)
- {
- if(((QDCT_XiaQieStep == 0) || (QDCT_XiaQieStep == 6)) && !QDCT_SQ_LIMIT_IN)
- {
- if(QDCT_MotorStep == 0)
- {
- QDCT_MotorStep = 40;
- QDCT_AutoStep = 16;
- }
- }
- }
- else if((QDCT_AutoStep == 16) && (QDCT_MotorStep == 0))
- {
- CalProSP(QDCT_SPEED_ADDR); //计算生产速度
- AddToTal(QDCT_TOTAL_ADDR); //生产总量加1并保存
- AddToTal(QDCT_NOWTOTAL_ADDR); //生产总量加1并保存
- cWorkCnt++;
- dwZipCnt++;
- cTbCnt++;
- if(cTbCnt >= QDCT_PARAM_TABLE_NUM)
- {
- QDCT_TB_OUT = 1;
- cTbCnt = 0;
- QDCT_TableDelay = dwTickCount + QDCT_PARAM_TABLE_TIME;
- }
-
- if(QDCT_ZHA_STOP_TIME == 0)
- {
- if(GetTotal(QDCT_NOWTOTAL_ADDR) >= GetTotal(QDCT_SETTOTAL_ADDR))
- {
- bStartOnceTime = 0;
- QDCT_SetAlarmCode(QDCT_TOTAL_ALARM);
- }
- else
- {
- QDCT_AutoStep = 17;
- }
- }
- else
- {
- if(GetTotal(QDCT_NOWTOTAL_ADDR) >= GetTotal(QDCT_SETTOTAL_ADDR))
- {
- ClrcToTal(QDCT_NOWTOTAL_ADDR);
- QDCT_AutoDelay = dwTickCount + QDCT_ZHA_STOP_TIME;
- QDCT_AutoStep = 17;
- }
- else
- {
- QDCT_AutoDelay = dwTickCount;
- QDCT_AutoStep = 17;
- }
- }
- }
- else if((QDCT_AutoStep == 17) && (dwTickCount >= QDCT_AutoDelay))
- {
- {
- QDCT_AutoDelay = dwTickCount + QDCT_PARAM_CYCLE_DELAY;
- QDCT_AutoStep = 2;
- }
-
- }
- }
- }
- void QDCT_TuiLian(void)
- {
- switch(QDCT_TuiLianStep)
- {
- case 0:
- break;
- case 1:
- QDCT_TuiLianStep = 2;
- break;
- case 2:
- if(QDCT_SQ_LIMIT_IN)
- QDCT_SetAlarmCode(QDCT_SQ_LIMIT_ALARM);
- else
- {
- if(!QDCT_YD_OUT)QDCT_TLDelay = dwTickCount + QDCT_PARAM_TL_DELAY;
- else
- QDCT_TLDelay = dwTickCount;
- QDCT_YD_OUT = 1;
- QDCT_TuiLianStep = 3;
- }
- break;
- case 3:
- if(dwTickCount >= QDCT_TLDelay)
- {
- QDCT_TL_OUT = 1;
- QDCT_TLDelay = dwTickCount;
- QDCT_TuiLianStep = 4;
- }
- break;
- case 4:
- if(dwTickCount >= QDCT_TLDelay)
- {
- QDCT_TuiLianStep = 0;
- }
- break;
- }
- }
- //台面电机动作
- void QDCT_TableAction(void)
- {
- if(QDCT_TB_OUT && (dwTickCount >= QDCT_TableDelay))QDCT_TB_OUT = 0;
- }
- void QDCT_CheckStart(void)
- {
- if(bRunning)
- QDCT_PARAM_RUN_STATE = 1;
- else
- QDCT_PARAM_RUN_STATE = 0;
- //启动 自动启动 单一自动
- if(START_IN_UP || bStart || QDCT_bOnceStart)
- {
- if(QDCT_bOnceStart)
- {
- QDCT_bOnceStart = 0;
- bStartOnceTime = 1;
- dwZipCnt = 0;
- }
- bStart = 0;
-
- if(!QDCT_NO_ZIPPER_CHECK_IN)QDCT_SetAlarmCode(QDCT_NO_ZIPPER_ALARM);
- else if(QDCT_LTCZ_IN)QDCT_SetAlarmCode(QDCT_LTCZ_ALARM);
- else if(!QDCT_HSL_ORIGIN_IN)QDCT_SetAlarmCode(QDCT_HSL_ORIGIN_ALARM);
- else if(QDCT_HSL_LIMIT_IN)QDCT_SetAlarmCode(QDCT_HSL_LIMIT_ALARM);
- else if(!QDCT_XM_ORIGIN_IN)QDCT_SetAlarmCode(QDCT_XM_ORIGIN_ALARM);
- else if(QDCT_SQ_LIMIT_IN)QDCT_SetAlarmCode(QDCT_SQ_LIMIT_ALARM);
- else if(QDCT_GO_LIMIT_IN && QDCT_JZ_IN && QDCT_HSL_ORIGIN_IN && !QDCT_SL_LIMIT_IN)
- {
- if(!bRunning && (QDCT_AutoStep == 0) && (GetAlarmCode(QDCT_ALARM_ADDR) == 0))
- {
- bRunning = 1;
- QDCT_AutoStep = 4;
- cWorkCnt = 0;
- TryCnt = 0;
- SongLaTouOkFlg = 1;
- dwZipCnt = 0;
- FirstStartFlg = 0;
- cBackFlg = 0;
- }
- }
- else
- {
- if(!bRunning && (QDCT_AutoStep == 0) && (GetAlarmCode(QDCT_ALARM_ADDR) == 0))
- {
- bRunning = 1;
- QDCT_AutoStep = 1;
- cWorkCnt = 0;
- TryCnt = 0;
- SongLaTouOkFlg = 1;
- dwZipCnt = 0;
- FirstStartFlg = 1;
- cBackFlg = 0;
- }
- }
- }
-
- if(bStop)
- {
- bStop = 0;
- if(bRunning)bStartOnceTime = 1;
- }
- //停止
- if(STOP_IN_UP)
- {
- {
- AxisDecStop(X_AXIS);
- bRunning = 0;
- QDCT_bOnceStart = 0;
- bStop = 0;
- bStartOnceTime = 0;
- QDCT_AutoStep = 0;
- QDCT_ZhuangLiaoStep = 0;
- QDCT_MotorStep = 0;
- QDCT_JiaLianStep = 0;
- QDCT_XiaQieStep = 0;
- QDCT_ZhenDongStep = 0;
- QDCT_SongLiaoStep = 0;
- QDCT_TuiLianStep =0;
- QDCT_CS_OUT = 0;
- QDCT_SQ_OUT = 0;
- QDCT_XM_OUT = 0;
- QDCT_JD_OUT = 0;
- QDCT_SL_OUT = 0;
- QDCT_JLT_OUT= 0;
- QDCT_HSL_OUT = 0;
- QDCT_KL_OUT = 0;
- QDCT_TL_OUT = 0;
- QDCT_YD_OUT = 0;
- cBackFlg = 0;
- QDCT_SZ_OUT = QDCT_MOTOR_DISEN;
- if(GetAlarmCode(QDCT_ALARM_ADDR) != 0)QDCT_SetAlarmCode(QDCT_NO_ALARM);
-
- if(!X_DRV && (QDCT_GO_DEC_IN) && !bRunning && (QDCT_MotorStep == 0))
- {
- QDCT_MotorStep = 20;
- }
-
- }
- }
-
-
- if(QDCT_bAlarmStop)
- {
- bRunning = 0;
- QDCT_bOnceStart = 0;
- QDCT_bAlarmStop = 0;
- bStartOnceTime = 0;
- AxisDecStop(X_AXIS);
- QDCT_AutoStep = 0;
- QDCT_ZhuangLiaoStep = 0;
- QDCT_MotorStep = 0;
- QDCT_JiaLianStep = 0;
- QDCT_XiaQieStep = 0;
- QDCT_ZhenDongStep = 0;
- QDCT_SongLiaoStep = 0;
- QDCT_CS_OUT = 0;
- QDCT_SQ_OUT = 0;
- }
- }
- //电机控制动作
- void QDCT_Motor(void) //
- {
- static long save_buff,length_buff,gou_zhen_buff,back_dec_buff,dandao_buff,back_buff,gouzhen_buff,go_buff,go_length_buff,jz_buff;
- switch(QDCT_MotorStep)
- {
- case 1:
- QDCT_MotorDelay = dwTickCount + QD_PARAM_DELAY_BACK;
- QDCT_MotorStep = 2;
- break;
- case 2:
- if(dwTickCount >= QDCT_MotorDelay)
- {
- back_dec_buff = dwRealPos;
- if(dwZipCnt == 0)
- {
- cSeBiaoOk = 0;
- cSeBiaoEn = 1;
- AxisContinueMove(X_AXIS,20,QDCT_DIR_P);
- }
- else
- {
- AxisContinueMove(X_AXIS,QDCT_PARAM_JJBACK_SPEED,QDCT_DIR_P);
- }
- QDCT_MotorStep = 3;
- }
- break;
- case 3:
- if(dwZipCnt != 0)
- {
- if(QDCT_PARAM_SET_ZIPPER_LENGTH >= (QDCT_SEBIAO_LENGTH + QDCT_REMAIN_CHECK_LENGTH))
- {
- cSeBiaoOk = 0;
- cSeBiaoEn = 1;
- }
- else
- {
- if((dwRealPos - back_dec_buff) >= (QDCT_PARAM_SET_ZIPPER_LENGTH - QDCT_SEBIAO_LENGTH - QDCT_REMAIN_CHECK_LENGTH))
- {
- cSeBiaoOk = 0;
- cSeBiaoEn = 1;
- }
- }
- }
- if((dwRealPos - back_dec_buff) > (QDCT_PARAM_SET_ZIPPER_LENGTH - (QDCT_BACK_LOWSPEED_LENGTH + PulseToPos(X_AXIS,MV_Cal_Dec_pulse(QDCT_PARAM_JJBACK_SPEED,20,30)))))
- {
- if(X_DRV)MoveChangSpeed(X_AXIS,20);
- }
-
- if(cSeBiaoOk)
- {
- cSeBiaoOk = 0;
- cSeBiaoEn = 0;
- QDCT_MotorStep = 4;
- }
-
- break;
- case 4:
- if(!X_DRV)
- {
- QDCT_MotorStep = 0;
- }
- break;
- case 20:
- {
- if(QDCT_SZ_OUT == QDCT_MOTOR_DISEN)
- {
- QDCT_SZ_OUT = QDCT_MOTOR_EN;
- QDCT_MotorDelay = dwTickCount + 50;
- }
-
- QDCT_MotorStep = 21;
- }
- break;
- case 21:
- if(dwTickCount >= QDCT_MotorDelay)
- {
- AxisMovePos(X_AXIS,20,-QDCT_PARAM_ON_BACK_LENGTH);
- QDCT_MotorStep = 22;
- }
- break;
- case 22:
- if(!X_DRV)
- {
- QDCT_MotorStep = 0;
- }
- break;
- case 30:
- if(QDCT_SZ_OUT == QDCT_MOTOR_DISEN)
- {
- QDCT_SZ_OUT = QDCT_MOTOR_EN;
- QDCT_MotorDelay = dwTickCount + 50;
- }
- QDCT_MotorDelay = dwTickCount + QDCT_PARAM_DELAY_BACK;
- QDCT_MotorStep = 31;
- break;
- case 31:
- if(dwTickCount >= QDCT_MotorDelay)
- {
- gou_zhen_buff = dwRealPos;
- save_buff = dwRealPos;
- QDCT_MotorDelay = dwTickCount + QDCT_PARAM_XM_START_TIME;
- MoveAction_Pulse2_AccDec(X_AXIS,PosToPulse(X_AXIS,QDCT_PARAM_SET_ZIPPER_LENGTH),PosToPulse(X_AXIS,QDCT_PARAM_PUTIN_SPEED_LENGTH),PosToPulse(X_AXIS,0),QDCT_PARAM_JJBACK_SPEED,QDCT_PARAM_PUTIN_SPEED,1, 5,10);
- QDCT_MotorStep = 32;
- }
- break;
- case 32:
- if(dwTickCount >= QDCT_MotorDelay)
- {
- back_buff = dwRealPos;
- QDCT_MotorStep = 33;
- }
- break;
- case 33:
- if((dwRealPos - back_buff) >= (QDCT_PARAM_PUTIN_LENGTH))
- {
- QDCT_JLT_OUT = 1;
- QDCT_MotorDelay = dwTickCount + QDCT_VAVLE_ERROR_TIME;
- QDCT_MotorStep = 34;
- }
- else if(!X_DRV)
- {
- QDCT_JLT_OUT = 1;
- QDCT_MotorDelay = dwTickCount + QDCT_VAVLE_ERROR_TIME;
- QDCT_MotorStep = 34;
- }
- break;
- case 34:
- if(!QDCT_JLT_IN)
- {
- QDCT_XM_OUT = 0;
- if(QDCT_SongLiaoStep == 0)QDCT_SongLiaoStep = 1;
- QDCT_MotorDelay = dwTickCount + QDCT_VAVLE_ERROR_TIME;
- QDCT_MotorStep = 35;
- }
- else if(!X_DRV && !QDCT_JLT_IN)
- {
- QDCT_XM_OUT = 0;
- QDCT_MotorDelay = dwTickCount + QDCT_VAVLE_ERROR_TIME;
- QDCT_MotorStep = 35;
- }
- else if(dwTickCount >= QDCT_MotorDelay)QDCT_SetAlarmCode(QDCT_JLT_ALARM);
- break;
- case 35:
- if(!X_DRV && QDCT_XM_ORIGIN_IN && QDCT_XM_ORIGIN_IN)
- {
- if(QDCT_SongLiaoStep == 0)QDCT_SongLiaoStep = 1;
- QDCT_MotorStep = 36;
- }
- else if(dwTickCount >= QDCT_MotorDelay)QDCT_SetAlarmCode(QDCT_XM_ORIGIN_ALARM);
- break;
- case 36:
- if(!X_DRV)
- {
- if(QDCT_SongLiaoStep == 0)QDCT_SongLiaoStep = 1;
- AxisMovePosAccDec(X_AXIS,QDCT_PARAM_JJGO_SPEED,QDCT_PARAM_FZ_LENGTH,1,10,10);
- QDCT_MotorStep = 37;
- }
- break;
- case 37:
- if(!X_DRV)
- {
- if(QDCT_SongLiaoStep == 0)QDCT_SongLiaoStep = 1;
- QDCT_MotorStep = 0;
- }
- break;
- case 40:
- // if(dwTickCount >= QDCT_MotorDelay)
- {
- jz_buff = dwRealPos;
-
- if(QDCT_PARAM_SJZ_LENGTH == 0)
- {
- QDCT_JD_OUT = 0;
- }
- QDCT_MotorDelay = dwTickCount + QDCT_PARAN_SJ_TIME;
- QDCT_MotorStep = 41;
- }
- break;
- case 41:
- if(QDCT_JD_OUT && (dwTickCount >= QDCT_MotorDelay))
- {
- AxisMovePosAccDec(X_AXIS,QDCT_PARAM_CUTBACK_SPEED,-(QDCT_PARAM_SJZ_LENGTH + QDCT_PARAM_CUT_BACK_LENGTH),1,10,10);
- QDCT_MotorStep = 42;
- }
- break;
- case 42: // 切断完成后拉电机动作
- if(((QDCT_PARAM_SJZ_LENGTH) <= (dwRealPos - jz_buff)))
- {
- QDCT_JD_OUT = 0;
- QDCT_MotorStep = 43;
- }
- else if(!X_DRV)
- {
- QDCT_JD_OUT = 0;
- QDCT_MotorStep = 43;
- }
- break;
- case 43: // 切断完成后拉电机动作
- if(!X_DRV)
- {
- QDCT_MotorStep = 0;
- QDCT_MotorDelay = dwTickCount;
- }
- break;
- case 61: // 前点定位数控模式
- if(QDCT_JD_OUT || (QDCT_SZ_OUT == QDCT_MOTOR_DISEN))
- {
- QDCT_JD_OUT = 0;
- QDCT_SZ_OUT = QDCT_MOTOR_EN;
- QDCT_MotorDelay = dwTickCount + 50;
- }
-
- if((QDCT_TuiLianStep == 0) && !QDCT_TL_OUT)QDCT_TuiLianStep = 1;
- QDCT_MotorStep = 62;
- break;
- case 62:
- if(dwTickCount >= QDCT_MotorDelay)
- {
- if(QDCT_GO_LIMIT_IN || QDCT_GO_DEC_IN)
- {
- AxisMovePos(X_AXIS,20,-QDCT_PARAM_ON_BACK_LENGTH);
- QDCT_MotorDelay = dwTickCount + 1000;
- }
- QDCT_MotorStep = 63;
- QDCT_JD_OUT = 0;
- }
- break;
- case 63:
- if(!X_DRV && !QDCT_GO_LIMIT_IN && (dwTickCount >= QDCT_MotorDelay))
- {
- go_buff = dwRealPos;
- if(dwZipCnt > 0)
- {
- MoveAction_Const_Stop_AccDec(X_AXIS,QDCT_DIR_P,QDCT_PARAM_JJGO_SPEED,1,5,10);
- }
- else
- {
- MoveAction_Const_Stop_AccDec(X_AXIS,QDCT_DIR_P,QDCT_PARAM_FIRSTSPEED,1,5,10);
- }
-
- QDCT_MotorDelay = dwTickCount + MOTOR_ALARM_TIME;
- QDCT_MotorStep = 64;
- }
- break;
- case 64:
- if(dwZipCnt > 0)
- {
- if(((go_buff - dwRealPos) > ((QDCT_PARAM_SET_ZIPPER_LENGTH - QDCT_PARAM_OFFSET_LENGTH) - (QDCT_PARAM_GO_LOWSPEED_LENGTH + PulseToPos(X_AXIS,MV_Cal_Dec_pulse(QDCT_PARAM_JJGO_SPEED,QDCT_PARAM_GO_LOWSPEED,5))) + QDCT_PARAM_SJZ_LENGTH + QDCT_PARAM_CUT_BACK_LENGTH)) || QDCT_GO_DEC_IN_UP)
- {
- MoveChangSpeed(X_AXIS,QDCT_PARAM_GO_LOWSPEED);
- QDCT_MotorStep = 66;
- QDCT_MotorDelay = dwTickCount + MOTOR_ALARM_TIME;
- }
- else if(dwTickCount >= QDCT_MotorDelay)QDCT_SetAlarmCode(QDCT_NO_ZIPPER_ALARM);
- }
- else
- {
- QDCT_MotorStep = 66;
- }
- break;
- case 65:
- if(QDCT_GO_LIMIT_IN_UP)
- {
- AxisEgmStop(X_AXIS);
- QDCT_MotorStep = 66;
- }
- else if(dwTickCount >= QDCT_MotorDelay)QDCT_SetAlarmCode(QDCT_NO_ZIPPER_ALARM);
- break;
- case 66:
- if(!X_DRV)
- {
- QDCT_MotorDelay = dwTickCount;
- QDCT_MotorStep = 67;
- }
- break;
- case 67:
- if(dwTickCount >= QDCT_MotorDelay)
- {
- if(QDCT_JiaLianStep == 0)
- {
- QDCT_JiaLianStep = 1;
- QDCT_MotorStep = 68;
- }
- }
- break;
- case 68:
- if(QDCT_JiaLianStep == 0)
- {
- QDCT_MotorStep = 0;
- }
- break;
- case 100:
- if((dwTickCount >= QDCT_MotorDelay) && !X_DRV)
- {
- AxisMovePos(X_AXIS,QDCT_PARAM_JJBACK_SPEED,-(QDCT_PARAM_SET_ZIPPER_LENGTH));
- QDCT_MotorStep = 101;
- QDCT_MotorDelay = dwTickCount + 1000;
- }
- break;
- case 101:
- if((dwTickCount >= QDCT_MotorDelay) && !X_DRV)
- {
- QDCT_MotorStep = 102;
- }
- break;
- case 102:
- AxisMovePos(X_AXIS,QDCT_PARAM_JJBACK_SPEED,(QDCT_PARAM_SET_ZIPPER_LENGTH));
- QDCT_MotorStep = 100;
- QDCT_MotorDelay = dwTickCount + 1000;
- break;
- }
- }
- //切断动作
- void QDCT_XiaQieAction(void)
- {
- user_datas[121] = QDCT_AutoStep;
- user_datas[122] = QDCT_ZhuangLiaoStep;
- user_datas[123] = QDCT_TuiLianStep;
- user_datas[124] = QDCT_MotorStep;
- user_datas[125] = QDCT_JiaLianStep;
- // user_datas[126] = QDCT_XiaQieStep;
- // user_datas[127] = PosToPulse(X_AXIS,QDCT_PARAM_PUTIN_SPEED_LENGTH);
- if(QDCT_XiaQieStep == 1)
- {
- if(QDCT_GO_LIMIT_IN)
- {
- QDCT_SetAlarmCode(QDCT_GO_LIMIT_ALARM);
- }
- else if(!QDCT_TL_ORIGIN_IN)
- QDCT_SetAlarmCode(QDCT_TL_ORIGIN_ALARM);
- else
- {
- QDCT_XiaQieStep = 2;
- }
- }
- else if(QDCT_XiaQieStep == 2)
- {
- QDCT_XiaQieDelay = dwTickCount + QDCT_PARAM_CUT_DELAY;
- QDCT_XiaQieStep = 3;
- }
- else if((QDCT_XiaQieStep == 3) && (dwTickCount >= QDCT_XiaQieDelay))
- {
- QDCT_SQ_OUT = 1;
- QDCT_XiaQieDelay = dwTickCount + QDCT_VAVLE_ERROR_TIME;
- QDCT_XiaQieStep = 4;
- }
- else if(QDCT_XiaQieStep == 4)
- {
- if(QDCT_SQ_LIMIT_IN)
- {
- QDCT_XiaQieStep = 5;
- QDCT_XiaQieDelay = dwTickCount + QDCT_PARAM_DELAY_CS;
- }
- else if(dwTickCount >= QDCT_XiaQieDelay)
- {
- QDCT_SetAlarmCode(QDCT_SQ_LIMIT_ALARM);
- }
- }
- else if((QDCT_XiaQieStep == 5) && (dwTickCount >= QDCT_XiaQieDelay))
- {
- QDCT_XiaQieStep = 6;
- if(QDCT_PARAM_CS_ENABLE)QDCT_CS_OUT = 1;
- QDCT_XiaQieDelay = dwTickCount + QDCT_PARAM_CS_TIME;
- }
- else if((QDCT_XiaQieStep == 6) && (dwTickCount >= QDCT_XiaQieDelay))
- {
- QDCT_CS_OUT = 0;
- QDCT_XiaQieStep = 7;
- QDCT_XiaQieDelay = dwTickCount + QDCT_PARAM_COLD_TIME;
- }
- else if((QDCT_XiaQieStep == 7) && (dwTickCount >= QDCT_XiaQieDelay))
- {
- QDCT_SQ_OUT = 0;
- QDCT_XiaQieDelay = dwTickCount + QDCT_VAVLE_ERROR_TIME;
- QDCT_XiaQieStep = 8;
- }
- else if(QDCT_XiaQieStep == 8)
- {
- if(!QDCT_SQ_LIMIT_IN)
- {
- QDCT_XiaQieStep = 0;
- if(cBackFlg)
- {
- cBackFlg = 0;
- if(QDCT_MotorStep==0)QDCT_MotorStep = 40;
- }
- QDCT_YD_OUT = 1;
- }
- else if(dwTickCount >= QDCT_XiaQieDelay)
- {
- QDCT_SetAlarmCode(QDCT_SQ_LIMIT_ALARM);
- }
- }
- }
- //装拉头动作
- void QDCT_ZLT_Step(void)
- {
- if(QDCT_ZhuangLiaoStep == 1)
- {
- if(ZhuangLiaoOkFlg)
- {
- QDCT_ZhuangLiaoStep = 0;
- }
- else
- {
- if(FirstStartFlg && QDCT_JLT_IN)
- {
- QDCT_ZhuangLiaoStep = 7;
- }
- else
- {
- FirstStartFlg = 0;
- if(QDCT_SongLiaoStep == 0)
- {
- QDCT_SongLiaoStep = 1;
- QDCT_ZhuangLiaoStep = 2;
- }
- }
- }
- }
- else if(QDCT_ZhuangLiaoStep == 2)
- {
- if(QDCT_SongLiaoStep == 0)
- {
- QDCT_ZhuangLiaoDelay = dwTickCount + QDCT_VAVLE_ERROR_TIME;
- if(QDCT_JLT_IN)QDCT_JLT_OUT = 1;
- QDCT_ZhuangLiaoStep = 3;
- }
- }
- else if(QDCT_ZhuangLiaoStep == 3)
- {
- if(QDCT_HSL_ORIGIN_IN && QDCT_XM_ORIGIN_IN && !QDCT_JLT_IN && (QDCT_XiaQieStep == 0))
- {
- QDCT_HSL_OUT = 1;
- QDCT_ZhuangLiaoDelay = dwTickCount + QDCT_VAVLE_ERROR_TIME;
- QDCT_ZhuangLiaoStep = 4;
- }
- else if(dwTickCount >= QDCT_ZhuangLiaoDelay)
- {
- if(!QDCT_HSL_ORIGIN_IN)
- QDCT_SetAlarmCode(QDCT_HSL_ORIGIN_ALARM);
- else
- QDCT_SetAlarmCode(QDCT_XM_ORIGIN_ALARM);
- }
- }
- else if(QDCT_ZhuangLiaoStep == 4)
- {
- if(QDCT_HSL_LIMIT_IN)
- {
- QDCT_JLT_OUT = 0;
- QDCT_ZhuangLiaoDelay = dwTickCount + QDCT_VAVLE_ERROR_TIME;
- QDCT_ZhuangLiaoStep = 5;
- }
- else if(dwTickCount >= QDCT_ZhuangLiaoDelay)
- {
- QDCT_SetAlarmCode(QDCT_HSL_LIMIT_ALARM);
- }
- }
- else if(QDCT_ZhuangLiaoStep == 5)
- {
- if(QDCT_JLT_IN)
- {
- QDCT_ZhuangLiaoStep = 6;
- }
- else if(dwTickCount >= QDCT_ZhuangLiaoDelay)
- {
- QDCT_SetAlarmCode(QDCT_JLT_ALARM);
- }
- }
- else if(QDCT_ZhuangLiaoStep == 6)
- {
-
- QDCT_HSL_OUT = 0;
- QDCT_ZhuangLiaoDelay = dwTickCount + QDCT_VAVLE_ERROR_TIME;
-
- if(!bRunning)
- {
- QDCT_ZhuangLiaoStep = 0;
- SongLaTouOkFlg = 0;
- if(QDCT_SongLiaoStep == 0)QDCT_SongLiaoStep = 1;
- }
- else
- QDCT_ZhuangLiaoStep = 7;
- }
- else if(QDCT_ZhuangLiaoStep == 7)
- {
- if(!QDCT_HSL_LIMIT_IN && QDCT_GO_LIMIT_IN)
- {
- QDCT_XM_OUT = 1;
- if(FirstStartFlg)
- {
- FirstStartFlg = 0;
- }
- else
- SongLaTouOkFlg = 0;
- if(QDCT_SongLiaoStep == 0)QDCT_SongLiaoStep = 1;
- QDCT_ZhuangLiaoDelay = dwTickCount + QDCT_VAVLE_ERROR_TIME;
- QDCT_ZhuangLiaoStep = 8;
- }
- else if(dwTickCount >= QDCT_ZhuangLiaoDelay)
- {
- if(QDCT_HSL_LIMIT_IN)QDCT_SetAlarmCode(QDCT_HSL_LIMIT_ALARM);
- }
- }
- else if(QDCT_ZhuangLiaoStep == 8)
- {
- if(!QDCT_XM_ORIGIN_IN)
- {
- QDCT_ZhuangLiaoStep = 9;
- QDCT_ZhuangLiaoDelay = dwTickCount + 1000;
-
- }
- else if(dwTickCount >= QDCT_ZhuangLiaoDelay)
- {
- QDCT_SetAlarmCode(QDCT_XM_LIMIT_ALARM);
- }
- }
- else if(QDCT_ZhuangLiaoStep == 9)
- {
- if(QDCT_LTCZ_IN)
- {
- QDCT_ZhuangLiaoStep = 0;
- ZhuangLiaoOkFlg = 1;
- TryCnt = 0;
- }
- else if(dwTickCount >= QDCT_ZhuangLiaoDelay)
- {
- if(bRunning)
- {
- TryCnt++;
- if(TryCnt > 4)
- {
- QDCT_SetAlarmCode(QDCT_LTCZ_ALARM);
- QDCT_JLT_OUT = 1;
- QDCT_XM_OUT = 0;
- }
- else
- {
- QDCT_ZhuangLiaoStep = 10;
- }
- }
- else
- {
- QDCT_ZhuangLiaoStep = 0;
- QDCT_ZhuangLiaoDelay = dwTickCount;
- }
- }
-
- }
- else if(QDCT_ZhuangLiaoStep == 10) //装拉头失败重复装几次拉头
- {
- QDCT_XM_OUT = 0;
- QDCT_JLT_OUT = 0;
- QDCT_ZhuangLiaoDelay = dwTickCount + QDCT_VAVLE_ERROR_TIME;
- QDCT_ZhuangLiaoStep = 11;
- }
- else if(QDCT_ZhuangLiaoStep == 11)
- {
- if(QDCT_XM_ORIGIN_IN)
- {
- QDCT_ZhuangLiaoStep = 12;
- }
- else if(dwTickCount >= QDCT_ZhuangLiaoDelay)
- {
- QDCT_SetAlarmCode(QDCT_XM_ORIGIN_ALARM);
- }
- }
- else if(QDCT_ZhuangLiaoStep == 12)
- {
- QDCT_ZhuangLiaoStep = 1;
- }
- }
- void QDCT_SL_Step(void)
- {
- if(QDCT_SongLiaoStep == 1)
- {
- if(SongLaTouOkFlg)
- {
- QDCT_SongLiaoStep = 0;
- }
- else
- {
- QDCT_SL_Delay = dwTickCount + QDCT_VAVLE_ERROR_TIME;
- QDCT_SongLiaoStep = 2;
- }
- }
- else if(QDCT_SongLiaoStep == 2)
- {
- if(QDCT_HSL_ORIGIN_IN && !QDCT_HSL_LIMIT_IN)
- {
- QDCT_SL_OUT = 1;
- QDCT_SL_Delay = dwTickCount + QDCT_VAVLE_ERROR_TIME;
- QDCT_SongLiaoStep = 3;
- }
- else if(dwTickCount >= QDCT_SL_Delay)
- QDCT_SetAlarmCode(QDCT_HSL_ORIGIN_ALARM);
- }
- else if(QDCT_SongLiaoStep == 3)
- {
- if(QDCT_SL_LIMIT_IN)
- {
- QDCT_SL_Delay = dwTickCount + QDCT_PARAM_SL_BACKDELAY;
- QDCT_SongLiaoStep = 4;
- }
- else if(dwTickCount >= QDCT_SL_Delay)
- QDCT_SetAlarmCode(QDCT_SL_ALARM);
-
- }
- else if((QDCT_SongLiaoStep == 4) && (dwTickCount >= QDCT_SL_Delay))
- {
- QDCT_SL_OUT = 0;
- QDCT_SL_Delay = dwTickCount + QDCT_VAVLE_ERROR_TIME;
- QDCT_SongLiaoStep = 5;
- }
- else if(QDCT_SongLiaoStep == 5)
- {
- if(!QDCT_SL_LIMIT_IN)
- {
- QDCT_SongLiaoStep = 0;
- QDCT_SL_Delay = dwTickCount;
- SongLaTouOkFlg = 1;
- }
- else if(dwTickCount >= QDCT_SL_Delay)
- QDCT_SetAlarmCode(QDCT_SL_ALARM);
- }
- }
- //手动动作
- void QDCT_ManualAction(void)
- {
- if(bRunning == 0)
- {
- if(bClearTotal) //切断计数清零
- {
- bClearTotal = 0;
- ClrcToTal(QDCT_TOTAL_ADDR);
- }
-
- if(QDCT_bClerNowTotal)
- {
- QDCT_bClerNowTotal = 0;
- cTbCnt = 0;
- ClrcToTal(QDCT_NOWTOTAL_ADDR);
- }
-
-
- if(QDCT_bQieDuan)
- {
- QDCT_bQieDuan = 0;
- if(QDCT_XiaQieStep == 0)QDCT_XiaQieStep = 1;
- }
-
- if(QDCT_bQianDianDW)
- {
- QDCT_bQianDianDW = 0;
- if((QDCT_MotorStep == 0) && !QDCT_SQ_LIMIT_IN)
- {
- QDCT_MotorStep = 61;
- dwZipCnt = 0;
- }
- else if(QDCT_SQ_LIMIT_IN)
- QDCT_SetAlarmCode(QDCT_SQ_LIMIT_ALARM);
- }
-
- if(QDCT_bManXM)
- {
- QDCT_bManXM = 0;
- QDCT_XM_OUT = ~QDCT_XM_OUT;
-
- if(QDCT_HSL_OUT == 1)QDCT_XM_OUT = 0;
- }
-
- if(QDCT_bManSQ)
- {
- QDCT_bManSQ = 0;
- QDCT_SQ_OUT = ~QDCT_SQ_OUT;
- if(QDCT_GO_LIMIT_IN) QDCT_SQ_OUT = 0;
- }
-
- if(QDCT_bManJD)
- {
- QDCT_bManJD = 0;
- QDCT_JD_OUT = ~QDCT_JD_OUT;
- }
-
- if(QDCT_bManSL)
- {
- QDCT_bManSL = 0;
- QDCT_SL_OUT = ~QDCT_SL_OUT;
-
- if(!QDCT_HSL_ORIGIN_IN)QDCT_SL_OUT = 0;
- }
-
- if(QDCT_bManHSL)
- {
- QDCT_bManHSL = 0;
- QDCT_HSL_OUT = ~QDCT_HSL_OUT;
-
- if(QDCT_JLT_IN)QDCT_JLT_OUT = 1;
- if(QDCT_XM_OUT || QDCT_SL_LIMIT_IN)QDCT_HSL_OUT = 0;
-
- }
-
- if(QDCT_bManZD)
- {
- QDCT_bManZD = 0;
- QDCT_ZDP_OUT = ~QDCT_ZDP_OUT;
- }
-
- if(QDCT_bManKL)
- {
- QDCT_bManKL = 0;
- QDCT_KL_OUT = ~QDCT_KL_OUT;
- }
-
-
- if(QDCT_bManJLT)
- {
- QDCT_bManJLT = 0;
- QDCT_JLT_OUT = ~QDCT_JLT_OUT;
- }
-
- if(QDCT_bManYD)
- {
- QDCT_bManYD = 0;
- QDCT_YD_OUT = ~QDCT_YD_OUT;
- }
-
- if(QDCT_bManTL)
- {
- QDCT_bManTL = 0;
-
- if(QDCT_TL_OUT)
- {
- QDCT_TL_OUT = 0;
- QDCT_YD_OUT = 0;
- }
- else
- {
- if(QDCT_TuiLianStep==0)QDCT_TuiLianStep=1;
- }
- }
- if(QDCT_bZhuangLiao)
- {
- QDCT_bZhuangLiao = 0;
- if(QDCT_ZhuangLiaoStep == 0)
- {
- TryCnt = 0;
- SongLaTouOkFlg = 1;
- QDCT_ZhuangLiaoStep = 1;
- FirstStartFlg = 0;
- }
- }
-
- if(QDCT_bSongLT)
- {
- QDCT_bSongLT = 0;
- if(QDCT_SongLiaoStep == 0)
- {
- QDCT_SongLiaoStep = 1;
- SongLaTouOkFlg = 0;
- }
- }
-
- if(QDCT_bChuanLT)
- {
- QDCT_bChuanLT = 0;
- if(!QDCT_BACK_LIMIT_IN)
- {
- if(QDCT_MotorStep == 0)QDCT_MotorStep = 30;
- }
- }
-
- if(QDCT_bManSZ)
- {
- QDCT_bManSZ = 0;
- QDCT_SZ_OUT = ~QDCT_SZ_OUT;
- }
- //电机控制
- if(QDCT_bMotorGo && !QDCT_GO_LIMIT_IN && !QDCT_SQ_LIMIT_IN)
- {
- QDCT_JD_OUT = 0;
- QDCT_SZ_OUT = QDCT_MOTOR_EN;
- if(!X_DRV)MoveAction_Const_AccDec(X_AXIS, QDCT_DIR_P, 5,5,10,10);
- }
- else if(QDCT_bMotorGo && QDCT_SQ_LIMIT_IN)
- QDCT_SetAlarmCode(QDCT_SQ_LIMIT_ALARM);
-
- if(QDCT_bMotorBack && !QDCT_BACK_LIMIT_IN)
- {
- QDCT_JD_OUT = 0;
- QDCT_SZ_OUT = QDCT_MOTOR_EN;
- if(!X_DRV)MoveAction_Const_AccDec(X_AXIS, QDCT_DIR_N, 5,5,10,10);
- }
-
- if(!QDCT_bMotorGo && !QDCT_bMotorBack && (QDCT_MotorStep == 0))
- {
- if(X_DRV)AxisDecStop(X_AXIS);
- }
-
- if(QDCT_GO_LIMIT_IN && (QDCT_MotorStep == 0) && !QDCT_bMotorBack &&(QDCT_AutoStep == 0))
- {
- if(X_DRV)AxisEgmStop(X_AXIS);
- }
-
- }
-
- if(QDCT_PARAM_ZD_ENABLE)QDCT_ZDP_OUT = 1;
- else QDCT_ZDP_OUT = 0;
-
- }
- #endif
|