📄 volatile_define.c
字号:
#include <p30f4011.h>
#include "regesiter.h"
//**************************************************************//
//extern unchar KR0; //x left limit
//extern unchar KR1; //x right limit
//extern unchar KR2; //z up limit
//extern unchar KR3; //z down limit
//extern unchar KR4; //y forward limit
//extern unchar KR5; //y back limit
//extern unchar KR6; //y message light1
//extern unchar KR7; //y message light2
//extern unchar KR8; //x protect switch close x
//extern unchar KR9; //y protect switch close y
//LR_num.bits.LR0=1; //oil OUTPUT LR=0 与24V ctrl relay out
//LR_num.bits.LR1=1; //主轴
//LR_num.bits.LR2=1; //cool
//LR_num.bits.LR3=1; //Y 前行
//LR_num.bits.LR4=1; //Y 后行
//LR_num.bits.LR5=1; //X 左行
//LR_num.bits.LR6=1; //X 右行
//LR_num.bits.LR7=1; //err message
//LED_num.bits.LED0=0; //平面 //led=0 ctrl output
//LED_num.bits.LED1=1; //开槽
//LED_num.bits.LED2=1; //oil start
//LED_num.bits.LED3=1; //主轴start
//LED_num.bits.LED4=1; //cool start
//LED_num.bits.LED5=0; //oil stop
//LED_num.bits.LED6=0; //主轴stop
//LED_num.bits.LED7=0; //cool stop
//LED_num.bits.LED8=0; //x 往复 start _RE4=LED8,RE4=1,LED8=ON
//KR=1 extern input,but NPN常闭的 limit 感应到limit 时KR=0,感应不到时KR=1
//NPN 常开的limit 感应到为1,感应不到为0
//****************************************************************//
//input data bus RF0-RF6,RE5 8bit
//IC:74_245 3颗,245_1:KR0-KR7,245_2:KR8-KR15,245_3:波多开关,启动,停止等按键
//KEYSCAN return bus :RF0,RF1,RF4,RF5 ,outbus :RB0-RB7
//lcd rs:RD0,wr:RD2,lcd_en:RE8 ,lcd_bus :RB0-RB7
//IC;74_138 ctrl CTRL BUS ;
//CTRL BUS:RE8,RD3,RD0,RD1,RD2 5bit
//RD0,RD1,RD2 ctrl 138的8 bit{74_245 3 bit ,74_373 3 bit,led8 1 bit
//IC:74_373_1:OUT0-OUT7,74_373_2:OUT8-OUT15,74_373_3:LED0-LED7
//OUTBUS:RB0-RB7,CTRL :OUT0-OUT15,LED0-LED7
//RS485:RC13,4,RRC1B8
//PWM:RE0,RE1,RE2,RE3
//**************************************************************************
UnByte BUSY ,in_buffer,out_buffer,KR_input,y_postion_staus,z_postion_staus _NEAR;
UnWord X1,X2 _NEAR;
UnByte limit_staus,KR_staus _NEAR;
UnDuWord Time_base _NEAR;
UnDuWord FPWM,z_postion,z_waitpostion _PERSISTENT;
UnWord y_totallength,var,y_postion ,z_up_speed,z_down_speed,y_endpos _PERSISTENT;
UnByte jingei_times,y_distance,LCD_FLAG,operator_mode, motor_jingei _PERSISTENT;
UnByte SW,SW0,SW1,SW2,SW3,SW4 _PERSISTENT;
UnByte KR0,KR1,KR2,KR3,KR4,KR5,KR6,KR7,KR8,KR9,KR10,KR11,KR12,KR13,KR14,KR15 _PERSISTENT;
UnByte KEYUPDOWN,y_firstpos,plane,var1,var2,keyboard_flag _PERSISTENT;
UnByte xx_photo,EXCHANGE,guangmo_times _PERSISTENT;
UnByte instruction,TAB,ADDR _PERSISTENT;
UnByte i,j,k,q _NEAR;
UnByte LCD_jingei_staus,y_distance_staus,y_totallength_staus,z_waitpostion_staus,guangmo_times_staus _PERSISTENT;
UnByte z_up_speed_staus,z_down_speed_staus _PERSISTENT;
UnDuWord z_encoder_pluse,pluse_counter,last_pluse_counter,total_pluse,pluse_con, mid_pluse _PERSISTENT;
UnByte motor_jingeiliang, pwm_flag _PERSISTENT;
UnWord motor_jingei_encoder _PERSISTENT;
UnByte count,SW_flag,X_END,X_DIRECTION _PERSISTENT; //x 往复flag
UnByte HALFAUTO,XY_END,XY_DIRECTION,Y_DIRECTION _PERSISTENT; //half auto
UnByte Back_xx_photo _PERSISTENT;
UnByte const tab1[]={"进给次"};
UnByte const tab2[]={"Y 间距"};
UnByte const tab3[]={"Y 总长"};
UnByte const tab4[]={"参数"};
UnByte const tab5[]={"光磨次"};
UnByte const tab6[]={"Z 待机"};
UnByte const tab7[]={"位置"};
UnByte const tab8[]={"Y 轴"};
UnByte const tab9[]={"Z 轴"};
UnByte const tab10[]={"速度"};
UnByte const tab11[]={"Z 向上"};
UnByte const tab12[]={"Z 向下"};
UnByte const tab13[]={"Y 前限位"};
UnByte const tab14[]={"Y 后限位"};
UnByte const tab15[]={"X 左限位"};
UnByte const tab16[]={"X 右限位"};
UnByte const tab17[]={"Z 上限位"};
LR_NUM LR_num _PERSISTENT;
LED_NUM LED_num _PERSISTENT;
CONT Cont _NEAR;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -