TYJinShuDinCun.h 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  1. #ifndef __TYJINSHUDINCUN_H__
  2. #define __TYJINSHUDINCUN_H__
  3. #if TONG_YONG_MACHINE | BRUCE_MACHINE
  4. extern void JSDC_InitAction(void);
  5. extern void JSDC_NiLongXiuCiJiAction(void);
  6. extern void JSDC_ExtiActionX20(void);
  7. #define JSDC_ALARM_ADDR 100
  8. #define JSDC_ZIPPER_LENGTH_ADDR 17
  9. #define JSDC_TOTAL_ADDR 76
  10. #define JSDC_PROSPEED_ADDR 78
  11. #define JSDC_SERVER_EN 0
  12. #define JSDC_SERVER_DISEN 1
  13. #define JSDC_SC_EN 1
  14. #define JSDC_SC_DISEN 0
  15. #define JSDC_XC_SERVER_EN 1
  16. #define JSDC_XC_SERVER_DISEN 0
  17. #define JSDC_DIR_P 1
  18. #define JSDC_DIR_N 0
  19. #define JSDC_DC_GZ_MODE 0
  20. #define JSDC_DC_BMQ_MODE 1
  21. #define JSDC_DC_SF_MODE 2
  22. #define JSDC_DC_SB_MODE 3
  23. #define JSDC_NO_ALARM 0
  24. #define JSDC_TOTAL_ALARM 1
  25. #define JSDC_XIA_CHONG_ALARM 2
  26. #define JSDC_KA_DAI_ALARM 3
  27. #define JSDC_XC_ALARM 4
  28. #define JSDC_NO_ZIPPER_ALARM 5
  29. #define JSDC_NO_GOUZHEN_ALARM 7
  30. #define JSDC_LFZ_ORIGIN_ALARM 8
  31. #define JSDC_LFZ_LIMIT_ALARM 9
  32. #define JSDC_RFZ_ORIGIN_ALARM 10
  33. #define JSDC_RFZ_LIMIT_ALARM 11
  34. #define JSDC_LONG_TIME_NO_ZIPPER_ALARM 12
  35. #define JSDC_NO_SEBIAO_ALARM 13
  36. #define JSDC_SEBIAO_ZIPPER_LENGTH_ALARM 14
  37. #define JSDC_MOTOR_ALALRM_TIME 20000
  38. #define JSDC_FenZhengErrorTime 1000
  39. #define JSDC_ERRORTIME 3000 //出错时间
  40. #define JSDC_PARAM_XIAZHI_TIME (user_datas[0]*10)
  41. #define JSDC_PARAM_CHUIQI_TIME (user_datas[1]*10)
  42. #define JSDC_PARAM_CHAOSHENG_TIME (user_datas[2]*10)
  43. #define JSDC_PARAM_YD_DELAY (user_datas[3]*10)
  44. #define JSDC_PARAM_SC_DELAY (user_datas[4]*10)
  45. #define JSDC_PARAM_XC_DELAY (user_datas[5]*10)
  46. #define JSDC_PARAM_FZ_SELECT user_datas[6]
  47. #define JSDC_PARAM_SET_SPEED user_datas[8]
  48. #define JSDC_PARAM_LOW_SPEED user_datas[9]
  49. #define JSDC_PARAM_LOWSPEED_LENGTH user_datas[10]
  50. #define JSDC_PARAM_YD_TIME (user_datas[12]*10)
  51. #define JSDC_PARAM_DAOKOU_LENGTH user_datas[13]
  52. #define JSDC_PARAM_DAILUN_LENGTH user_datas[11]
  53. #define JSDC_SET_ZIPPER_LENGTH (user_datas[15] | (user_datas[16] << 16))
  54. #define JSDC_SET_ZIPPER_LENGTH_INCH (user_datas[18] | (user_datas[19] << 16))
  55. #define JSDC_SET_ZIPPER_ALL_LENGTH (user_datas[20] | (user_datas[21] << 16))
  56. #define JSDC_SET_ZIPPER_ALL_LENGTH_INCH (user_datas[22] | (user_datas[23] << 16))
  57. #define JSDC_DC_MODE user_datas[62] //0勾针 1步进/伺服 2色标 3编码器
  58. #define JSDC_SET_TOTAL (user_datas[84] | (user_datas[85] << 16))
  59. #define JSDC_NOW_POS (user_datas[24] | (user_datas[25] << 16))
  60. #define JSDC_XiaChongLowSpeed user_datas[26]
  61. #define JSDC_XiaChongMotorMode user_datas[27] //0为交流1为步进/伺服
  62. #define JSDC_XiaChongSpeed user_datas[29]
  63. #define JSDC_MOTOR_MODE user_datas[30] //0步进松轴电平1伺服松轴电平
  64. #define JSDC_PARAM_DELAY_CHUIQI_TIME (user_datas[31]*10)
  65. #define JSDC_PARAM_FIRST_SPEED user_datas[32]
  66. #define JSDC_PARAM_GZ_RESET_MODE user_datas[33] //勾针复位方式 0为自动1为数控
  67. #define JSDC_PARAM_CYCLE_PULSE user_datas[34]
  68. #define JSDC_PARAM_KONG_WEI_LENGTH user_datas[35]
  69. #define JSDC_PARAM_KONG_WEI_LENGTH_INCH user_datas[36]
  70. #define JSDC_PARAM_SEBIAO_TQ_LENGTH user_datas[46]
  71. #define JSDC_PARAM_SEBIAO_DW_LENGTH user_datas[47]
  72. #define JSDC_PARAM_GZ_LENGTH user_datas[48]
  73. #define JSDC_PARAM_GZ_DELAY (user_datas[49]*10)
  74. #define JSDC_PARAM_MOTOR_ALARM_TIME (user_datas[50]*10)
  75. #define JSDC_PARAM_R_FZ_DELAY (user_datas[51]*10)
  76. #define JSDC_PARAM_L_FZ_DELAY (user_datas[52]*10)
  77. #define JSDC_PARAM_MOTOR_DELAY (user_datas[53]*10)
  78. #define JSDC_PARAM_SC_MODE user_datas[54]
  79. #define JSDC_PARAM_AUTO_CHECK_MODE 1//1为自动测长0为手动输入长度
  80. #define JSDC_PARAM_DELAY_XC (user_datas[56]*10)
  81. #define JSDC_PARAM_SB_HIGH_SPEED user_datas[57]
  82. #define JSDC_PARAM_SB_LOW_SPEED user_datas[58]
  83. #define JSDC_PARAM_SB_OFFSET_SPEED user_datas[59]
  84. #define JSDC_ERROR_LENGTH user_datas[60]
  85. #define JSDC_BM_LENGTH user_datas[12]
  86. #define JSDC_DELAY_STOP_SD (user_datas[61]*10)
  87. #define DISPLAY_DATA0 user_datas[121]
  88. #define DISPLAY_DATA1 user_datas[122]
  89. #define DISPLAY_DATA2 user_datas[123]
  90. #define DISPLAY_DATA3 user_datas[124]
  91. #define DISPLAY_DATA4 user_datas[125]
  92. #define DISPLAY_DATA5 user_datas[126]
  93. #define DISPLAY_DATA6 user_datas[127]
  94. #define DISPLAY_DATA7 user_datas[128]
  95. #define JSDC_bStart M0000
  96. #define JSDC_bClear M0001
  97. #define JSDC_bXiaZhi M0002
  98. #define JSDC_bXiaChong M0003
  99. #define JSDC_bStop M0004
  100. #define JSDC_bLeftFenZhen M0005
  101. #define JSDC_bRightFenZhen M0006
  102. #define JSDC_bDotXiaChong M0007
  103. #define JSDC_bDotXiaChongDisplay M0008
  104. #define JSDC_bGouZhen M0009
  105. #define JSDC_bAddLength M0010
  106. #define JSDC_bDecLength M0011
  107. #define JSDC_bSetDCMode M0012
  108. #define JSDC_bChuiQi M0013
  109. #define JSDC_bClearAlarm M0015
  110. #define JSDC_bSetLengthCM M0016
  111. #define JSDC_bSetLengthINCH M0017
  112. #define JSDC_bYD M0018
  113. #define JSDC_bDingWei M0019
  114. #define JSDC_bNext M0020
  115. #define JSDC_bJiaoDao M0021
  116. #define JSDC_bSaveWorkData M0022
  117. #define JSDC_bAlarmStop M0023
  118. #define JSDC_bRunning M0024
  119. #define JSDC_bTestMotor M0025
  120. #define JSDC_cAutoStep cStepMByte
  121. #define JSDC_cMotorStep cStepMByte1
  122. #define JSDC_cXiaChongStep cStepMByte2
  123. #define JSDC_cLeftFenZhenStep cStepMByte3
  124. #define JSDC_cJiaoDaoStep cStepMByte5
  125. #define JSDC_cChuiQiStep cStepMByte6
  126. #define JSDC_cSDStep cStepMByte7
  127. #define JSDC_cAutoDelay cDelayTime1
  128. #define JSDC_cChuiQiDelay cDelayTime2
  129. #define JSDC_cXiaZhiDelay cDelayTime3
  130. #define JSDC_cGouZhenTime cDelayTime4
  131. #define JSDC_cBudaiCheckDelay cDelayTime5
  132. #define JSDC_cFenZhenLeftDelay cDelayTime6
  133. #define JSDC_cSDDelay cDelayTime7
  134. #define JSDC_cKaDaiDelay cDelayTime8
  135. #define JSDC_cXiaChongDelay cDelayTime9
  136. #define JSDC_cMotorDelay cDelayTime11
  137. #define START_IN X00
  138. #define START_IN_UP (X00 && !OLDX00)
  139. #define STOP_IN X01
  140. #define STOP_IN_UP (X01 && !OLDX01)
  141. #define JSDC_XiaChong_IN X02
  142. #define JSDC_XiaChong_IN_UP (X02 && !OLDX02)
  143. #define JSDC_KaDai_IN X03
  144. #define JSDC_KaDai_IN_UP (X03 && !OLDX03)
  145. #define JSDC_GouZhen_IN X07
  146. #define JSDC_LeftFenZhen_IN X10
  147. #define JSDC_XC_ShaChe Y00
  148. #define JSDC_ChuiQi_VAVLE Y01
  149. #define JSDC_XiaChong_MOTOR Y02
  150. #define JSDC_LeftFenZhen_VAVLE Y03
  151. #define JSDC_RightFenZhen_VAVLE Y05
  152. #define JSDC_GouZhen_VAVLE Y06
  153. #define JSDC_YD_VAVLE Y07
  154. #define JSDC_SZ_OUT Y10
  155. #endif
  156. #endif