FJQueduanChuantou.h 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  1. #ifndef FJQUEDUAN_CHUANTOU_H
  2. #define FJQUEDUAN_CHUANTOU_H
  3. #if FU_JIAN_MACHINE
  4. #define QDCT_TOTAL_ADDR 8
  5. #define QDCT_NOWTOTAL_ADDR 10
  6. #define QDCT_SETTOTAL_ADDR 12
  7. #define QDCT_ALARM_ADDR 15
  8. #define QDCT_PARAM_CYCLE_PULSE user_datas[0]
  9. #define QDCT_PARAM_CYCLE_LENGTH user_datas[1]
  10. #define QDCT_PARAM_SET_ZIPPER_LENGTH (user_datas[16] | user_datas[17] << 16)
  11. #define QDCT_PARAM_PUTIN_LENGTH user_datas[18]
  12. #define QDCT_PARAM_JJGO_SPEED user_datas[20]
  13. #define QDCT_PARAM_JJFZ_LENGTH user_datas[21]
  14. #define QDCT_PARAM_JJBACK_SPEED user_datas[22]
  15. #define QDCT_PARAM_PUTIN_SPEED user_datas[23]
  16. #define QDCT_PARAM_CUT_BACK_LENGTH user_datas[24]
  17. #define QDCT_PARAM_SJZ_LENGTH user_datas[25]
  18. #define QDCT_PARAM_CUT_DELAY (user_datas[26]*10)
  19. #define QDCT_PARAM_CUTBACK_DELAY (user_datas[27]*10)
  20. #define QDCT_PARAM_CUTBACK_SPEED user_datas[28]
  21. #define QDCT_PARAM_KL_TIME_SPEED (user_datas[30]*10)
  22. #define QDCT_PARAM_FZ_DELAY (user_datas[34]*10)
  23. #define QDCT_PARAM_ZD_WORKNUM user_datas[36]
  24. #define QDCT_PARAM_ZD_WORK_TIME (user_datas[37]*10)
  25. #define QDCT_PARAM_JD_DELAY (user_datas[41]*10)
  26. #define QDCT_PARAM_CYCLE_DELAY (user_datas[43]*10)
  27. #define QDCT_PARAM_FIRST_SPEED user_datas[44]
  28. #define QDCT_PARAM_GO_LOWSPEED_LENGTH user_datas[45]
  29. #define QDCT_PARAM_CZ_CHECK_DELAY (user_datas[46]*10)
  30. #define QDCT_PARAM_LOCK_TIME (user_datas[47]*10)
  31. #define QDCT_PARAM_ON_BACK_LENGTH user_datas[50]
  32. #define QDCT_PARAM_KL_DELAY user_datas[52]
  33. #define QDCT_ZD_MODE user_datas[42]
  34. #define QDCT_ZFC_MODE user_datas[51]
  35. typedef __packed struct
  36. {
  37. unsigned short XCyclePulse; //0 转一圈脉冲数
  38. unsigned short XCycleDist; //1 转一圈拖带多长
  39. unsigned short XStopSpeed; //2 停止速度
  40. unsigned short XStartSpeed; //3 启动速度
  41. unsigned short XMaxSpeed; //4 最大速度
  42. unsigned short XMinSpeed; //5 最小速度
  43. unsigned short XAccTime; //6 加速时间
  44. unsigned short XDecTime; //7 减速时间
  45. unsigned long Total; //8
  46. unsigned long NowTotal; //10
  47. unsigned long SetTotal; //12
  48. unsigned short Speed; //14
  49. unsigned short AlarmCode; //15
  50. unsigned long ZipperLength;//16 拉链长度
  51. unsigned short PutInLength;//18 穿拉头低速长度
  52. unsigned short FZSpeed; //19 反转速度
  53. unsigned short JJGoSpeed; //20夹具前进速度
  54. unsigned short FZLength; //21 反转长度
  55. unsigned short LDBackSpeed; //22拉带后退速度
  56. unsigned short LDBackLowSpeed; //23穿拉头低速
  57. unsigned short CutBackLength; //24切断后退总长度
  58. unsigned short SJZdist; //25 松夹子的位置
  59. unsigned short CutDelay; //26
  60. unsigned short CutBackDelay; //27切断持续时间
  61. unsigned short CutBackSpeed; //28切断之后后拉的速度
  62. unsigned short DelayReBack; //29
  63. unsigned short KaiLianTime; //30开链持续时间
  64. unsigned short BackLowSpeedLength; //31 后拉低速长度
  65. unsigned short StopTime; //32
  66. unsigned short HighSpeedLength;//33 穿入前高速长度
  67. unsigned short FZDelay; //34 延时反转
  68. unsigned short TableMotorWorkTime;//35
  69. unsigned short ZDWorkNum; //36振动盘启动个数
  70. unsigned short ZDWorkDelay; //37振动盘工作时间
  71. long XRealPos; //38
  72. unsigned short DecLength; //40 前进减速长度
  73. unsigned short DelayJD; //41 延时夹带
  74. unsigned short ZhenDongMode; //42 振动盘工作模式
  75. unsigned short CycleDelay; //43循环工作时间间隔
  76. unsigned short LowSpeed; //44前进慢速
  77. unsigned short LowSpeedLength;//45前进慢速长度
  78. unsigned short CZDelayCheck;//46延时检测触针信号
  79. unsigned short LockZipperTime;//47锁拉头所需时间
  80. unsigned short UnLockDist; //48提前解锁拉头位置
  81. unsigned short SecondMoveLength;//49二次前进长度
  82. unsigned short FirstBackLength;//50压感应后退长度
  83. unsigned short MachineMode; //51正穿反穿模式选择
  84. unsigned short DelayKL; //52延时开链
  85. } SystemParam_str;
  86. typedef __packed struct
  87. {
  88. long DispLay[10];
  89. } TestData_str;
  90. #define START_IN X00
  91. #define START_IN_UP (X00 && !OLDX00)
  92. #define STOP_IN X01
  93. #define STOP_IN_UP (X01 && !OLDX01)
  94. #define QDCT_NO_ZIPPER_CHECK_IN X02
  95. #define QDCT_JLT_IN X03
  96. #define QDCT_KA_DAI_IN X04
  97. #define QDCT_GO_LIMIT_IN X05
  98. #define QDCT_GO_DEC_IN X06
  99. #define QDCT_BACK_LIMIT_IN X07
  100. #define QDCT_LTCZ_IN X10
  101. #define QDCT_GL_LIMIT_IN X12
  102. #define GL_ORIGIN_IN X11
  103. #define SL_ARRIVE_IN X13
  104. #define SQ_ORIGIN_IN X15
  105. #define XQ_ARRIVE_IN X17
  106. #define XQ_ORIGIN_IN X20
  107. #define SM_ARRIVE_IN X21
  108. #define SM_ORIGIN_IN X22
  109. #define LATOU_IN X23
  110. #define JZ_LEFT_IN X24
  111. #define JZ_RIGHT_IN X25
  112. #define SQ_OUT Y00
  113. #define XQ_OUT Y01
  114. #define SM_OUT Y02
  115. #define JZ_OUT Y03
  116. #define SL_OUT Y04
  117. #define JLT_OUT Y05
  118. #define GL_OUT Y06
  119. #define KL_OUT Y07
  120. #define ZDP_OUT Y13
  121. #define SLT_OUT Y17
  122. #define bStart M00
  123. #define bRunning M01
  124. #define bOnceStart M02
  125. #define bAlarmStop M03
  126. #define bClearTotal M04
  127. #define bClerNowTotal M05
  128. #define bQianDianDW M06
  129. #define bGeiLT M07
  130. #define bZhuangLiao M08
  131. #define bQieDuan M09
  132. #define bNext M11
  133. #define bStop M12
  134. #define bTuiLT M13
  135. #define bZuangLT M14
  136. #define bHeMo M15
  137. #define bChuanLT M16
  138. #define bSaveWorkState M17
  139. #define bWorkMode !M18
  140. #define XIA_QIE_ERROR_TIME 3000
  141. #define SONG_LIAO_ERROR_TIME 3000
  142. #define XIA_MO_DW_ERROR_TIME 3000
  143. #define SUO_JIN_ERROR_TIME 3000
  144. #define JIA_DAI_ERROR_TIME 3000
  145. #define ZLT_ERROR_TIME 3000
  146. //M50开始为手动IO
  147. extern SystemParam_str *SystemParam;
  148. extern TestData_str *TestData;
  149. extern void DelayYJ(void);
  150. extern void InitActionYJ(void);
  151. extern void QueDuan_ChuanTou_ActionYJ(void);
  152. #endif
  153. #endif