JiaoYaDinCun.h 8.1 KB

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