YXYYaJi.h 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354
  1. #ifndef __XDYYA_JI_H__
  2. #define __XDYYA_JI_H__
  3. #if XI_DONG_MACHINE
  4. /**************************************
  5. ** 函数名称:void SYYAJi(void)
  6. ** 函数功能:方块插稍机动作函数
  7. ** 输入输出说明:
  8. 输入:
  9. X0 启动开关
  10. X1 停止开关(做完当条停机)
  11. X2 紧急停机开关
  12. X3 左计数接近开关
  13. X4 右计数接近开关
  14. X5 注油机液位开关
  15. X6 注油机液压开关
  16. X7 铜线故障
  17. X10 成型故障
  18. X11 卡带故障(布带1)
  19. X12 没带故障(布带2)
  20. X13 送带故障(布带3)
  21. X14 合链上限、下限位开关(合链1)
  22. X15 缺牙开关(合链2)
  23. X16 缺牙开关(合链3)
  24. X17 左送料开关上限(关)
  25. X20 左送料下限开关(开)
  26. X21 右送料上限开关(关)
  27. X22 右送料下限开关(开)
  28. X23 并链机上限开关(关)
  29. X24 并链机下限开关(开)
  30. X25
  31. X26
  32. X27
  33. 输出:
  34. Y0 蜂鸣器
  35. Y1 左直流电磁铁(进)
  36. Y2 左直流电磁铁(出)
  37. Y3 右直流电磁铁(进)
  38. Y4 右直流电磁铁(出)
  39. Y5 主电机
  40. Y6 注油机
  41. Y7 左、右送带电机
  42. Y10 压链电机
  43. Y11 合链电机
  44. Y12 合链电磁铁
  45. Y13 左送料电机
  46. Y14 右送料电机
  47. Y15 并链电机
  48. Y16
  49. Y17
  50. ***************************************/
  51. extern void YYa_Action(void);
  52. extern void YYa_InitAction(void);
  53. #define YY_TOTAL_ADDR 76
  54. #define YY_QIE_DUAN_TOTAL_ADDR 79
  55. #define YY_ALARM_ADDR 100
  56. #define YY_PROSPEED_ADDR 78
  57. /*
  58. * 警告类型 警告编号
  59. */
  60. #define YY_NO_ALARM 0 /* 没警告*/
  61. #define YY_KA_DAI_ALARM 0x0001
  62. #define YY_CHENG_XING_ALARM 0x0002
  63. #define YY_OIL_VOLUME_ALARM 0x0004
  64. #define YY_QUE_DAI_ALARM 0x0008
  65. #define YY_TONG_XIAN_ALARM 0x0010
  66. #define YY_OIL_PRESSURE_ALARM 0x0020
  67. #define YY_JIN_LIAN_ALARM 0x0040
  68. #define YY_TOOTH_NUM_ALARM 0x0080
  69. #define YY_EGM_ALARM 0x0100
  70. #define VAVLE_ALARM_TIME 3000
  71. #define MOTOR_ALARM_TIME 5000
  72. #define YY_DCT_OUT_TIME 38 //电磁铁输出时间
  73. #define YY_SINGLE_MODE 0
  74. #define YY_GROUP_MODE 1
  75. #define YY_SINGLE_ADDR 0
  76. #define YY_GROUP_ADDR 40
  77. #define YY_SYSTEM_ADDR 192
  78. #define YY_LIFE_ADDR 207
  79. #define YY_ErrorDelay cDelayTime1
  80. #define YY_CalProcessDelay cDelayTime2
  81. #define YY_OilCheckDelay cDelayTime3
  82. #define YY_CheckDelay cDelayTime4
  83. #define YY_HLDelay cDelayTime5
  84. #define YY_LCntDelay cDelayTime6
  85. #define YY_RCntDelay cDelayTime7
  86. #define YY_ZYDelay cDelayTime8
  87. #define YY_TryDelay cDelayTime10
  88. #define YY_SJDelay cDelayTime11
  89. #define YY_XMDelay cDelayTime12
  90. #define YY_ZhuYouDelay cDelayTime13
  91. #define YY_AutoStep cStepMByte
  92. #define YY_MotorStep cStepMByte1
  93. #define YY_XiaQieStep cStepMByte2
  94. #define YY_YuanDianStep cStepMByte3
  95. #define YY_TuiLianStep cStepMByte4
  96. #define YY_TuiFangKuaiStep cStepMByte5
  97. #define YY_BinLianStep cStepMByte6
  98. //超声花边切输入输出
  99. #define YY_START_IN X00
  100. #define YY_START_IN_UP (X00 && !OLDX00)
  101. #define YY_STOP_IN X01
  102. #define YY_STOP_IN_UP (X01 && !OLDX01)
  103. #define YY_EGMSTOP_IN X02
  104. #define YY_YW_IN X03
  105. #define YY_YY_IN X04
  106. #define YY_TX_IN X05
  107. #define YY_CX_IN X06
  108. #define YY_KD_IN X07
  109. #define YY_ZIPPER_IN X10
  110. #define YY_JT_IN X11
  111. #define YY_JT_IN_UP (X11 && !OLDX11)
  112. #define YY_JT_IN_DW (!X11 && OLDX11)
  113. #define YY_HL_LIMIT_IN X12
  114. #define YY_LEFT_SL_UP_IN X13
  115. #define YY_LEFT_SL_DW_IN X14
  116. #define YY_RIGHT_SL_UP_IN X15
  117. #define YY_RIGHT_SL_DW_IN X16
  118. #define YY_LEFT_COUNT_IN X17
  119. #define YY_LEFT_COUNT_IN_UP (X17 && !OLDX17)
  120. #define YY_RIGHT_COUNT_IN X20
  121. #define YY_RIGHT_COUNT_IN_UP (X20 && !OLDX20)
  122. #define YY_HL_UP_IN X30
  123. #define YY_HL_DW_IN X31
  124. #define YY_ALARM_LED Y00
  125. #define YY_LEFT_IN Y01
  126. #define YY_LEFT_OUT Y02
  127. #define YY_RIGHT_IN Y03
  128. #define YY_RIGHT_OUT Y04
  129. #define YY_MAIN_MOTOR Y05
  130. #define YY_OIL_MOTOR Y06
  131. #define YY_HL_MOTOR Y10
  132. #define YY_LEFT_SL_MOTOR Y13
  133. #define YY_RIGHT_SL_MOTOR Y14
  134. typedef __packed struct
  135. {
  136. unsigned short LeftToothNum; // 0
  137. unsigned short LeftToothLengthCM; // 1
  138. unsigned short LeftToothLengthINCH; // 2
  139. unsigned short LeftToothNumSpace; // 3
  140. unsigned short LeftToothLengthCMSpace;// 4
  141. unsigned short LeftToothLengthINCHSpace;//5
  142. unsigned short RightToothNum; // 6
  143. unsigned short RightToothLengthCM; // 7
  144. unsigned short RightToothLengthINCH; // 8
  145. unsigned short RightToothNumSpace; // 9
  146. unsigned short RightToothLengthCMSpace;// 10
  147. unsigned short RightToothLengthINCHSpace;//11
  148. unsigned short DisplyLeftToothNum; // 12
  149. unsigned short DisplyLeftToothLengthCM; // 13
  150. unsigned short DisplyLeftToothLengthINCH; // 14
  151. unsigned short DisplyLeftToothNumSpace; // 15
  152. unsigned short DisplyLeftToothLengthCMSpace;// 16
  153. unsigned short DisplyLeftToothLengthINCHSpace;//17
  154. unsigned short DisplyRightToothNum; // 18
  155. unsigned short DisplyRightToothLengthCM; // 19
  156. unsigned short DisplyRightToothLengthINCH; // 20
  157. unsigned short DisplyRightToothNumSpace; // 21
  158. unsigned short DisplyRightToothLengthCMSpace;// 22
  159. unsigned short DisplyRightToothLengthINCHSpace;//23
  160. unsigned long SetTotal; //24
  161. unsigned long OverTotal;//26
  162. unsigned long SetLength;//28
  163. unsigned long OverLength;//30
  164. unsigned short SetTimeHour; //32
  165. unsigned short SetTimeMinute; //33
  166. unsigned short RemainTimeHour; //34
  167. unsigned short RemainTimeMinute; //35
  168. unsigned short res[4];
  169. } YY_SingleParam_str;
  170. typedef __packed struct
  171. {
  172. unsigned short LeftToothNum[5]; // 40
  173. unsigned short LeftToothLengthCM[5]; // 45
  174. unsigned short LeftToothLengthINCH[5]; // 50
  175. unsigned short LeftToothNumSpace[5]; // 55
  176. unsigned short LeftToothLengthCMSpace[5];// 60
  177. unsigned short LeftToothLengthINCHSpace[5];//65
  178. unsigned short RightToothNum[5]; // 70
  179. unsigned short RightToothLengthCM[5]; // 75
  180. unsigned short RightToothLengthINCH[5]; // 80
  181. unsigned short RightToothNumSpace[5]; // 85
  182. unsigned short RightToothLengthCMSpace[5];// 90
  183. unsigned short RightToothLengthINCHSpace[5];//95
  184. unsigned long SetTotal[5];//100
  185. unsigned short DisplyLeftToothNum[5]; // 110
  186. unsigned short DisplyLeftToothLengthCM[5]; // 115
  187. unsigned short DisplyLeftToothLengthINCH[5]; // 120
  188. unsigned short DisplyLeftToothNumSpace[5]; // 125
  189. unsigned short DisplyLeftToothLengthCMSpace[5];// 130
  190. unsigned short DisplyLeftToothLengthINCHSpace[5];//135
  191. unsigned short DisplyRightToothNum[5]; // 140
  192. unsigned short DisplyRightToothLengthCM[5]; // 145
  193. unsigned short DisplyRightToothLengthINCH[5]; // 150
  194. unsigned short DisplyRightToothNumSpace[5]; // 155
  195. unsigned short DisplyRightToothLengthCMSpace[5];// 160
  196. unsigned short DisplyRightToothLengthINCHSpace[5];//165
  197. unsigned long OverSetTotal[5];//170
  198. unsigned long AllSetTotal;//180
  199. unsigned long AllSetLength;//182
  200. unsigned long AllOverTotal;//184
  201. unsigned long AllOverLength;//186
  202. unsigned short SetTimeHour; //188
  203. unsigned short SetTimeMinute;//189
  204. unsigned short RemainTimeHour; //190
  205. unsigned short RemainTimeMinute;//191
  206. } YY_GroupParam_str;
  207. typedef __packed struct
  208. {
  209. unsigned short AlarmCode; // 192
  210. unsigned short OilTime; //193
  211. unsigned short IntOilTime; //194
  212. unsigned short StartOilTime; //195
  213. unsigned short RemainOilTime; //196
  214. unsigned short JieTouToothNum; //197
  215. unsigned long AllProductTime; //198
  216. unsigned long AllProductLength;//200
  217. unsigned short DisplayOilTime; //202
  218. unsigned short NowGroup; //203
  219. unsigned short JieTouMJToothNum;// 204
  220. unsigned short DifferentLengthToothNum;// 205
  221. unsigned short NextGroupBuff;// 206
  222. unsigned short TotalDisplayState[5];//207
  223. unsigned short ToothLength;//212
  224. unsigned short ToothNum;//213
  225. } YY_SystemParam_str;
  226. typedef __packed struct
  227. {
  228. unsigned short LeftRightLife[16]; // 212
  229. unsigned short LeftRightUsedLife[16]; // 228
  230. unsigned short RefreshTimes[16]; //244
  231. unsigned short res[2];
  232. unsigned short RemainLife[16]; // 262
  233. unsigned short LifeAlarm; //278
  234. } YY_ComponentParam_str;
  235. #define YY_DISPLAY_STATE user_datas[300]
  236. #define YY_DIAPLAY0 user_datas[350]
  237. #define YY_DIAPLAY1 user_datas[351]
  238. #define YY_DIAPLAY2 user_datas[352]
  239. #define YY_DIAPLAY3 user_datas[353]
  240. #define YY_DIAPLAY4 user_datas[354]
  241. #define YY_DIAPLAY5 user_datas[355]
  242. #define YY_DIAPLAY6 user_datas[356]
  243. #define YY_DIAPLAY7 user_datas[357]
  244. #define YY_bPYMotor M0002
  245. #define YY_bZhuYou M0003
  246. #define YY_bHL M0004
  247. #define YY_bSongSi M0005
  248. #define YY_bPYControl M0006
  249. #define YY_bWorkState M0007
  250. #define YY_bZYNow M0008
  251. #define YY_bClearTotal M0009
  252. #define YY_bOnceStartPower M0010
  253. #define YY_bMode M0011
  254. #define YY_bReset M0012
  255. #define YY_bClearAlarm M0013
  256. #define YY_bCalculateTotal M0015
  257. #define YY_bCalInputToothNum M0016
  258. #define YY_bCalInputLength M0017
  259. #define YY_bCalInputLengthInch M0018
  260. #define YY_bCalInputRightToothNum M0019
  261. #define YY_bCalInputRightToothNumLength M0020
  262. #define YY_bCalInputRightToothNumLengthInch M0021
  263. #define YY_bCalInputRightKongWei M0022
  264. #define YY_bCalInputRightKongWeiLength M0023
  265. #define YY_bCalInputRightKongWeiLengthInch M0024
  266. #define YY_bCalAllLength M0025
  267. #define YY_bChangeNextGroup M0026
  268. #define YY_bDCTEnable M0027
  269. #define YY_bSetDCTEnable M0028
  270. #define YY_bRunning M0030
  271. #define YY_bStart M0031
  272. #define YY_bStop M0032
  273. #define YY_bAlarmStop M0033
  274. #define YY_bSingStop M0034
  275. #define YY_bClearPro M0035
  276. #define YY_bClearLife1 M0050
  277. #define YY_bClearLife2 M0051
  278. #define YY_bClearLife3 M0052
  279. #define YY_bClearLife4 M0053
  280. #define YY_bClearLife5 M0054
  281. #define YY_bClearLife6 M0055
  282. #define YY_bClearLife7 M0056
  283. #define YY_bClearLife8 M0057
  284. #define YY_bClearLife9 M0058
  285. #define YY_bClearLife10 M0059
  286. #define YY_bClearLife11 M0060
  287. #define YY_bClearLife12 M0061
  288. #define YY_bClearLife13 M0062
  289. #define YY_bClearLife14 M0063
  290. #define YY_bClearLife15 M0064
  291. #define YY_bClearLife16 M0065
  292. #define YY_bClearTimes1 M0066
  293. #define YY_bClearTimes2 M0067
  294. #define YY_bClearTimes3 M0068
  295. #define YY_bClearTimes4 M0069
  296. #define YY_bClearTimes5 M0070
  297. #define YY_bClearTimes6 M0071
  298. #define YY_bClearTimes7 M0072
  299. #define YY_bClearTimes8 M0073
  300. #define YY_bClearTimes9 M0074
  301. #define YY_bClearTimes10 M0075
  302. #define YY_bClearTimes11 M0076
  303. #define YY_bClearTimes12 M0077
  304. #define YY_bClearTimes13 M0078
  305. #define YY_bClearTimes14 M0079
  306. #define YY_bClearTimes15 M0080
  307. #define YY_bClearTimes16 M0081
  308. #define YY_bFirstZY M0100
  309. #define YY_bClear1 M0101
  310. #define YY_bClear2 M0102
  311. #define YY_bClear3 M0103
  312. #define YY_bClear4 M0104
  313. #define YY_bClear5 M0105
  314. #endif
  315. #endif