123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274 |
- #if FJ_YING_XING_MACHINE == 1
- extern void YWXChuanTou_HeLian_InitAction(void);
- extern void YWXChuanTou_HeLian_Action(void);
- extern void YWXChuanTou_HeLian_SetAlarmCode(unsigned alarm_code);
- extern void ExtiAcitionX02(void);
- #define DIR_P 1
- #define DIR_N 0
- #define MOTOR_EN 0
- #define MOTOR_DISEN 1
- #define YX_CTHL_VAVLE_ERROR_TIME 3000
- #define YX_CTHL_MOTOR_ALARM_TIME 5000
- //故障代码列表
- #define YX_CTHL_NO_ALARM 0
- #define YX_CTHL_WLZDTJ_ALARM 1 //无拉链自动停机
- #define YX_CTHL_XKSC_Limit_ALARM 2 //X03斜口上止到位异常
- #define YX_CTHL_TLiao_Limit_ALARM 3 //X04推料到位异常
- #define YX_CTHL_COLOR_IN_ALARM 4 //色标感应异常
- #define YX_CTHL_HSLiao_Limit_ALARM 5 //X06横送料到位异常
- #define YX_CTHL_HSLiao_Origin_ALARM 6 //X07横送料原位异常
- #define YX_CTHL_JLiao_Origin_ALARM 7 //X10接料到原位异常
- #define YX_CTHL_CTM_Limit_ALARM 8 //X11穿头模到位异常
- #define YX_CTHL_CTM_Origin_ALARM 9 //X12穿头模原位异常
- #define YX_CTHL_FKDW_Limit_ALARM 10 //X13一次穿头原位异常
- #define YX_CTHL_LTou_Check_ALARM 11 //X14拉头缺料感应异常
- #define YX_CTHL_TQM_Limit_ALARM 12 //X15插稍上止感应异常
- #define YX_CTHL_CX_Limit_ALARM 13 //X16插稍到位感应异常
- #define YX_CTHL_XKTD_Origin_ALARM 14 //X17斜口原位感应异常
- #define YX_CTHL_XIAOCHA_ALARM 15 //X20插稍下移到位异常
- #define YX_CTHL_SF_ALR_ALARM 16 //X22伺服报警异常
- #define YX_CTHL_SF_Origin_ALARM 17 //X23伺服原位(穿链原位)异常
- #define YX_CTHL_ZLT_ALARM 18 //装拉头异常
- #define YX_CTHL_FKYC_ALARM 19 //无方块或检测异常
- #define YX_CTHL_AutoStep cStepMByte
- #define YX_CTHL_ZhuangLiaoStep cStepMByte1
- #define YX_CTHL_TLiaoStep cStepMByte2
- #define YX_CTHL_TD_MotorStep cStepMByte3 //拖带电机
- #define YX_CTHL_JiaLianStep cStepMByte4
- #define YX_CTHL_ZhenDongStep cStepMByte6
- #define YX_CTHL_SongLiaoStep cStepMByte7
- #define YX_CTHL_FZ_MotorStep cStepMByte8 //穿链
- #define YX_CTHL_AutoStep1 cStepMByte9
- #define YX_CTHL_ColorStep cStepMByte10
- #define YX_CTHL_ZhuangLiaoDelay cDelayTime2
- #define YX_CTHL_TLiao_Delay cDelayTime3
- #define YX_CTHL_TD_MotorDelay cDelayTime4
- #define YX_CTHL_AutoDelay cDelayTime5
- #define YX_CTHL_TestDelay cDelayTime6
- #define YX_CTHL_FZ_MotorDelay cDelayTime7
- #define YX_CTHL_TouchDelay cDelayTime8
- #define YX_CTHL_AutoDelay1 cDelayTime9
- #define YX_CTHL_ZDP_Delay cDelayTime10
- #define YX_CTHL_MOTORZ_Delay cDelayTime11
- #define YX_CTHL_bColor_Delay cDelayTime12
- //32位无符号变量
- #define YX_CTHL_LianLengthCheck cUDword32Buff1
- #define YX_CTHL_LianLengthAutoCheck cUDword32Buff2
- #define YX_CTHL_LianLengthCheckOld cUDword32Buff3
- #define YX_CTHL_LianLengthBuff cUDword32Buff4
- #define YX_CTHL_LianLengthAutoCheckERROR cUDword32Buff5
- #define YX_CTHL_LianLengthAutoCRCDcheck cUDword32Buff6
- #define YX_CTHL_LianLengthAutoFZcheck cUDword32Buff7
- #define YX_CTHL_LianLengthAutoSECONDcheck cUDword32Buff8
- #define YX_CTHL_LianLengthAutoSECONDONEcheck cUDword32Buff9
- #define YX_CTHL_LianLengthAutoTHREEcheck cUDword32Buff10
- #define YX_CTHL_LianLengthAutoTD_CHECK cUDword32Buff11
- //32位有符号变量
- #define YX_CTHL_XSavePosBuff cDword32Buff1
- #define YX_CTHL_X_CXPosBuff cDword32Buff2
- #define YX_CTHL_YSavePosBuff cDword32Buff3
- #define YX_CTHL_CheckInX02PosBuff cDword32Buff4
- #define YX_CTHL_YsaveCXDWPosBuff cDword32Buff5
- #define YX_CTHL_LENTH cDword32Buff6
- #define YX_CTHL_XSavePosBuff1 cDword32Buff7
- #define YX_CTHL_XSavePosBuff2 cDword32Buff8
- #define YX_CTHL_XSavePosBuff3 cDword32Buff9
- //16位变量
- #define YX_CTHL_RunStepSave cUShort16Buff1
- #define YX_CTHL_Test cUShort16Buff2
- //8位变量
- #define YX_CTHL_TryCnt cCharBuff1
- #define YX_CTHL_cZipCnt cCharBuff2
- #define YX_CTHL_stop cCharBuff3
- #define YX_CTHL_AUTO_start cCharBuff4
- #define YX_CTHL_MOTOR_MODE cCharBuff5
- #define YX_CTHL_wltzi cCharBuff6
- #define YX_CTHL_FKJC cCharBuff7
- #define YX_CTHL_cONERROR cCharBuff8
- //位标志位
- #define bTuiLaTouOkFlg bBitFlag0
- #define bZhuangLiaoOkFlg bBitFlag1
- #define bXiaMoENFlg bBitFlag2
- #define bHeLaTouOK bBitFlag3
- #define bCL_EN_FLG bBitFlag4
- #define bCL_OK_FLG bBitFlag5
- #define bCheckEN_FLG bBitFlag6
- #define bSingOneFlg bBitFlag7
- #define YX_CTHL_bFZ_LengthOK bBitFlag8
- #define YX_CTHL_bFirst_CheckOK bBitFlag9
- #define YX_CTHL_bQDinWeiOK bBitFlag10
- #define YX_CTHL_bHDinWeiOk bBitFlag11
- #define YX_CTHL_ZhouWanone bBitFlag12
- #define YX_CTHL_ZhouWantwo bBitFlag13
- #define YX_CTHL_TOTAL_ADDR 76
- #define YX_CTHL_SPEED_ADDR 78
- #define YX_CTHL_ALARM_ADDR 100
- #define YX_CTHL_TRUST_ALARM_ADDR 102
- #define YX_CTHL_TEST_ALARM_ADDR 106
- //104、105地址 作产量锁
- #define YX_CTHL_PARAM_TDCYCLE_PULSE user_datas[0]//0 转一圈脉冲数
- #define YX_CTHL_PARAM_TDCYCLE_LENGTH user_datas[1]//整数 转一圈拖带多长
- #define YX_CTHL_PARAM_FZCYCLE_LENGTH user_datas[2]//0 转一圈脉冲数
- #define YX_CTHL_PARAM_FZLDCYCLE_LENGTH user_datas[3]//整数 转一圈拖带多长
- #define YX_CTHL_PARAM_TD_RunSpeed user_datas[4]//整数 拖带电机拖带速度
- #define YX_CTHL_PARAM_FKDW_Speed user_datas[5]//整数 方块定位速度(低速度)
- #define YX_CTHL_PARAM_FZ_Speed user_datas[6]//整数 反转速度
- #define YX_CTHL_PARAM_first_CL_MAX_Length user_datas[7]//第一条拉链最长度
- #define YX_CTHL_PARAM_FKDW_Length user_datas[8]//0.01 方块定位长度
- #define YX_CTHL_PARAM_TXCYL_BACK_DELAY (10*user_datas[9])//0.01延时退小插压轮
- #define YX_CTHL_PARAM_TCXC_BACK_DELAY (10*user_datas[10])//0.01穿入小插后延时退插小插
- #define YX_CTHL_PARAM_HLT_SPEED_Speed user_datas[11]//合拉头速度
- #define YX_CTHL_PARAM_TLiao_BACKDELAY (10*user_datas[12])//0.01推拉头到位延时返回
- #define YX_CTHL_PARAM_MaGou_DELAY (10*user_datas[13])//0.01接料到位延时码勾
- #define YX_CTHL_PARAM_HSLiaoOff_DELAY (10*user_datas[14])//0.01码勾输出后退横送料
- #define YX_CTHL_PARAM_CheckLT_DELAY (10*user_datas[15])//0.01码勾输出后延时检测拉头
- #define YX_CTHL_PARAM_WLCDSHEZHI_LENTH user_datas[16] //拉带报警长度
- #define YX_CTHL_PARAM_GDQMTD_BACK_DELAY (10*user_datas[17])//0.01固定前码后延时拖带
- #define YX_CTHL_PARAM_XCDWTD_BACK_DELAY (10*user_datas[18])//0.01大插压轮退回来后延时小插定位
- #define YX_CTHL_PARAM_TQM_DELAY (10*user_datas[19]) //0.01 下模上来后延时推前码
- #define YX_CTHL_PARAM_FMOTOR_BILI (98/100)//(user_datas[20]/100) //0.01 副电机指数
- #define YX_CTHL_PARAM_TDCT_DELAY (10*user_datas[21]) //0.01 延时输出压轮
- #define YX_CTHL_PARAM_CXDW_Length user_datas[22] //插销定位长度
- #define YX_CTHL_PARAM_QMFZ_DELAY (10*user_datas[23]) //延时插小插
- #define YX_CTHL_PARAM_YSHL_DELAY (10*user_datas[24])//0.01延时合链
- #define YX_CTHL_PARAM_ZDP_Start_TIME (10*user_datas[25]) //0.01振动盘启动延时
- #define YX_CTHL_PARAM_ZDP_Stop_TIME (10*user_datas[26]) //0.01振动盘延时停止
- #define YX_CTHL_PARAM_THLJZ_Length user_datas[27] //插销定位长度
- #define YX_CTHL_PARAM_QM_MODE user_datas[28] //0斜码,1直码
- #define YX_CTHL_PARAM_FZYS_DELAY (10*user_datas[29]) //0.01延时反转
- #define YX_CTHL_PARAM_QMFZ_Length user_datas[30] //插前码定位反转长度
- #define YX_CTHL_PARAM_LTCD_MODE 1 //0短拉头模式,1长拉头模式
- #define YX_CTHL_PARAM_ZDP_AUTO user_datas[32] //0.01振动盘
- #define YX_CTHL_PARAM_TJSJ_TIME (10*user_datas[33]) //0.01退下模停机时间
- #define YX_CTHL_PARAM_GYH_DELAY (10*user_datas[34]) //0.01感应后延时固定方块
- #define YX_CTHL_PARAM_YAdai_lenth user_datas[35] //0.01提前距离输出压带
- #define YX_CTHL_AUTO_run_LENGTH user_datas[36] //0.01感应后再走长度
- #define YX_CTHL_PARAM_COLOR_CODE user_datas[37] //色标模式设置
- #define YX_CTHL_PARAM_BinLin_SPEED user_datas[38] //并链感应速度
- #define YX_CTHL_PARAM_DWFZ_LENGTH user_datas[39] //前码定位反转长度
- #define YX_CTHL_PARAM_CRSD_SPEED user_datas[60] //穿入速度
- #define YX_CTHL_PARAM_XKCR_LENGTH user_datas[61] //穿入长度
- //#define YX_CTHL_PARAM_QM_MODE user_datas[45] //公司简介
- //输入
- #define YX_CTHL_START_IN M0384 //X00 //启动
- #define YX_CTHL_START_IN_UP (M0384 && !OLDM384)//(X00 && !OLDX00)
- #define YX_CTHL_STOP_IN M0385 // X01 //停止
- #define YX_CTHL_STOP_IN_UP (M0385 && !OLDM385)//(X01 && !OLDX01)
- #define YX_CTHL_STOP_IN_DW (!M0385 && OLDM385)//(!X01 && OLDX01)
- #define YX_CTHL_FK_Check M0386 //X02方块感应定位
- #define YX_CTHL_FK_Check_UP (M0386 && !OLDM386)//(X02 && !OLDX02)
- #define YX_CTHL_FK_Check_DW (!M0386 && OLDM386)//(!X02 && OLDX02)
- #define YX_CTHL_TQM_Limit_IN M0387 //X03推前码到位
- #define YX_CTHL_HSLiao_Origin_IN M0388 //X04横送料原位
- #define YX_CTHL_HSLiao_Limit_IN M0389 //X05横送料到位
- #define YX_CTHL_JLiao_Limit_IN M0390 //X06接拉头到位
- #define YX_CTHL_LTou_Check M0391 //X07拉头缺料感应(码勾)
- #define YX_CTHL_CTM_Origin_IN M0392 //X10下模原位
- #define YX_CTHL_CTM_Limit_IN M0393 //X11下模到位
- #define YX_CTHL_FKDWE_IN M0394 //X12小插到位
- #define YX_CTHL_FKDWE_IN_UP (M0394 && !OLDM394)
- #define YX_CTHL_FKDWE_IN_DW (!M0394 && OLDM394)
- #define YX_CTHL_FKQL_IN M0395 //X13方块感应定位
- #define YX_CTHL_FKQL_IN_UP (M0395 && !OLDM395)
- #define YX_CTHL_FKQL_IN_DW (!M0395 && OLDM395)
- #define YX_CTHL_TLiao_Origin_IN M0396 //X14推料原位
- #define YX_CTHL_ZDP_IN M0397 //X15振动盘
- #define YX_CTHL_Colorcode_IN M0398 //X16色标感应
- #define YX_CTHL_Colorcode_IN_UP (M0398 && !OLDM398)
- #define YX_CTHL_XIAOCHA_IN M0400 //X20小插布带感应
- #define YX_CTHL_XIAOCHA_IN_UP (M0400 && !OLDM400)
- #define YX_CTHL_XIAOCHA_IN_DW (!M0400 && OLDM400)
- #define YX_CTHL_CHULIAOSHANG_IN M0401 //X21储带上感应
- #define YX_CTHL_CHULIAOSHANG_IN_UP (M0401 && !OLDM401)
- #define YX_CTHL_CHULIAOXIA_IN M0402 //X22储带下感应
- #define YX_CTHL_CHULIAOXIA_IN_UP (M0402 && !OLDM402)
- //输出
- #define YX_CTHL_TLiao_VAVLE M0304 //Y00推料
- #define YX_CTHL_HSLiao_VAVLE M0305 //Y01横送料
- #define YX_CTHL_JLTou_VAVLE M0306 //Y02接拉头
- #define YX_CTHL_MGuo_VAVLE M0307 //Y03码勾
- #define YX_CTHL_LYLun_VAVLE M0308 //Y04前压轮
- #define YX_CTHL_FKGD_VAVLE M0309 //Y05方块固定
- #define YX_CTHL_CXC_VAVLE M0310 //Y06 插小插
- #define YX_CTHL_GDQM_VAVLE M0311 //Y07 固定前码
- #define YX_CTHL_ZhenDongPian_OUT M0312 //Y10振动盘
- #define YX_CTHL_TQM_VAVLE M0313 //Y11推前码
- #define YX_CTHL_RYLun_VAVLE M0314 //Y12后压轮
- #define YX_CTHL_CTXM_VAVLE M0315 //Y13下模
- #define YX_CTHL_YADAI_VAVLE M0316 //Y14压带
-
- #define YX_CTHL_TestLED M0328 //Y30 测试状态灯
- //M0~M4全局固定使用
- /*
- #define bRunning M0000
- #define bStart M0001
- #define bStop M0002
- #define bAlarmStop M0003
- #define bClearTotal M0004
- */
- #define YX_CTHL_bHSL M0005 //手动横送料
- #define YX_CTHL_bTLiao M0006 //手动推料
- #define YX_CTHL_bJLT M0007 //接拉头
- #define YX_CTHL_bMG M0008 //码勾
- #define YX_CTHL_bLYLun M0009 //小插压轮
- #define YX_CTHL_bFKGD M0010 //固定方块
- #define YX_CTHL_bCXC M0011 //插小插
- #define YX_CTHL_bXCDWGYZ M0012 //小插到位感应针
- #define YX_CTHL_bFKGM M0013 //方块勾模
- #define YX_CTHL_bRYLun M0014 //大插压轮
- #define YX_CTHL_bCTXM M0015 //下模
- #define YX_CTHL_bYD M0016 //过链杆压带
- #define YX_CTHL_bSingOne M0017 //单循环
- #define YX_CTHL_bYJDW M0029 //一键定位
- #define YX_CTHL_bCLMotor_P M0025 //X轴电机测试
- #define YX_CTHL_bCLMotor_N M0026 //X轴电机测试
- #define YX_CTHL_bCLMotor_Z M0027 //Z轴电机测试
-
- #define YX_CTHL_bDanBu_MODE M0048 //调试单步
- #define YX_CTHL_bAutoZhuangLiao M0024 //自动装料
- #endif
|