昵称:烦夫子
类别:界面/平面设计师
年龄:38
现所在地:北京
主页浏览总数:24255
总积分:89
文章数:88
作品数:70
开放源码
数控切割机复位功能实现
extern void indeal(void) /*IN处理*/
{
uint idata i=300; //800
dbzh=1;
a8255=0x00; /*设置输出口为高电平子程序*/
out_8255c=c8255;
#define back_speed 30 //18 2004-6-24 //50
/*while(Z_BEGAIN!=0) //当没到Z光电二极管处
{
z_fx=0; //yangbin 11-21
z_qd=1;
a8255=out_8255a; //outfz
delay(SPEED*100);
z_qd=0;
a8255=out_8255a;
}*/
while(Z_BEGAIN!=0) //当没到Z光电二极管处
{
z_fx=0;
z_qd=0;
a8255=out_8255a;
delay(SPEED*20); //100
z_fx=1;
a8255=out_8255a;
}
ZJ=80;
PU_PD=0;
while(Y_BEGAIN==0) //当没到Y光电二极管处
{
outfy1( );
if(i!=back_speed)
{
delay(i);
i=i-1;
}
else
delay(back_speed);
}
for(i=0;i<240;i++) //当到了光电二极管处,Y还向里慢速走3个毫米
{
outfy1( );
//if(i<=40)
delay(back_speed+i*2);
//else
//delay(100);
}
i=300; //800
while(X_BEGAIN==0) //当没到X光电二极管处
{
outfx1( );
if(i!=back_speed)
{
delay(i);
i=i-1;
}
else
delay(back_speed);
}
for(i=0;i<240;i++) //当到了光电二极管处,X还向里慢速走3个毫米
{
outfx1( );
//if(i<=40)
delay(back_speed+i*2);
//else
//delay(1000);
}
for(i=0;i<2400;i++)
{
outzx1( );
delay(150);
}
for(i=0;i<2400;i++)
{
outzy1( );
delay(150);
}
while(X_BEGAIN==0) //当没到X光电二极管处
{
outfx1( );
delay(150);
}
XJ=0;
while(Y_BEGAIN==0) //当没到Y光电二极管处
{
outfy1( );
delay(150);
}
YJ=0;
}