Action.h 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647
  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. #define JIAO_YA_DIN_CUN 1
  129. #define CHU_CHI_JI 2
  130. #define JIAO_YA_CHU_CHI 3
  131. #define MXC_NILONG 4
  132. #define BK_QIE_DUAN_JI 5 //闭口切断机
  133. #define CHUAN_TOU_QIE_DUAN_JI 6
  134. #define KE_LI_JI 7
  135. #define TIE_BU_JI 8
  136. #define GONG_ZHI_MA 9
  137. #define JIN_SHU_DIN_CUN 10
  138. #define CHUAN_TOU_JI 11 //侧送穿头机
  139. #define JIN_SHU_KLSZ_JI 12
  140. #define HE_LIAN_JI 13
  141. #define FANG_KUAI_CHA_XIAO_JI 14
  142. #define CHUANTOU_HELIAN_JI 15 //穿头合链
  143. #define QIE_DUAN_NEWSTR 16 //切断机开闭一体
  144. #define SK_QIE_DUAN_JI 17 //双开切断机
  145. #define KK_QIE_DUAN_JI 18 //开口切断机
  146. #define CS_CHUAN_TOU_JI 19 //侧送穿头机
  147. #define QIE_DUAN_JI_JIUJIQI 20 //切断机旧机器
  148. /*************************/
  149. //厂家配置
  150. #define HAI_HUA_MACHINE (0) // 海华拉链
  151. #define JIN_HONG_MACHINE (0) // 锦泓拉链
  152. #define HONG_YE_MACHINE (0) // 宏业拉链
  153. #define FU_XIAO_WEI_MACHINE (0) // 付小伟
  154. #define CHANG_SHENG_GEI_LI_MACHINE (1) // 昌盛给力拉链
  155. #define YOU_GUAN_MACHINE (0) // 福建优冠拉链
  156. #define ZHEN_YU_MACHINE (0) // 振宇拉链
  157. #define JUN_TENG_MACHINE (0) // 南通骏腾拉链
  158. #define JIA_CHENG_WEI_YE_MACHINE (0) // 嘉成伟业拉链
  159. #define XIN_SHENG_MACHINE (0) // 欣盛拉链
  160. #define WEI_YUAN_SONG_MACHINE (0) //魏远松东城协力,王志文树脂定寸
  161. #define PENG_WEI_CHANG_MACHINE (0) //彭伟昌
  162. #define XIN_YE_MACHINE (0) //鑫业(舜业)拉链机械
  163. #define XI_DONG_MACHINE (0) //陈锡冬拉链机械
  164. #define JU_XING_MACHINE (0) //湖北汉川聚星拉链机械
  165. #define YU_WEN_XUAN_MACHINE (0) //宇文轩拉链机械
  166. #define TONG_YONG_MACHINE (0) //厂家通用机型 浙江温州王永贴布机,浙江湖州织里优诚开口切断机,聚星贴布机 温州鸿门定制机
  167. #define FJ_YING_XING_MACHINE (0) //福建盈兴拉链机械
  168. #define BRUCE_MACHINE (0) //布鲁斯打褶机
  169. #define JIN_LONG_MACHINE (0) //温州金龙拉链
  170. #define CHUAN_CHI_MACHINE (0) //福建传驰拉链机械
  171. //板脉冲方式定义
  172. #define SET_PULSE_TYPE cSetPulseType
  173. #define X_AXIS_PULSE_Y_ON (X_AXIS_PULSE_ENABLE | Y_ON_ENABLE) //X轴脉冲Y轴当使能
  174. #define X_AXIS_PULSE_Y_DIR (X_AXIS_PULSE_ENABLE | Y_DIR_ENABLE) //X轴脉冲Y轴当方向
  175. #define Y_AXIS_PULSE_X_ON (Y_AXIS_PULSE_ENABLE | X_ON_ENABLE) //Y轴脉冲X轴当使能
  176. #define Y_AXIS_PULSE_X_DIR (Y_AXIS_PULSE_ENABLE | X_DIR_ENABLE) //Y轴脉冲X轴当方向
  177. #define XY_AXIS_ON (X_ON_ENABLE | Y_ON_ENABLE) //XY轴都当使能
  178. #define XY_AXIS_PULSE (X_AXIS_PULSE_ENABLE | Y_AXIS_PULSE_ENABLE) //XY轴脉冲两个当脉冲
  179. //轴方向类型选择
  180. #define SET_XDIR_TYPE cSetXdirType
  181. #define SET_YDIR_TYPE cSetYdirType
  182. #define SET_XDIR_CH cSetXdirCh
  183. #define SET_YDIR_CH cSetYdirCh
  184. //方向输出类型分为脉冲和Y输出和不使用三种
  185. #define PULSE_OUTPUT_TYPE 0
  186. #define Y_OUTPUT_TYPE 1
  187. #define NO_USE_TYPE 2
  188. //数据保存区域用于保存故障信息等数据不含备份功能
  189. //保存在芯片FLASH的最后一段存储区
  190. #define SAVE_MESSAGE_SIZE 30 // 故障信息保存大小 单位k
  191. #define SAVE_MESSAGE_DATA_SIZE (2048 * SAVE_MESSAGE_SIZE / 2)
  192. #define SAVE_MESSAGE_START_ADDR (127 - (SAVE_MESSAGE_SIZE / 2 - 1)) * 2048
  193. #define ONE_MESSAGE_SIZE_WORD 10
  194. #define SAV_MESSAGE_USER_DATAS_START_ADDR 1000
  195. #define ALARM_MESSAGE_CMD user_datas[SAV_MESSAGE_USER_DATAS_START_ADDR+2]
  196. #define CMD_READ_MESSAGE 1
  197. #define CMD_READ_ALARM_MESSAGE 2
  198. #if (TONG_YONG_MACHINE | ZHEN_YU_MACHINE | YU_WEN_XUAN_MACHINE | XIN_YE_MACHINE)
  199. #define DWORD (unsigned long)
  200. #define M00 M0000
  201. #define M01 M0001
  202. #define M02 M0002
  203. #define M03 M0003
  204. #define M04 M0004
  205. #define M05 M0005
  206. #define M06 M0006
  207. #define M07 M0007
  208. #define M08 M0008
  209. #define M09 M0009
  210. #define M0 M0000
  211. #define M1 M0001
  212. #define M2 M0002
  213. #define M3 M0003
  214. #define M4 M0004
  215. #define M5 M0005
  216. #define M6 M0006
  217. #define M7 M0007
  218. #define M8 M0008
  219. #define M9 M0009
  220. #define M10 M0010
  221. #define M11 M0011
  222. #define M12 M0012
  223. #define M13 M0013
  224. #define M14 M0014
  225. #define M15 M0015
  226. #define M16 M0016
  227. #define M17 M0017
  228. #define M18 M0018
  229. #define M19 M0019
  230. #define M20 M0020
  231. #define M21 M0021
  232. #define M22 M0022
  233. #define M23 M0023
  234. #define M24 M0024
  235. #define M25 M0025
  236. #define M26 M0026
  237. #define M27 M0027
  238. #define M28 M0028
  239. #define M29 M0029
  240. #define M30 M0030
  241. #define M31 M0031
  242. #define M32 M0032
  243. #define M33 M0033
  244. #define M34 M0034
  245. #define M35 M0035
  246. #define M36 M0036
  247. #define X00_UP (X00 && !OLDX00)
  248. #define X01_UP (X01 && !OLDX01)
  249. #define X02_UP (X02 && !OLDX02)
  250. #define X03_UP (X03 && !OLDX03)
  251. #define X04_UP (X04 && !OLDX04)
  252. #define X05_UP (X05 && !OLDX05)
  253. #if (FANG_KUAI_JI_CONFIG)
  254. #define X006 (X30)
  255. #define X007 (X31)
  256. #define X010 (X32)
  257. #define X011 (X33)
  258. #define X06_UP (X30 && !OLDX30)
  259. #define X07_UP (X31 && !OLDX31)
  260. #define X10_UP (X32 && !OLDX32)
  261. #define X11_UP (X33 && !OLDX33)
  262. #else
  263. #define X06_UP (X06 && !OLDX06)
  264. #define X07_UP (X07 && !OLDX07)
  265. #define X10_UP (X10 && !OLDX10)
  266. #define X11_UP (X11 && !OLDX11)
  267. #endif
  268. #define X12_UP (X12 && !OLDX12)
  269. #define X13_UP (X13 && !OLDX13)
  270. #define X14_UP (X14 && !OLDX14)
  271. #define X15_UP (X15 && !OLDX15)
  272. #define X16_UP (X16 && !OLDX16)
  273. #define X17_UP (X17 && !OLDX17)
  274. #define X20_UP (X20 && !OLDX20)
  275. #if (FANG_KUAI_JI_CONFIG)
  276. #define X21_UP (X06 && !OLDX06)
  277. #define X22_UP (X07 && !OLDX07)
  278. #define X23_UP (X10 && !OLDX10)
  279. #define X24_UP (X11 && !OLDX11)
  280. #else
  281. //#define X21_UP (X30 && !OLDX30)
  282. #define X22_UP (X31 && !OLDX31)
  283. #define X23_UP (X32 && !OLDX32)
  284. #define X24_UP (X33 && !OLDX33)
  285. #endif
  286. #define X25_UP (X34 && !OLDX34)
  287. #define X26_UP (X35 && !OLDX35)
  288. #define X27_UP (X36 && !OLDX36)
  289. #define X00_DW (!X00 && OLDX00)
  290. #define X01_DW (!X01 && OLDX01)
  291. #define X02_DW (!X02 && OLDX02)
  292. #define X03_DW (!X03 && OLDX03)
  293. #define X04_DW (!X04 && OLDX04)
  294. #define X05_DW (!X05 && OLDX05)
  295. #if (FANG_KUAI_JI_CONFIG)
  296. #define X06_DW (!X30 && OLDX30)
  297. #define X07_DW (!X31 && OLDX31)
  298. #define X10_DW (!X32 && OLDX32)
  299. #define X11_DW (!X33 && OLDX33)
  300. #else
  301. #define X06_DW (!X06 && OLDX06)
  302. #define X07_DW (!X07 && OLDX07)
  303. #define X10_DW (!X10 && OLDX10)
  304. #define X11_DW (!X11 && OLDX11)
  305. #endif
  306. #define X12_DW (!X12 && OLDX12)
  307. #define X13_DW (!X13 && OLDX13)
  308. #define X14_DW (!X14 && OLDX14)
  309. #define X15_DW (!X15 && OLDX15)
  310. #define X16_DW (!X16 && OLDX16)
  311. #define X17_DW (!X17 && OLDX17)
  312. #define X20_DW (!X20 && OLDX20)
  313. #if (FANG_KUAI_JI_CONFIG)
  314. #define X21_DW (!X06 && OLDX06)
  315. #define X22_DW (!X07 && OLDX07)
  316. #define X23_DW (!X10 && OLDX10)
  317. #define X24_DW (!X11 && OLDX11)
  318. #else
  319. //#define X21_DW (!X30 && OLDX30)
  320. #define X22_DW (!X31 && OLDX31)
  321. #define X23_DW (!X32 && OLDX32)
  322. #define X24_DW (!X33 && OLDX33)
  323. #endif
  324. #define X25_DW (!X34 && OLDX34)
  325. #define X26_DW (!X35 && OLDX35)
  326. #define X27_DW (!X36 && OLDX36)
  327. #define SETQ00 Y00 = 1//cMidleCoil[2] |= 0x1
  328. #define SETQ01 Y01 = 1//cMidleCoil[2] |= 0x2
  329. #define SETQ02 Y02 = 1//cMidleCoil[2] |= 0x4
  330. #define SETQ03 Y03 = 1//cMidleCoil[2] |= 0x8
  331. #if (FANG_KUAI_JI_CONFIG)
  332. #define SETQ04 Y04Flg = 1//Y04 = 1//cMidleCoil[2] |= 0x10
  333. #define SETQ05 Y05Flg = 1//cMidleCoil[2] |= 0x20
  334. #define SETQ06 Y06Flg = 1//cMidleCoil[2] |= 0x40
  335. #define SETQ07 Y07Flg = 1//SETQ07 Y07 = 1//cMidleCoil[2] |= 0x80
  336. #else
  337. #define SETQ04 Y04 = 1//Y04 = 1//cMidleCoil[2] |= 0x10
  338. #define SETQ05 Y05 = 1//cMidleCoil[2] |= 0x20
  339. #define SETQ06 Y06 = 1//cMidleCoil[2] |= 0x40
  340. #define SETQ07 Y07 = 1//SETQ07 Y07 = 1//cMidleCoil[2] |= 0x80
  341. #endif
  342. #define SETQ10 Y10 = 1//cMidleCoil[2] |= 0x100
  343. #define SETQ11 Y11 = 1//cMidleCoil[2] |= 0x200
  344. #define SETQ12 Y12 = 1//cMidleCoil[2] |= 0x400
  345. #define SETQ13 Y13 = 1//cMidleCoil[2] |= 0x800
  346. #define SETQ14 Y14 = 1//cMidleCoil[2] |= 0x1000
  347. #define SETQ15 Y15 = 1//cMidleCoil[2] |= 0x2000
  348. #define SETQ16 Y20 = 1//cMidleCoil[2] |= 0x2000
  349. #define SETQ17 Y21 = 1//cMidleCoil[2] |= 0x2000
  350. #define CLRQ00 Y00 = 0//cMidleCoil[2] &= ~0x1
  351. #define CLRQ01 Y01 = 0//cMidleCoil[2] &= ~0x2
  352. #define CLRQ02 Y02 = 0//cMidleCoil[2] &= ~0x4
  353. #define CLRQ03 Y03 = 0//cMidleCoil[2] &= ~0x8
  354. #if (FANG_KUAI_JI_CONFIG)
  355. #define CLRQ04 Y04Flg = 0//cMidleCoil[2] &= ~0x10
  356. #define CLRQ05 Y05Flg = 0//cMidleCoil[2] &= ~0x20
  357. #define CLRQ06 Y06Flg = 0//cMidleCoil[2] &= ~0x40
  358. #define CLRQ07 Y07Flg = 0//cMidleCoil[2] &= ~0x80
  359. #else
  360. #define CLRQ04 Y04 = 0//cMidleCoil[2] &= ~0x10
  361. #define CLRQ05 Y05 = 0//cMidleCoil[2] &= ~0x20
  362. #define CLRQ06 Y06 = 0//cMidleCoil[2] &= ~0x40
  363. #define CLRQ07 Y07 = 0//cMidleCoil[2] &= ~0x80
  364. #endif
  365. #define CLRQ10 Y10 = 0//cMidleCoil[2] &= ~0x100
  366. #define CLRQ11 Y11 = 0//cMidleCoil[2] &= ~0x200
  367. #define CLRQ12 Y12 = 0//cMidleCoil[2] &= ~0x400
  368. #define CLRQ13 Y13 = 0//cMidleCoil[2] &= ~0x800
  369. #define CLRQ14 Y14 = 0//cMidleCoil[2] &= ~0x1000
  370. #define CLRQ15 Y15 = 0//cMidleCoil[2] &= ~0x2000
  371. #define CLRQ16 Y20 = 0//cMidleCoil[2] &= ~0x2000
  372. #define CLRQ17 Y21 = 0//cMidleCoil[2] &= ~0x2000
  373. #define SETY000() Y00 = 1//cMidleCoil[2] |= 0x1
  374. #define SETY001() Y01 = 1//cMidleCoil[2] |= 0x2
  375. #define SETY002() Y02 = 1//cMidleCoil[2] |= 0x4
  376. #define SETY003() Y03 = 1//cMidleCoil[2] |= 0x8
  377. #define SETY004() Y04 = 1//cMidleCoil[2] |= 0x10
  378. #define SETY005() Y05 = 1//cMidleCoil[2] |= 0x20
  379. #define SETY006() Y06 = 1//cMidleCoil[2] |= 0x40
  380. #define SETY007() Y07 = 1//cMidleCoil[2] |= 0x80
  381. #define SETY010() Y10 = 1//cMidleCoil[2] |= 0x100
  382. #define SETY011() Y11 = 1//cMidleCoil[2] |= 0x200
  383. #define SETY012() Y12 = 1//cMidleCoil[2] |= 0x400
  384. #define SETY013() Y13 = 1//cMidleCoil[2] |= 0x800
  385. #define SETY014() Y14 = 1//cMidleCoil[2] |= 0x1000
  386. #define SETY015() Y15 = 1//cMidleCoil[2] |= 0x2000
  387. #define SETY016() Y20 = 1//cMidleCoil[2] |= 0x1000
  388. #define SETY017() Y21 = 1//cMidleCoil[2] |= 0x2000
  389. #define SETY020() Y22 = 1//cMidleCoil[2] |= 0x100
  390. #define SETY021() Y23 = 1//cMidleCoil[2] |= 0x200
  391. #define SETY022() Y24 = 1//cMidleCoil[2] |= 0x400
  392. #define SETY023() Y25 = 1//cMidleCoil[2] |= 0x800
  393. #define SETY024() Y26 = 1//cMidleCoil[2] |= 0x1000
  394. #define SETY025() Y27 = 1//cMidleCoil[2] |= 0x2000
  395. #define SETY026() Y30 = 1//cMidleCoil[2] |= 0x1000
  396. #define SETY027() Y31 = 1//cMidleCoil[2] |= 0x2000
  397. #define CLRY000() Y00 = 0//cMidleCoil[2] &= ~0x1
  398. #define CLRY001() Y01 = 0//cMidleCoil[2] &= ~0x2
  399. #define CLRY002() Y02 = 0//cMidleCoil[2] &= ~0x4
  400. #define CLRY003() Y03 = 0//cMidleCoil[2] &= ~0x8
  401. #define CLRY004() Y04 = 0//cMidleCoil[2] &= ~0x10
  402. #define CLRY005() Y05 = 0//cMidleCoil[2] &= ~0x20
  403. #define CLRY006() Y06 = 0//cMidleCoil[2] &= ~0x40
  404. #define CLRY007() Y07 = 0//cMidleCoil[2] &= ~0x80
  405. #define CLRY010() Y10 = 0//cMidleCoil[2] &= ~0x100
  406. #define CLRY011() Y11 = 0//cMidleCoil[2] &= ~0x200
  407. #define CLRY012() Y12 = 0//cMidleCoil[2] &= ~0x400
  408. #define CLRY013() Y13 = 0//cMidleCoil[2] &= ~0x800
  409. #define CLRY014() Y14 = 0//cMidleCoil[2] &= ~0x1000
  410. #define CLRY015() Y15 = 0//cMidleCoil[2] &= ~0x2000
  411. #define CLRY016() Y20 = 0//cMidleCoil[2] &= ~0x1000
  412. #define CLRY017() Y21 = 0//cMidleCoil[2] &= ~0x2000
  413. #define CLRY020() Y22 = 0//cMidleCoil[2] &= ~0x100
  414. #define CLRY021() Y23 = 0//cMidleCoil[2] &= ~0x200
  415. #define CLRY022() Y24 = 0//cMidleCoil[2] &= ~0x400
  416. #define CLRY023() Y25 = 0//cMidleCoil[2] &= ~0x800
  417. #define CLRY024() Y26 = 0//cMidleCoil[2] &= ~0x1000
  418. #define CLRY025() Y27 = 0//cMidleCoil[2] &= ~0x2000
  419. #define CLRY026() Y30 = 0//cMidleCoil[2] &= ~0x1000
  420. #define CLRY027() Y31 = 0//cMidleCoil[2] &= ~0x2000
  421. #define SETY00() Y00 = 1//cMidleCoil[2] |= 0x1
  422. #define SETY01() Y01 = 1//cMidleCoil[2] |= 0x2
  423. #define SETY02() Y02 = 1//cMidleCoil[2] |= 0x4
  424. #define SETY03() Y03 = 1//cMidleCoil[2] |= 0x8
  425. #define SETY04() Y04 = 1//cMidleCoil[2] |= 0x10
  426. #define SETY05() Y05 = 1//cMidleCoil[2] |= 0x20
  427. #define SETY06() Y06 = 1//cMidleCoil[2] |= 0x40
  428. #define SETY07() Y07 = 1//cMidleCoil[2] |= 0x80
  429. #define SETY10() Y10 = 1//cMidleCoil[2] |= 0x100
  430. #define SETY11() Y11 = 1//cMidleCoil[2] |= 0x200
  431. #define SETY12() Y12 = 1//cMidleCoil[2] |= 0x400
  432. #define SETY13() Y13 = 1//cMidleCoil[2] |= 0x800
  433. #define SETY14() Y14 = 1//cMidleCoil[2] |= 0x1000
  434. #define SETY15() Y15 = 1//cMidleCoil[2] |= 0x2000
  435. #define SETY16() Y20 = 1//cMidleCoil[2] |= 0x2000
  436. #define SETY017() Y21 = 1//cMidleCoil[2] |= 0x2000
  437. #define CLRY00() Y00 = 0//cMidleCoil[2] &= ~0x1
  438. #define CLRY01() Y01 = 0//cMidleCoil[2] &= ~0x2
  439. #define CLRY02() Y02 = 0//cMidleCoil[2] &= ~0x4
  440. #define CLRY03() Y03 = 0//cMidleCoil[2] &= ~0x8
  441. #define CLRY04() Y04 = 0//cMidleCoil[2] &= ~0x10
  442. #define CLRY05() Y05 = 0//cMidleCoil[2] &= ~0x20
  443. #define CLRY06() Y06 = 0//cMidleCoil[2] &= ~0x40
  444. #define CLRY07() Y07 = 0//cMidleCoil[2] &= ~0x80
  445. #define CLRY10() Y10 = 0//cMidleCoil[2] &= ~0x100
  446. #define CLRY11() Y11 = 0//cMidleCoil[2] &= ~0x200
  447. #define CLRY12() Y12 = 0//cMidleCoil[2] &= ~0x400
  448. #define CLRY13() Y13 = 0//cMidleCoil[2] &= ~0x800
  449. #define CLRY14() Y14 = 0//cMidleCoil[2] &= ~0x1000
  450. #define CLRY15() Y15 = 0//cMidleCoil[2] &= ~0x2000
  451. #define CLRY16() Y20 = 0//cMidleCoil[2] &= ~0x2000
  452. #define CLRY017() Y21 = 0//cMidleCoil[2] &= ~0x2000
  453. #define X000 X00
  454. #define X001 X01
  455. #define X002 X02
  456. #define X003 X03
  457. #define X004 X04
  458. #define X005 X05
  459. #if (FANG_KUAI_JI_CONFIG)
  460. #define X006 X30
  461. #define X007 X31
  462. #define X010 X32
  463. #define X011 X33
  464. #else
  465. #define X006 X06
  466. #define X007 X07
  467. #define X010 X10
  468. #define X011 X11
  469. #endif
  470. #define X012 X12
  471. #define X013 X13
  472. #define X014 X14
  473. #define X015 X15
  474. #define X016 X16
  475. #define X017 X17
  476. #define X020 X20
  477. #if (FANG_KUAI_JI_CONFIG)
  478. #define X021 X06
  479. #define X022 X07
  480. #define X023 X10
  481. #define X024 X11
  482. #else
  483. #define X021 X30
  484. #define X022 X31
  485. #define X023 X32
  486. #define X024 X33
  487. #endif
  488. #define X025 X34
  489. #define X026 X35
  490. #define X027 X36
  491. #define Y000 Y00
  492. #define Y001 Y01
  493. #define Y002 Y02
  494. #define Y003 Y03
  495. #if (FANG_KUAI_JI_CONFIG)
  496. #define Y004 Y04Flg//Y04
  497. #define Y005 Y05Flg// Y05
  498. #define Y006 Y06Flg
  499. #define Y007 Y07Flg//Y07
  500. #else
  501. #define Y004 Y04//Y04
  502. #define Y005 Y05// Y05
  503. #define Y006 Y06
  504. #define Y007 Y07//Y07
  505. #endif
  506. #define Y010 Y10
  507. #define Y011 Y11
  508. #define Y012 Y12
  509. #define Y013 Y13
  510. #define Y014 Y14
  511. #define Y015 Y15
  512. #define Y016 Y20
  513. #define Y017 Y21
  514. #define Y020 Y22
  515. #define Y021 Y23
  516. #define Y022 Y24
  517. #define Y023 Y25
  518. #define Y024 Y26
  519. #define Y025 Y27
  520. #define SETDR() SetEn(X_AXIS,1) //步进电机松
  521. #define CLRDR() SetEn(X_AXIS,0) //步进电机锁轴
  522. //输入输出警告
  523. #define ERY00 32
  524. #define ERY01 33
  525. #define ERY02 34
  526. #define ERY03 35
  527. #define ERY04 36
  528. #define ERY05 37
  529. #define ERY06 38
  530. #define ERY07 39
  531. #define ERY10 40
  532. #define ERY11 41
  533. #define ERY12 42
  534. #define ERY13 43
  535. #define ERY14 44
  536. #define ERY15 45
  537. #define ERY16 46
  538. #define ERY017 47
  539. #define ERX00 48
  540. #define ERX01 49
  541. #define ERX02 50
  542. #define ERX03 51
  543. #define ERX04 52
  544. #define ERX05 53
  545. #define ERX06 54
  546. #define ERX07 55
  547. #define ERX10 56
  548. #define ERX11 57
  549. #define ERX12 58
  550. #define ERX13 59
  551. #define ERX14 60
  552. #define ERX15 61
  553. #define ERX16 62
  554. #define ERX17 63
  555. #define ERX20 64
  556. #define ERX21 65
  557. #define ERX22 66
  558. #define ERX23 67
  559. #define ERX24 68
  560. #define ERX25 69
  561. #define ERX26 70
  562. #define ERX27 71
  563. #define InPage 6
  564. #define OutPage 7
  565. #define ActionPage 11
  566. #endif
  567. #endif