JHJinShuDinCun.h 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274
  1. #ifndef __JHJINSHUDINCUN_H__
  2. #define __JHJINSHUDINCUN_H__
  3. #if JIN_HONG_MACHINE==1
  4. extern void JSDC_InitAction(void);
  5. extern void JSDC_NiLongXiuCiJiAction(void);
  6. extern void JSDC_ExtiActionX20(void);
  7. extern void JSDC_Action(void);
  8. #define JSDC_ALARM_ADDR 100
  9. #define JSDC_ZIPPER_LENGTH_ADDR 17
  10. #define JSDC_TOTAL_ADDR 76
  11. #define JSDC_PROSPEED_ADDR 78
  12. #define JSDC_TRUST_ALARM_ADDR 102
  13. #define JSDC_SERVER_EN 1
  14. #define JSDC_SERVER_DISEN 0
  15. #define JSDC_SC_EN 1
  16. #define JSDC_SC_DISEN 0
  17. #define JSDC_XC_SERVER_EN 1
  18. #define JSDC_XC_SERVER_DISEN 0
  19. #define JSDC_DIR_P 1
  20. #define JSDC_DIR_N 0
  21. #define JSDC_DC_GZ_MODE 0
  22. #define JSDC_DC_BMQ_MODE 1
  23. #define JSDC_DC_SF_MODE 2
  24. #define JSDC_DC_SB_MODE 3
  25. #define JSDC_NO_ALARM 0
  26. #define JSDC_TOTAL_ALARM 1 //到达预设数量
  27. #define JSDC_XIA_CHONG_ALARM 2 // 下冲异常
  28. #define JSDC_KA_DAI_ALARM 3 //卡带感应异常
  29. #define JSDC_XC_ALARM 4 //下冲感应异常
  30. #define JSDC_NO_ZIPPER_ALARM 5 //无尺寸
  31. #define JSDC_XUANCHI_IN_ALARM 6
  32. #define JSDC_NO_GOUZHEN_ALARM 7 //勾针
  33. #define JSDC_LFZ_ORIGIN_ALARM 8
  34. #define JSDC_LFZ_LIMIT_ALARM 9
  35. #define JSDC_RFZ_ORIGIN_ALARM 10
  36. #define JSDC_RFZ_LIMIT_ALARM 11
  37. #define JSDC_LONG_TIME_NO_ZIPPER_ALARM 12 //长时间没有感应到拉链
  38. #define JSDC_NO_SEBIAO_ALARM 13
  39. #define JSDC_SEBIAO_ZIPPER_LENGTH_ALARM 14 //色标尺寸异常
  40. #define JSDC_MOTOR_ALALRM_TIME 20000
  41. #define FenZhengErrorTime 500
  42. #define JSDC_ERRORTIME 3000 //出错时间
  43. #define JSDC_PARAM_XIAZHI_TIME (user_datas[0]*10)
  44. #define JSDC_PARAM_CHUIQI_TIME (user_datas[1]*10) // 吹气时间
  45. #define JSDC_PARAM_CHAOSHENG_TIME (user_datas[2]*10)
  46. #define JSDC_PARAM_INCH_MODE user_datas[3]
  47. #define JSDC_PARAM_SC_DELAY (user_datas[4]*10)
  48. #define JSDC_PARAM_XC_DELAY (user_datas[5]*10)
  49. #define JSDC_PARAM_SET_SPEED user_datas[8] //最快速
  50. #define JSDC_PARAM_LOW_SPEED user_datas[9] //慢速速度
  51. #define JSDC_PARAM_LOWSPEED_LENGTH user_datas[10] //慢速长度
  52. #define JSDC_XiaMode user_datas[44] //0 普通下止 1 超声下止
  53. #define JSDC_GuoLianMode user_datas[12]
  54. #define JSDC_PARAM_DAOKOU_LENGTH user_datas[13] //刀口长度
  55. #define JSDC_PARAM_DAILUN_LENGTH user_datas[11]
  56. #define JSDC_SET_ZIPPER_LENGTH (user_datas[15] | (user_datas[16] << 16))
  57. #define JSDC_SET_REVISE_ZIPPER_LENGTH user_datas[17]
  58. #define JSDC_SET_ZIPPER_LENGTH_INCH (user_datas[18] | (user_datas[19] << 16))
  59. #define JSDC_SET_REVISE_ZIPPER_LENGTH_INCH user_datas[20]
  60. #define JSDC_DC_MODE user_datas[62] //0勾针 1步进/伺服 2色标 3编码器
  61. //#define JSDC_CS_ENABLE user_datas[44] //0不使用下止 1使用下止
  62. #define JSDC_DEC_MODE user_datas[21] //0为感应减速模式,1为数控减速模式
  63. #define JSDC_SET_TOTAL (user_datas[84] | (user_datas[85] << 16))
  64. #define JSDC_GOU_ZHEN_MODE user_datas[24] // 0为普通勾针 1为活动勾针
  65. #define JSDC_GuoLianCheckMode user_datas[25] // 超声下止模式下,过链感应有效电平配置1为翻转电平
  66. #define JSDC_PARAM_XIAZHI_DELAY_TIME user_datas[26]
  67. #define JSDC_XiaChongMotorMode user_datas[27] //0为交流1为步进/伺服
  68. #define JSDC_XiaChongSpeed user_datas[29]
  69. #define JSDC_XiaChongLowSpeed 10
  70. #define JSDC_MOTOR_MODE user_datas[30] //0步进松轴电平1伺服松轴电平
  71. #define JSDC_PARAM_DELAY_CHUIQI_TIME (user_datas[31]*10) //吹气时间
  72. #define JSDC_PARAM_FIRST_SPEED user_datas[32] //第一,二条测长速度
  73. #define JSDC_PARAM_GZ_RESET_MODE user_datas[33] //勾针复位方式 0为自动1为数控
  74. #define JSDC_PARAM_CYCLE_PULSE user_datas[34]
  75. #define JSDC_PARAM_KONG_WEI_LENGTH user_datas[35] //除齿长度
  76. #define JSDC_PARAM_START_SPEED user_datas[36] //启动速度
  77. #define JSDC_PARAM_ACC_SPEED user_datas[37] //加速度
  78. #define JSDC_PARAM_DEC_SPEED user_datas[38] //减速度
  79. #define JSDC_PARAM_SEBIAO_TQ_LENGTH user_datas[46]
  80. #define JSDC_PARAM_SEBIAO_DW_LENGTH user_datas[47]
  81. #define JSDC_PARAM_GZ_LENGTH user_datas[48]
  82. #define JSDC_PARAM_GZ_DELAY (user_datas[49]*10)
  83. #define JSDC_PARAM_MOTOR_ALARM_TIME (user_datas[50]*10)
  84. #define JSDC_PARAM_R_FZ_DELAY (user_datas[51]*10)
  85. #define JSDC_PARAM_L_FZ_DELAY (user_datas[52]*10)
  86. #define JSDC_PARAM_MOTOR_DELAY (user_datas[53]*10) //延时启动拖带
  87. #define JSDC_PARAM_SC_MODE user_datas[54]
  88. #define JSDC_PARAM_AUTO_CHECK_MODE 1//1为自动测长0为手动输入长度
  89. #define JSDC_PARAM_DELAY_XC (user_datas[56]*10) //延时下冲
  90. #define JSDC_PARAM_SB_HIGH_SPEED user_datas[57]
  91. #define JSDC_PARAM_SB_LOW_SPEED user_datas[58]
  92. #define JSDC_PARAM_SB_OFFSET_SPEED user_datas[59]
  93. #define JSDC_ERROR_LENGTH user_datas[60]
  94. #define JSDC_BM_LENGTH user_datas[12]
  95. #define JSDC_DELAY_STOP_SD (user_datas[61]*10)
  96. #define JSDC_LENTH_BUFF user_datas[69] // 当前位置
  97. #define JSDC_All_LENTH user_datas[63] //总长度
  98. #define JSDC_TuiJia_DELAY (user_datas[64]*10) //延时推夹
  99. #define JSDC_TTuiJia_DELAY (user_datas[65]*10) //延时退推夹
  100. #define JSDC_RightXC_DELAY (user_datas[66]*10) //延时右选齿
  101. #define JSDC_TuiXC_DELAY (user_datas[67]*10) //延时退选齿
  102. #define JSDC_GOUZHEN_MODE user_datas[68] //勾针方式 单选齿或双选齿
  103. #define JSDC_SDtuodai_sSPEED user_datas[70] //手动拖带速度
  104. #define JSDC_LENTH_MODE user_datas[71] //测试长度方式
  105. #define JSDC_TDCQ_TIME (user_datas[72]*10) //拖带吹气时间
  106. #define DISPLAY_DATA0 user_datas[121]
  107. #define DISPLAY_DATA1 user_datas[122]
  108. #define DISPLAY_DATA2 user_datas[123]
  109. #define DISPLAY_DATA3 user_datas[124]
  110. #define DISPLAY_DATA4 user_datas[125]
  111. #define DISPLAY_DATA5 user_datas[126]
  112. #define DISPLAY_DATA6 user_datas[127]
  113. #define DISPLAY_DATA7 user_datas[128]
  114. //#define M0000
  115. #define JSDC_bStart M0001
  116. //#define JSDC_bXiaZhi M0002
  117. #define JSDC_bClear M0003
  118. #define JSDC_bStop M0002
  119. /*
  120. #define JSDC_bLeftFenZhen M0050
  121. #define JSDC_bRightFenZhen M0050
  122. //#define JSDC_bChuiQi M0050
  123. #define JSDC_bChangeLength M0014
  124. #define JSDC_bClearAlarm M0015
  125. #define JSDC_bChangeGouZhenMode M0016
  126. #define JSDC_bChangeXiaZhiMode M0017
  127. #define JSDC_bChuDai M0018
  128. #define JSDC_bDingWei M0019
  129. #define JSDC_bJiaoDao M0021
  130. #define JSDC_bSaveWorkData M0022
  131. #define JSDC_bAlarmStop M0023
  132. #define JSDC_bRunning M0024
  133. #define JSDC_bTestMotor M0025
  134. */
  135. #define JSDC_cAutoStep cStepMByte
  136. #define JSDC_cMotorStep cStepMByte1
  137. #define JSDC_cXiaChongStep cStepMByte2
  138. #define JSDC_cLeftFenZhenStep cStepMByte3
  139. #define JSDC_cJiaoDaoStep cStepMByte5
  140. #define JSDC_cChuiQiStep cStepMByte6
  141. #define JSDC_cSDStep cStepMByte7
  142. #define JSDC_cValveStep cStepMByte8
  143. #define JSDC_cAutoDelay cDelayTime1
  144. #define JSDC_cChuiQiDelay cDelayTime2
  145. #define JSDC_cXiaZhiDelay cDelayTime3
  146. #define JSDC_cGouZhenTime cDelayTime4
  147. #define JSDC_cBudaiCheckDelay cDelayTime5
  148. #define JSDC_cFenZhenLeftDelay cDelayTime6
  149. #define JSDC_cSDDelay cDelayTime7
  150. #define JSDC_cKaDaiDelay cDelayTime8
  151. #define JSDC_cXiaChongDelay cDelayTime9
  152. #define JSDC_cMotorDelay cDelayTime11
  153. #define JSDC_cValveDelay cDelayTime12
  154. //参数定义
  155. //8位变量
  156. #define JSDC_cLFengTimer cCharBuff1
  157. #define JSDC_cRFengTimer cCharBuff2
  158. #define JSDC_cCheckLengthOk cCharBuff3
  159. #define JSDC_cGZDW_CNT cCharBuff4
  160. #define JSDC_SingOne cCharBuff5
  161. #define JSDC_oneDEL cCharBuff6
  162. #define JSDC_twoDEL cCharBuff7
  163. #define JSDC_STOP_IN_FLAG cCharBuff8
  164. #define JSDC_STOP_IN_FLAG_OLD cCharBuff9
  165. #define JSDC_STOP_FILTER cCharBuff10
  166. #define JSDC_SingOneFlag cCharBuff11
  167. #define JSDC_FirstFlg cCharBuff12
  168. #define JSDC_cAlarmStopFlg cCharBuff13
  169. //32位无符号变量
  170. #define JSDC_SaveLength cUDword32Buff2
  171. #define JSDC_SAVEdwEncPos cUDword32Buff3
  172. #define JSDC_CRUKONGWEILENGTH cUDword32Buff5
  173. //32位有符号变量;
  174. #define JSDC_CURENCODELENGTH cDword32Buff1
  175. #define JSDC_LENGTHCMP cDword32Buff2
  176. #define JSDC_dwEncPos cDword32Buff3
  177. //输入
  178. #define JSDC_KaDai_IN M0387 //X03卡带
  179. #define JSDC_KaDai_IN_UP (M0387 && !OLDM387)
  180. #define JSDC_ManualXC_IN M0388 //X04手动下冲
  181. #define JSDC_ManualXC_IN_UP (M0388 && !OLDM388)
  182. #define JSDC_ZXC_IN M0390 //X06左选齿到位
  183. #define JSDC_GouZhen_IN M0391 //X07勾针到位
  184. #define JSDC_YXC_IN M0392 //X10右选齿到位
  185. #define JSDC_START_IN M0394
  186. #define JSDC_START_IN_UP (M0394 && !OLDM394)
  187. #define JSDC_STOP_IN M0395
  188. #define JSDC_STOP_IN_UP (M0395 && !OLDM395)
  189. #define JSDC_XiaChong_IN M0386
  190. #define JSDC_XiaChong_IN_UP (M0386 && !OLDM386)
  191. #define JSDC_XiaChong_IN_DW (!M0386 && OLDM386)
  192. //输出
  193. #define JSDC_XC_ShaChe M0354 // Y02 下冲刹车
  194. #define JSDC_LeftXC_VAVLE M0355 // Y03 左选齿气阀
  195. #define JSDC_SuoDai_VAVLE M0356 // Y04 锁带气缸
  196. #define JSDC_RightXC_VAVLE M0357 // Y05 右选齿气阀
  197. #define JSDC_GouZhen_VAVLE M0358 // Y06 勾针气阀
  198. #define JSDC_XiaChong_MOTOR M0359 // Y07 下冲电机
  199. #define JSDC_TuiJia_VAVLE M0360 // Y10 推夹气缸
  200. #define JSDC_ChuiQi_VAVLE M0361 // Y11 吹气气阀
  201. #define JSDC_DingZhen_VAVLE M0362 // Y12 顶针
  202. #define JSDC_RightCY_VAVLE M0330 // Y10 右撑牙
  203. #define JSDC_SZ_OUT M0352 // Y00 电机使能
  204. #define JSDC_LeftDY_VAVLE M0330 // Y13左顶牙
  205. //#define JSDC_SD_MOTOR M0340
  206. #define JSDC_LeftFenZhen_VAVLE M0341
  207. #define JSDC_bDingZhen M0005 //手动顶针
  208. #define JSDC_bRightXuanChi M0006 //手动右选齿气阀
  209. #define JSDC_bChuiQi M0007 //手动吹气
  210. #define JSDC_bLeftXuanChi M0008 //手动左选齿气阀
  211. #define JSDC_bGouZhen M0009 //手动勾针
  212. #define JSDC_bShaChe M0010 //手动刹车
  213. #define JSDC_bXiaChong M0011 //手动下冲
  214. #define JSDC_bRightCY M0012 //手动右撑牙
  215. #define JSDC_bLeftDY M0013 //手动左顶牙
  216. #define JSDC_bChangeLength M0014
  217. #define JSDC_bSetDCMode M0015 //定寸模式选择
  218. #define JSDC_bDotXiaChong M0016 //点动下冲
  219. #define JSDC_bAddLength M0017 //加尺寸
  220. #define JSDC_bDecLength M0018 //减尺寸
  221. #define JSDC_bSetLength M0019
  222. #define JSDC_bMotorSZ M0020 //电机使能
  223. #define JSDC_bNext M0021 //单循环
  224. #define JSDC_bDanBu 1// M0022 //单步
  225. #define JSDC_bAlarmStop M0023
  226. #define JSDC_bRunning M0024
  227. #define JSDC_bTestMotor M0025
  228. #endif
  229. #endif