#ifndef LOGIC_IO_DEFINE_LOWK_H
#define LOGIC_IO_DEFINE_LOWK_H

/*!
IO配置
*/
#pragma region INPUT
#define IN_CASSEXISTCHECK12Inch_Left	0   //!料盒传感器,左
#define IN_CASSEXISTCHECK12Inch_Right   1   //!料盒传感器,右
#define IN_CASSEXISTCHECK8Inch_Left		2	//!8寸料盒传感器,左
#define IN_CASSEXISTCHECK8Inch_Right	3	//!8寸料盒传感器,右

#define IN_SCAN_LEFT				    4   //!扫描传感器左
#define IN_SCAN_RIGHT				    5   //!扫描传感器右

#define IN_CHECKBOX_HAS_WAFER_LEFT		6   //!CheckBox有无晶圆检测左，检测有无晶圆传感器12Inch
#define IN_CHECKBOX_HAS_WAFER_RIGHT     7   //!CheckBox有无晶圆检测，检测有无晶圆传感器8Inch
#define IN_CHECKBOX_DOOR_OPENED			8	//!CheckBox盒 门打开状态，打开时为TRUE

#define IN_WaferOutCass_Wafer_OutSide	9   //!料框晶元出位检测，下
#define IN_WaferOutCass_Front_Cassete	10   //!料框外靠轨道有晶元检测,上

#define IN_CLAW_Opend			        11   //!夹爪伸出传感器,即张开、释放Release
#define IN_CLAW_Closed			        12  //!夹爪缩回传感器，即闭合
#define IN_CLAW_ANTICOLLISION		    13	//!夹爪防撞，有信号时正常，没有信号时撞到了或传感器异常

#define IN_CHECK_EXIST_CLAW             14  //!夹爪上检测铁环有无的传感器

#define IN_Rail_NearCass_HasWafer		15  //!近轨道检测传感器1,靠料盒
#define IN_Rail_NearLoc_HasWafer		16  //!近轨道检测传感器2,远离料盒

#define IN_Rail_FarCass_HasWafer        17  //!远轨道检测传感器1,靠料盒

//气压相关
#define IN_MAIN_PRESSURE                18  //!总输入气压
#define IN_WT_WAFER_VACUUM              19  //!平台陶瓷盘真空压力传感器

#define IN_LOAD_VACUUM                  20  //!上料真空压力传感器
#define IN_UNLOAD_VACUUM		        21  //!下料真空压力传感器

#define IN_CLEAN_VACUUM			        22  //!清洗真空状态
#define IN_COAT_VACUUM			        23  //!涂敷真空状态

#define IN_WT_RING_VACUUM		        24  //!刚环真空压力传感器
#define IN_TRANS_VACUUM                 25  //!中转真空压力传感器

#define IN_CLEAN_CURTAIN_CLOSED         26  //!清洗保护罩关闭
#define IN_CLEAN_CURTAIN_OPENED         27  //!清洗保护罩打开

#define IN_COAT_CURTAIN_CLOSED          28  //!涂覆保护罩关闭
#define IN_COAT_CURTAIN_OPENED          29  //!涂覆保护罩打开

#define IN_COAT_ARM_UP_FORWARD		    30  //!涂覆摆臂升起传感器
#define IN_COAT_ARM_DOWN_BACK		    31  //!涂覆摆臂缩回传感器

#define IN_LASER_Shutter_All_Down       32  //!总光闸缩回传感器
#define IN_LASER_Shutter_All_Up	        33  //!总光闸伸出传感器
#define IN_LASER_Shutter_Wide_Down      34  //!Wide光闸缩回传感器
#define IN_LASER_Shutter_Wide_Up	    35  //!Wide光闸伸出传感器
#define IN_LASER_Shutter_Narrow_Down    36  //!Narrow光闸缩回传感器
#define IN_LASER_Shutter_Narrow_Up	    37  //!Narrow光闸伸出传感器

#define IN_CLAW_Collision_Detection_Push	38  //!防撞伸出，如果没信号说明撞到吧
#define IN_CLAW_Collision_Detection_Pull    39  //!防止拉不动,缩回
#define IN_WT_Worktable_Install_Check       40  //!陶瓷盘底坐安装真空检测，Base检查

#define IN_SAFEDOOR_Cassete			    41  //!安全门上料区,前门
#define IN_SAFEDOOR_LEFT			    42  //!安全门左,切割
#define IN_SAFEDOOR_RIGHT			    43  //!安全门右,切割
#define IN_SAFEDOOR_Clean_Left          44  //清洗只有一个门，使用的同一个
#define IN_SAFEDOOR_Clean_Right         45
#define IN_SAFEDOOR_Coat_Left			46  //!安全门上料区
#define IN_SAFEDOOR_Coat_Right			47  //!安全门上料区

#define IN_WATER_PRESSURE		        48  //!水压传感器
#define IN_WATER_FLOW			        49	//!水流量传感器

#define IN_LIQUID_ALM_CLEAN		        50	//!清洗区漏液
#define IN_LIQUID_ALM_COOLING	        51	//!水冷机漏液
#define IN_LIQUID_ALARM_LASER	        52	//!激光漏液传感器
#define IN_LIQUID_ALARM_COAT		    53	//!涂覆区漏液

#define IN_WT_KERF_VACCUM               59  //!Kerf真空状态
#define IN_WT_KERF_VACCUM_BREAK         60  //!Kerf破真空

//#define IN_Z_SAFE_CHECK				    51  //!Z轴安全检测

//#define IN_SAFETY_SENSOR_LOAD			33  //!安全限位保护
//#define IN_SAFETY_SENSOR_UNLOAD			32  //!安全限位保护
//#define IN_SAFETY_SENSOR_CLAW			34  //!安全限位保护

//unused
//#define IN_CLEAN_SPINDLE_UP_FORWARD  34 //!清洗主轴伸出传感器
//#define IN_CLEAN_SPINDLE_DOWN_BACK   35 //!清洗主轴缩回传感器
//
//#define IN_COAT_SPINDLE_UP_FORWARD  41  //!涂覆主轴伸出传感器
//#define IN_COAT_SPINDLE_DOWN_BACK   42  //!涂覆主轴缩回传感器

#pragma endregion INPUT

#pragma region OUTPUT
#define OUT_LOAD_VACUUM                 0       //!上料吸真空电磁阀
#define OUT_LOAD_VACUUM_BREAK           1       //!上料破真空电磁阀
#define OUT_UNLOAD_VACUUM               2       //!下料吸真空电磁阀
#define OUT_UNLOAD_VACUUM_BREAK         3       //!下料破真空电磁阀

#define OUT_WT_WAFER_VACUUM		        4       //!加工台吸真空电磁阀
#define OUT_WT_WAFER_VACUUM_BREAK	    5       //!加工台破真空电磁阀

#define OUT_CLEAN_VACUUM                6       //!清洗主轴吸真空电磁阀
#define OUT_CLEAN_VACUUM_BREAK          7       //!清洗破真空

#define OUT_COAT_VACUUM                 8       //!涂覆主轴吸真空电磁阀
#define OUT_COAT_VACUUM_BREAK           9		//!涂覆主轴破真空电磁阀

#define OUT_WT_RING_VACUUM              10      //!刚环吸真空电磁阀
#define OUT_WT_RING_VACUUM_BREAK	    11      //!刚环破真空电磁阀

#define OUT_TRANSFER_VACUUM             12      //!中转吸真空电磁阀
#define OUT_TRANSFER_VACUUM_BREAK       13      //!中转破真空电磁阀

#define OUT_TRANSFER_VACCUM_BREAK_FORCE 14
#define OUT_LOAD_VACCUM_BREAK_FORCE     15
#define OUT_UNLOAD_VACCUM_BREAK_FORCE   16

#define OUT_CLAW_CLOSED				    17      //!夹抓电磁阀,给信号即闭合，夹取物料 
#define OUT_CLAW_PUSHOUT                18      //!防撞气缸伸出

#define OUT_CLEAN_CURTAIN_OPENED        19      //!清洗保护罩关闭
#define OUT_CLEAN_AIR                   20      //清洗吹气阀(清洗摆臂)
#define OUT_CLEAN_TWOFLUID_WATER        21      //清洗二体水阀(清洗摆臂)
#define OUT_CLEAN_TWOFLUID_AIR          22      //清洗二流体气阀(清洗摆臂)
#define OUT_CLEAN_ELECT_AIR			    23	    //!摆臂上的静电气阀(清洗摆臂)
#define OUT_CLEAN_CURTAIN_AIR			24	    //!清洗保护罩气阀

#define OUT_COAT_CURTAIN_OPENED         25      //!涂覆保护罩关闭
#define OUT_COAT_ARM_UP                 26      //!涂敷摆臂升降控制阀(涂覆摆臂)
#define OUT_COAT_TWOFLUID_WATER         27      //!涂覆区二流体水(清洗摆臂)
#define OUT_COAT_TWOFLUID_AIR           28      //!涂覆区二流体气(清洗摆臂)
#define OUT_COAT_ELECT_AIR              29      //!静电清除气阀(清洗摆臂)
#define OUT_COAT_WASHRING_WATER         30      //!洗铁环水阀(清洗摆臂)

#define OUT_COAT_CLEANING_GLUE_WATER    31      //!涂覆区清洗胶水池的水
#define OUT_COAT_CURTAIN_AIR			32	    //!涂覆保护罩气阀

#define OUT_Shutter_All_Open            33      //!总光闸
#define OUT_Shutter_Wide_Open           34      //!Wide光闸
#define OUT_Shutter_Narrow_Open         35	    //!Narrow总光闸
#define OUT_LASERGATE				    36	    //!没有信号时出光   NOTOE:为0时出光 1时不出光

#define OUT_LENS_Blow_Inner             37      //!切割内吹气
#define OUT_LENS_Blow_Outter            38	    //!切割外吹气
#define OUT_CCD_AIR					    39      //!2X CCD吹气
#define OUT_CCD_AIR_6X					40      //!6X CCD吹气

#define OUT_LEFTDOOR_UNLOCK			    41	    //!左门(加工区)解锁，为1时解锁
#define OUT_RIGHTDOOR_UNLOCK		    42	    //!右门(清洗涂覆)解锁，为1时解锁


#define OUT_POWER_ELECT_ENTRY		    43      //入口静电消除器供电
#define OUT_ELECT_Entry                 44      //!入口静电阀
#define OUT_POWER_ELECT_WT              45      //!平台静电供电
#define OUT_ELECT_Wt                    46      //!平台区静电阀

#define OUT_POWER_ELECT_Other           47      //!其他静电阀供电
#define OUT_ELECT_Clean                 48      //!清洗区静电阀
#define OUT_ELECT_Coat                  49      //!涂覆区静电阀
#define OUT_ELECT_Transfer              50      //!传片静电阀
#define OUT_ELECT_Load                  51      //!上料静电阀
#define OUT_ELECT_Unload                52      //!下料静电阀

#define OUT_RED				            53      //!报警灯
#define OUT_YELLOW			            54      //!黄
#define OUT_BLUE			            55      //!蓝,白
#define	OUT_GREEN			            56      //!绿
#define	OUT_BUZZ			            57      //!蜂鸣
#define OUT_LIGHT                       58      //!日光灯

#define OUT_WT_BASE_VACUUM              59      //!陶瓷盘底座真空
#define OUT_WT_BASE_VACUUM_Break        60      //!陶瓷盘底座真空

#define OUT_WT_KERF_VACCUM              61
#define OUT_WT_KERF_VACCUM_BREAK        62


#define IN_Rail_FarLoc_HasWafer         IN_Rail_FarCass_HasWafer  //!远轨道检测传感器2,远离料盒(正常应该不使用了)
//UNUSED
//#define OUT_COAT_SPINDLE_UPDOWN         24  //主轴，升降控制阀
//#define OUT_CLEAN_SPINDLE_UPDOWN        31  //清洗主轴阀

//清洗副臂
//#define OUT_CLEAN_TWOFLUID_WATER2        21  //清洗2二体水阀
//#define OUT_CLEAN_TWOFLUID_AIR2          22  //清洗2二流体气阀

//#define OUT_POWER_WATER_COOLING		43  //水冷机冷却

#define IN_ANALOG_BEAM_LENS_AIR			0	//!吹气保护流量

#pragma endregion OUTPUT
#endif //LOGIC_IO_DEFINE_LOWK_H
