#ifndef __GLTIEBUJI_H__ #define __GLTIEBUJI_H__ #if JU_XING_MACHINE == 1 extern void TBJ_InitAction(void); extern void TBJ_ManualAction(void); extern void TBJ_Action(void); extern void TBJ_DelayAction(void); #define TBJ_ALARM_ADDR 100 #define TBJ_TOTAL_ADDR 76 #define TBJ_NOWTOTAL_ADDR 80 #define TBJ_SPEED_ADDR 83 #define TBJ_PROSPEED_ADDR 78 #define ERRORTIME 2000 #define VAVLE_ALARM_TIME 3000 #define GUO_LIAN_OVER_TIME 10000 //故障代码列表 #define TBJ_NO_ALARM 0 #define TBJ_KADAI_ALARM 2 #define TBJ_XIACHONG_ARRIVE_ALARM 3 #define TBJ_HM_LIMIT_ALARM 4 #define TBJ_SM_LIMIT_ALARM 5 #define TBJ_GUOLIAN_ALARM 6 #define TBJ_Auto_Step cStepMByte //自动操作步骤 #define TBJ_Motor_Step cStepMByte1 //电机拖带步骤 #define TBJ_HMCS_Step cStepMByte2 //合模超声步骤 #define TBJ_SJ_FJ_Step cStepMByte3 //送胶分胶步骤 #define TBJ_STOP_Step cStepMByte4 //停机动作步骤 #define TBJ_TEST_TIME cDelayTime1 //测试跳过条件时间 #define TBJ_Auto_Delay cDelayTime2 //自动步骤延迟时间 #define TBJ_FJ_Delay cDelayTime3 //延时分胶 #define TBJ_SJ_Delay cDelayTime4 //延时送胶 #define TBJ_CS_Delay cDelayTime5 //延时超声 #define TBJ_Motor_Delay cDelayTime6 //延时电机 #define TBJ_GZ_Delay cDelayTime7 //延时钩针 #define TBJ_SM_ErrorTime cDelayTime8 //上模容错时间 #define TBJ_SJ_ErrorTime cDelayTime9 //送胶容错时间 #define TBJ_DJ_ErrorTime cDelayTime10 //电机容错时间 #define TBJ_CQ_Delay cDelayTime11 //吹气延时 #define TBJ_STOP_Delay cDelayTime12 //暂停延时 #define TBJ_DIR_P 1 #define TBJ_DIR_N 0 #define TBJ_MOTOR_EN 1 #define TBJ_MOTOR_DISEN 0 #define TBJ_NO_ALARM 0 #define FRIST_LL_LENGTH cDword32Buff1 //第一条拉链长度 #define TBJ_SAVE_POS cDword32Buff2 //保存当前位置信息,用于计算 #define TBJ_OneTimes cCharBuff3 //完成一次标志位 #define TEST1 cCharBuff2 //判断是否为第一条拉链 #define TBJ_Hand_Hemo_flag cCharBuff4 //手动合模完成标志位,做吹气用 #define TBJ_bSingleone cCharBuff5 //单循环记忆参数 #define TBJ_PARAM_CS_DELAY (user_datas[0] * 10) //超声延时时间 #define TBJ_PARAM_GZ_DELAY user_datas[1] //延时上钩针 #define TBJ_PARAM_JJ_TIME (user_datas[3] * 10) //压带夹胶时间 #define TBJ_PARAM_FJ_DELAY (user_datas[4] * 10) //分胶延时输出 #define TNJ_PARAM_TD_LENGTH user_datas[5] //过链由空位到上升沿时,电机拖带距离 #define TBJ_PARAM_BJ_CS_TIME (user_datas[6] * 10) //布胶超声时间 #define TBJ_PARAM_BJ_GH_TIME (user_datas[7] * 10) //布胶固化时间 #define TBJ_PARAM_ChuiQi_TIME (user_datas[8] * 10) //吹气时间 #define TBJ_PARAM_SJ_TIME (user_datas[9] * 10) //送胶时间 #define TBJ_PARAM_MOTOR_START_SPEED user_datas[10] //电机启动速度 #define TBJ_PARAM_MOTOR_ADD user_datas[11] //电机加速速度 #define TBJ_PARAM_HIGH_SPEED user_datas[12] //电机高位速度 #define TBJ_PARAM_NULL_SPEED user_datas[13] //电机空位速度 #define TBJ_PARAM_SongJiaoMode user_datas[14] //送胶方式 0气缸 1滚轮 #define TBJ_PARAM_XiaMo_Mode user_datas[15] //下模方式 0下模活动,1下模不动(下模活动,超声需要考虑烧坏焊头) #define TBJ_PARAM_TuiGouZhen_Mode user_datas[16] //0 先超声后下勾针,1 先下勾针后超声 #define TBJ_PARAM_SGZSelect user_datas[17] //钩针方式选择 0为双钩针 1为单钩针 #define TBJ_PARAM_TWOTD_SELECT user_datas[18] //二次拖带选择 0 为普通拖带 1为二次拖带 #define TBJ_PARAM_GUNLUN_SIGN user_datas[19] //滚轮送胶时到位是否有信号 0 有前限位 1没前限位 #define TBJ_PARAM_DJ_FANZHUAN user_datas[20] //电机是否反转 0不反转 1反转 #define TBJ_PARAM_FenJiaoSelect user_datas[21] //是否有分胶阀,1为没有,0为有 #define TBJ_PARAM_DJ_AUTO_STOP_TIME (user_datas[24] * 100) //拖带自动停机时间(防止压坏轮胶) #define TBJ_PARAM_TWOTD_DELAY (user_datas[25] * 10) //延时二次拖带 #define TBJ_PARAM_TWOTD_LENGTH user_datas[26] //二次拖带 过链由空位到上升沿时,电机拖带距离 #define TBJ_TUILIAN_LENGTH user_datas[27] //退链长度 #define TBJ_PARAM_WENDU_TIME (user_datas[28] * 10) //温度到达,超声时减少的时间 #define TBJ_PARAM_LL_PRETECT_LENGTH (user_datas[29]) //自动测长度时自动允许拉带长度偏差 #define TBJ_PARAM_KAIMO_TD_DELAY (user_datas[31] * 10) //开模后延时拖带时间 #define TBJ_PARAM_CS_MODE user_datas[32] //超声模式选择 0为透明胶 1为布胶 #define TBJ_PARAM_TMJ_CS_TIME (user_datas[33] * 10) //透明胶超声时间 #define TBJ_PARAM_TMJ_GH_TIME (user_datas[34] * 10) //透明胶固化时间 #define TBJ_FJBACKMode user_datas[35] //1 为二次拖带后 退分胶 #define TBJ_PARAM_HONGWAI_GanYin user_datas[36] //是否有红外(模拟)(0为没有感应器,1为有感应器) #define TBJ_Frist_SetDefa user_datas[71] //写入程序后,第一次上电恢复默认出厂参数 #define TBJ_CHENGXU_UPDATE user_datas[74] //便于屏幕判断程序有无更新 #define TBJ_SET_TOTAL user_datas[75] //设定产量 #define TBJ_TOTAL_DISPLAY user_datas[76] //显示产量 #define TBJ_PARAM_SHENGJIAO user_datas[79] //是否开启节省布胶 #define TBJ_PARAM_CYCLE_PULSE user_datas[84] //转一圈脉冲数 #define TBJ_PARAM_CYCLE_LENGTH user_datas[85] //转一圈拖带多长 #define TBJ_PARAM_DEC_MODE user_datas[86] //减速模式 0感应 1数控 #define TBJ_PARAM_DEC_LEN user_datas[87] //数控减速距离 #define TBJ_PARAM_AOKO_MODE user_datas[88] //凹口普通切换 #define TBJ_TEST_MODE (user_datas[90] == 55) //55为测试模式 #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 TBJ_START_IN M0384 //X00启动 #define TBJ_START_IN_UP (M0384 && !OLDM384) //X00启动上升沿 #define TBJ_STOP_IN M0385 //X01停止 #define TBJ_STOP_IN_UP (M0385 && !OLDM385) //X01停止上升沿 #define TBJ_HAND_GOUZHEN M0386 //X02手动钩针 #define TBJ_HAND_GOUZHEN_UP (M0386 && !OLDM386) //X02手动钩针上升沿 #define TBJ_HAND_FENJIAO M0387 //X03手动分胶 #define TBJ_HAND_FENJIAO_UP (M0387 && !OLDM387) //X03手动分胶上升沿 #define TBJ_HAND_FENJIAO_DW (!M0387 && OLDM387) //X03手动分胶下降沿 #define TBJ_HAND_HEMO M0388 //X04手动合模 #define TBJ_HAND_HEMO_UP (M0388 && !OLDM388) //X04手动合模上升沿 #define TBJ_HAND_HEMO_DW (!M0388 && OLDM388) //X04手动合模下降沿 #define TBJ_HAND_SONGJIAO M0389 //X05手动送胶 #define TBJ_HAND_SONGJIAO_UP (M0389 && !OLDM389) //X05手动送胶上升沿 #define TBJ_HAND_SONGJIAO_DW (!M0389 && OLDM389) //X05手动送胶下降沿 #define TBJ_HAND_CHAOSHENG M0390 //X06手动超声 #define TBJ_HAND_CHAOSHENG_UP (M0390 && !OLDM390) //X06手动超声上升沿 #define TBJ_HAND_CHAOSHENG_DW (!M0390 && OLDM390) //X06手动超声下降沿 #define TBJ_NOJIAO_IN M0391 //X07切换自动位 目前空置 #define TBJ_SHANGCHAO_IN M0392 //X10上超 #define TBJ_SHANGCHAO_IN_UP (M0392 && !OLDM392) //X10上超上升沿 #define TBJ_SHANGCHAO_IN_DW (!M0392 && OLDM392) //X10上超下降沿 #define TBJ_GUO_LIAN_IN M0393 //X11过链接近开关 有链为 1 无链(空位)为 0 #define TBJ_GUO_LIAN_IN_UP (M0393 && !OLDM393) //X11过链接近开关上升沿 #define TBJ_GUO_LIAN_IN_DOWN (!M0393 && OLDM393) //X11过链接近开关下降沿 #define TBJ_FJ_LIMIT_IN M0394 //X12分胶阀到位感应 #define TBJ_FJ_ORIGIN_IN M0395 //X13分胶阀原位感应 #define TBJ_SM_LIMIT_IN M0396 //X14上模下冲到位感应 #define TBJ_SM_LIMIT_IN_UP (M0396 && !OLDM396) //X14上模下冲到位感应上升沿 #define TBJ_GZ_ORIGIN_IN M0397 //X15钩针复位原位感应 #define TBJ_SJ_LIMIT_IN M0398 //X16送胶到位感应 #define TBJ_SJ_LIMIT_IN_UP (M0398 && !OLDM398) //X16送胶到位感应上升沿 #define TBJ_SJ_ORIGIN_IN M0399 //X17送胶复位感应 #define TBJ_TD_LIMIT_IN M0400 //X20拖带到位感应(双钩针才有) #define TBJ_AUTO_IN M0401 //X21缺胶信号 #define TBJ_XM_LIMIT_IN M0402 //X22下模到位感应 #define TBJ_CLUTH_VAVLE M0352 //Y00离合器(步进方向) #define TBJ_GZ_VAVLE M0353 //Y01钩针 #define TBJ_FJ_VAVLE M0354 //Y02分胶 #define TBJ_SM_VAVLE M0355 //Y03上模(下冲) #define TBJ_SJ_VAVLE M0356 //Y04送胶电磁阀 #define TBJ_YD_VAVLE M0357 //Y05压带 #define TBJ_CQ_VAVLE M0358 //Y06吹气 //#define //Y07夹胶 #define TBJ_MOTOR_OUT M0361 //Y11 #define TBJ_XM_VAVLE M0362 //Y12下模 #define TBJ_CS_OUT M0365 //Y15超声 //Y15电机松轴 //Y12运行 //Y13停止 //Y14警告 //M0~M4 Actioon.h全局使用 #define TBJ_bYD M0005 //压带 老版屏幕为M0003 #define TBJ_bGZ M0006 //钩针 老版屏幕为M0004 #define TBJ_bSJ M0007 //送胶 #define TBJ_bHM M0008 //合模 #define TBJ_bCS M0009 //超声 #define TBJ_bCS_FLAG M0010 //超声标志 #define TBJ_bSC M0011 //上超 #define TBJ_bSC_FLAG M0012 //上超标志 #define TBJ_bFJ M0013 //分胶 #define TBJ_bRESET_TOTAL M0014 //产量清零 #define TBJ_bRunning M0020 #define TBJ_bStart M0021 #define TBJ_bStop M0022 #define TBJ_bAlarmStop M0023 #define TBJ_bClearTotal M0024 #define TBJ_bSingle M0025 #define TBJ_bTiaoShi_MODE M0040 #define DJ_NoZip_W 1 //E01 没拉链警告 请检查 X11 过链接近开关 #define DJ_TuiGZ_W 2 //E02 退勾针不到位或 X15 钩针复位感应异常,当前程序处于电机第七步 #define QD_GZDaoWei_W 3 //E03 钩针未退位或 X20 钩针到位感应异常警告,无法启动 #define SJ_SongJiao_W 4 //E04 送胶不到位或 X16送胶前感应异常 #define SJ_TuiJiao_W 5 //E05 退胶不到位警告 或 X16、X17送胶前后感应异常 #define SJ_TuiFenJiao_W 6 //E06 退分胶不到位警告或 X12分胶后感应异常 #define SJ_NoJiao_W 7 //E07 胶已用完,请补充胶 #define ZipperLengPRO_W 8 //E08 拉链长度异常,超过拉链保护长度 #define QD_Hemo_DaoWei_W 9 //E09 下冲气缸未上升或 X14 合模感应异常,无法启动 #define SJ_FenJiao_DaoWei_W 10 //E10 分胶未到位,无法送胶或 X12分胶前感应异常 #define QD_SongJiaoFa_W 11 //E11 送胶阀未退回,无法启动 #define QD_FenJiaoFa_W 12 //E12 分胶阀未退回,无法启动 #define QD_FenJiaoQian_W 13 //E13 分胶阀未退位或 X12 分胶前感应异常,无法启动 #define QD_FenJiaoHou_W 14 //E14 X13 分胶后感应异常,无法启动 #define QD_TuiJiaoHou_W 15 //E15 X17 送胶后感应异常,无法启动 #define TBJ_TOTAL_ALARM 16 //E16 已达设定产量,请清空产量或重新设定产量 #define QD_GZOut_W 18 //E18 钩针阀未退回,无法启动 #define QD_GZreset_W 19 //E19 X15 钩针复位感应异常,无法启动 #define QD_XiaChong_W 20 //E20 下冲气缸输出中,无法启动 #define FenJiao_BuDaoWei_W 21 //E21 分胶阀不到位或 X12 分胶前感应异常 #define SongJiao_BuDaoWei 22 //E22 送胶不到位 或 X16送胶前感应异常 #define Hemo_BuDaoWei_W 23 //E23 合模不到位警告或 X14 合模到位感应异常 #define DJ_ZipperTimePRO_W 24 //E24 拉拉链时间过长,可能由以下原因:①超出保护时间,请检查保护时间是否设置过短②电机是否启动,速度是否过慢③拉链过紧,电机没拉动 #define DJ_GZWeiDaoWei_W 25 //E25 钩针未到位或 X20钩针到位感应异常警告,电机停止 #define CS_Hemo_DaoWei_W 26 //E26 超声停止,合模不到位或X14下冲到位感应异常 #define CS_GZ_DaoWei_W 27 //E27 超声停止,钩针不到位或 X15钩针复位感应异常 #define ZD_FenJiaoFa_W 28 //E28 自动停止,分胶阀输出停止异常 #define ZD_FenJiaoQian_W 29 //E29 自动停止,分胶未退位或分胶前感应异常 #define ZD_FenJiaoHou_W 30 //E30 自动停止,分胶未退位或分胶后感应异常 #define ZD_SongJiaoFa_W 31 //E31 自动停止,送胶阀退位异常 #define ZD_SongJiaoQian_W 32 //E32 自动停止,送胶未退位或送胶前感应异常 #define ZD_SongJiaoHou_W 33 //E33 自动停止,送胶未退位或送胶后感应异常 #define SDFJ_ModeAction_W 34 //E34 手动分胶停止,原因可能如下①夹胶非单独气缸,压胶阀未关闭;②单钩针模式下,钩针退位了;③双钩针模式下,钩针未退位; #define SDFJ_XiaChongFa_W 35 //E35 手动分胶停止,下冲气缸未退位 #define SDFJ_XiaChong_DaoWei_W 36 //E36 手动分胶停止,下冲气缸未退位或X14下冲到位感应异常 #define SDFJ_CS_W 37 //E37 手动分胶停止,超声未关闭 #define SDFJ_SongJiaoDaoWei_W 38 //E38 手动分胶停止,送胶阀未退回,或X16送胶到位感应异常 #define SDFJ_TuiJiaoDaoWei_W 39 //E39 手动分胶停止,送胶阀未退回,或X17退胶到位感应异常 #define SDSJ_ModeAction_W 40 //E40 手动送胶停止,原因可能如下①夹胶非单独气缸,压胶阀未关闭;②单钩针模式下,钩针退位;③双钩针模式下,钩针未退位; #define SDSJ_FenJiaoFa_W 41 //E41 手动送胶停止,分胶阀处于异常状态,X12X13前后感应灯同亮或同灭 #define SDSJ_TuiJiao_DaoWei_W 42 //E42 手动送胶停止,送胶阀未输出,送胶后感应亮 #define SDSJ_XiaChongFa_W 43 //E43 手动送胶停止,下冲气缸输出中 #define SDSJ_XiaChong_DaoWei_W 44 //E44 手动送胶停止,下冲气缸未退回,或X14 下冲到位感应异常 #define SDSJ_CS_W 45 //E45 手动送胶停止,超声未关闭 #define SDHM_FenJiaoHou_W 46 //E46 手动合模停止,分胶阀未退位,或 X13分胶后感应异常 #define SDHM_FenJiaoQian_W 47 //E47 手动合模停止,分胶阀未退位,或 X12分胶前感应异常 #define SDHM_SongJiao_DaoWei_W 48 //E48 手动合模停止,送胶阀未退位,或 X16送胶前感应异常 #define SDHM_SongJiao_TuiWei_W 49 //E49 手动合模停止,送胶阀未退位,或 X17分胶后感应异常 #define SDHM_CS_W 50 //E50 手动合模停止,超声未关闭 #define SDCS_FenJiaoFa_W 51 //E51 手动超声停止,分胶阀未退回 #define SDCS_SongJiaoFa_W 52 //E52 手动超声停止,送胶阀未退回 #define SDCS_FenJiaoQian_W 53 //E53 手动超声停止,分胶阀未退回,或X12分胶前感应异常 #define SDCS_FenJiaoHou_W 54 //E54 手动超声停止,分胶阀未退回,或X13分胶后感应异常 #define SDCS_SongJiao_DaoWei_W 55 //E55 手动超声停止,送胶阀未退回,或X16送胶到位感应异常 #define SDCS_TuiJiao_DaoWei_W 56 //E56 手动超声停止,送胶阀未退回,或X17退胶到位感应异常 #define SDSC_FenJiaoFa_W 57 //E57 手动上超停止,分胶阀未退回 #define SDSC_FenJiaoQian_W 58 //E58 手动上超停止,分胶阀未退回,或X12分胶前感应异常 #define SDSC_FenJiaoHou_W 59 //E59 手动上超停止,分胶阀未退回,或X13分胶后感应异常 #define SDSC_SongJiaoFa_W 60 //E60 手动上超停止,送胶阀未退回 #define SDSC_SongJiao_DaoWei_W 61 //E61 手动上超停止,送胶阀未退回,或X16送胶到位感应异常 #define SDSC_TuiJiao_DaoWei_W 62 //E62 手动上超停止,送胶阀未退回,或X17退胶到位感应异常 #endif #endif