123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255 |
- #ifndef __ACTION_H__
- #define __ACTION_H__
- extern unsigned long cMachineType;
- extern unsigned long cScreenEnable;
- extern unsigned long cWifiEnable;
- extern unsigned short cSetPulseType;
- extern unsigned char JYDCRunFlg,CCJRunFlg;
- extern byte_bits_t cRunState,cRunState1,cRunState2,cRunState3,cRunState4,cRunState5,cRunState6,cRunState7;
- extern byte_bits_t cTimeState;
- //动作步就量
- extern unsigned short cStepMByte,cStepMByte1,cStepMByte2,cStepMByte3,cStepMByte4,cStepMByte5,
- cStepMByte6,cStepMByte7,cStepMByte8,cStepMByte9,cStepMByte10,cStepMByte11,cStepMByte12,
- cStepMByte13,cStepMByte14,cStepMByte15,cStepMByte16,cStepMByte17,cStepMByte18,cStepMByte19,
- cStepMByte20,cStepMByte21,cStepMByte22,cStepMByte23,cStepMByte24,cStepMByte25,cStepMByte26;
- //定时器
- extern unsigned long cDelayTime1,cDelayTime2,cDelayTime3,cDelayTime4,cDelayTime5,cDelayTime6,
- cDelayTime7,cDelayTime8,cDelayTime9,cDelayTime10,cDelayTime11,cDelayTime12,cDelayTime13,cDelayTime14,
- cDelayTime15,cDelayTime16,cDelayTime17,cDelayTime18,cDelayTime19,cDelayTime20,cDelayTime21,cDelayTime22,
- cDelayTime23,cDelayTime24,cDelayTime25,cDelayTime26,cDelayTime27,cDelayTime28,cDelayTime29,cDelayTime30,
- cDelayTime31,cDelayTime32,cDelayTime33,cDelayTime34,cDelayTime35;
- //8位变量
- extern unsigned char cCharBuff1,cCharBuff2,cCharBuff3,cCharBuff4,cCharBuff5,cCharBuff6,cCharBuff7,cCharBuff8,
- cCharBuff9,cCharBuff10,cCharBuff11,cCharBuff12,cCharBuff13,cCharBuff14,cCharBuff15,
- cCharBuff16,cCharBuff17,cCharBuff18,cCharBuff19,cCharBuff20,cCharBuff21,cCharBuff22,
- cCharBuff23,cCharBuff24,cCharBuff25,cCharBuff26,cCharBuff27,cCharBuff28,cCharBuff29,
- cCharBuff30,cCharBuff31,cCharBuff32,cCharBuff33,cCharBuff34,cCharBuff35,cCharBuff36,
- cCharBuff37,cCharBuff38,cCharBuff39,cCharBuff40,cCharBuff41,cCharBuff41,cCharBuff42,
- cCharBuff43,cCharBuff44,cCharBuff45,cCharBuff46,cCharBuff47,cCharBuff48,cCharBuff49,
- cCharBuff50,cCharBuff51,cCharBuff52,cCharBuff53,cCharBuff54,cCharBuff55,cCharBuff56,
- cCharBuff57,cCharBuff58,cCharBuff59,cCharBuff60;
- //16位变量
- extern unsigned short cUShort16Buff1,cUShort16Buff2,cUShort16Buff3,cUShort16Buff4,cUShort16Buff5,cUShort16Buff6,cUShort16Buff7,
- cUShort16Buff8,cUShort16Buff9,cUShort16Buff10,cUShort16Buff11,cUShort16Buff12,cUShort16Buff13,cUShort16Buff14,
- cUShort16Buff15,cUShort16Buff16,cUShort16Buff17,cUShort16Buff18,cUShort16Buff18,cUShort16Buff19,cUShort16Buff20,
- cUShort16Buff20,cUShort16Buff21,cUShort16Buff22,cUShort16Buff23,cUShort16Buff24,cUShort16Buff25,cUShort16Buff26,
- cUShort16Buff27,cUShort16Buff28,cUShort16Buff29,cUShort16Buff30,cUShort16Buff31,cUShort16Buff32,cUShort16Buff33,
- cUShort16Buff34,cUShort16Buff35,cUShort16Buff36,cUShort16Buff37,cUShort16Buff38,cUShort16Buff39,cUShort16Buff40;
- //32位变量
- extern unsigned long cUDword32Buff1,cUDword32Buff2,cUDword32Buff3,cUDword32Buff4,cUDword32Buff5,cUDword32Buff6,cUDword32Buff7,
- cUDword32Buff8,cUDword32Buff9,cUDword32Buff10,cUDword32Buff11,cUDword32Buff12,cUDword32Buff13,
- cUDword32Buff14,cUDword32Buff15;
- //有符号变量
- extern long cDword32Buff1,cDword32Buff2,cDword32Buff3,cDword32Buff4,cDword32Buff5,cDword32Buff6,cDword32Buff7,cDword32Buff8,cDword32Buff9,
- cDword32Buff10,cDword32Buff11,cDword32Buff12,cDword32Buff13,cDword32Buff14,cDword32Buff15;
- //16位指针型有符号变量
- extern short *Short16Buff1,*Short16Buff2,*Short16Buff3;
- extern long dwXRealPos,dwYRealPos,dwYRealPos_com,dwZRealPos,dwARealPos;
- extern long olddwXRealPos[5],olddwYRealPos[5];
- extern unsigned char SingOneFlg;
- extern unsigned long dwZipCnt;
- extern unsigned char cSeBiaoEn;
- extern unsigned char cSeBiaoOk;
- extern unsigned char LockMachineFlg;
- extern void InitPWM(void);
- extern void GetMachineType(void);
- extern void SetMachineType(void);
- extern void CalProSP(unsigned short addr);
- extern void AddToTal(unsigned short addr);
- extern unsigned long GetTotal(unsigned short addr);
- extern void ClrcToTal(unsigned short addr);
- extern void SetAlarmCode(unsigned short addr,unsigned short alarm_code);
- extern unsigned short GetAlarmCode(unsigned short addr);
- extern void InitAction(void);
- extern void Action(void);
- extern unsigned long CalInch(unsigned long length);
- extern unsigned long CalLengthCM(unsigned long length);
- extern void DelayAction(void);
- extern void ExtiAcitionX30(void);
- extern void ExtiAcitionX31(void);
- extern void ExtiAcitionX20(void);
- extern void SetData32bits(unsigned short addr,long source_data);
- extern unsigned long GetData32bits(unsigned short addr);
- extern void AlarmMessageSave(unsigned short alarm_addr);
- extern void ReSetWifi(void);
- extern void CheckTimeOver(void);
- extern void PWMAction(void);
- extern unsigned char Y05Flg;
- extern unsigned char Y06Flg;
- extern unsigned char Y04Flg;
- extern unsigned char Y07Flg;
- #define bShaCheRun cRunState.bits.b1
- #define bFreqChange cRunState.bits.b2
- #define bCountEn cRunState.bits.b3
- #define bClrPulse cRunState.bits.b4
- #define bTwoDK cRunState.bits.b5
- #define bDZRunning cRunState.bits.b6
- #define bDZJiaoZhunState cRunState.bits.b7
- #define bDZStart cRunState1.bits.b0
- #define bBitFlag0 cRunState2.bits.b0
- #define bBitFlag1 cRunState2.bits.b1
- #define bBitFlag2 cRunState2.bits.b2
- #define bBitFlag3 cRunState2.bits.b3
- #define bBitFlag4 cRunState2.bits.b4
- #define bBitFlag5 cRunState2.bits.b5
- #define bBitFlag6 cRunState2.bits.b6
- #define bBitFlag7 cRunState2.bits.b7
- #define bBitFlag8 cRunState3.bits.b0
- #define bBitFlag9 cRunState3.bits.b1
- #define bBitFlag10 cRunState3.bits.b2
- #define bBitFlag11 cRunState3.bits.b3
- #define bBitFlag12 cRunState3.bits.b4
- #define bBitFlag13 cRunState3.bits.b5
- #define bBitFlag14 cRunState3.bits.b6
- #define bBitFlag15 cRunState3.bits.b7
- #define bBitFlag16 cRunState4.bits.b0
- #define bBitFlag17 cRunState4.bits.b1
- #define bBitFlag18 cRunState4.bits.b2
- #define bBitFlag19 cRunState4.bits.b3
- #define bBitFlag20 cRunState4.bits.b4
- #define bBitFlag21 cRunState4.bits.b5
- #define bBitFlag22 cRunState4.bits.b6
- #define bBitFlag23 cRunState4.bits.b7
- #define bBitFlag24 cRunState5.bits.b0
- #define bBitFlag25 cRunState5.bits.b1
- #define bBitFlag26 cRunState5.bits.b2
- #define bBitFlag27 cRunState5.bits.b3
- #define bBitFlag28 cRunState5.bits.b4
- #define bBitFlag29 cRunState5.bits.b5
- #define bBitFlag30 cRunState5.bits.b6
- #define bBitFlag31 cRunState5.bits.b7
- #define bBitFlag32 cRunState6.bits.b0
- #define bBitFlag33 cRunState6.bits.b1
- #define bBitFlag34 cRunState6.bits.b2
- #define bBitFlag35 cRunState6.bits.b3
- #define bBitFlag36 cRunState6.bits.b4
- #define bBitFlag37 cRunState6.bits.b5
- #define bBitFlag38 cRunState6.bits.b6
- #define bBitFlag39 cRunState6.bits.b7
- #define bBitFlag40 cRunState7.bits.b0
- #define bBitFlag41 cRunState7.bits.b1
- #define bBitFlag42 cRunState7.bits.b2
- #define bBitFlag43 cRunState7.bits.b3
- #define bBitFlag44 cRunState7.bits.b4
- #define bBitFlag45 cRunState7.bits.b5
- #define bBitFlag46 cRunState7.bits.b6
- #define bBitFlag47 cRunState7.bits.b7
- #define bt10ms cTimeState.bits.b0
- #define b10ms cTimeState.bits.b1
- #define b100ms cTimeState.bits.b2
- #define X_ON_ENABLE 0x01
- #define X_DIR_ENABLE 0x02
- #define X_AXIS_PULSE_ENABLE 0x04
- #define Y_ON_ENABLE 0x10
- #define Y_DIR_ENABLE 0x20
- #define Y_AXIS_PULSE_ENABLE 0x40
- #define bRunning M0000
- #define bStart M0001
- #define bStop M0002
- #define bAlarmStop M0003
- #define bClearTotal M0004
- //
- #define Plublic_ALARM_ADD 100
- //公共的告警位置
- #define Plublic_EX_ALARM 40 //扩展故障告警
- //机器种类
- #define MACHINE_TYPE_SAVE_ADDR (POWEROFF_BACKUP_ADDRESS - 2048) //机型存储在备份数据的前2k的第一个地址
- #define MACHINE_TYPE_SET_DATA user_datas[500] // D500设置机型种类
- #define MACHINE_TYPE user_datas[300]//cMachineType
- //机器带不带触摸屏
- #define MACHINE_SCREEN_SAVE_ADDR (MACHINE_TYPE_SAVE_ADDR + 4)
- #define MACHINE_SCREEN_SET_DATA user_datas[501]
- #define MACHINE_SCREEN cScreenEnable
- //机器带不带WIFI
- #define MACHINE_WIFI_SAVE_ADDR (MACHINE_TYPE_SAVE_ADDR + 8)
- #define MACHINE_WIFI_SET_DATA user_datas[502]
- #define MACHINE_WIFI cWifiEnable user_datas[502]
- //机器上电启动不启动WIFI
- #define MACHINE_BOOT_WIFI user_datas[254]
- #define MACHINE_LOCK_TIME user_datas[240]//使用时间保存单位小时
- #define MACHINE_PSW_ENABLE user_datas[241]
- #define MACHINE_LOCK_PSW (user_datas[16] | user_datas[17] << 16)
- #define MACHINE_BASE_PSW (user_datas[0] | user_datas[1] << 16)
- #define MACHINE_USE_DAY 30//使用天数
- #define USE_PSW (0) //配置使能三个月使用期限
- /*************************/
-
-
- //厂家配置
- #define HAI_HUA_MACHINE (0) // 海华拉链
- #define JIN_HONG_MACHINE (1) // 锦泓拉链
- #define HONG_YE_MACHINE (0) // 宏业拉链
- #define FU_XIAO_WEI_MACHINE (0) // 付小伟
- #define CHANG_SHENG_GEI_LI_MACHINE (0) // 昌盛给力拉链
- #define YOU_GUAN_MACHINE (0) // 福建优冠拉链。
- #define ZHEN_YU_MACHINE (0) // 振宇拉链
- #define JUN_TENG_MACHINE (0) // 南通骏腾拉链
- #define JIA_CHENG_WEI_YE_MACHINE (0) // 嘉成伟业拉链
- #define XIN_SHENG_MACHINE (0) // 欣盛拉链
- #define WEI_YUAN_SONG_MACHINE (0) //魏远松东城协力,王志文树脂定寸
- #define PENG_WEI_CHANG_MACHINE (0) //彭伟昌
- #define XIN_YE_MACHINE (0) //鑫业拉链机械
- #define FJ_YING_XING_MACHINE (0) //福建盈兴拉链机械
- #define XI_DONG_MACHINE (0) //陈锡冬拉链机械
- #define JU_XING_MACHINE (0) //湖北汉川聚星拉链机械
- #define YU_WEN_XUAN_MACHINE (0) //宇文轩拉链机械
- #define TONG_YONG_MACHINE (0) //厂家通用机型 浙江温州王永贴布机,浙江湖州织里优诚开口切断机,聚星贴布机 温州鸿门定制机
- #define BRUCE_MACHINE (0) //布鲁斯打褶机
- #define Chuan_Chi_MACHINE (0) //福建传驰拉链机械
- #define FIE_YUE_MACHINE (0) //虎门飞跃
- #define ZHANG_CHUN_YANG_MACHINE (0) //张春阳
- #define LONG_YI_MACHINE (0) //龙一
- #define JIN_LONG_MACHINE (0) //金龙拉链
- #define JUN_YUE_MACHINE (0) //福建俊跃拉链
- //板脉冲方式定义
- #define SET_PULSE_TYPE cSetPulseType
- #define X_AXIS_PULSE_Y_ON (X_AXIS_PULSE_ENABLE | Y_ON_ENABLE) //X轴脉冲Y轴当使能
- #define X_AXIS_PULSE_Y_DIR (X_AXIS_PULSE_ENABLE | Y_DIR_ENABLE) //X轴脉冲Y轴当方向
- #define Y_AXIS_PULSE_X_ON (Y_AXIS_PULSE_ENABLE | X_ON_ENABLE) //Y轴脉冲X轴当使能
- #define Y_AXIS_PULSE_X_DIR (Y_AXIS_PULSE_ENABLE | X_DIR_ENABLE) //Y轴脉冲X轴当方向
- #define XY_AXIS_ON (X_ON_ENABLE | Y_ON_ENABLE) //XY轴都当使能
- #define XY_AXIS_PULSE (X_AXIS_PULSE_ENABLE | Y_AXIS_PULSE_ENABLE) //XY轴脉冲两个当脉冲
- //数据保存区域用于保存故障信息等数据不含备份功能
- //保存在芯片FLASH的最后一段存储区
- #define SAVE_MESSAGE_SIZE 30 // 故障信息保存大小 单位k
- #define SAVE_MESSAGE_DATA_SIZE (2048 * SAVE_MESSAGE_SIZE / 2)
- #define SAVE_MESSAGE_START_ADDR (127 - (SAVE_MESSAGE_SIZE / 2 - 1)) * 2048
- #define ONE_MESSAGE_SIZE_WORD 10
- #define SAV_MESSAGE_USER_DATAS_START_ADDR 1000
- #define ALARM_MESSAGE_CMD user_datas[SAV_MESSAGE_USER_DATAS_START_ADDR+2]
- #define CMD_READ_MESSAGE 1
- #define CMD_READ_ALARM_MESSAGE 2
- #endif
|