GLJiaoYaDinCun.h 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224
  1. #ifndef __GLJIAOYADINCUN_H__
  2. #define __GLJIAOYADINCUN_H__
  3. #if CHANG_SHENG_GEI_LI_MACHINE
  4. extern void JYDC_InitAction(void);
  5. extern void JYDC_ManualAction(void);
  6. extern void JYDC_Action(void);
  7. extern void JYDC_DelayAction(void);
  8. extern void JYDC_ExtiActionX30(void);
  9. extern void JYDC_ExtiActionX31(void);
  10. //0
  11. typedef struct
  12. {
  13. unsigned long Total; //0生产总量
  14. unsigned long SetTotal; //2产量设置
  15. unsigned long CurLength; //4
  16. unsigned long SetLength; //6拉链长度
  17. unsigned long CurLength_JY;//8当前位置
  18. unsigned short CntDir; //10
  19. unsigned short SetSpeed; //11胶牙定寸速度
  20. unsigned short SetAccDec; //12
  21. unsigned short ShaCheDelayTime;//13延时刹车
  22. unsigned short ShaCheTime; //14刹车持续时间
  23. unsigned short DelayChuiQiTime;//15
  24. unsigned short XC_AlarmTime;//16下冲报警时间
  25. unsigned short XC_DelayTime;//17延时下冲
  26. unsigned short SetDaoKouLength;//18
  27. unsigned short res2; //19
  28. unsigned short EncCircleLength;//20
  29. unsigned short SetSlowLength; //21
  30. unsigned short SetKouWeiLength;//22
  31. unsigned short JiZhunChiShu;//23
  32. unsigned short JiZhunLength;//24
  33. unsigned short LowSpeed; //25慢速度
  34. unsigned short ReviseChi; //26修正齿数
  35. unsigned short KongWeiLength;//27除齿长度
  36. unsigned short DaoKouLength; //28刀口长度
  37. unsigned short SetSlow; //29慢速长度
  38. unsigned short SetChuiQiTime; //30吹气持续时间
  39. unsigned short XiChiEn; //31铣齿电机开关
  40. unsigned short MotorCyclePulse;//32电机细分
  41. unsigned short MotorCycleLength;//33拖带轮周长
  42. unsigned short MotorAccTime; //34电机加速时间
  43. unsigned short MotorDecTime; //35电机减速时间
  44. unsigned short res4[15]; //36~50
  45. unsigned short ModeSelect; //51当前模具类型选择
  46. unsigned short JiZhunChiShu_1;//52 3号模具齿数
  47. unsigned short JiZhunLength_1;//53 3号模具长度
  48. unsigned short SetDaoKou_1; //54 3号模具刀口长度
  49. unsigned short JiZhunChiShu_2;//55 5号模具齿数
  50. unsigned short JiZhunLength_2;//56 5号模具长度
  51. unsigned short SetDaoKou_2; //57 5号模具刀口长度
  52. unsigned short JiZhunChiShu_3;//58 8号模具齿数
  53. unsigned short JiZhunLength_3;//59 8号模具长度
  54. unsigned short SetDaoKou_3; //60 8号模具刀口长度
  55. unsigned short JiZhunChiShu_4;//61 特殊模具齿数
  56. unsigned short JiZhunLength_4;//62 特殊模具长度
  57. unsigned short SetDaoKou_4; //63 特殊模具刀口长度
  58. unsigned short res5[10]; //64~73
  59. unsigned short PassWordError; //74
  60. unsigned short res6[46]; //75~120
  61. unsigned short DisplayData[8]; //121
  62. unsigned short res7[232];
  63. unsigned short NowGroup; //361
  64. unsigned long AllSetLength; //362
  65. unsigned long AllSetTotal; //364
  66. unsigned long AllOverZipLength; //366
  67. unsigned long AllOverZipTotal; //368
  68. unsigned short res8[32];
  69. unsigned long ZipperLength[5];//400~409
  70. unsigned short KongWeiTooth[5];//410~414
  71. unsigned short ReviseTooth[5];//415~419
  72. unsigned long SetZipTotal[5]; //420~429
  73. unsigned long OverZipTotal[5];//430~439
  74. unsigned long ZipperLengthBuff;//440
  75. unsigned short KongWeiToothBuff;//442
  76. unsigned short ReviseToothBuff; //443
  77. unsigned long SetZipTotalBuff; //444
  78. unsigned long OverZipTotalBuff;//446
  79. } JYDC_ParamStrct;
  80. #define SET_LEN_ADDR 6
  81. #define SET_LEN_ADDR_JY 26
  82. #define CLR_PULSE_DELAY 100
  83. #define MAXSPEED 150
  84. #define JYDC_ALARM_ADDR 100
  85. #define JYDC_TOTAL_ADDR 0
  86. #define JYDC_PROSPEED_ADDR 78
  87. //故障代码列表
  88. #define JYDC_NO_ALARM 0
  89. #define JYDC_TOTAL_ALARM 1
  90. #define JYDC_KADAI_ALARM 2
  91. #define JYDC_XIACHONG_ARRIVE_ALARM 3
  92. #define JYDC_COUNT_ALARM 4
  93. #define JYDC_START_XIACHONG_ALARM 5
  94. #define JYDC_SEBIAO_ALARM 6
  95. #define NO_TOOTHCOUT_TIME user_datas[81] //多久没感应到数齿信号异常
  96. #define SET_ACCDEC 10
  97. #define JYDC_XiaChongStep cStepMByte3
  98. #define JYDC_ManualStep cStepMByte2
  99. #define JYDC_MotorStep cStepMByte1
  100. #define JYDC_AutoStep cStepMByte
  101. #define JYDC_XiaChongDelay cDelayTime1
  102. #define JYDC_AutoDelay cDelayTime2
  103. #define JYDC_ChuiQiDelay cDelayTime3
  104. #define JYDC_XiChiChuiQiDelay cDelayTime4
  105. #define SET_ZIPPER_LENGTH (user_datas[6] | user_datas[7] << 16)
  106. #define SET_TOTAL (user_datas[2] | user_datas[3] << 16)
  107. #define JYDC_PARAM_REVICHISHU user_datas[26]
  108. #define JYDC_PARAM_CHUIQI_TIME user_datas[30]
  109. #define CUR_LEN_JY user_datas[8]
  110. #define JYDC_PARAM_SET_SPEED user_datas[11]
  111. #define JYDC_PARAM_LOW_SPEED user_datas[25]
  112. #define SET_KOUWEI_JY user_datas[27] //除齿长度
  113. #define JYDC_PARAM_LOW_LENGTH user_datas[29]
  114. #define JYDC_PARAM_XC_ALARM_TIME user_datas[16]//JYDC_Param->XC_AlarmTime //下冲最长时间
  115. #define JYDC_PARAM_SHACHE_DELAY_TIME user_datas[13]//JYDC_Param->ShaCheDelayTime //下冲最长时间
  116. #define JYDC_PARAM_SHACHE_TIME (user_datas[38]*10) //JYDC_Param->ShaCheTime //刹车时间
  117. #define CUIQI_TIME user_datas[30]//JYDC_Param->CuiQiTime //吹气时间
  118. #define XIACONG_DELAY_TIME user_datas[17]//JYDC_Param->XC_DelayTime //下冲最长时间
  119. #define SET_ZIPPER_LENGTH_INCH (user_datas[31] | user_datas[32] << 16)
  120. #define JYDC_PARAM_CYCLE_DELAY user_datas[33]
  121. #define JYDC_COUNT_DIR user_datas[34] // 数齿信号方向
  122. #define JYDC_SEBIAO_MODE user_datas[35]//色标模式,0为普通1为色标模式
  123. #define JYDC_SEBIAO_DELAY user_datas[36]//色标模式延迟下冲齿数
  124. #define JYDC_XICHI_MOTOR_MODE user_datas[37]//0为自动的时候不用铣齿电机,1为使用
  125. #define JYDC_FILTER 10
  126. #define DISPLAY_DATA0 user_datas[121]
  127. #define DISPLAY_DATA1 user_datas[122]
  128. #define DISPLAY_DATA2 user_datas[123]
  129. #define DISPLAY_DATA3 user_datas[124]
  130. #define DISPLAY_DATA4 user_datas[125]
  131. #define DISPLAY_DATA5 user_datas[126]
  132. #define DISPLAY_DATA6 user_datas[127]
  133. #define DISPLAY_DATA7 user_datas[128]
  134. #define MODE_SELECT user_datas[51]
  135. #define JY_JIZHUN_CISHU user_datas[23] //基准齿数
  136. #define JY_JIZHUN_LEN user_datas[24] //基准长度
  137. #define SET_DAOKOU_JY user_datas[28] //机械模具刀口
  138. //3#
  139. #define JY_JIZHUN_CISHU1 user_datas[52] //基准齿数
  140. #define JY_JIZHUN_LEN1 user_datas[53] //基准长度
  141. #define SET_DAOKOU_JY1 user_datas[54] //机械模具刀口
  142. //5#
  143. #define JY_JIZHUN_CISHU2 user_datas[55] //基准齿数
  144. #define JY_JIZHUN_LEN2 user_datas[56] //基准长度
  145. #define SET_DAOKOU_JY2 user_datas[57] //机械模具刀口
  146. //8#
  147. #define JY_JIZHUN_CISHU3 user_datas[58] //基准齿数
  148. #define JY_JIZHUN_LEN3 user_datas[59] //基准长度
  149. #define SET_DAOKOU_JY3 user_datas[60] //机械模具刀口
  150. //特殊刀模
  151. #define JY_JIZHUN_CISHU4 user_datas[61] //基准齿数
  152. #define JY_JIZHUN_LEN4 user_datas[62] //基准长度
  153. #define SET_DAOKOU_JY4 user_datas[63] //机械模具刀口
  154. #define START_IN X00
  155. #define START_IN_UP (X00 && !OLDX00)
  156. #define STOP_IN X01
  157. #define STOP_IN_UP (X01 && !OLDX01)
  158. #define JYDC_ManXiaChong_UP (X02 && !OLDX02)
  159. #define JYDC_ChuDai_IN_UP (X12 && !OLDX12)
  160. #define JYDC_ChuDai_IN_DW (!X12 && OLDX12)
  161. #define JYDC_ChuDai_IN (X12)
  162. #define JYDC_XiaChong_IN X14
  163. #define JYDC_XiaChong_IN_UP (X14 && !OLDX14)
  164. #define JYDC_XiaChong_DW (!X14 && OLDX14)
  165. #define JYDC_KaDai_IN X03
  166. #define JYDC_COUNT_IN_UP (X16 && !OLDX16)
  167. #define JYDC_COUNT_IN_DW (!X16 && OLDX16)
  168. #define JYDC_ShaChe_VAVLE Y00
  169. #define JYDC_ChuiQi_VAVLE Y01
  170. #define JYDC_SuoChi_VAVLE Y02
  171. #define JYDC_XiaChong_MOTOR Y04
  172. #define JYDC_XiChiChuiQi_VAVLE Y13
  173. #define JYDC_XiChi_MOTOR Y14
  174. #define ALARM_LED Y04
  175. //M0~M4 Actioon.h全局使用
  176. #define JYDC_bManSuoChi M0005
  177. #define JYDC_bTest M0006
  178. #define JYDC_bManChuiQi M0007
  179. #define JYDC_bManXiaChong M0008
  180. #define JYDC_bStart M0009
  181. #define JYDC_bAddTooth M0010
  182. #define JYDC_bDecTooth M0011
  183. #define JYDC_bChangeLength M0016
  184. #define JYDC_bRunning M0017
  185. #define JYDC_bStop M0018
  186. #define JYDC_bSingleOrGroup M0019
  187. #define JYDC_bManXiChiMotor M0020
  188. #define JYDC_bAlarmStop M0036
  189. #define JYDC_bSetInch M0039
  190. #define JYDC_bSetTooth M0040
  191. #define JYDC_bManMotor M0041
  192. #define JYDC_bManGuaChiMotor M0042
  193. #endif
  194. #endif