ZYQueduanChuantou.h 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254
  1. #ifndef QUEDUAN_CHUANTOU_ZY_H
  2. #define QUEDUAN_CHUANTOU_ZY_H
  3. #if ZHEN_YU_MACHINE
  4. extern void QDCT_InitAction(void);
  5. extern void QDCT_Action(void);
  6. extern void QDCT_ExtiActionX31(void);
  7. extern void QDCT_SetAlarmCode(unsigned alarm_code);
  8. #define QDCT_DIR_P 0
  9. #define QDCT_DIR_N 1
  10. #define QDCT_Y_DIR_P 0
  11. #define QDCT_Y_DIR_N 1
  12. #define QDCT_MOTOR_EN 0
  13. #define QDCT_MOTOR_DISEN 1
  14. #define QDCT_VAVLE_ERROR_TIME 3000
  15. #define QDCT_MOTOR_ALARM_TIME 5000
  16. #define QDCT_YL_MOTOR_SAFE_LENGTH 100
  17. //故障代码列表
  18. #define QDCT_NO_ALARM 0
  19. #define QDCT_JD_ALARM 1
  20. #define QDCT_DEC_ALARM 2
  21. #define QDCT_GO_LIMIT_ALARM 3
  22. #define QDCT_BACK_LIMIT_ALARM 4
  23. #define QDCT_LTCZ_ALARM 5
  24. #define QDCT_TOTAL_ALARM 6
  25. #define QDCT_XM_ORIGIN_ALARM 7
  26. #define QDCT_TL_ORIGIN_ALARM 8
  27. #define QDCT_SL_ALARM 9
  28. #define QDCT_HSL_LIMIT_ALARM 10
  29. #define QDCT_HSL_ORIGIN_ALARM 11
  30. #define QDCT_KD_ALARM 12
  31. #define QDCT_JLT_ALARM 13
  32. #define QDCT_NO_ZIPPER_ALARM 14
  33. #define QDCT_SQ_LIMIT_ALARM 15
  34. #define QDCT_LT_ALARM 16
  35. #define QDCT_XQ_ORIGIN_ALARM 17
  36. #define QDCT_XQ_LIMIT_ALARM 18
  37. #define QDCT_XM_LIMIT_ALARM 19
  38. #define QDCT_XQ_ALARM 20
  39. #define QDCT_YL_ORIGIN_ALARM 21
  40. #define QDCT_SE_BIAO_ALARM 22
  41. #define QDCT_EX_ALARM 40
  42. #define QDCT_AutoStep cStepMByte
  43. #define QDCT_ZhuangLiaoStep cStepMByte1
  44. #define QDCT_TuiLianStep cStepMByte2
  45. #define QDCT_MotorStep cStepMByte3
  46. #define QDCT_JiaLianStep cStepMByte4
  47. #define QDCT_XiaQieStep cStepMByte5
  48. #define QDCT_ZhenDongStep cStepMByte6
  49. #define QDCT_SongLiaoStep cStepMByte7
  50. #define QDCT_SongLianStep cStepMByte8
  51. #define QDCT_XiaQieDelay cDelayTime1
  52. #define QDCT_ZhuangLiaoDelay cDelayTime2
  53. #define QDCT_TLDelay cDelayTime3
  54. #define QDCT_MotorDelay cDelayTime4
  55. #define QDCT_AutoDelay cDelayTime5
  56. #define QDCT_TableDelay cDelayTime6
  57. #define QDCT_ZhenDongDelay cDelayTime7
  58. #define QDCT_KL_Delay cDelayTime8
  59. #define QDCT_JD_Delay cDelayTime9
  60. #define QDCT_SL_Delay cDelayTime10
  61. #define QDCT_SongLian_Delay cDelayTime11
  62. #define QDCT_TOTAL_ADDR 76
  63. #define QDCT_NOWTOTAL_ADDR 79
  64. #define QDCT_SETTOTAL_ADDR 12
  65. #define QDCT_SPEED_ADDR 78
  66. #define QDCT_ALARM_ADDR 100
  67. #define QDCT_SET_ALL_TOTALADDR 5
  68. #define QDCT_PARAM_CYCLE_PULSE user_datas[0]//0 转一圈脉冲数
  69. #define QDCT_PARAM_CYCLE_LENGTH user_datas[1]//1 转一圈拖带多长
  70. #define QDCT_PARAM_TABLE_TIME (user_datas[2]*10)//台面电机工作时间
  71. #define QDCT_PARAM_GO_LOWSPEED user_datas[3] //夹带前进低速
  72. #define QDCT_PARAM_TABLE_NUM user_datas[4]
  73. #define QDCT_PARAM_SET_ZIPPER_LENGTH (user_datas[16] | user_datas[17] << 16)//拉链长度
  74. #define QDCT_PARAM_PUTIN_LENGTH user_datas[18] //传入长度
  75. #define QDCT_PARAM_JJGO_SPEED user_datas[20] //前进高速
  76. #define QDCT_PARAM_JJFZ_LENGTH user_datas[21] //后退反转速度
  77. #define QDCT_PARAM_JJBACK_SPEED user_datas[22] //后退速度
  78. #define QDCT_PARAM_PUTIN_SPEED user_datas[23] //穿入速度
  79. #define QDCT_PARAM_CUT_BACK_LENGTH user_datas[24] //剩余多长松夹子
  80. #define QDCT_PARAM_SJZ_LENGTH user_datas[25] //切断后后退长度
  81. #define QDCT_PARAM_CUT_DELAY (user_datas[26]*10) //延迟下切
  82. #define QDCT_PARAM_CUTBACK_DELAY (user_datas[27]*10) //切断后延时后退
  83. #define QDCT_PARAM_CUTBACK_SPEED user_datas[28] //切断后后退速度
  84. #define QDCT_PARAM_KL_TIME (user_datas[30]*10) //开链时间
  85. #define QDCT_PARAM_FZ_DELAY (user_datas[34]*10) //延时反转
  86. #define QDCT_PARAM_ZD_WORKNUM user_datas[36]
  87. #define QDCT_PARAM_ZD_WORK_TIME (user_datas[37]*10) //振动盘工作时间
  88. #define QDCT_PARAM_KL_DELAY (user_datas[40]*10)
  89. #define QDCT_PARAM_JD_DELAY (user_datas[41]*10) //延时夹带
  90. #define QDCT_PARAM_ZD_MODE user_datas[42] //振动盘工作模式 0为连续1为间歇工作
  91. #define QDCT_PARAM_CYCLE_DELAY (user_datas[43]*10) //延时启动拉带
  92. #define QDCT_PARAM_FIRST_SPEED user_datas[44] //第一条慢速度
  93. #define QDCT_PARAM_GO_LOWSPEED_LENGTH user_datas[45] //前进慢速长度
  94. #define QDCT_PARAM_CZ_CHECK_DELAY (user_datas[46]*10) //延时检测拉头触针
  95. #define QDCT_PARAM_DELAY_JLT (user_datas[47]*10) //延时夹拉头
  96. #define QDCT_PARAM_ON_BACK_LENGTH user_datas[50] //压感应时后退长度
  97. #define QDCT_BACK_LOWSPEED_LENGTH user_datas[53] //后退慢速长度后退钩针模式才用
  98. #define QDCT_ZFC_MODE user_datas[51] //正反穿模式
  99. #define QDCT_PARAM_TL_DELAY user_datas[54] //延时推链
  100. #define QDCT_ZHA_NO user_datas[55] //扎数
  101. #define QDCT_ZHA_STOP_TIME (user_datas[56]*10) //扎数到停止时间
  102. #define QDCT_BACK_LOWSPEED user_datas[58]
  103. #define QDCT_SEBIAO_MODE user_datas[59] //色标模式
  104. #define QDCT_SEBIAO_LENGTH user_datas[60] //色标定位长度
  105. #define QDCT_SEBIAO_TQ_CHECK_LENGTH user_datas[61]
  106. #define QDCT_PARAM_MAX_BACK_LENGTH user_datas[62]
  107. #define QDCT_PARAM_OFFSET_LENGTH user_datas[63]
  108. #define QDCT_PARAM_PUTIN_SPEED_LENGTH user_datas[64]
  109. #define QDCT_PARAN_SJ_TIME user_datas[65]
  110. #define QDCT_PARAM_PUTIN_START_LENGTH user_datas[66]
  111. #define QDCT_PARAM_SL_BACKDELAY (user_datas[67]*10)
  112. #define QDCT_PARAM_FZ_LENGTH user_datas[68]
  113. #define QDCT_PARAM_DELAY_BACK (user_datas[69]*10)
  114. #define QDCT_PARAM_XM_START_TIME user_datas[70]
  115. #define QDCT_PARAM_FIRSTSPEED user_datas[71]
  116. #define QDCT_PARAM_CHANGE_LT user_datas[72]
  117. #define QDCT_PARAM_PUTIN_LOW_SPEED user_datas[73]
  118. #define QDCT_PARAM_PUTIN_LOW_SPEED_LENGTH user_datas[74]
  119. #define QDCT_PARAM_TC_LENGTH user_datas[75]
  120. #define QDCT_PARAM_DELAY_CS (user_datas[90]*10)
  121. #define QDCT_PARAM_CS_TIME (user_datas[91]*10)
  122. #define QDCT_PARAM_COLD_TIME (user_datas[92]*10)
  123. #define QDCT_PARAM_CS_ENABLE user_datas[93]
  124. #define QDCT_PARAM_ZD_ENABLE user_datas[94]
  125. #define QDCT_PARAM_JJ_STOP_POS user_datas[95]
  126. #define QDCT_PARAM_YL_OFFSET_LENGTH user_datas[96]
  127. #define QDCT_PARAM_YL_SPEED user_datas[97]
  128. #define QDCT_PARAM_YL_DELAY_START (user_datas[98]*10)
  129. #define QDCT_PARAM_YL_CYCLE_PULSE user_datas[99]
  130. #define QDCT_PARAM_YL_CYCLE_LENGTH user_datas[105]
  131. #define QDCT_PARAM_YL_TRANS_LENGTH user_datas[101]
  132. #define QDCT_PARAM_YL_FZ_LENGTH user_datas[102]
  133. #define QDCT_PARAM_YL_CUT_SPEED user_datas[103]
  134. #define QDCT_PARAM_YL_CUT_LENGTH user_datas[104]
  135. #define QDCT_SEBIAO_HIGH_SPEED user_datas[105]
  136. #define QDCT_SEBIAO_LOW_SPEED user_datas[106]
  137. #define QDCT_SEBIAO_ERROR_LENGHT user_datas[107]
  138. #define QDCT_SEBIAO_BACK_LSPEED_LENGTH user_datas[108]
  139. #define QDCT_SEBIAO_BACK_DW_SPEED user_datas[109]
  140. #define QDCT_DELAY_XM_BACK user_datas[110]
  141. #define QDCT_PARAM_HSL_DELAY (user_datas[111]*10)
  142. #define QDCT_PARAM_GL_DELAY (user_datas[112]*10)
  143. #define QDCT_PARAM_RUN_STATE user_datas[250]
  144. #define QDCT_PARAM_BACK_ALARM_MODE 1 //后退为感应后限
  145. #define START_IN X00
  146. #define START_IN_UP (X00 && !OLDX00)
  147. #define STOP_IN X01
  148. #define STOP_IN_UP (X01 && !OLDX01)
  149. #define STOP_IN_DW (!X01 && OLDX01)
  150. #define QDCT_YL_ORIGIN_IN X02
  151. #define QDCT_NO_ZIPPER_CHECK_IN X02
  152. #define QDCT_JZ_IN X03
  153. #define QDCT_JZ_IN_UP (X03 && !OLDX03)
  154. #define QDCT_BACK_LIMIT_IN X04
  155. #define QDCT_BACK_LIMIT_IN_UP (X04 && !OLDX04)
  156. #define QDCT_GO_LIMIT_IN X05
  157. #define QDCT_GO_LIMIT_IN_UP (X05 && !OLDX05)
  158. #define QDCT_GO_DEC_IN X06
  159. #define QDCT_GO_DEC_IN_UP (X06 && !OLDX06)
  160. #define QDCT_SQ_LIMIT_IN X07
  161. #define QDCT_KA_DAI_IN (!X10)
  162. #define QDCT_XM_ORIGIN_IN X11
  163. #define QDCT_HSL_LIMIT_IN X12
  164. #define QDCT_HSL_LIMIT_IN_UP (X12 && !OLDX12)
  165. #define QDCT_HSL_ORIGIN_IN X13
  166. #define QDCT_JLT_IN X14
  167. #define QDCT_TL_ORIGIN_IN X15
  168. #define QDCT_LTCZ_IN X16
  169. // X17 色标感应
  170. #define QDCT_SL_LIMIT_IN X20
  171. #define QDCT_SZ_OUT Y00
  172. #define QDCT_ZDP_OUT Y01
  173. #define QDCT_HSL_OUT Y02
  174. #define QDCT_TL_OUT Y03
  175. #define QDCT_YD_OUT Y04
  176. #define QDCT_JD_OUT Y05
  177. #define QDCT_SQ_OUT Y06
  178. #define QDCT_SL_OUT Y07
  179. #define QDCT_JLT_OUT Y10
  180. #define QDCT_XM_OUT Y11
  181. #define QDCT_KL_OUT Y12
  182. #define QDCT_TB_OUT Y13
  183. #define QDCT_DIR_OUT Y14
  184. #define QDCT_CS_OUT Y15
  185. #define QDCT_YL_WORK_OUT Y20
  186. #define QDCT_YL_OUT Y21
  187. #define QDCT_YL_DIR_OUT Y22
  188. //M0~M4全局固定使用
  189. /*
  190. #define bRunning M0000
  191. #define bStart M0001
  192. #define bStop M0002
  193. #define bAlarmStop M0003
  194. #define bClearTotal M0004
  195. */
  196. #define QDCT_bClerNowTotal M0005
  197. #define QDCT_bQianDianDW M0006
  198. #define QDCT_bGeiLT M0007
  199. #define QDCT_bZhuangLiao M0008
  200. #define QDCT_bQieDuan M0009
  201. #define QDCT_bOnceStart M0010
  202. #define QDCT_bTuiLT M0013
  203. #define QDCT_bHeMo M0015
  204. #define QDCT_bChuanLT M0016
  205. #define QDCT_bSaveWorkState M0017
  206. #define QDCT_bWorkMode M0018
  207. #define QDCT_bAlarmStop M0019
  208. #define QDCT_bTable M0020
  209. #define QDCT_bSongLT M0021
  210. #define QDCT_bTL M0022
  211. #define QDCT_bManXQ M0051
  212. #define QDCT_bManXM M0052
  213. #define QDCT_bMotorGo M0053
  214. #define QDCT_bMotorBack M0054
  215. #define QDCT_bManSQ M0055
  216. #define QDCT_bManJD M0056
  217. #define QDCT_bManSL M0057
  218. #define QDCT_bManHSL M0058
  219. #define QDCT_bManZD M0059
  220. #define QDCT_bManKL M0060
  221. #define QDCT_bManSLT M0061
  222. #define QDCT_bManJLT M0062
  223. #define QDCT_bManSZ M0063
  224. #define QDCT_bManYD M0064
  225. #define QDCT_bManTL M0065
  226. #define QDCT_bManMotorSL M0066
  227. #endif
  228. #endif