TYYYaJi.h 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341
  1. #ifndef __TYYYA_JI_H__
  2. #define __TYYYA_JI_H__
  3. #if TONG_YONG_MACHINE | BRUCE_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. extern void YYa_ExtiActionX31(void);
  54. #define YY_TOTAL_ADDR 76
  55. #define YY_QIE_DUAN_TOTAL_ADDR 79
  56. #define YY_ALARM_ADDR 100
  57. #define YY_PROSPEED_ADDR 78
  58. /*
  59. * 警告类型 警告编号
  60. */
  61. #define YY_NO_ALARM 0 /* 没警告*/
  62. #define YY_NO_ZIPPER_ALARM 1 /* 没拉链,自动停机*/
  63. #define YY_KA_DAI_ALARM 2 /* 卡带异常*/
  64. #define YY_SM_YUANWEI 3 /* 上模上限位*/
  65. #define YY_SM_DAOWEI 4 /* 上模下限位*/
  66. #define YY_XM_YUANWEI 5 /* 下模上限位*/
  67. #define YY_XM_DAOWEI 6 /* 下模下限位*/
  68. #define YY_BACK_ALARM 7
  69. #define YY_TOTAL_ALARM 8
  70. #define YY_TL_ALARM 9
  71. #define YY_GZ_ALARM 10
  72. #define YY_JD_ORIGIN_ALARM 11
  73. #define YY_DEC_ALARM 12
  74. #define YY_BL_ALARM 17
  75. #define YY_SM_ALARM 18
  76. #define YY_LENGTH_LONG_ALARM 19
  77. #define YY_LENGTH_SHORT_ALARM 20
  78. #define YY_JD_IN_ALARM 21
  79. #define VAVLE_ALARM_TIME 3000
  80. #define MOTOR_ALARM_TIME 5000
  81. #define YY_AutoDelay cDelayTime1
  82. #define YY_MotorDelay cDelayTime2
  83. #define YY_ZhuYouDelay cDelayTime3
  84. #define YY_CheckDelay cDelayTime4
  85. #define YY_CSDelay cDelayTime5
  86. #define YY_TBDelay cDelayTime6
  87. #define YY_TFKDelay cDelayTime7
  88. #define YY_TLDelay cDelayTime8
  89. #define YY_AlarmDelay cDelayTime10
  90. #define YY_SJDelay cDelayTime11
  91. #define YY_XMDelay cDelayTime12
  92. #define YY_GZDelay cDelayTime13
  93. #define YY_AutoStep cStepMByte
  94. #define YY_MotorStep cStepMByte1
  95. #define YY_XiaQieStep cStepMByte2
  96. #define YY_YuanDianStep cStepMByte3
  97. #define YY_TuiLianStep cStepMByte4
  98. #define YY_TuiFangKuaiStep cStepMByte5
  99. #define YY_BinLianStep cStepMByte6
  100. //超声花边切输入输出
  101. #define YY_START_IN X00
  102. #define YY_START_IN_UP (X00 && !OLDX00)
  103. #define YY_STOP_IN X01
  104. #define YY_STOP_IN_UP (X01 && !OLDX01)
  105. #define YY_EGMSTOP_IN X02
  106. #define YY_YW_IN X03
  107. #define YY_YY_IN X04
  108. #define YY_TX_IN X05
  109. #define YY_CX_IN X06
  110. #define YY_KD_IN X07
  111. #define YY_ZIPPER_IN X10
  112. #define YY_SD_IN X11
  113. #define YY_HL_LIMIT_IN X12
  114. #define YY_QY1_IN X13
  115. #define YY_QY2_IN X14
  116. #define YY_JT_IN X15
  117. #define YY_LEFT_COUNT_IN X16
  118. #define YY_LEFT_COUNT_IN_UP (X16 && !OLDX16)
  119. #define YY_RIGHT_COUNT_IN X17
  120. #define YY_RIGHT_COUNT_IN_UP (X17 && !OLDX17)
  121. #define YY_LEFT_SL_DW_IN X30
  122. #define YY_LEFT_SL_UP_IN X31
  123. #define YY_RIGHT_SL_DW_IN X32
  124. #define YY_RIGHT_SL_UP_IN X33
  125. #define YY_HL_UP_IN X34
  126. #define YY_HL_DW_IN X35
  127. #define YY_LEFT_IN Y01
  128. #define YY_LEFT_OUT Y02
  129. #define YY_RIGHT_IN Y03
  130. #define YY_RIGHT_OUT Y04
  131. #define YY_MAIN_MOTOR Y05
  132. #define YY_OIL_MOTOR Y06
  133. #define YY_SD_MOTOR Y07
  134. #define YY_YL_MOTOR Y10
  135. #define YY_HL_MOTOR Y11
  136. #define YY_HL_VAVLE Y12
  137. #define YY_LEFT_SL_MOTOR Y13
  138. #define YY_RIGHT_SL_MOTOR Y14
  139. #define YY_SINGLE_MODE 0
  140. #define YY_GROUP_MODE 1
  141. #define YY_SINGLE_ADDR 0
  142. #define YY_GROUP_ADDR 40
  143. #define YY_SYSTEM_ADDR 192
  144. #define YY_LIFE_ADDR 206
  145. typedef __packed struct
  146. {
  147. unsigned short LeftToothNum; // 0
  148. unsigned short LeftToothLengthCM; // 1
  149. unsigned short LeftToothLengthINCH; // 2
  150. unsigned short LeftToothNumSpace; // 3
  151. unsigned short LeftToothLengthCMSpace;// 4
  152. unsigned short LeftToothLengthINCHSpace;//5
  153. unsigned short RightToothNum; // 6
  154. unsigned short RightToothLengthCM; // 7
  155. unsigned short RightToothLengthINCH; // 8
  156. unsigned short RightToothNumSpace; // 9
  157. unsigned short RightToothLengthCMSpace;// 10
  158. unsigned short RightToothLengthINCHSpace;//11
  159. unsigned short DisplyLeftToothNum; // 12
  160. unsigned short DisplyLeftToothLengthCM; // 13
  161. unsigned short DisplyLeftToothLengthINCH; // 14
  162. unsigned short DisplyLeftToothNumSpace; // 15
  163. unsigned short DisplyLeftToothLengthCMSpace;// 16
  164. unsigned short DisplyLeftToothLengthINCHSpace;//17
  165. unsigned short DisplyRightToothNum; // 18
  166. unsigned short DisplyRightToothLengthCM; // 19
  167. unsigned short DisplyRightToothLengthINCH; // 20
  168. unsigned short DisplyRightToothNumSpace; // 21
  169. unsigned short DisplyRightToothLengthCMSpace;// 22
  170. unsigned short DisplyRightToothLengthINCHSpace;//23
  171. unsigned long SetTotal; //24
  172. unsigned long OverTotal;//26
  173. unsigned long SetLength;//28
  174. unsigned long OverLength;//30
  175. unsigned short SetTimeHour; //32
  176. unsigned short SetTimeMinute; //33
  177. unsigned short OverTimeHour; //34
  178. unsigned short OverTimeMinute; //35
  179. unsigned short res[4];
  180. } YY_SingleParam_str;
  181. typedef __packed struct
  182. {
  183. unsigned short LeftToothNum[5]; // 40
  184. unsigned short LeftToothLengthCM[5]; // 45
  185. unsigned short LeftToothLengthINCH[5]; // 50
  186. unsigned short LeftToothNumSpace[5]; // 55
  187. unsigned short LeftToothLengthCMSpace[5];// 60
  188. unsigned short LeftToothLengthINCHSpace[5];//65
  189. unsigned short RightToothNum[5]; // 70
  190. unsigned short RightToothLengthCM[5]; // 75
  191. unsigned short RightToothLengthINCH[5]; // 80
  192. unsigned short RightToothNumSpace[5]; // 85
  193. unsigned short RightToothLengthCMSpace[5];// 90
  194. unsigned short RightToothLengthINCHSpace[5];//95
  195. unsigned long SetTotal[5];//100
  196. unsigned short DisplyLeftToothNum[5]; // 110
  197. unsigned short DisplyLeftToothLengthCM[5]; // 115
  198. unsigned short DisplyLeftToothLengthINCH[5]; // 120
  199. unsigned short DisplyLeftToothNumSpace[5]; // 125
  200. unsigned short DisplyLeftToothLengthCMSpace[5];// 130
  201. unsigned short DisplyLeftToothLengthINCHSpace[5];//135
  202. unsigned short DisplyRightToothNum[5]; // 140
  203. unsigned short DisplyRightToothLengthCM[5]; // 145
  204. unsigned short DisplyRightToothLengthINCH[5]; // 150
  205. unsigned short DisplyRightToothNumSpace[5]; // 155
  206. unsigned short DisplyRightToothLengthCMSpace[5];// 160
  207. unsigned short DisplyRightToothLengthINCHSpace[5];//165
  208. unsigned long OverSetTotal[5];//170
  209. unsigned long AllSetToatal;//180
  210. unsigned long AllSetLength;//182
  211. unsigned long AllOverTotal;//184
  212. unsigned long AllOverLength;//186
  213. unsigned short SetTimeHour; //188
  214. unsigned short SetTimeMinute;//189
  215. unsigned short RemainTimeHour; //190
  216. unsigned short RemainTimeMinute;//191
  217. } YY_GroupParam_str;
  218. typedef __packed struct
  219. {
  220. unsigned short AlarmCode; // 192
  221. unsigned short OilTime; //193
  222. unsigned short IntOilTime; //194
  223. unsigned short StartOilTime; //195
  224. unsigned short RemainOilTime; //196
  225. unsigned short JieTouToothNum; //197
  226. unsigned long AllProductTime; //198
  227. unsigned long AllProductLength;//200
  228. unsigned short DisplayOilTime; //202
  229. unsigned short NowGroup; //203
  230. unsigned short res[2]; // 204
  231. } YY_SystemParam_str;
  232. typedef __packed struct
  233. {
  234. unsigned short LeftRightLife[16]; // 206
  235. unsigned short LeftRightUsedLife[16]; // 222
  236. unsigned short RefreshTimes[16]; //238
  237. unsigned short res[2];
  238. unsigned short RemainLife[16]; // 256
  239. unsigned short LifeAlarm; //272
  240. } YY_ComponentParam_str;
  241. //M0~M4全局固定使用
  242. /*
  243. #define bRunning M0000
  244. #define bStart M0001
  245. #define bStop M0002
  246. #define bAlarmStop M0003
  247. #define bClearTotal M0004
  248. */
  249. #define YY_bMode M0005
  250. #define YY_bHL M0006
  251. #define YY_bPYMotor M0007
  252. #define YY_bPYControl M0008
  253. #define YY_bZhuYou M0009
  254. #define YY_bOnceStartPower M0010
  255. #define YY_bClearAll M0011
  256. #define YY_bReset M0012
  257. #define YY_bClearAlarm M0013
  258. #define YY_bBackMotor M0014
  259. #define YY_bTL M0015
  260. #define YY_bYD M0016
  261. #define YY_bGZ M0017
  262. #define YY_bJD M0018
  263. #define YY_bYuanDianDW M0020
  264. #define YY_bTestCS M0021
  265. #define YY_bSingle M0022
  266. #define YY_bTFK M0023
  267. #define YY_bTB M0024
  268. #define YY_bYBD M0025
  269. #define YY_bClearNowTotal M0026
  270. #define YY_bTS M0027
  271. #define YY_bBL M0028
  272. #define YY_bSetGZMode M0029
  273. #define YY_bClearLife1 M0050
  274. #define YY_bClearLife2 M0051
  275. #define YY_bClearLife3 M0052
  276. #define YY_bClearLife4 M0053
  277. #define YY_bClearLife5 M0054
  278. #define YY_bClearLife6 M0055
  279. #define YY_bClearLife7 M0056
  280. #define YY_bClearLife8 M0057
  281. #define YY_bClearLife9 M0058
  282. #define YY_bClearLife10 M0059
  283. #define YY_bClearLife11 M0060
  284. #define YY_bClearLife12 M0061
  285. #define YY_bClearLife13 M0062
  286. #define YY_bClearLife14 M0063
  287. #define YY_bClearLife15 M0064
  288. #define YY_bClearLife16 M0065
  289. #define YY_bClearTimes1 M0066
  290. #define YY_bClearTimes2 M0067
  291. #define YY_bClearTimes3 M0068
  292. #define YY_bClearTimes4 M0069
  293. #define YY_bClearTimes5 M0070
  294. #define YY_bClearTimes6 M0071
  295. #define YY_bClearTimes7 M0072
  296. #define YY_bClearTimes8 M0073
  297. #define YY_bClearTimes9 M0074
  298. #define YY_bClearTimes10 M0075
  299. #define YY_bClearTimes11 M0076
  300. #define YY_bClearTimes12 M0077
  301. #define YY_bClearTimes13 M0078
  302. #define YY_bClearTimes14 M0079
  303. #define YY_bClearTimes15 M0080
  304. #define YY_bClearTimes16 M0081
  305. #endif
  306. #endif