123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152 |
- #ifndef __TYHELIAN_H__
- #define __TYHELIAN_H__
- #if TONG_YONG_MACHINE | BRUCE_MACHINE
- extern void HL_InitAction(void);
- extern void HL_ManualAction(void);
- extern void HL_Action(void);
- #define HL_MOTOR_DISEN 1
- #define HL_MOTOR_EN 0
- #define HL_DIR_P 0
- #define HL_DIR_N 1
- #define HL_ALARM_ADDR 100
- #define HL_TOTAL_ADDR 76
- #define HL_PROSPEED_ADDR 78
- #define HL_VAVLE_ALARM_TIME 3000
- //故障代码列表
- #define HL_NO_ALARM 0
- #define HL_TOTAL_ALARM 1
- #define HL_GUOLIAN_ALARM 2
- #define HL_SM_LIMIT_ALARM 3
- #define HL_XM_LIMIT_ALARM 4
- #define HL_BB_LIMIT_ALARM 5
- #define HL_DK_LIMIT_ALARM 6
- #define HL_DK_ORIGIN_ALARM 7
- #define HL_DK_UP_LIMIT_ALARM 8
- #define HL_CCX_LIMIT_ALARM 9
- #define HL_CCX_ORIGIN_ALARM 10
- #define HL_TFK_LIMIT_ALARM 11
- #define HL_TFK_ORIGIN_ALARM 12
- #define HL_MJ_LIMIT_ALARM 13
- #define HL_HM_BACK_ALARM 14
- #define HL_MotorStep cStepMByte
- #define HL_AutoStep cStepMByte1
- #define HL_HLStep cStepMByte2
- #define HL_ManDKStep cStepMByte3
- #define HL_AutoDelay cDelayTime1
- #define HL_MotorDelay cDelayTime2
- #define HL_CheckDelay cDelayTime3
- #define HL_HLDelay cDelayTime4
- #define HL_YCXDelay cDelayTime5
- #define HL_ManDKDelay cDelayTime6
- #define HL_PARAM_SET_TOTAL (user_datas[2] | user_datas[3] << 16)
- #define HL_PARAM_MOTOR_ALARM_TIME (user_datas[4] * 10)
- #define HL_PARAM_HIGH_SPEED user_datas[5] // 电机高速
- #define HL_PARAM_LOW_SPEED user_datas[6] // 空位速度
- #define HL_PARAM_DELAY_STOP user_datas[7] // 定位调节
- #define HL_PARAM_CYCLE_DELAY (user_datas[8] * 10) // 延时启动
- #define HL_PARAM_DELAY_HM (user_datas[9] * 10) // 延时合模
- #define HL_PARAM_DELAY_TFK (user_datas[10] * 10) // 延时推方块
- #define HL_PARAM_DELAY_JD (user_datas[11] * 10) // 延时夹带
- #define HL_PARAM_DELAY_CCX (user_datas[12] * 10) // 延时穿插销
- #define HL_PARAM_DELAY_CHECK_CCX (user_datas[13] * 10) // 延时检测穿插销到位
- #define HL_PARAM_DELAY_BACK_DK_UP (user_datas[14] * 10) // 延时复位上下挡块
- #define HL_PARAM_CCX_LENGTH user_datas[15] // 穿插销到位后拖带走多长
- #define HL_PARAM_DELAY_TFK_BACK (user_datas[16] * 10) // 延时复位推方块
- #define HL_PARAM_DELAY_DK_GO (user_datas[17] * 10) // 延时挡块前后
- //#define HL_PARAM_DELAY_STOP2 user_datas[18]
- #define HL_PARAM_DELAY_BB_BACK (user_datas[19] * 10) // 延时复位摆臂
- #define HL_PARAM_DELAY_BB (user_datas[20] * 10) // 延时摆臂
- #define HL_PARAM_DELAY_HM_BACK user_datas[21] // 延时复位合模
- //#define HL_PARAM_OFFSET_LENGTH user_datas[22]
- #define HL_PARAM_DELAY_JD_BACK (user_datas[23] * 10) // 夹带延时复位
- #define HL_PARAM_DELAY_CHECK_TIME user_datas[24] // 延时检测定位信号
- #define HL_PARAM_YCX_TIME (user_datas[25] * 10) // 压插销时间
- #define HL_PARAM_DELAY_DK_UP (user_datas[26] * 10) // 延时上挡块
- #define HL_PARAM_CCX_TIMES user_datas[27] //夹带穿插销次数0为1次 1为两次
- #define HL_PARAM_CCX_MODE user_datas[28] //穿插销模式 1为电机穿 0为夹带气缸穿
- #define HL_PARAM_CCX_SPEED user_datas[29]
- #define DISPLAY_DATA0 user_datas[121]
- #define DISPLAY_DATA1 user_datas[122]
- #define DISPLAY_DATA2 user_datas[123]
- #define DISPLAY_DATA3 user_datas[124]
- #define DISPLAY_DATA4 user_datas[125]
- #define DISPLAY_DATA5 user_datas[126]
- #define DISPLAY_DATA6 user_datas[127]
- #define DISPLAY_DATA7 user_datas[128]
- #define START_IN X00
- #define START_IN_UP (X00 && !OLDX00)
- #define STOP_IN X01
- #define STOP_IN_UP (X01 && !OLDX01)
- #define HL_GUO_LIAN_IN X02 //过链感应
- #define HL_GUO_LIAN_IN_UP (X02 && !OLDX02)
- #define HL_GUO_LIAN_IN_DW (!X02 && OLDX02)
- #define HL_SM_LIMIT_IN X04 //上模到位
- #define HL_XM_LIMIT_IN X05 //下模到位
- #define HL_BB_LIMIT_IN X06 //摆臂到位
-
- #define HL_DK_UP_LIMIT_IN X11 //挡块上下到位
- #define HL_CCX_LIMIT_IN X12 //穿插销到位
- #define HL_CCX_ORIGIN_IN X13 //穿插销原位
- #define HL_TFK_LIMIT_IN X14 //推方块到位
- #define HL_TFK_ORIGIN_IN X15 //推方块原位
-
- #define HL_HM_VAVLE Y00 //合模
- #define HL_TFK_VAVLE Y01 //推方块
- #define HL_BB_VAVLE Y02 //摆臂
- #define HL_DK_UP_VAVLE Y03 //挡块上下
- #define HL_JD_VAVLE Y04 //夹带
- #define HL_CCX_VAVLE Y05 //穿插销
- #define HL_YD_VAVLE Y07 //压带
- #define HL_SJ_VAVLE Y10 //松紧气缸
- #define HL_CD_MOTOR Y11 //储带电机
- #define HL_ALARM_OUT Y12
- #define HL_YCX_VAVLE Y13 //压插销电磁阀
- //M0~M4 Actioon.h全局使用
- #define HL_bHM M0005
- #define HL_bTFK M0006
- #define HL_bBB M0007
- #define HL_bDK_UP M0008
- #define HL_bJD M0009
- #define HL_bCCX M0010
- #define HL_bDK_GO M0011
- #define HL_bYD M0012
- #define HL_bSJ M0013
- #define HL_bCD M0014
- #define HL_bMotor M0015
- #define HL_bStart M0016
- #define HL_bRunning M0017
- #define HL_bStop M0018
- #define HL_bAlarmStop M0019
- #define HL_bSingStart M0020
- #define HL_bAdd M0021
- #define HL_bSetWorkData M0022
- #define HL_bDec M0023
- #define HL_bDW M0024
- #define HL_bZCX M0025
- #define HL_bHL M0026
- #define HL_bHMYD M0027
- #define HL_bDKUP M0028
- #define HL_bYCX M0029
- #endif
- #endif
|