📄 address.h
字号:
/*
File: address.h
Header file for common defines used by both TURBO_PMAC
and PC programs. This file is used by the DLL and LIB
librarys when compiled.
Warning: This file may change at any new library compilation.
!!!!!! Change this file at your own risk. !!!!!!
///////////////////////// Naming Conventions //////////////////////////////
Date || Name || Content || Base Version
2004.7.4 Change the address to turbo pmac Base MC180
**************************************************************************/
#ifndef ADDRESS_H
#define ADDRESS_H
#define TRUE 1
#define FALSE 0
#define ON TRUE
#define OFF FALSE
///////////////////////////////////////////////////////////////////////////
// Command / Control / Status BIT Mapping
// Command/Status Area Reserves M0..M15 for 32 bit words
// The selectors reserve M60..M99
///////////////////////////////////////////////////////////////////////////
#define PC_STATUS_OFS 0x3780
#define PC_COMMAND_OFS 0x37C0
// Command/Status (CS) #1 32 bits /////////////////////////////////////////
// This 32 bit word makes up the 8 selector switch inputs for Delta Tau's
// Control panel. Normally these are put into the Dual Port Ram by the
// MAIN.PLC into the CS_COMMAND1_M word. The DLL operates on these inputs
// and then writes its operating values to the CS_STATUS1_M word. In certain
// cases where the DLL is not allowing the requested COMMAND the STATUS will
// not match the COMMAND. In the case where a PLC is not making a request
// but needing to inform the DLL of a status change, the PLC should do this
// via the STATUS word.
// The handwheel panel input is generally inputed and filtered in the
// MAIN.PLC and the motor master handwheel address ( Ix05 ) is then
// pointed to this address. Since the handwheel input is directly operated
// on by the PMAC, this input is not passed thruough DPRAM to the DLL.
//
#define PC_STATUS1_M 0
#define CS_STATUS1_ADR DP:$60DE0 ;DP:$DDE0
#define CS_STATUS1_M M0
#define PC_COMMAND1_M 8
#define CS_COMMAND1_ADR DP:$60DF0 ;DP:$DDF0
#define CS_COMMAND1_M M8
// The following are the individual switch selectors for the Delta Tau
// Control panel. They make up the above 32 bit inputs to the CNC DLL
// ( 8 switches x 4 bits = 32 bits ).
#define S_JOG_M M60
#define S_JOG_ADR Y:$60DE0,0,4,U
#define C_JOG_M M80
#define C_JOG_ADR Y:$60DF0,0,4,U
#define SEL_JOG_MASK 15 ;// $0000000F
#define SEL_JOG_HANDLE 1 ;// $00000001
#define SEL_JOG_INC 2 ;// $00000002
#define SEL_JOG_CONT 3 ;// $00000003
#define SEL_JOG_HOME 4 ;// $00000004
#define S_MODE_M M61
#define S_MODE_ADR Y:$60DE0,4,4,U
#define C_MODE_M M81
#define C_MODE_ADR Y:$60DF0,4,4,U
#define SEL_MODE_MASK 240 ;// $000000F0
#define SEL_MODE_AUTO 1 ;// $00000010
#define SEL_MODE_MANUAL 2 ;// $00000020
#define SEL_MODE_MDI 3 ;// $00000030
#define S_AXIS_M M62
#define S_AXIS_ADR Y:$60DE0,8,4,U
#define C_AXIS_M M82
#define C_AXIS_ADR Y:$60DF0,8,4,U
#define SEL_AXIS_MASK 3840 ;// $00000F00
#define SEL_AXIS_X 1 ;// $00000100
#define SEL_AXIS_Y 2 ;// $00000200
#define SEL_AXIS_Z 3 ;// $00000300
#define SEL_AXIS_A 4 ;// $00000400
#define SEL_AXIS_B 5 ;// $00000500
#define SEL_AXIS_C 6 ;// $00000600
#define SEL_AXIS_U 7 ;// $00000700
#define SEL_AXIS_V 8 ;// $00000800
#define SEL_AXIS_W 9 ;// $00000900
#define S_FEED_M M63
#define S_FEED_ADR Y:$60DE0,12,4,U
#define C_FEED_M M83
#define C_FEED_ADR Y:$60DF0,12,4,U
#define SEL_FEED_MASK 61440 ;// $0000F000
#define SEL_FEED_1 1 ;// $00001000
#define SEL_FEED_10 2 ;// $00002000
#define SEL_FEED_100 3 ;// $00003000
#define SEL_FEED_1000 4 ;// $00004000
#define SEL_FEED_10000 5 ;// $00005000
#define S_ROVRD_M M64
#define S_ROVRD_ADR X:$60DE0,0,4,U
#define C_ROVRD_M M84
#define C_ROVRD_ADR X:$60DF0,0,4,U
#define SEL_ROVRD_MASK 983040 ;// $000F0000
#define SEL_ROVRD_FEED 1 ;// $00010000
#define SEL_ROVRD_25 2 ;// $00020000
#define SEL_ROVRD_50 3 ;// $00030000
#define SEL_ROVRD_100 4 ;// $00040000
#define PC_SPND_M 65
#define S_SPND_M M65
#define S_SPND_ADR X:$60DE0,4,4,U
#define C_SPND_M M85
#define C_SPND_ADR X:$60DF0,4,4,U
#define SEL_SPND_MASK 15728640 ;// $00F00000
#define SEL_SPND_CCW 1 ;// $00100000
#define SEL_SPND_OFF 2 ;// $00200000
#define SEL_SPND_CW 3 ;// $00300000
#define SEL_SPND_ORIENT1 4 ;// $00400000
#define SEL_SPND_ORIENT2 5 ;// $00500000
#define SEL_SPND_LOCK 6 ;// $00600000
#define S_FOVRD_M M66
#define S_FOVRD_ADR X:$60DE0,8,4,U
#define C_FOVRD_M M86
#define C_FOVRD_ADR X:$60DF0,8,4,U
#define SEL_FOVRD_MASK 51658240 ;// $0F000000
#define SEL_FOVRD_0 0 ;// $00000000
#define SEL_FOVRD_10 1 ;// $01000000
#define SEL_FOVRD_20 2 ;// $02000000
#define SEL_FOVRD_30 3 ;// $03000000
#define SEL_FOVRD_40 4 ;// $04000000
#define SEL_FOVRD_50 5 ;// $05000000
#define SEL_FOVRD_60 6 ;// $06000000
#define SEL_FOVRD_70 7 ;// $07000000
#define SEL_FOVRD_80 8 ;// $08000000
#define SEL_FOVRD_90 9 ;// $09000000
#define SEL_FOVRD_100 10 ;/;/ $0A000000
#define SEL_FOVRD_110 11 ;// $0B000000
#define SEL_FOVRD_120 12 ;// $0C000000
#define SEL_FOVRD_130 13 ;// $0D000000
#define SEL_FOVRD_140 14 ;// $0E000000
#define SEL_FOVRD_150 15 ;// $0F000000
// More Selectors
#define S_ZOVRD_M M67
#define S_ZOVRD_ADR X:$60DE0,12,4,U
#define C_ZOVRD_M M87
#define C_ZOVRD_ADR X:$60DF0,12,4,U
#define SEL_ZOVRD_MASK 4026531840 ;// $F0000000
#define SEL_ZOVRD_0 0 ;// $00000000
#define SEL_ZOVRD_10 1 ;// $10000000
#define SEL_ZOVRD_20 2 ;// $20000000
#define SEL_ZOVRD_30 3 ;// $30000000
#define SEL_ZOVRD_40 4 ;// $40000000
#define SEL_ZOVRD_50 5 ;// $50000000
#define SEL_ZOVRD_60 6 ;// $60000000
#define SEL_ZOVRD_70 7 ;// $70000000
#define SEL_ZOVRD_80 8 ;// $80000000
#define SEL_ZOVRD_90 9 ;// $90000000
#define SEL_ZOVRD_100 10 ;//$100000000
#define SEL_ZOVRD_110 11 ;//$110000000
#define SEL_ZOVRD_120 12 ;//$120000000
#define SEL_ZOVRD_130 13 ;// $130000000
#define SEL_ZOVRD_140 14 ;// $140000000
#define SEL_ZOVRD_150 15 ;// $150000000
// Command/Status (CS) #2 32 bits ////////////////////////////////////////////
// This 32 bit word make up the 2nd Command/Status interface between PMAC
// PLC(s) and the CNC DLL. Their use is defined in each selector
// In some instances the request ( COMMAND ) could come from a different
// source than the PMAC Input. For example it may it may come from the PC
// key board inputs or the CNC panel emulation input. The CNC DLL would
// then be the initiator of the request.
// The STATUS value would then be set by the CNC DLL and should be used by
// the PLC that uses this information.
#define PC_STATUS2_M 1
#define CS_STATUS2_ADR DP:$60DE1
#define CS_STATUS2_M M1
#define PC_COMMAND2_M 9
#define CS_COMMAND2_ADR DP:$60DF1
#define CS_COMMAND2_M M9
#define S_COORD_M M68
#define S_COORD_ADR Y:$60DE1,0,4,U
#define C_COORD_M M88
#define C_COORD_ADR Y:$60DF1,0,4,U
#define SEL_COORD_MASK 15 ;// $0000000F
#define S_GEAR_M M69
#define S_GEAR_ADR Y:$60DE1,4,4,U
#define C_GEAR_M M89
#define C_GEAR_ADR Y:$60DF1,4,4,U
#define SEL_GEAR_MASK 240 ;// $000000F0
// The HOME.PLC uses the status output of the DLL S_HOME_M for selecting
// which motor is to be homed. The format is a follows 1 = Mtr #1,
// 2 = Mtr #2, 4 = Mtr #3, .. 128 = Mtr #8.
#define PC_HOME_M 70
#define S_HOME_M M70
#define S_HOME_ADR Y:$60DE1,8,8,U
#define C_HOME_M M90
#define C_HOME_ADR Y:$60DF1,8,8,U
#define SEL_HOME_MTR_MASK 65280 ;// $0000FF00
#define S_ERROR_M M71
#define S_ERROR_ADR X:$60DE1,0,4,U
#define C_ERROR_M M91
#define C_ERROR_ADR X:$60DF1,0,4,U
#define SEL_ERROR_MASK 983040 ;// $000F0000
#define S_DIST_M M72
#define S_DIST_ADR X:$60DE1,4,4,U
#define C_DIST_M M92
#define C_DIST_ADR X:$60DF1,4,4,U
#define SEL_DIST_MASK 15728640 ;// $00F00000
#define SEL_DIST_1 1 ;// $00100000
#define SEL_DIST_10 2 ;// $00200000
#define SEL_DIST_100 3 ;// $00300000
#define SEL_DIST_1000 4 ;// $00400000
#define SEL_DIST_10000 5 ;// $00500000
#define S_JOGINC_M M73
#define S_JOGINC_ADR X:$60DE1,8,4,U
#define C_JOGINC_M M93
#define C_JOGINC_ADR X:$60DF1,8,4,U
#define SEL_JOGINC_MASK 51658240 ;// $0F000000
#define SEL_JOG_X1 1 ;// $01000000
#define SEL_JOG_X10 2 ;// $02000000
#define SEL_JOG_X100 3 ;// $03000000
#define SEL_JOG_X1000 4 ;// $04000000
#define SEL_JOG_X10000 5 ;// $05000000
#define SEL_JOG_S 6 ;// $06000000
#define S_MACHINE_M M74
#define S_MACHINE_ADR X:$60DE1,12,4,U
#define C_MACHINE_M M94
#define C_MACHINE_ADR X:$60DF1,12,4,U
#define SEL_MACHINE_MASK 4026531840 ;// $F0000000
#define SEL_MACHINE_MILL 1 ;// $10000000
#define SEL_MACHINE_LATHE 2 ;// $20000000
#define SEL_MACHINE_GRINDER 3 ;// $30000000
#define SEL_MACHINE_LASER 4 ;// $40000000
#define SEL_MACHINE_EDM 5 ;// $50000000
//******************************************
// Command/Status (CS) #3 32 bits ////////////////////////////////////////////
#define PC_STATUS3_M 2
#define CS_STATUS3_ADR DP:$60DE2
#define CS_STATUS3_M M2
#define PC_COMMAND3_M 10
#define CS_COMMAND3_ADR DP:$60DF2
#define CS_COMMAND3_M M10
// Singles
#define CS_MACHINE_LOCK 1 ;// $00000001
#define CS_RESET 2 ;// $00000002
#define CS_SINGLE_BLOCK 4 ;// $00000004
#define CS_OPT_STOP 8 ;// $00000008
#define CS_BLOCK_DELETE 16 ;// $00000010
#define CS_CLNT_FLOOD 32 ;// $00000020
#define CS_CLNT_MIST 64 ;// $00000040
#define CS_JOG_PLUS 128 ;// $00000080
#define CS_JOG_MINUS 256 ;// $00000100
#define CS_JOG_STOP 512 ;// $00000200
#define CS_JOG_RETURN 1024 ;// $00000400
#define CS_HOME 2048 ;// $00000800
#define CS_CYCLE_START 4096 ;// $00001000
#define CS_CYCLE_RESTART 8192 ;// $00002000
#define CS_FEED_HOLD 16384 ;// $00004000
#define CS_DRY_RUN 32768 ;// $00008000
#define CS_SPND_CW 65536 ;// $00010000
#define CS_SPND_CCW 131072 ;// $00020000
#define CS_SPND_BRAKE 262144 ;// $00040000
#define CS_SPND_NEUTRAL 524288 ;// $00080000
#define CS_PRG_REWIND 1048576 ;// $00100000
#define CS_CHUCK_OPEN 2097152 ;// $00200000
#define CS_CHUCK_CLOSE 4194304 ;// $00300000
#define CS_CHUCK_OD_GRIP 8388608 ;// $00800000
#define CS_CHUCK_ID_GRIP 16777216 ;// $01000000
#define CS_TOOL_RELEASE 33554432 ;// $02000000
#define CS_TOOL_ENGAGE 67108864 ;// $04000000
#define CS_SPND_DETECT 134217728 ;// $08000000
#define CS_SPND_CSS 268435456 ;// $10000000
#define CS_SPND_AT_SPEED 536870912 ;// $20000000
#define CS_SPND_AT_ZERO 1073741824 ;// $40000000
#define CS_SPND_FEED 2147483648 ;// $80000000
// Command/Status (CS) #4 32 bits ////////////////////////////////////////////
#define PC_STATUS4_M 3
#define CS_STATUS4_ADR DP:$60DE3
#define CS_STATUS4_M M3
#define PC_COMMAND4_M 11
#define CS_COMMAND4_ADR DP:$60DF3
#define CS_COMMAND4_M M11
#define CS_TURRET_HOME 1 ;// $00000001
#define CS_TURRET_INC_CW 2 ;// $00000002
#define CS_TURRET_INC_CCW 4 ;// $00000004
#define CS_TURRET_JOG_CW 8 ;// $00000008
#define CS_TURRET_JOG_CCW 16 ;// $00000010
#define CS_TURRET_SELECT 32 ;// $00000020
#define CS_TURRET_ALIGN 64 ;// $00000040
#define CS_TURRET_PARK 128 ;// $00000080
#define CS_TSTOCKB_ADV 256 ;// $00000100
#define CS_TSTOCKB_RET 512 ;// $00000200
#define CS_TSTOCKQ_ADV 1024 ;// $00000400
#define CS_TSTOCKQ_RET 2048 ;// $00000800
#define CS_SREST1_OPEN 4096 ;// $00001000
#define CS_SREST1_CLOSE 8192 ;// $00002000
#define CS_SREST2_OPEN 16384 ;// $00004000
#define CS_SREST2_CLOSE 32768 ;// $00008000
#define CS_PCATCHR_CATCH 65536 ;// $00010000
#define CS_PCATCHR_PARK 131072 ;// $00020000
#define CS_HOME_INIT 262144 ;// $00040000
#define CS_HOME_INPROGRESS 524288 ;// $00080000
#define CS_HOME_REFERENCE 1048576 ;// $00100000
#define CS_TOOL_CHANGE 2097152 ;// $00200000
#define CS_SPND_ORIENT 4194304 ;// $00400000
#define CS_CHIP_CONVEYOR 8388608 ;// $00800000
#define CS_PROG_STOP 16777216 ;//CS_USER_1, 0x01000000
#define CS_MAGAZINE_CW 33554432 ;//CS_USER_2, 0x02000000
#define CS_MAGAZINE_BRAKE 67108864 ;//CS_USER_3, 0x04000000
#define CS_SOURCE_OFF 134217728 ;//CS_USER_4, 0x08000000
#define CS_POWER_ON 268435456 ;//CS_USER_5, 0x10000000
#define CS_LIGHT_ON 536870912 ;//CS_USER_6, 0x20000000
#define CS_SAFEDOOR_OPEN 1073741824 ;//CS_USER_7, 0x40000000
#define CS_SAFEDOOR_UNLOCK 2147483648 ;//CS_USER_8, 0x80000000
// Command/Status (CS) #5 32 bits ////////////////////////////////////////////
#define PC_STATUS5_M 4
#define CS_STATUS5_ADR DP:$60DE4
#define CS_STATUS5_M M4
#define PC_COMMAND5_M 12
#define CS_COMMAND5_ADR DP:$60DF4
#define CS_COMMAND5_M M12
#define S_MOTION_M M75
#define S_MOTION_ADR Y:$60DE4,0,4,U
#define C_MOTION_M M95
#define C_MOTION_ADR Y:$60DF4,0,4,U
#define SEL_MOTION_MASK 240 ;// $0000000F
#define SEL_MOTION_LINEAR 0
#define SEL_MOTION_RAPID 1
#define SEL_MOTION_CIR1 2
#define SEL_MOTION_CIR2 3
#define SEL_MOTION_SPLINE1 4
#define SEL_MOTION_PVT 5
#define S_TIMEBASE_M M76
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -