Action.h 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623
  1. #ifndef __ACTION_H__
  2. #define __ACTION_H__
  3. extern unsigned long cMachineType;
  4. extern unsigned long cScreenEnable;
  5. extern unsigned long cWifiEnable;
  6. extern unsigned short cSetPulseType;
  7. extern unsigned char cSetXdirType;
  8. extern unsigned char cSetYdirType;
  9. extern unsigned char cSetXdirCh;
  10. extern unsigned char cSetYdirCh;
  11. extern unsigned char JYDCRunFlg,CCJRunFlg;
  12. extern byte_bits_t cRunState,cRunState1;
  13. extern byte_bits_t cTimeState;
  14. extern unsigned short cStepMByte,cStepMByte1,cStepMByte2,cStepMByte3,cStepMByte4,cStepMByte5,cStepMByte6,cStepMByte7,cStepMByte8,cStepMByte9,cStepMByte10,cStepMByte11,cStepMByte12,cStepMByte13,cStepMByte14,cStepMByte15;
  15. extern unsigned long cDelayTime1,cDelayTime2,cDelayTime3,cDelayTime4,cDelayTime5,cDelayTime6,cDelayTime7,cDelayTime8,cDelayTime9,cDelayTime10,cDelayTime11,cDelayTime12,cDelayTime13,cDelayTime14,cDelayTime15,cDelayTime16,cDelayTime17,cDelayTime18;
  16. extern long dwXRealPos,dwYRealPos;
  17. extern long dwRealPos,dwRealPosY;
  18. extern unsigned char SingOneFlg;
  19. extern unsigned long dwZipCnt;
  20. extern unsigned char cSeBiaoEn;
  21. extern unsigned char cSeBiaoOk;
  22. extern unsigned char LockMachineFlg;
  23. extern unsigned char jydc_use_x30;
  24. extern unsigned char jydc_use_x20;
  25. //8位变量
  26. extern unsigned char cCharBuff1,cCharBuff2,cCharBuff3,cCharBuff4,cCharBuff5,cCharBuff6,cCharBuff7,cCharBuff8,
  27. cCharBuff9,cCharBuff10,cCharBuff11,cCharBuff12,cCharBuff13,cCharBuff14,cCharBuff15,
  28. cCharBuff16,cCharBuff17,cCharBuff18,cCharBuff19,cCharBuff20,cCharBuff21,cCharBuff22,
  29. cCharBuff23,cCharBuff24,cCharBuff25,cCharBuff26,cCharBuff27,cCharBuff28,cCharBuff29,
  30. cCharBuff30,cCharBuff31,cCharBuff32,cCharBuff33,cCharBuff34,cCharBuff35,cCharBuff36,
  31. cCharBuff37,cCharBuff38,cCharBuff39,cCharBuff40,cCharBuff41,cCharBuff41,cCharBuff42,
  32. cCharBuff43,cCharBuff44,cCharBuff45,cCharBuff46,cCharBuff47,cCharBuff48,cCharBuff49,
  33. cCharBuff50,cCharBuff51,cCharBuff52,cCharBuff53,cCharBuff54,cCharBuff55,cCharBuff56,
  34. cCharBuff57,cCharBuff58,cCharBuff59,cCharBuff60;
  35. //16位变量
  36. extern unsigned short cUShort16Buff1,cUShort16Buff2,cUShort16Buff3,cUShort16Buff4,cUShort16Buff5,cUShort16Buff6,cUShort16Buff7,
  37. cUShort16Buff8,cUShort16Buff9,cUShort16Buff10,cUShort16Buff11,cUShort16Buff12,cUShort16Buff13,cUShort16Buff14,
  38. cUShort16Buff15,cUShort16Buff16,cUShort16Buff17,cUShort16Buff18,cUShort16Buff18,cUShort16Buff19,cUShort16Buff20,
  39. cUShort16Buff20,cUShort16Buff21,cUShort16Buff22,cUShort16Buff23,cUShort16Buff24,cUShort16Buff25,cUShort16Buff26,
  40. cUShort16Buff27,cUShort16Buff28,cUShort16Buff29,cUShort16Buff30,cUShort16Buff31,cUShort16Buff32,cUShort16Buff33,
  41. cUShort16Buff34,cUShort16Buff35,cUShort16Buff36,cUShort16Buff37,cUShort16Buff38,cUShort16Buff39,cUShort16Buff40;
  42. //32位变量
  43. extern unsigned long cUDword32Buff1,cUDword32Buff2,cUDword32Buff3,cUDword32Buff4,cUDword32Buff5,cUDword32Buff6,cUDword32Buff7,
  44. cUDword32Buff8,cUDword32Buff9,cUDword32Buff10,cUDword32Buff11,cUDword32Buff12,cUDword32Buff13,
  45. cUDword32Buff14,cUDword32Buff15;
  46. //有符号变量
  47. extern long cDword32Buff1,cDword32Buff2,cDword32Buff3,cDword32Buff4,cDword32Buff5,cDword32Buff6,cDword32Buff7,cDword32Buff8,cDword32Buff9,
  48. cDword32Buff10,cDword32Buff11,cDword32Buff12,cDword32Buff13,cDword32Buff14,cDword32Buff15;
  49. //16位指针型有符号变量
  50. extern short *Short16Buff1,*Short16Buff2,*Short16Buff3;
  51. extern long dwXRealPos,dwYRealPos,dwZRealPos,dwARealPos;
  52. extern void InitPWM(void);
  53. extern void GetMachineType(void);
  54. extern void SetMachineType(void);
  55. extern void CalProSP(unsigned short addr);
  56. extern void AddToTal(unsigned short addr);
  57. extern unsigned long GetTotal(unsigned short addr);
  58. extern void ClrcToTal(unsigned short addr);
  59. extern void SetAlarmCode(unsigned short addr,unsigned short alarm_code);
  60. extern unsigned short GetAlarmCode(unsigned short addr);
  61. extern void InitAction(void);
  62. extern void Action(void);
  63. extern unsigned long CalInch(unsigned long length);
  64. extern unsigned long CalLengthCM(unsigned long length);
  65. extern void DelayAction(void);
  66. extern void ExtiAcitionX30(void);
  67. extern void ExtiAcitionX31(void);
  68. extern void ExtiAcitionX20(void);
  69. extern void SetData32bits(unsigned short addr,long source_data);
  70. extern unsigned long GetData32bits(unsigned short addr);
  71. extern long CalLengthCM2(long length);
  72. extern long CalInch2(long length);
  73. extern void AlarmMessageSave(unsigned short alarm_addr);
  74. extern void ReSetWifi(void);
  75. extern void CheckTimeOver(void);
  76. extern void PWMAction(void);
  77. extern void Mechine_Config(void);
  78. extern void InitUart(void);
  79. extern unsigned char Y05Flg;
  80. extern unsigned char Y06Flg;
  81. extern unsigned char Y04Flg;
  82. extern unsigned char Y07Flg;
  83. #define bShaCheRun cRunState.bits.b1
  84. #define bFreqChange cRunState.bits.b2
  85. #define bCountEn cRunState.bits.b3
  86. #define bClrPulse cRunState.bits.b4
  87. #define bTwoDK cRunState.bits.b5
  88. #define bDZRunning cRunState.bits.b6
  89. #define bDZJiaoZhunState cRunState.bits.b7
  90. #define bDZStart cRunState1.bits.b0
  91. #define bCheckOK cRunState1.bits.b1
  92. #define bt10ms cTimeState.bits.b0
  93. #define b10ms cTimeState.bits.b1
  94. #define b100ms cTimeState.bits.b2
  95. #define X_ON_ENABLE 0x01
  96. #define X_DIR_ENABLE 0x02
  97. #define X_AXIS_PULSE_ENABLE 0x04
  98. #define Y_ON_ENABLE 0x10
  99. #define Y_DIR_ENABLE 0x20
  100. #define Y_AXIS_PULSE_ENABLE 0x40
  101. #define bRunning M0000
  102. #define bStart M0001
  103. #define bStop M0002
  104. #define bAlarmStop M0003
  105. #define bClearTotal M0004
  106. /**机器设置**/
  107. //机器种类
  108. #define MACHINE_TYPE_SAVE_ADDR (POWEROFF_BACKUP_ADDRESS - 2048) //机型存储在备份数据的前2k的第一个地址
  109. #define MACHINE_TYPE_SET_DATA user_datas[500] // D500设置机型种类
  110. #define MACHINE_TYPE user_datas[300]
  111. //机器带不带触摸屏
  112. #define MACHINE_SCREEN_SAVE_ADDR (MACHINE_TYPE_SAVE_ADDR + 4)
  113. #define MACHINE_SCREEN_SET_DATA user_datas[501]
  114. #define MACHINE_SCREEN cScreenEnable
  115. //机器带不带WIFI
  116. #define MACHINE_WIFI_SAVE_ADDR (MACHINE_TYPE_SAVE_ADDR + 8)
  117. #define MACHINE_WIFI_SET_DATA user_datas[502]
  118. #define MACHINE_WIFI cWifiEnable user_datas[502]
  119. //机器上电启动不启动WIFI
  120. #define MACHINE_BOOT_WIFI user_datas[254]
  121. #define MACHINE_LOCK_TIME user_datas[240]//使用时间保存单位小时
  122. #define MACHINE_PSW_ENABLE user_datas[241]
  123. #define MACHINE_LOCK_PSW (user_datas[16] | user_datas[17] << 16)
  124. #define MACHINE_BASE_PSW (user_datas[0] | user_datas[1] << 16)
  125. #define MACHINE_USE_DAY 30//使用天数
  126. #define USE_PSW (0) //配置使能三个月使用期限
  127. /*************************/
  128. //厂家配置
  129. #define HAI_HUA_MACHINE (0) // 海华拉链
  130. #define JIN_HONG_MACHINE (1) // 锦泓拉链
  131. #define HONG_YE_MACHINE (0) // 宏业拉链
  132. #define FU_XIAO_WEI_MACHINE (0) // 付小伟
  133. #define CHANG_SHENG_GEI_LI_MACHINE (0) // 昌盛给力拉链
  134. #define YOU_GUAN_MACHINE (0) // 福建优冠拉链
  135. #define ZHEN_YU_MACHINE (0) // 振宇拉链
  136. #define JUN_TENG_MACHINE (0) // 南通骏腾拉链
  137. #define JIA_CHENG_WEI_YE_MACHINE (0) // 嘉成伟业拉链
  138. #define XIN_SHENG_MACHINE (0) // 欣盛拉链
  139. #define WEI_YUAN_SONG_MACHINE (0) //魏远松东城协力,王志文树脂定寸
  140. #define PENG_WEI_CHANG_MACHINE (0) //彭伟昌
  141. #define XIN_YE_MACHINE (0) //鑫业(舜业)拉链机械
  142. #define XI_DONG_MACHINE (0) //陈锡冬拉链机械
  143. #define JU_XING_MACHINE (0) //湖北汉川聚星拉链机械
  144. #define YU_WEN_XUAN_MACHINE (0) //宇文轩拉链机械
  145. #define TONG_YONG_MACHINE (0) //厂家通用机型 浙江温州王永贴布机,浙江湖州织里优诚开口切断机,聚星贴布机 温州鸿门定制机
  146. #define FJ_YING_XING_MACHINE (0) //福建盈兴拉链机械
  147. #define BRUCE_MACHINE (0) //布鲁斯打褶机
  148. #define JIN_LONG_MACHINE (0) //温州金龙拉链
  149. #define CHUAN_CHI_MACHINE (0) //福建传驰拉链机械
  150. //板脉冲方式定义
  151. #define SET_PULSE_TYPE cSetPulseType
  152. #define X_AXIS_PULSE_Y_ON (X_AXIS_PULSE_ENABLE | Y_ON_ENABLE) //X轴脉冲Y轴当使能
  153. #define X_AXIS_PULSE_Y_DIR (X_AXIS_PULSE_ENABLE | Y_DIR_ENABLE) //X轴脉冲Y轴当方向
  154. #define Y_AXIS_PULSE_X_ON (Y_AXIS_PULSE_ENABLE | X_ON_ENABLE) //Y轴脉冲X轴当使能
  155. #define Y_AXIS_PULSE_X_DIR (Y_AXIS_PULSE_ENABLE | X_DIR_ENABLE) //Y轴脉冲X轴当方向
  156. #define XY_AXIS_ON (X_ON_ENABLE | Y_ON_ENABLE) //XY轴都当使能
  157. #define XY_AXIS_PULSE (X_AXIS_PULSE_ENABLE | Y_AXIS_PULSE_ENABLE) //XY轴脉冲两个当脉冲
  158. //轴方向类型选择
  159. #define SET_XDIR_TYPE cSetXdirType
  160. #define SET_YDIR_TYPE cSetYdirType
  161. #define SET_XDIR_CH cSetXdirCh
  162. #define SET_YDIR_CH cSetYdirCh
  163. //方向输出类型分为脉冲和Y输出和不使用三种
  164. #define PULSE_OUTPUT_TYPE 0
  165. #define Y_OUTPUT_TYPE 1
  166. #define NO_USE_TYPE 2
  167. //数据保存区域用于保存故障信息等数据不含备份功能
  168. //保存在芯片FLASH的最后一段存储区
  169. #define SAVE_MESSAGE_SIZE 30 // 故障信息保存大小 单位k
  170. #define SAVE_MESSAGE_DATA_SIZE (2048 * SAVE_MESSAGE_SIZE / 2)
  171. #define SAVE_MESSAGE_START_ADDR (127 - (SAVE_MESSAGE_SIZE / 2 - 1)) * 2048
  172. #define ONE_MESSAGE_SIZE_WORD 10
  173. #define SAV_MESSAGE_USER_DATAS_START_ADDR 1000
  174. #define ALARM_MESSAGE_CMD user_datas[SAV_MESSAGE_USER_DATAS_START_ADDR+2]
  175. #define CMD_READ_MESSAGE 1
  176. #define CMD_READ_ALARM_MESSAGE 2
  177. #if (TONG_YONG_MACHINE | ZHEN_YU_MACHINE | YU_WEN_XUAN_MACHINE | XIN_YE_MACHINE)
  178. #define DWORD (unsigned long)
  179. #define M00 M0000
  180. #define M01 M0001
  181. #define M02 M0002
  182. #define M03 M0003
  183. #define M04 M0004
  184. #define M05 M0005
  185. #define M06 M0006
  186. #define M07 M0007
  187. #define M08 M0008
  188. #define M09 M0009
  189. #define M0 M0000
  190. #define M1 M0001
  191. #define M2 M0002
  192. #define M3 M0003
  193. #define M4 M0004
  194. #define M5 M0005
  195. #define M6 M0006
  196. #define M7 M0007
  197. #define M8 M0008
  198. #define M9 M0009
  199. #define M10 M0010
  200. #define M11 M0011
  201. #define M12 M0012
  202. #define M13 M0013
  203. #define M14 M0014
  204. #define M15 M0015
  205. #define M16 M0016
  206. #define M17 M0017
  207. #define M18 M0018
  208. #define M19 M0019
  209. #define M20 M0020
  210. #define M21 M0021
  211. #define M22 M0022
  212. #define M23 M0023
  213. #define M24 M0024
  214. #define M25 M0025
  215. #define M26 M0026
  216. #define M27 M0027
  217. #define M28 M0028
  218. #define M29 M0029
  219. #define M30 M0030
  220. #define M31 M0031
  221. #define M32 M0032
  222. #define M33 M0033
  223. #define M34 M0034
  224. #define M35 M0035
  225. #define M36 M0036
  226. #define X00_UP (X00 && !OLDX00)
  227. #define X01_UP (X01 && !OLDX01)
  228. #define X02_UP (X02 && !OLDX02)
  229. #define X03_UP (X03 && !OLDX03)
  230. #define X04_UP (X04 && !OLDX04)
  231. #define X05_UP (X05 && !OLDX05)
  232. #if (FANG_KUAI_JI_CONFIG)
  233. #define X006 (X30)
  234. #define X007 (X31)
  235. #define X010 (X32)
  236. #define X011 (X33)
  237. #define X06_UP (X30 && !OLDX30)
  238. #define X07_UP (X31 && !OLDX31)
  239. #define X10_UP (X32 && !OLDX32)
  240. #define X11_UP (X33 && !OLDX33)
  241. #else
  242. #define X06_UP (X06 && !OLDX06)
  243. #define X07_UP (X07 && !OLDX07)
  244. #define X10_UP (X10 && !OLDX10)
  245. #define X11_UP (X11 && !OLDX11)
  246. #endif
  247. #define X12_UP (X12 && !OLDX12)
  248. #define X13_UP (X13 && !OLDX13)
  249. #define X14_UP (X14 && !OLDX14)
  250. #define X15_UP (X15 && !OLDX15)
  251. #define X16_UP (X16 && !OLDX16)
  252. #define X17_UP (X17 && !OLDX17)
  253. #define X20_UP (X20 && !OLDX20)
  254. #if (FANG_KUAI_JI_CONFIG)
  255. #define X21_UP (X06 && !OLDX06)
  256. #define X22_UP (X07 && !OLDX07)
  257. #define X23_UP (X10 && !OLDX10)
  258. #define X24_UP (X11 && !OLDX11)
  259. #else
  260. #define X21_UP (X30 && !OLDX30)
  261. #define X22_UP (X31 && !OLDX31)
  262. #define X23_UP (X32 && !OLDX32)
  263. #define X24_UP (X33 && !OLDX33)
  264. #endif
  265. #define X25_UP (X34 && !OLDX34)
  266. #define X26_UP (X35 && !OLDX35)
  267. #define X27_UP (X36 && !OLDX36)
  268. #define X00_DW (!X00 && OLDX00)
  269. #define X01_DW (!X01 && OLDX01)
  270. #define X02_DW (!X02 && OLDX02)
  271. #define X03_DW (!X03 && OLDX03)
  272. #define X04_DW (!X04 && OLDX04)
  273. #define X05_DW (!X05 && OLDX05)
  274. #if (FANG_KUAI_JI_CONFIG)
  275. #define X06_DW (!X30 && OLDX30)
  276. #define X07_DW (!X31 && OLDX31)
  277. #define X10_DW (!X32 && OLDX32)
  278. #define X11_DW (!X33 && OLDX33)
  279. #else
  280. #define X06_DW (!X06 && OLDX06)
  281. #define X07_DW (!X07 && OLDX07)
  282. #define X10_DW (!X10 && OLDX10)
  283. #define X11_DW (!X11 && OLDX11)
  284. #endif
  285. #define X12_DW (!X12 && OLDX12)
  286. #define X13_DW (!X13 && OLDX13)
  287. #define X14_DW (!X14 && OLDX14)
  288. #define X15_DW (!X15 && OLDX15)
  289. #define X16_DW (!X16 && OLDX16)
  290. #define X17_DW (!X17 && OLDX17)
  291. #define X20_DW (!X20 && OLDX20)
  292. #if (FANG_KUAI_JI_CONFIG)
  293. #define X21_DW (!X06 && OLDX06)
  294. #define X22_DW (!X07 && OLDX07)
  295. #define X23_DW (!X10 && OLDX10)
  296. #define X24_DW (!X11 && OLDX11)
  297. #else
  298. #define X21_DW (!X30 && OLDX30)
  299. #define X22_DW (!X31 && OLDX31)
  300. #define X23_DW (!X32 && OLDX32)
  301. #define X24_DW (!X33 && OLDX33)
  302. #endif
  303. #define X25_DW (!X34 && OLDX34)
  304. #define X26_DW (!X35 && OLDX35)
  305. #define X27_DW (!X36 && OLDX36)
  306. #define SETQ00 Y00 = 1//cMidleCoil[2] |= 0x1
  307. #define SETQ01 Y01 = 1//cMidleCoil[2] |= 0x2
  308. #define SETQ02 Y02 = 1//cMidleCoil[2] |= 0x4
  309. #define SETQ03 Y03 = 1//cMidleCoil[2] |= 0x8
  310. #if (FANG_KUAI_JI_CONFIG)
  311. #define SETQ04 Y04Flg = 1//Y04 = 1//cMidleCoil[2] |= 0x10
  312. #define SETQ05 Y05Flg = 1//cMidleCoil[2] |= 0x20
  313. #define SETQ06 Y06Flg = 1//cMidleCoil[2] |= 0x40
  314. #define SETQ07 Y07Flg = 1//SETQ07 Y07 = 1//cMidleCoil[2] |= 0x80
  315. #else
  316. #define SETQ04 Y04 = 1//Y04 = 1//cMidleCoil[2] |= 0x10
  317. #define SETQ05 Y05 = 1//cMidleCoil[2] |= 0x20
  318. #define SETQ06 Y06 = 1//cMidleCoil[2] |= 0x40
  319. #define SETQ07 Y07 = 1//SETQ07 Y07 = 1//cMidleCoil[2] |= 0x80
  320. #endif
  321. #define SETQ10 Y10 = 1//cMidleCoil[2] |= 0x100
  322. #define SETQ11 Y11 = 1//cMidleCoil[2] |= 0x200
  323. #define SETQ12 Y12 = 1//cMidleCoil[2] |= 0x400
  324. #define SETQ13 Y13 = 1//cMidleCoil[2] |= 0x800
  325. #define SETQ14 Y14 = 1//cMidleCoil[2] |= 0x1000
  326. #define SETQ15 Y15 = 1//cMidleCoil[2] |= 0x2000
  327. #define SETQ16 Y20 = 1//cMidleCoil[2] |= 0x2000
  328. #define SETQ17 Y21 = 1//cMidleCoil[2] |= 0x2000
  329. #define CLRQ00 Y00 = 0//cMidleCoil[2] &= ~0x1
  330. #define CLRQ01 Y01 = 0//cMidleCoil[2] &= ~0x2
  331. #define CLRQ02 Y02 = 0//cMidleCoil[2] &= ~0x4
  332. #define CLRQ03 Y03 = 0//cMidleCoil[2] &= ~0x8
  333. #if (FANG_KUAI_JI_CONFIG)
  334. #define CLRQ04 Y04Flg = 0//cMidleCoil[2] &= ~0x10
  335. #define CLRQ05 Y05Flg = 0//cMidleCoil[2] &= ~0x20
  336. #define CLRQ06 Y06Flg = 0//cMidleCoil[2] &= ~0x40
  337. #define CLRQ07 Y07Flg = 0//cMidleCoil[2] &= ~0x80
  338. #else
  339. #define CLRQ04 Y04 = 0//cMidleCoil[2] &= ~0x10
  340. #define CLRQ05 Y05 = 0//cMidleCoil[2] &= ~0x20
  341. #define CLRQ06 Y06 = 0//cMidleCoil[2] &= ~0x40
  342. #define CLRQ07 Y07 = 0//cMidleCoil[2] &= ~0x80
  343. #endif
  344. #define CLRQ10 Y10 = 0//cMidleCoil[2] &= ~0x100
  345. #define CLRQ11 Y11 = 0//cMidleCoil[2] &= ~0x200
  346. #define CLRQ12 Y12 = 0//cMidleCoil[2] &= ~0x400
  347. #define CLRQ13 Y13 = 0//cMidleCoil[2] &= ~0x800
  348. #define CLRQ14 Y14 = 0//cMidleCoil[2] &= ~0x1000
  349. #define CLRQ15 Y15 = 0//cMidleCoil[2] &= ~0x2000
  350. #define CLRQ16 Y20 = 0//cMidleCoil[2] &= ~0x2000
  351. #define CLRQ17 Y21 = 0//cMidleCoil[2] &= ~0x2000
  352. #define SETY000() Y00 = 1//cMidleCoil[2] |= 0x1
  353. #define SETY001() Y01 = 1//cMidleCoil[2] |= 0x2
  354. #define SETY002() Y02 = 1//cMidleCoil[2] |= 0x4
  355. #define SETY003() Y03 = 1//cMidleCoil[2] |= 0x8
  356. #define SETY004() Y04 = 1//cMidleCoil[2] |= 0x10
  357. #define SETY005() Y05 = 1//cMidleCoil[2] |= 0x20
  358. #define SETY006() Y06 = 1//cMidleCoil[2] |= 0x40
  359. #define SETY007() Y07 = 1//cMidleCoil[2] |= 0x80
  360. #define SETY010() Y10 = 1//cMidleCoil[2] |= 0x100
  361. #define SETY011() Y11 = 1//cMidleCoil[2] |= 0x200
  362. #define SETY012() Y12 = 1//cMidleCoil[2] |= 0x400
  363. #define SETY013() Y13 = 1//cMidleCoil[2] |= 0x800
  364. #define SETY014() Y14 = 1//cMidleCoil[2] |= 0x1000
  365. #define SETY015() Y15 = 1//cMidleCoil[2] |= 0x2000
  366. #define SETY016() Y20 = 1//cMidleCoil[2] |= 0x1000
  367. #define SETY017() Y21 = 1//cMidleCoil[2] |= 0x2000
  368. #define SETY020() Y22 = 1//cMidleCoil[2] |= 0x100
  369. #define SETY021() Y23 = 1//cMidleCoil[2] |= 0x200
  370. #define SETY022() Y24 = 1//cMidleCoil[2] |= 0x400
  371. #define SETY023() Y25 = 1//cMidleCoil[2] |= 0x800
  372. #define SETY024() Y26 = 1//cMidleCoil[2] |= 0x1000
  373. #define SETY025() Y27 = 1//cMidleCoil[2] |= 0x2000
  374. #define SETY026() Y30 = 1//cMidleCoil[2] |= 0x1000
  375. #define SETY027() Y31 = 1//cMidleCoil[2] |= 0x2000
  376. #define CLRY000() Y00 = 0//cMidleCoil[2] &= ~0x1
  377. #define CLRY001() Y01 = 0//cMidleCoil[2] &= ~0x2
  378. #define CLRY002() Y02 = 0//cMidleCoil[2] &= ~0x4
  379. #define CLRY003() Y03 = 0//cMidleCoil[2] &= ~0x8
  380. #define CLRY004() Y04 = 0//cMidleCoil[2] &= ~0x10
  381. #define CLRY005() Y05 = 0//cMidleCoil[2] &= ~0x20
  382. #define CLRY006() Y06 = 0//cMidleCoil[2] &= ~0x40
  383. #define CLRY007() Y07 = 0//cMidleCoil[2] &= ~0x80
  384. #define CLRY010() Y10 = 0//cMidleCoil[2] &= ~0x100
  385. #define CLRY011() Y11 = 0//cMidleCoil[2] &= ~0x200
  386. #define CLRY012() Y12 = 0//cMidleCoil[2] &= ~0x400
  387. #define CLRY013() Y13 = 0//cMidleCoil[2] &= ~0x800
  388. #define CLRY014() Y14 = 0//cMidleCoil[2] &= ~0x1000
  389. #define CLRY015() Y15 = 0//cMidleCoil[2] &= ~0x2000
  390. #define CLRY016() Y20 = 0//cMidleCoil[2] &= ~0x1000
  391. #define CLRY017() Y21 = 0//cMidleCoil[2] &= ~0x2000
  392. #define CLRY020() Y22 = 0//cMidleCoil[2] &= ~0x100
  393. #define CLRY021() Y23 = 0//cMidleCoil[2] &= ~0x200
  394. #define CLRY022() Y24 = 0//cMidleCoil[2] &= ~0x400
  395. #define CLRY023() Y25 = 0//cMidleCoil[2] &= ~0x800
  396. #define CLRY024() Y26 = 0//cMidleCoil[2] &= ~0x1000
  397. #define CLRY025() Y27 = 0//cMidleCoil[2] &= ~0x2000
  398. #define CLRY026() Y30 = 0//cMidleCoil[2] &= ~0x1000
  399. #define CLRY027() Y31 = 0//cMidleCoil[2] &= ~0x2000
  400. #define SETY00() Y00 = 1//cMidleCoil[2] |= 0x1
  401. #define SETY01() Y01 = 1//cMidleCoil[2] |= 0x2
  402. #define SETY02() Y02 = 1//cMidleCoil[2] |= 0x4
  403. #define SETY03() Y03 = 1//cMidleCoil[2] |= 0x8
  404. #define SETY04() Y04 = 1//cMidleCoil[2] |= 0x10
  405. #define SETY05() Y05 = 1//cMidleCoil[2] |= 0x20
  406. #define SETY06() Y06 = 1//cMidleCoil[2] |= 0x40
  407. #define SETY07() Y07 = 1//cMidleCoil[2] |= 0x80
  408. #define SETY10() Y10 = 1//cMidleCoil[2] |= 0x100
  409. #define SETY11() Y11 = 1//cMidleCoil[2] |= 0x200
  410. #define SETY12() Y12 = 1//cMidleCoil[2] |= 0x400
  411. #define SETY13() Y13 = 1//cMidleCoil[2] |= 0x800
  412. #define SETY14() Y14 = 1//cMidleCoil[2] |= 0x1000
  413. #define SETY15() Y15 = 1//cMidleCoil[2] |= 0x2000
  414. #define SETY16() Y20 = 1//cMidleCoil[2] |= 0x2000
  415. #define SETY017() Y21 = 1//cMidleCoil[2] |= 0x2000
  416. #define CLRY00() Y00 = 0//cMidleCoil[2] &= ~0x1
  417. #define CLRY01() Y01 = 0//cMidleCoil[2] &= ~0x2
  418. #define CLRY02() Y02 = 0//cMidleCoil[2] &= ~0x4
  419. #define CLRY03() Y03 = 0//cMidleCoil[2] &= ~0x8
  420. #define CLRY04() Y04 = 0//cMidleCoil[2] &= ~0x10
  421. #define CLRY05() Y05 = 0//cMidleCoil[2] &= ~0x20
  422. #define CLRY06() Y06 = 0//cMidleCoil[2] &= ~0x40
  423. #define CLRY07() Y07 = 0//cMidleCoil[2] &= ~0x80
  424. #define CLRY10() Y10 = 0//cMidleCoil[2] &= ~0x100
  425. #define CLRY11() Y11 = 0//cMidleCoil[2] &= ~0x200
  426. #define CLRY12() Y12 = 0//cMidleCoil[2] &= ~0x400
  427. #define CLRY13() Y13 = 0//cMidleCoil[2] &= ~0x800
  428. #define CLRY14() Y14 = 0//cMidleCoil[2] &= ~0x1000
  429. #define CLRY15() Y15 = 0//cMidleCoil[2] &= ~0x2000
  430. #define CLRY16() Y20 = 0//cMidleCoil[2] &= ~0x2000
  431. #define CLRY017() Y21 = 0//cMidleCoil[2] &= ~0x2000
  432. #define X000 X00
  433. #define X001 X01
  434. #define X002 X02
  435. #define X003 X03
  436. #define X004 X04
  437. #define X005 X05
  438. #if (FANG_KUAI_JI_CONFIG)
  439. #define X006 X30
  440. #define X007 X31
  441. #define X010 X32
  442. #define X011 X33
  443. #else
  444. #define X006 X06
  445. #define X007 X07
  446. #define X010 X10
  447. #define X011 X11
  448. #endif
  449. #define X012 X12
  450. #define X013 X13
  451. #define X014 X14
  452. #define X015 X15
  453. #define X016 X16
  454. #define X017 X17
  455. #define X020 X20
  456. #if (FANG_KUAI_JI_CONFIG)
  457. #define X021 X06
  458. #define X022 X07
  459. #define X023 X10
  460. #define X024 X11
  461. #else
  462. #define X021 X30
  463. #define X022 X31
  464. #define X023 X32
  465. #define X024 X33
  466. #endif
  467. #define X025 X34
  468. #define X026 X35
  469. #define X027 X36
  470. #define Y000 Y00
  471. #define Y001 Y01
  472. #define Y002 Y02
  473. #define Y003 Y03
  474. #if (FANG_KUAI_JI_CONFIG)
  475. #define Y004 Y04Flg//Y04
  476. #define Y005 Y05Flg// Y05
  477. #define Y006 Y06Flg
  478. #define Y007 Y07Flg//Y07
  479. #else
  480. #define Y004 Y04//Y04
  481. #define Y005 Y05// Y05
  482. #define Y006 Y06
  483. #define Y007 Y07//Y07
  484. #endif
  485. #define Y010 Y10
  486. #define Y011 Y11
  487. #define Y012 Y12
  488. #define Y013 Y13
  489. #define Y014 Y14
  490. #define Y015 Y15
  491. #define Y016 Y20
  492. #define Y017 Y21
  493. #define Y020 Y22
  494. #define Y021 Y23
  495. #define Y022 Y24
  496. #define Y023 Y25
  497. #define Y024 Y26
  498. #define Y025 Y27
  499. #define SETDR() SetEn(X_AXIS,1) //步进电机松
  500. #define CLRDR() SetEn(X_AXIS,0) //步进电机锁轴
  501. //输入输出警告
  502. #define ERY00 32
  503. #define ERY01 33
  504. #define ERY02 34
  505. #define ERY03 35
  506. #define ERY04 36
  507. #define ERY05 37
  508. #define ERY06 38
  509. #define ERY07 39
  510. #define ERY10 40
  511. #define ERY11 41
  512. #define ERY12 42
  513. #define ERY13 43
  514. #define ERY14 44
  515. #define ERY15 45
  516. #define ERY16 46
  517. #define ERY017 47
  518. #define ERX00 48
  519. #define ERX01 49
  520. #define ERX02 50
  521. #define ERX03 51
  522. #define ERX04 52
  523. #define ERX05 53
  524. #define ERX06 54
  525. #define ERX07 55
  526. #define ERX10 56
  527. #define ERX11 57
  528. #define ERX12 58
  529. #define ERX13 59
  530. #define ERX14 60
  531. #define ERX15 61
  532. #define ERX16 62
  533. #define ERX17 63
  534. #define ERX20 64
  535. #define ERX21 65
  536. #define ERX22 66
  537. #define ERX23 67
  538. #define ERX24 68
  539. #define ERX25 69
  540. #define ERX26 70
  541. #define ERX27 71
  542. #define InPage 6
  543. #define OutPage 7
  544. #define ActionPage 11
  545. #endif
  546. #endif