⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 tsodick3.h

📁 基于PMAC运动控制卡的八轴数控磨床PLC运动控制程序
💻 H
📖 第 1 页 / 共 2 页
字号:
/*** change log ********                  
1. probe_power_on_err & stylus_status_err moved from warn to stop.	98.2.10
2. collision moved from warn to stop.					98.2.10
***********************/
//////////////////////////////////////////////////////////////////
// Defined for Sodick GPNC System
// Version 2.9
//////////////////////////////////////////////////////////////////
#ifndef TSODICK3_H
#define TSODICK3_H
//-----------------MACRO DEFINITION------------------------------
#define NOISE_DETECT_CYCLE	3
#define IO_NOISE_DETECT_CYCLE	3	;// for filter of i/o error 2000.06.06
#define MTR_QDR_CYCLE		5
#define MOTOR_IN_POS_BIT        1       ;//ADDED FOR MC180L 2000.07.05


////////////////////////////FATAL////////////////////////////////
#define SPND_TEMPE_ALARM		1		;//B0
#define PUMP_THERM_ALARM		2		;//B1
#define PHASE_POS_X_ERROR		4		;//B2
#define PHASE_POS_Y_ERROR		8		;//B3
#define PHASE_POS_Z_ERROR		16		;//B4
#define PHASE_POS_S_ERROR		32		;//B5
#define PHASE_POS_U_ERROR		64		;//B6
#define PHASE_POS_V_ERROR		128		;//B7
#define MOTOR1_OVERLOAD_ERR		256		;//B8
#define MOTOR2_OVERLOAD_ERR		512		;//B9
#define MOTOR3_OVERLOAD_ERR		1024		;;/B10
#define MOTOR4_OVERLOAD_ERR		2048		;;/B11
#define MOTOR5_OVERLOAD_ERR		4096		;//B12
#define MOTOR6_OVERLOAD_ERR		8192		;//B13
#define PHASE_POS_A_ERROR		16384		;//B14
#define PC_THERM_ALARM			32768		;//B15
#define GEAR_SENSOR_ALARM		65536		;//B16 for GearBox Sensor Alarm,Billy99-3
#define PHASE_POS_C_ERROR		131072		;//B17


// THESE ERRORS USE FOR ATC OF MC180L 2000.07 
#define MAG_DRV_ALARM			262144		;//B18
#define SHUT_SENS_ALARM			524288		;//B19

// THIS ERROR USE FOR UPS OF MC180L 2001.04.02 
#define UPS_LOW_ALARM			1048576 	;//B20
#define UPS_ALARM			2097152		;//B21
// THIS ERROR USE FOR SPFAR AND SPSTP 2001.11.06
#define SPND_OVER_ALARM			4194304		;//B22
//Added by sekisawa for process at manual mode
#define MANUAL_LIMIT			8388608		;//B23
//Origin-Signal ERROR 2002/9/27 Added By Wei.J.F
#define X_ORIGIN_SIGNAL_ERR		16777216	;//B24
#define Y_ORIGIN_SIGNAL_ERR		33554432	;//B25
#define Z_ORIGIN_SIGNAL_ERR		67108864	;//B26

//*************************for g8a******************************
#define MOTOR7_OVERLOAD_ERR		262144		;//B18
#define MOTOR8_OVERLOAD_ERR		524288		;//B19


////////////////////////////STOP/////////////////////////////////
#define OIL_PRESS_ALARM			 1
#define OIL_TEMPE_ALARM			 2
#define CLAMP_SENSOR_ALARM		 4

#define ARM_SENSOR_ALARM		 8

#define JIGCLAMP_TIMEOUT_ERR            16
#define MCODE_TIMEOUT_ERR               32  ;//for M code input timeout error
#define SPND_THR_ERR                    64  ;//for SPINDLE THROUGH PROTECT

#define GEAR_CHANGE_ERR                128 ;//Gear convert timeout err

#define AIR_PRESS_ALARM		       256 ;//move from warn
#define COOLANT_TEMPE_ALARM	       512 ;//move from msg 
#define AIR_DRIER_ALARM		      1024 ;//move from msg 
#define DOOR_UNLOCKED		      2048
#define POWER_IS_OFF		      4096
#define EMERGENCY_STOPPED	      8192
#define FLOAT_SENSOR_FAULT           16384 ;//for float sensor fault
#define MAG_NOT_ON_PORT		     32768 ;//for M6 protect,Billy99-9
#define SPND_NOT_ORIENT		     65536 ;//for M6 protect,Billy99-9
#define AUTO_GREASTER_ALARM	    131072 ;//for MC180L 2000.03.21 
//#define MIST_OCCURRENCE_ALARM	    262144 //Move to Warning. 2001.07.15
#define NO_TOOL_SPIN_ALARM          262144 ;//2001,08.9
#define HANDLE_PROTECT		    524288 ;// for HANDLE PROTECT 2000.05.18

// THESE ERRORS USE FOR ATC OF MC180L 2000.07 

#define ATC_ERROR_1		   1048576 ;//BIT 21
#define ATC_ERROR_2		   2097152 ;//BIT 22
#define ATC_ERROR_3		   4194304 ;//BIT 23
#define ATC_ERROR_4		   8388608 ;//BIT 24
#define ATC_ERROR_5		  16777216 ;//BIT 25

// THESE ERRORS USE FOR ATC OF MC180L 2000.07 

#define A_CLAMP_TIMEOUT           33554432 ;//BIT 26
#define	TABLECLAMP_A_MOVE_ALARM   67108864 ;//BIT 27
// THESE ERRORS USE FOR ATC OF MC180L 2000.07 
//#define OPTIONBOX_DOOR_ALARM   134217728 //BIT 28
#define ATC_ERROR_6		 134217728 ;//BIT 28
#define PUMP_THERMAL_ALARM    	 268435456 ;//BIT 29
#define	OIL_COOLER_ALARM	 536870912 ;//BIT 30
#define	ECONO_PACK_ALARM	1073741824 ;//BIT 31
#define	MIST_COLLECTOR_ALARM    2147483648 ;//BIT 32

//****************for g8a***************************************

//#define PUMP_THERMAL_ALARM       268435456 //BIT 29
#define	  COLDALM_ALARM	   536870912 ;//BIT 30
//#define  PUMPOVLD_ALARM	  1073741824 ;//BIT 31
#define   AIRLOW_ALARM           2147483648 ;//BIT 32

////////////////////////////STOP 2 /////////////////////////////////
#define PROBE_POWER_ON_ERR			1
#define STYLUS_STATUS_ERR			2
#define COLLISION_IN_AUTOMEASURE	        4
#define STYLUS_LOWBATT_ERR			8
#define LASER_UNIT_ON_ERR			16	;//for LOK fault
#define PROBE_TYPE_ERR				32
#define RADIUS_MEASURE_ERR			64	;//Tool radius auto measure err.
#define NO_TOOL_MEASURE_ERR			128
#define APC_ALARM_ERR				256	;//ALARM of Automatic Palette Changer
#define FRONT_DOOR_MNL_MODE_ERR		        512     ;//Door-Mode change to Manual
#define DIS_SPIN_TOOL_NUM_ERR		       1024	;//Added by sekisawa for Flag of prohibition spindle cw for touch senser 2002.10.30
///////////////////////////WARNING///////////////////////////////
#define MIST_OCCURRENCE_ALARM	               1        ;//From STOP Error to Warning. 2001.07.15

///////////////////////////WARNING 2 ///////////////////////////////
#define ABORT_FOR_LMT			       1	 ;//issued from plcc0, ver2.3
#define COLLISION_WILL_IN_AUTOMEASURE	       2         ;//98.4.7 yao moved from msg.
#define INVALID_OPER_WHEN_MTC                  4         ;//when MTC is doing, some panel oper is invalidated,Billy99-8
#define M_OPTION_INPUT_ERR                     8         ;//98.7.15 for settable M code option input sensor err.
#define G5_SINGLE_MODE_ERR                    16         ;//WARNING of Lookahead at the single mode.2001.10.23 MITSUI.
#define FRONT_DOOR_OPEN_ALM		      32	 ;//Automatic Front Door is OPEN

//****************for g8a**************************************
#define MOTORX_NOTRDY_ERR                    64  
#define MOTORY_NOTRDY_ERR                   128 
#define MOTORU_NOTRDY_ERR		    256	
#define MOTORV_NOTRDY_ERR		    512 
#define MOTORC_NOTRDY_ERR		   1024 
#define MOTORZ_NOTRDY_ERR		   2048
#define MOTORA_NOTRDY_ERR		   4096
#define MOTORB_NOTRDY_ERR	           8192

///////////////////////////MESSAGE///////////////////////////////
#define DOOR_IS_OPEN		1		
//#define COOLANT_TEMPE_ALARM	1 //move to stop 5/12
//#define AIR_DRIER_ALARM	2 //move to stop 5/12
#define OPTION_STOP_ALARM	2		
#define ATC_DOOR_ALARM		4		
#define PROG_STOP_ALARM		8
/********* FOR STRORK LIMIT STOP  ADDED BY TAHOO 97.7 ***********/
#define X_AXIS_MINUS_100  	-860160000 ;//(-450000+170000)cts * 3072
#define X_AXIS_PLUS_100 	-522240000 ;//(0-170000)cts * 3072
#define Y_AXIS_MINUS_100	-860160000 ;//(-450000+170000)cts * 3072
#define Y_AXIS_PLUS_100	        -522240000 ;//(0-170000)cts * 3072
#define Z_AXIS_MINUS_100	-860160000 ;//(-450000+170000)cts * 3072
#define Z_AXIS_PLUS_100	        -522240000 ;//(0-170000)cts * 3072
#define X_AXIS_MINUS_75  	-1105920000 ;//(-450000+90000)cts * 3072
#define X_AXIS_PLUS_75  	-276480000  ;//(0-90000)cts * 3072
#define Y_AXIS_MINUS_75 	-1105920000 ;//(-450000+90000)cts * 3072
#define Y_AXIS_PLUS_75  	-276480000  ;//(0-90000)cts * 3072
#define Z_AXIS_MINUS_75 	-1105920000 ;//(-450000+90000)cts * 3072
#define Z_AXIS_PLUS_75  	-276480000  ;;/(0-90000)cts * 3072
#define X_AXIS_MINUS_50  	-1290240000 ;//(-450000+30000)cts * 3072
#define X_AXIS_PLUS_50  	-92160000   ;//(0-30000)cts * 3072
#define Y_AXIS_MINUS_50 	-1290240000 ;//(-450000+30000)cts * 3072
#define Y_AXIS_PLUS_50  	-92160000   ;//(0-30000)cts * 3072
#define Z_AXIS_MINUS_50 	-1290240000 ;//(-450000+30000)cts * 3072
#define Z_AXIS_PLUS_50  	-92160000   ;//(0-30000)cts * 3072
#define X_AXIS_MINUS_25   	-1363968000 ;//(-450000+6000)cts * 3072
#define X_AXIS_PLUS_25  	-18432000   ;//(0-6000)cts * 3072
#define Y_AXIS_MINUS_25 	-1363968000 ;//(-450000+6000)cts * 3072
#define Y_AXIS_PLUS_25  	-18432000   ;//(0-6000)cts * 3072
#define Z_AXIS_MINUS_25 	-1363968000 ;//(-450000+6000)cts * 3072
#define Z_AXIS_PLUS_25  	-18432000   ;//(0-6000)cts * 3072
/****************************************************/

//-------------------P Variable Definition-----------------------

#define HARD_TAP          	P350

//the P value(P501-P508) could used in Motion anywhere,but pay attention to the subpro use the same P value,Billy99-7
#define RESERVED_P1		P501	;//count used in M6 motion
#define RESERVED_P2		P502	;//used in Tmill.g N3 for G87 and G76,Billy99-2-17
#define RESERVED_P3		P503	;//used for saving GearBox,Billy99-4	
#define RESERVED_P4		P504	;//used in MTC motion
#define PC_RESERVED_P4	        504
#define RESERVED_P5		P505	;//used in MTC motion
#define PC_RESERVED_P5	        505
#define RESERVED_P6		P506	;//used to protect ATC and MTC
#define RESERVED_P7		P507	;//used in MTC motion
#define PC_RESERVED_P7	        507
#define RESERVED_P8		P508	;//used in MTC motion
#define PC_RESERVED_P8	        508

#define M48M49_P		P509	;//used by GearBox,Billy99-4
#define PHASE_S_P		P510	;//use for temp save to protect ATC,Billy99-10
#define PHASE_SAV_P		P511	;//use for temp save S axis's phase pos,Tahoo99-10
#define Z_REF_PT_P		P512	;//used in MTC motion
#define S_REP_CHK_P		P513	;//used for spindle orientation in ATC
#define S_REP_COUNT		3
//////////////// WE CAN USE P514 - P549. 2000.09.29 //////////////////////////// 
// For 50ATC(Kawaguchiko-seimitsu) Added by Wei.J.F 2002/7/22
#define BUSY_P			P540	;//A29 MAGAZINE MOVE STATUS
#define PC_BUSY_P		540
#define ALMG_P			P541	;//A30 MAGAZINE SERVO ALARM
#define PC_ALMG_P		541
#define STB_P			P542	;//B29 MAGAZINE STROBE SIGNAL
#define PC_STB_P		542
#define MSVON_P			P543	;//B30 MAGAZINE SERVO ON
#define PC_MSVON_P		543
#define PST_DFLCL_P		P544

#define SEC_CMD_Z_P		P550	;// G161 Q PARAMETER FOR YAMAKOU 2000.09.29
#define SEC_RET_Z_P		P551	;// G161 R PARAMETER FOR YAMAKOU 2000.09.29
#define WEEKLY_FLAG_P	        P552	;// WEEKLY TIMER FLAG FOR YAMAKOU 2000.09.30
//Added by Sukita for Spindle Max Rpm 2001.08.02
#define SPINDLE_MAX_RPM_P	P553	;// used in Spindle Motion
#define PC_SPINDLE_MAX_RPM_P	553
//Added by Sukita for Tool Length Auto Mesure Z Move 2001.09.05
#define TOOL_LENGTH_Z_MOVE_P	P554
#define PC_TOOL_LENGTH_Z_MOVE_P 554
//added by sekisawa 2002.01.26 for C_JOG_M at door closed
#define DOOR_FLAG_P	        P555
#define HTR_FLAG_P	        P556
//added by sekisawa 2002.02.13 for ATC tool POT Total
#define POT_TOTAL_P		P557
#define	PC_POT_TOTAL_P	557
#define REAL_OUT_P		P558
//for Auto Radius Measurement Added by Wei.J.F 2002/10/22
#define TOOL_RADIUS_MOVE_P	P559
#define PC_TOOL_RADIUS_MOVE_P	559

//added by sekiswa 2002.02.21 for Tool Radius Auto Messure by BLum
#define RADIUS_POINT_P		P582
#define PC_RADIUS_POINT_P	582
#define RADIUS_NUM_P		P583
#define PC_RADIUS_NUM_P		583
#define RADIUS_TOLERANCE_P	P584
#define PC_RADIUS_TOLERANCE_P	584

#define AM_RDS_AXIS_P		P585
#define PC_AM_RDS_AXIS_P	585
#define AM_LEN_AXIS_P		P586
#define PC_AM_LEN_AXIS_P	586
#define AM_LSR_AXIS_P		P587
#define PC_AM_LSR_AXIS_P	587

#define WAIT_ON_P		P588
#define IN_TOOL2_P		P589

#define MAX_TOOL_RAD_P		P590
#define PC_MAX_TOOL_RAD_P	590
#define MAX_MEASURE_MOVE_P	P591
#define MAX_Z_MOVE_P		P592
#define PC_MAX_Z_MOVE_P		592

//added by sekisawa 2002.07.02 for mask of GPIO when POWER OFF
#define POWER_OFF_MASK_P	P593

//Add for timer of CoolB 2001.10.31
#define COOL_ON_TIME_P		P594
#define COOL_OFF_TIME_P		P595
#define PC_COOL_ON_TIME_P	594
#define PC_COOL_OFF_TIME_P	595

//Added by sekisawa for intermittent Air Blow 2002.07.24
#define MEASURE_AIR_FLAG_P	P596
#define AIR_BLOW_TIME_P		P597
#define AIR_BLOW_TIME2_P	P598
#define PC_MEASURE_AIR_FLAG_P	596
#define PC_AIR_BLOW_TIME_P	597
#define PC_AIR_BLOW_TIME2_P	598

//////////////// WE CAN USE ONLY P599. 2002.07.02 //////////////////////////// 
#define LOOK_AHEAD_FLAG_P	       P801		;//@OVRD

#define TA_PREV_P          	       P815
#define TS_PREV_P          	       P816
#define TA_PREV4_P          	       P817
#define TS_PREV4_P          	       P818

#define PREV_1_JOG_TA                  P820
#define PREV_2_JOG_TA                  P821
#define PREV_3_JOG_TA                  P822
#define PREV_4_JOG_TA                  P823
#define PREV_5_JOG_TA                  P824
#define PREV_6_JOG_TA                  P825
#define PREV_1_JOG_TS                  P826
#define PREV_2_JOG_TS                  P827
#define PREV_3_JOG_TS                  P828
#define PREV_4_JOG_TS                  P829
#define PREV_5_JOG_TS                  P830
#define PREV_6_JOG_TS                  P831
//added by James 1998.10.01
#define PREV_7_JOG_TA                  P832
#define PREV_8_JOG_TA                  P833
#define PREV_7_JOG_TS                  P834
#define PREV_8_JOG_TS                  P835

// for filter of i/o error 2000.06.06
#define ALAP_NOISE_FILTER		P840
#define ALST_NOISE_FILTER		P841
#define ALPT_NOISE_FILTER		P842
// FOR MC180L 2000.08
#define ALEC_NOISE_FILTER		P843
#define SDLDOC_NOISE_FILTER		P844
#define PWS_NOISE_FILTER		P845
#define EMERGENCY_NOISE_FILTER		P846
#define ALAD_NOISE_FILTER		P847
#define ALOP_NOISE_FILTER		P848
#define ALCT_NOISE_FILTER		P849
#define ALOT_NOISE_FILTER		P850
#define ALPTO_NOISE_FILTER		P851
#define ALOC_NOISE_FILTER		P852
#define ALMIST_NOISE_FILTER		P853
#define OPTBOX_NOISE_FILTER		P854
#define PC_ALM_NOISE_FILTER		P855
#define APCALM_NOISE_FILTER		P856
//********for g8a******************************************
#define AIRLOW_NOISE_FILTER		P857
//#define PUMPOVLD_NOISE_FILTER		P858
#define COLDALM_NOISE_FILTER		P859

// P860-P879 IS RESERVED BY Mr. NAKAMOTO (nM MACHINE)
//  AND WE CAN NOT USE P860-P879.

#define CYCLE_START_NOISE_FILTER	P885
#define PROG_STOP_NOISE_FILTER		P886
#define FEED_HOLD_NOISE_FILTER		P887
#define RESET_NOISE_FILTER		P888
#define SOURCE_NOISE_FILTER		P889
#define POWER_NOISE_FILTER		P890

#define F1_NOISE_FILTER		P891
#define F2_NOISE_FILTER		P892
#define F3_NOISE_FILTER		P893
#define F4_NOISE_FILTER		P894
#define F5_NOISE_FILTER		P895
#define F6_NOISE_FILTER		P896
#define F7_NOISE_FILTER		P897
#define F8_NOISE_FILTER		P898

#define SOURCE_OFF_DELAY_STARTED P899
#define POWER_ON_DELAY_STARTED  P900
#define SOURCE_ON_FLAG		P901
#define POWER_SW_2_PUSH		P902
#define FUNC1_SW_2_PUSH		P903
#define FUNC2_SW_2_PUSH		P904
#define FUNC3_SW_2_PUSH		P905
#define FUNC4_SW_2_PUSH		P906
#define FUNC5_SW_2_PUSH		P907
#define FUNC6_SW_2_PUSH		P908
#define FUNC7_SW_2_PUSH		P909

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -