JHNiLongShangChiJi.h 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. #ifndef __JHNILONGSHANGCHIJI_H__
  2. #define __JHNILONGSHANGCHIJI_H__
  3. #if JIN_HONG_MACHINE==1
  4. /*
  5. * 警告类型 警告编号
  6. */
  7. #define SC_NO_ALARM 0 /* 没警告*/
  8. #define SC_NO_ZIPPER_ALARM 1 /* 没拉链,自动停机*/
  9. #define SC_CHENGXING_IN_ALARM 2 //成型到位感应异常
  10. #define SC_GOUZHEN_IN_ALARM 3 // 钩针未到位
  11. #define SC_GOUZHEN_ON_ALARM 4 //钩针输出 原点不到位
  12. #define SC_YADAI_IN_ALARM 5 // 压带未到位
  13. #define SC_LATOU_CHECK_ALARM 6 // 实际拉头比预设拉头少
  14. #define SC_ERROR_LENGTH_ALARM 7 // 拉链长度保护
  15. #define SC_XIAYA_IN_ALARM 8 // 下压不到位
  16. #define SC_CHENGXING_ORIGIN_ALARM 9 // 成型原点感应异常
  17. #define SC_LATOU_IN_ALARM 10 // 拉头感应异常
  18. #define SC_GOUZHEN_BCAK_ALARM 11 // 拉头感应异常
  19. #define SC_DIR_P 1
  20. #define SC_DIR_N 0
  21. #define SC_Y_DIR_P 1
  22. #define SC_Y_DIR_N 0
  23. #define SC_MOTOR_DISEN 1
  24. #define SC_MOTOR_EN 0
  25. #define SC_AutoDelay cDelayTime1
  26. #define SC_MotorDelay cDelayTime2
  27. #define SC_FengDaiDelay cDelayTime3
  28. #define SC_SongSiDelay cDelayTime4
  29. #define SC_QieDuanDelay cDelayTime5
  30. #define SC_XiaChongDelay cDelayTime6
  31. #define SC_AutoStep cStepMByte //自动动作
  32. #define SC_MotorStep cStepMByte1 //电机拖带
  33. #define SC_FengDai_Step cStepMByte2
  34. #define SC_QieDuan_Step cStepMByte3
  35. //内部参数
  36. #define SC_PARAM_CYCLE_PULSE user_datas[30] //电机细分
  37. #define SC_PARAM_CYCLE_LENGTH user_datas[31] //电机周长
  38. #define VAVLE_ALARM_TIME 3000
  39. #define MOTOR_ALARM_TIME 5000
  40. #define VAVLE_ALARM_TIME_GOUZHEN 300
  41. #define SC_ALARM_ADDR 100
  42. #define SC_PARAM_ZIPPER_LENGTH_ADDR 1
  43. #define SC_WORKTOTAL_ADDR 102
  44. #define SC_TOTAL_ADDR 76
  45. #define SC_PROSPEED_ADDR 78
  46. //变量设置 unsigned char
  47. #define SC_Zipper_Length cCharBuff1
  48. #define SC_MotorDinWei_OK cCharBuff2
  49. #define SC_ZipCnt cCharBuff3
  50. #define SC_PARAM_LT_TOTAL cCharBuff4
  51. #define SC_SUOZHOU cCharBuff5
  52. #define SC_Singleone cCharBuff6
  53. #define SC_DCC_TIME_BL cCharBuff7
  54. #define SC_XIAYA cCharBuff8
  55. #define SC_FIRST_RUN cCharBuff9
  56. //long
  57. #define SC_length_buff cDword32Buff1
  58. #define SC_LT_buff cDword32Buff2
  59. //可设置参数
  60. #define SC_PARAM_ZIPPER_LENGTH (user_datas[1] | (user_datas[2] << 16)) //
  61. #define SC_PARAM_TD_TIME (user_datas[3] * 10) //时间 秒 2位小数 //延时拖带
  62. #define SC_PARAM_SHUKONG_MODE user_datas[4] //数控模式模式,0有数控模式, 1 感应模式,2智能长度模式
  63. #define SC_PARAM_FANZHUAN_MODE user_datas[5] //反转模式,1有反转, 0 没反转
  64. //#define SC_PARAM_GO_LOW_SPEED_LENGTH user_datas[6] //慢速长度
  65. #define SC_PARAM_GOUZHEN_LENGTH user_datas[8] // 数控模式提前上钩针
  66. #define SC_PARAM_GOUZHEN_GANYIN_DELAY (user_datas[9]*10) // 延时上钩针
  67. #define SC_PARAM_GO_HIGN_SPEED user_datas[10] //电机快速度
  68. #define SC_PARAM_GO_LOW_SPEED user_datas[11] //电机慢速度
  69. #define SC_PARAM_SET_LT_TOTAL user_datas[15] //拉头预设数量
  70. #define SC_PARAM_SET_LT_LENGTH user_datas[16] //拉头检测有效长度
  71. #define SC_PARAM_ChengXing_BACK_DELAY (user_datas[18]*10)//成型气缸延时返回
  72. #define SC_PARAM_FANZHUAN_LENGTH user_datas[19] //电机反转长度
  73. #define SC_PARAM_YaDai_DELAY (user_datas[20]*10)//延时压带
  74. #define SC_PARAM_START_SPEED user_datas[21] //电机开始速度
  75. #define SC_PARAM_ACC_TIME user_datas[22] //加速时间
  76. #define SC_PARAM_DEC_TIME user_datas[23] //减速时间
  77. #define SC_PARAM_ERROR_LENGTH user_datas[24] //拉链长度保护
  78. #define SC_PARAM_NOGZ_DELAY (user_datas[25]*10) //退勾针延时成型
  79. #define SC_PARAM_GYGO_HIGN_SPEED user_datas[26] //感应模式快速度
  80. #define SC_PARAM_YAJINCISHU user_datas[27] //压紧次数
  81. #define SC_PARAM_Mator_Mode user_datas[28] //电机模式
  82. #define SC_PARAM_XiaChong_BACK_DELAY (user_datas[29]*10) //压紧次数
  83. #define SC_STOP_IN M0384 //X00 //停止
  84. #define SC_STOP_IN_UP (M0384 && !OLDM384)
  85. #define SC_START_IN M0385//X01 //开始
  86. #define SC_START_IN_UP (M0385 && !OLDM385)
  87. #define SC_GZ_IN M0386//X02 //钩针到位
  88. #define SC_YADAI_IN M0387 //X03 //压带到位
  89. #define SC_TUITOU_IN M0388 //X04 //推头感应
  90. #define SC_TUITOU_IN_UP (M0388 && !OLDM388)
  91. #define SC_ChengXing_ORIGIN_IN M0389//X05 //切线原位
  92. #define SC_ChengXing_ORIGIN_IN_UP (M0389 && !OLDM389) //X05
  93. #define SC_ChengXing_ORIGIN_IN_DW (!M0389 && OLDM389)//X05
  94. #define SC_ChengXing_IN M0390// X06 //切线到位
  95. #define SC_ChengXing_IN_UP (M0390 && !OLDM390)
  96. #define SC_XIAYA_IN M0391//X07 //撞针到位
  97. #define SC_XIAYA_IN_UP (M0391 && !OLDM391) //撞针到位
  98. #define SC_GOUZHEN_ON M0392//X10 //钩位输出
  99. #define SC_GUO_LIAN_IN M0393//X11 //
  100. #define SC_GUO_LIAN_IN_UP (M0393 && !OLDM393)
  101. #define SC_GUO_LIAN_IN_DW (!M0393 && OLDM393)
  102. #define SC_SZ_OUT M0354// Y02 //松轴
  103. #define SC_GouZhen_VAVLE M0355// Y03 //钩针气缸
  104. #define SC_YaDai_VAVLE M0356//Y04 //压带气缸
  105. #define SC_ChengXing_VAVLE M0357//Y05
  106. #define SC_XiaYa_VAVLE M0358// Y06
  107. #define SC_SongSi_VAVLE M0359// Y07 //送丝气缸
  108. #define SC_DianGLG_VAVLE M0360// Y10 // 顶过链杆
  109. #define SC_XiaChong_VAVLE M0361// Y11 // 下冲
  110. //M0~M4全局固定使用
  111. /*
  112. #define bRunning M0000
  113. #define bStart M0001
  114. #define bStop M0002
  115. #define bAlarmStop M0003
  116. #define bClearTotal M0004
  117. */
  118. #define SC_bGouZhen M0005 //手动钩针
  119. #define SC_bYaDai M0006 //手动压带
  120. #define SC_bXiaYa M0007 //手动上模
  121. #define SC_bChengXing M0008 //手动成型
  122. #define SC_bSongSi M0009 //手动送丝
  123. #define SC_bTuoDai M0010 //手动拖带
  124. #define SC_bSingleone M0011 //单循环
  125. #define SC_bXiaChong M0012 //下冲
  126. #endif
  127. #endif