XDMXC_NiLong_StepJi.h 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189
  1. #ifndef __XDMXC_NILONG_STEP_JI_H__
  2. #define __XDMXC_NILONG_STEP_JI_H__
  3. #if XI_DONG_MACHINE
  4. extern void MXC_InitAction(void);
  5. extern void MXC_NiLongXiuCiJiAction(void);
  6. extern void MXC_ExtiActionX20(void);
  7. #define MXC_ALARM_ADDR 100
  8. #define MXC_ZIPPER_LENGTH_ADDR 17
  9. #define MXC_TOTAL_ADDR 76
  10. #define MXC_PROSPEED_ADDR 78
  11. #define MXC_SERVER_EN 0
  12. #define MXC_SERVER_DISEN 1
  13. #define MXC_SC_EN 1
  14. #define MXC_SC_DISEN 0
  15. #define MXC_XC_SERVER_EN 0
  16. #define MXC_XC_SERVER_DISEN 1
  17. #define MXC_DIR_P 1
  18. #define MXC_DIR_N 0
  19. #define MXC_DC_GZ_MODE 0
  20. #define MXC_DC_SF_MODE 1
  21. #define MXC_DC_SB_MODE 2
  22. #define MXC_DC_BMQ_MODE 3
  23. #define MXC_NO_ALARM 0
  24. #define MXC_TOTAL_ALARM 1
  25. #define MXC_XIA_CHONG_ALARM 2
  26. #define MXC_KA_DAI_ALARM 3
  27. #define MXC_XC_ALARM 4
  28. #define MXC_NO_ZIPPER_ALARM 5
  29. #define MXC_NO_GOUZHEN_ALARM 7
  30. #define MXC_LFZ_ORIGIN_ALARM 8
  31. #define MXC_LFZ_LIMIT_ALARM 9
  32. #define MXC_RFZ_ORIGIN_ALARM 10
  33. #define MXC_RFZ_LIMIT_ALARM 11
  34. #define MXC_LONG_TIME_NO_ZIPPER_ALARM 12
  35. #define MXC_NO_SEBIAO_ALARM 13
  36. #define MXC_SEBIAO_ZIPPER_LENGTH_ALARM 14
  37. #define MXC_MOTOR_ALALRM_TIME 20000
  38. #define MXC_FenZhengErrorTime 500
  39. #define MXC_ERRORTIME 2000 //出错时间
  40. #define MXC_PARAM_XIAZHI_TIME (user_datas[0]*10)
  41. #define MXC_PARAM_CHUIQI_TIME (user_datas[1]*10)
  42. #define MXC_PARAM_CHAOSHENG_TIME (user_datas[2]*10)
  43. #define MXC_PARAM_INCH_MODE user_datas[3]
  44. #define MXC_PARAM_SC_DELAY user_datas[4]
  45. #define MXC_PARAM_XC_DELAY (user_datas[5]*10)
  46. #define MXC_PARAM_SET_SPEED user_datas[8]
  47. #define MXC_PARAM_LOW_SPEED user_datas[9]
  48. #define MXC_PARAM_LOWSPEED_LENGTH user_datas[10]
  49. #define MXC_GuoLianMode user_datas[12]
  50. #define MXC_PARAM_DAOKOU_LENGTH user_datas[13]
  51. #define MXC_PARAM_DAILUN_LENGTH user_datas[11]
  52. #define MXC_SET_ZIPPER_LENGTH (user_datas[15] | (user_datas[16] << 16))
  53. #define MXC_SET_REVISE_ZIPPER_LENGTH user_datas[17]
  54. #define MXC_SET_ZIPPER_LENGTH_INCH (user_datas[18] | (user_datas[19] << 16))
  55. #define MXC_SET_REVISE_ZIPPER_LENGTH_INCH user_datas[20]
  56. #define MXC_DC_MODE user_datas[62] //0勾针 1步进/伺服 2色标 3编码器
  57. #define MXC_XZ_ENABLE user_datas[44] //0不使用下止 1使用下止
  58. #define MXC_DEC_MODE user_datas[21] //0为感应减速模式,1为数控减速模式
  59. #define MXC_SET_TOTAL (user_datas[84] | (user_datas[85] << 16))
  60. #define MXC_GOU_ZHEN_MODE user_datas[24] // 0为普通勾针 1为活动勾针
  61. #define MXC_GuoLianCheckMode user_datas[25] // 超声下止模式下,过链感应有效电平配置1为翻转电平
  62. #define MXC_PARAM_XIAZHI_DELAY_TIME user_datas[26]
  63. #define MXC_XiaChongMotorMode user_datas[27] //0为交流1为步进/伺服
  64. #define MXC_XiaChongSpeed user_datas[29]
  65. #define MXC_XiaChongLowSpeed 10
  66. #define MXC_MOTOR_MODE user_datas[30] //0步进松轴电平1伺服松轴电平
  67. #define MXC_PARAM_DELAY_CHUIQI_TIME (user_datas[31]*10)
  68. #define MXC_PARAM_FIRST_SPEED user_datas[32]
  69. #define MXC_PARAM_GZ_RESET_MODE user_datas[33] //勾针复位方式 0为自动1为数控
  70. #define MXC_PARAM_CYCLE_PULSE user_datas[34]
  71. #define MXC_PARAM_KONG_WEI_LENGTH user_datas[35]
  72. #define MXC_PARAM_SEBIAO_TQ_LENGTH user_datas[46]
  73. #define MXC_PARAM_SEBIAO_DW_LENGTH user_datas[47]
  74. #define MXC_PARAM_GZ_LENGTH user_datas[48]
  75. #define MXC_PARAM_GZ_DELAY (user_datas[49]*10)
  76. #define MXC_PARAM_MOTOR_ALARM_TIME (user_datas[50]*10)
  77. #define MXC_PARAM_R_FZ_DELAY (user_datas[51]*10)
  78. #define MXC_PARAM_L_FZ_DELAY (user_datas[52]*10)
  79. #define MXC_PARAM_MOTOR_DELAY (user_datas[53]*10)
  80. #define MXC_PARAM_SC_MODE 0
  81. #define MXC_PARAM_AUTO_CHECK_MODE 1//1为自动测长0为手动输入长度
  82. #define MXC_PARAM_DELAY_XC (user_datas[56]*10)
  83. #define MXC_PARAM_SB_HIGH_SPEED user_datas[57]
  84. #define MXC_PARAM_SB_LOW_SPEED user_datas[58]
  85. #define MXC_PARAM_SB_OFFSET_SPEED user_datas[59]
  86. #define MXC_ERROR_LENGTH user_datas[60]
  87. #define MXC_BM_LENGTH user_datas[12]
  88. #define DISPLAY_DATA0 user_datas[121]
  89. #define DISPLAY_DATA1 user_datas[122]
  90. #define DISPLAY_DATA2 user_datas[123]
  91. #define DISPLAY_DATA3 user_datas[124]
  92. #define DISPLAY_DATA4 user_datas[125]
  93. #define DISPLAY_DATA5 user_datas[126]
  94. #define DISPLAY_DATA6 user_datas[127]
  95. #define DISPLAY_DATA7 user_datas[128]
  96. #define MXC_bStart M0000
  97. #define MXC_bClear M0001
  98. #define MXC_bXiaZhi M0002
  99. #define MXC_bXiaChong M0003
  100. #define MXC_bStop M0004
  101. #define MXC_bLeftFenZhen M0005
  102. #define MXC_bRightFenZhen M0006
  103. #define MXC_bDotXiaChong M0007
  104. #define MXC_bDotXiaChongDisplay M0008
  105. #define MXC_bGouZhen M0009
  106. #define MXC_bAddLength M0010
  107. #define MXC_bDecLength M0011
  108. #define MXC_bSetDCMode M0012
  109. #define MXC_bChuiQi M0013
  110. #define MXC_bChangeLength M0014
  111. #define MXC_bClearAlarm M0015
  112. #define MXC_bChangeGouZhenMode M0016
  113. #define MXC_bChangeXiaZhiMode M0017
  114. #define MXC_bChuDai M0018
  115. #define MXC_bDingWei M0019
  116. #define MXC_bNext M0020
  117. #define MXC_bJiaoDao M0021
  118. #define MXC_bSaveWorkData M0022
  119. #define MXC_bAlarmStop M0023
  120. #define MXC_bRunning M0024
  121. #define MXC_bTestMotor M0025
  122. #define MXC_bSetLength M0026
  123. #define MXC_cAutoStep cStepMByte
  124. #define MXC_cMotorStep cStepMByte1
  125. #define MXC_cXiaChongStep cStepMByte2
  126. #define MXC_cLeftFenZhenStep cStepMByte3
  127. #define MXC_cRightFenZhenStep cStepMByte4
  128. #define MXC_cJiaoDaoStep cStepMByte5
  129. #define MXC_cChuiQiStep cStepMByte6
  130. #define MXC_cDCPStep cStepMByte7
  131. #define MXC_cAutoDelay cDelayTime1
  132. #define MXC_cChuiQiDelay cDelayTime2
  133. #define MXC_cXiaZhiDelay cDelayTime3
  134. #define MXC_cGouZhenTime cDelayTime4
  135. #define MXC_cBudaiCheckDelay cDelayTime5
  136. #define MXC_cFenZhenLeftDelay cDelayTime6
  137. #define MXC_cFenZhenRightDelay cDelayTime7
  138. #define MXC_cKaDaiDelay cDelayTime8
  139. #define MXC_cXiaChongDelay cDelayTime9
  140. #define MXC_cDaoJuCheckDelay cDelayTime10
  141. #define MXC_cMotorDelay cDelayTime11
  142. #define START_IN X00
  143. #define START_IN_UP (X00 && !OLDX00)
  144. #define STOP_IN X01
  145. #define STOP_IN_UP (X01 && !OLDX01)
  146. #define MXC_KaDai_IN X03
  147. #define MXC_KaDai_IN_UP (X03 && !OLDX03)
  148. #define MXC_XiaChong_IN X04
  149. #define MXC_XiaChong_IN_UP (X04 && !OLDX04)
  150. #define MXC_XiaChong_IN_DW (!X04 && OLDX04)
  151. #define MXC_LeftFenZhen_Origin_IN X05
  152. #define MXC_RightFenZhen_Origin_IN X06
  153. #define MXC_LeftFenZhen_IN X07
  154. #define MXC_RighttFenZhen_IN X10
  155. #define MXC_Zipper_IN X14
  156. #define MXC_GouZhen_IN X15
  157. #define MXC_XC_ShaChe Y00
  158. #define MXC_XiaChong_MOTOR Y01
  159. #define MXC_LeftFenZhen_VAVLE Y02
  160. #define MXC_RightFenZhen_VAVLE Y03
  161. #define MXC_GouZhen_VAVLE Y04
  162. #define MXC_ChuiQi_VAVLE Y05
  163. #define MXC_ALARM_OUT Y06
  164. #define MXC_XCSZ_OUT Y07
  165. #define MXC_XiaZhi_MOTOR Y11
  166. #define MXC_XiaZhi_VAVLE Y12
  167. #endif
  168. #endif