📄 oem.h
字号:
///////////////////////////////////////////////////////////////////////////
//mmm
// File: oem.h
//
// Generic and test.
//
//
// 1. At beginning of macro name:
//
// A. VARIABLE
//
// CS = DPRAM Command/Status related value matching that used by DLL.
// ES = DPRAM Error/Status related value matching that used by DLL.
// PC = PC DPRAM related value used by DLL.
// VS = DPRAM Value/Status related value matching that used by DLL.
//
// B. INPUTS
//
// FS = Float switch or Foot switch.
// LS = Limit switch.
// PB = Push Button.
// PS = Pressure switch.
// PX = Proximity switch.
// SS = Selector switch.
//
// C. OUTPUTS
//
// CL = Coil.
// LT = Light
// SL = Solenoid.
//
// 2. At end of macro name:
//
// ADR = Address
// OFS = Offset
// BM = Bit Mask
// M = PMAC 'M' pointer
// L = PLCC L-Varible
//
/////////////////// Default PMAC/PC Variable Locations ////////////////////
//
// Function | M Var Range | P Var Range / L Var Range | Prog Name | DPRAM Addr
// ---------------------------------------------------------------------------------------
// Address.h : M0..M279 : : : DLL :
//-------------:--------------------------------------------------------------------------
// Oemm.h : M280..M339 : : : Predefine common used variables
//----------------------------------------------------------------------------------------
// Oem.h : M340..M469 : : : For Delta Tau PLC usage
//----------------------------------------------------------------------------------------
#ifndef OEM_H
#define OEM_H
//-----------------------------------------
// SPINDLE.PLC M,P & L Variable Definitions
//-----------------------------------------
// M340 .. M359, P340..P359, L340..359
#define JOG_CW CMD"#4j+"
#define JOG_CCW CMD"#4j-"
#define JOG_STOP CMD"#4j/"
//NO CHANGE
#define SPINDLE_MOTOR_VEL M340
#define SPINDLE_MOTOR_VEL_ADR X:$21D,0,24,S
#define SPINDLE_CSS_POS M341
#define SPINDLE_CSS_POS_ADR D:$8B
#define SPINDLE_DAC_M M342
#define SPINDLE_DAC_ADR Y:$C00A,8,16,S
#define SPINDLE_ENA_M M343
#define SPINDLE_ENA_ADR X:$C00C,14,1
SPINDLE_MOTOR_VEL->SPINDLE_MOTOR_VEL_ADR
SPINDLE_CSS_POS->SPINDLE_CSS_POS_ADR
SPINDLE_DAC_M->SPINDLE_DAC_ADR
SPINDLE_ENA_M->SPINDLE_ENA_ADR
#define SPINDLE_TEMP P340
#define SPINDLE_ERR_ALLOWED P341
#define LAST_SPND_DIR P342
#define LAST_CMD_RPM P343
#define RTIF P344
#define SPINDLE_CSS_RADIUS P345
#define SCAN P346
#define CSS_OFFSET P347
#define VOLTS_PER_RPM P348
#define SPINDLE_MIN_RPM P359
//NO CHANGE
#define SPINDLE_JOG_SPEED I422
//----------------------------------------
// Timebase Pointer Defines PLC 2 OVRD.PLC
//----------------------------------------
// M360..M379,P360..P379, X,Y memory space $772 - $774
// To assign cutting timebase: TIMEBASE_M = CUTTING_TIMEBASE
// To assign rapid timebase : TIMEBASE_M = RAPID_TIMEBASE
// To assign thread timebase : TIMEBASE_M = THREAD_TIMEBASE
#define TIMEBASE_M M360 ;// I193
#define TIMEBASE_ADR X:$2001,0,16,U ; $0807
#define TIMEBASE2_M M361 ;// I293
#define TIMEBASE2_ADR X:$2101,0,16,U ; $08c7
#define TIMEBASE3_M M1361 ;// I393
#define TIMEBASE3_ADR X:$2201,0,16,U ;
#define CUTTING_TIMEBASE_M M362
#define CUTTING_TIMEBASE_ADR X:$2002,0,24,S
#define CUTTING_TIMEBASE $2002 ; $0806
#define CUTTING_TIMEBASE2_M M363
#define CUTTING_TIMEBASE2_ADR X:$2102,0,24,S
#define CUTTING_TIMEBASE2 $2102 ;$08C6
#define CUTTING_TIMEBASE3_M M1363
#define CUTTING_TIMEBASE3_ADR X:$2202,0,24,S
#define CUTTING_TIMEBASE3 $2202
#define RAPID_TIMEBASE_M M364
#define RAPID_TIMEBASE_ADR X:$10F2,0,24,S ;// I10 units $772
#define RAPID_TIMEBASE $10F2
#define RAPID_TIMEBASE2_M M365
#define RAPID_TIMEBASE2_ADR X:$10F3,0,24,S ;// I10 units
#define RAPID_TIMEBASE2 $10F3
#define RAPID_TIMEBASE3_M M1365
#define RAPID_TIMEBASE3_ADR X:$10F4,0,24,S ;// I10 units
#define RAPID_TIMEBASE3 $10F4
//NO CHANGE
#define THREAD_TIMEBASE_M M366
#define THREAD_TIMEBASE_ADR Y:$072A,0,24,S
#define THREAD_TIMEBASE $072B
#define THREAD_PROC_BITS_M M367
#define THREAD_PROC_BITS_ADR Y:$072A,16,8
#define THREAD_SCALE_M M368
#define THREAD_SCALE_ADR Y:$072B,0,24,S
//NO CHANGE
#define FPR_TIMEBASE $0774
#define FPR_TIMEBASE_M M369
#define FPR_TIMEBASE_ADR X:$0774,0,24,S
#define SPND_TIMEBASE_M M370
#define SPND_TIMEBASE_ADR X:$0729,0,24,S
#define FPR_SCALE_M M371
#define FPR_SCALE_ADR Y:$0729,0,24,S
#define CS1_TIMEBASE_UNITS_I I5190
#define CS2_TIMEBASE_UNITS_I I5290
#define CS3_TIMEBASE_UNITS_I I5390
#define TIME_BASE_SLEW_I I5194
#define MAX_SLEW 8388607
#define MED_SLEW 4250
#define MINUTES_MS 60000
//NO CHANGE
#define TIMEBASE_FROZEN $90
#define THREAD_MODE P360
TIMEBASE_M->TIMEBASE_ADR
CUTTING_TIMEBASE_M->CUTTING_TIMEBASE_ADR
RAPID_TIMEBASE_M->RAPID_TIMEBASE_ADR
TIMEBASE2_M->TIMEBASE2_ADR
CUTTING_TIMEBASE2_M->CUTTING_TIMEBASE2_ADR
RAPID_TIMEBASE2_M->RAPID_TIMEBASE2_ADR
TIMEBASE3_M->TIMEBASE3_ADR
CUTTING_TIMEBASE3_M->CUTTING_TIMEBASE3_ADR
RAPID_TIMEBASE3_M->RAPID_TIMEBASE3_ADR
THREAD_PROC_BITS_M->THREAD_PROC_BITS_ADR
THREAD_SCALE_M->THREAD_SCALE_ADR
THREAD_TIMEBASE_M->THREAD_TIMEBASE_ADR
FPR_TIMEBASE_M->FPR_TIMEBASE_ADR
SPND_TIMEBASE_M->SPND_TIMEBASE_ADR
FPR_SCALE_M->FPR_SCALE_ADR
// Commanded Position Defines /////////////////////////////////////////////
#define X_CMD_POS_M M372
#define Y_CMD_POS_M M373
#define Z_CMD_POS_M M374
#define X_CMD_POS_ADR L:$2047 ;// Coord sys &1 X commanded position L:$081F
#define Y_CMD_POS_ADR L:$2048 ;// Coord sys &1 Y commanded position L:$0820
#define Z_CMD_POS_ADR L:$2049 ;// Coord sys &1 Z commanded position L:$0821
#define X2_CMD_POS_M M375
#define Y2_CMD_POS_M M376
#define Z2_CMD_POS_M M377
#define X2_CMD_POS_ADR L:$2147 ;// Coord sys &2 X commanded position L:$08DF
#define Y2_CMD_POS_ADR L:$2148 ;// Coord sys &2 Y commanded position L:$08E0
#define Z2_CMD_POS_ADR L:$2149 ;// Coord sys &2 Z commanded position L:$08E1
#define Z_ACT_POS_M M378
#define Z_ACT_POS_ADR D:$18B ;D:$00A3
#define Z_ERR P361
X_CMD_POS_M->X_CMD_POS_ADR
Y_CMD_POS_M->Y_CMD_POS_ADR
Z_CMD_POS_M->Z_CMD_POS_ADR
X2_CMD_POS_M->X2_CMD_POS_ADR
Y2_CMD_POS_M->Y2_CMD_POS_ADR
Z2_CMD_POS_M->Z2_CMD_POS_ADR
Z_ACT_POS_M->Z_ACT_POS_ADR
//------------------------------------------------------
// HOME.PMC prog 3 and HOME.PLC PLC Variable Definitions
//------------------------------------------------------
// M380..M399, P380..P399
#define MOTOR_1 1 ; 1st bit represents motor 1
#define MOTOR_2 2 ; 2nd bit represents motor 2
#define MOTOR_3 4 ; 3rd bit represents motor 3
#define MOTOR_4 8 ; 4th bit represents motor 4
#define MOTOR_5 $10 ; 5th bit represents motor 5
#define MOTOR_6 $20 ; 6th bit represents motor 6
#define MOTOR_7 $40 ; 7th bit represents motor 7
#define MOTOR_8 $80 ; 8th bit represents motor 8
#define POS_LIMIT_DISABLE $20000 ; Mask for position limits
#define AMP_FAULT_DISABLE $100000 ; Mask for amp fault
#define HOME_FLAG_1 M380 ; Home switch for motor 1X:$C000,20,1
#define HOME_FLAG_1_ADR X:$78000,20,1
#define HOME_FLAG_2 M381 ; Home switch for motor 2X:$C004,20,1
#define HOME_FLAG_2_ADR X:$78004,20,1
#define HOME_FLAG_3 M382 ; Home switch for motor 3X:$C008,20,1
#define HOME_FLAG_3_ADR X:$78008,20,1
#define HOME_FLAG_4 M383 ; Home switch for motor 4X:$C00C,20,1
#define HOME_FLAG_4_ADR X:$7800C,20,1
#define HOME_FLAG_5 M384 ; Home switch for motor 5X:$C010,20,1
#define HOME_FLAG_5_ADR X:$78100,20,1
#define HOME_FLAG_6 M385 ; Home switch for motor 6X:$C014,20,1
#define HOME_FLAG_6_ADR X:$78104,20,1
#define HOME_FLAG_7 M386 ; Home switch for motor 7X:$C018,20,1
#define HOME_FLAG_7_ADR X:$78108,20,1
#define HOME_FLAG_8 M387 ; Home switch for motor 8X:$C01C,20,1
#define HOME_FLAG_8_ADR X:$7810C,20,1
HOME_FLAG_1->HOME_FLAG_1_ADR
HOME_FLAG_2->HOME_FLAG_2_ADR
HOME_FLAG_3->HOME_FLAG_3_ADR
HOME_FLAG_4->HOME_FLAG_4_ADR
HOME_FLAG_5->HOME_FLAG_5_ADR
HOME_FLAG_6->HOME_FLAG_6_ADR
HOME_FLAG_7->HOME_FLAG_7_ADR
HOME_FLAG_8->HOME_FLAG_8_ADR
#define DES_VEL_ZERO_1_M M388
#define DES_VEL_ZERO_1_ADR X:$B0,13,1 ;X:$3D,13,1
#define DES_VEL_ZERO_2_M M389
#define DES_VEL_ZERO_2_ADR X:$130,13,1 ;X:$79,13,1
#define DES_VEL_ZERO_3_M M390
#define DES_VEL_ZERO_3_ADR X:$1B0,13,1
#define DES_VEL_ZERO_4_M M391
#define DES_VEL_ZERO_4_ADR X:$230,13,1
#define DES_VEL_ZERO_5_M M392
#define DES_VEL_ZERO_5_ADR X:$2B0,13,1
#define DES_VEL_ZERO_6_M M393
#define DES_VEL_ZERO_6_ADR X:$330,13,1
#define DES_VEL_ZERO_7_M M394
#define DES_VEL_ZERO_7_ADR X:$3B0,13,1
#define DES_VEL_ZERO_8_M M395
#define DES_VEL_ZERO_8_ADR X:$430,13,1
DES_VEL_ZERO_1_M->DES_VEL_ZERO_1_ADR
DES_VEL_ZERO_2_M->DES_VEL_ZERO_2_ADR
DES_VEL_ZERO_3_M->DES_VEL_ZERO_3_ADR
DES_VEL_ZERO_4_M->DES_VEL_ZERO_4_ADR
DES_VEL_ZERO_5_M->DES_VEL_ZERO_5_ADR
DES_VEL_ZERO_6_M->DES_VEL_ZERO_6_ADR
DES_VEL_ZERO_7_M->DES_VEL_ZERO_7_ADR
DES_VEL_ZERO_8_M->DES_VEL_ZERO_8_ADR
#define PREV_USER_2_STATE P380
////////////////////////////////////////////////////////////////////////////
// macro definitions for TIMERTIC.PLC (plcc 1) reserves M400..M415, P400..P415
// This is a Compiled PLC L0..L100
////////////////////////////////////////////////////////////////////////////
//****************************************************************************
// "TIMERTIC.PLC" Header Files
// This file is currently in OEM.H
// Description: Defines "TIMERTIC.PLC" & temporary variables.
// Many of these variables use the PMAC "UBUFFER" memory.
// The "DEFINE UBUFFER < size >" must be sent to the PMAC
// and SAVED for this area of memory to protected from being
// over-written by the PMAC.
// Memory $9FF0 to $9FFF is reserved for future PLCC Function Block
// use.
//
// Y:$9FFF is the PLCC Function Block FB start address in
// the UBUFFER memory and is used by the PLCC FB's
//
// X:$9FFF is the PLCC Function Block FB Timer .TS start address
// in the UBUFFER memory and is used by the PLCC FB's Timers
// TON, TOF, and TP.
//
// Y:$9FFE is the PLCC Function Block FB Timer Tic value.
// It is updated by the "TIMERTIC.PLC".
//****************************************************************************
//
// Resource Use: L0..100, M400..M415, P400..P415
// When used with Wizdom's Paradym 31 UBUFFER memory from $9FE0 to $9FFA
// is reserved for PMAC NC, TIMERTIC.PLC and Temporary Variable use.
//
//****************************************************************************
//
// Temporary L & M Variables:
// -------------------------
//
// ANY USER PLCs or PLCC can assign their temporary variables to these
// variables. Users are incouraged to use these variables to
// maximize the use of PMAC memory and M, L & P variables.
//
// Rules of Use:
// ------------
// 1. They are temporary storage and are not necessarily retained
// after exiting the PLC or PLCC.
//
// 2. They cannot be used in a WHILE loop if its value is needed on the
// multiple passes of the loop since the PLC is exited at the ENDWHILE
// on each pass of the WHILE loop.
// EX. #define COUNT IL24T1
// COUNT = 5
// WHILE( COUNT > 0
// COUNT = COUNT -1
// ENDWHILE // Each pass exit here so another PLC can use IL24T1
//
//****************************************************************************
//
// 26 x 24 bit signed Temp. L-Variables ( 13 x 48 bits used )
//
//#define IL24T1 L1
//#define IL24T2 L2
//#define IL24T3 L3
//#define IL24T4 L4
//#define IL24T5 L5
//#define IL24T6 L6
//#define IL24T7 L7
//#define IL24T8 L8
//#define IL24T9 L9
//#define IL24T10 L10
//#define IL24T11 L11
//#define IL24T12 L12
//#define IL24T13 L13
//#define IL24T14 L14
//#define IL24T15 L15
//#define IL24T16 L16
//#define IL24T17 L17
//#define IL24T18 L18
//#define IL24T19 L19
//#define IL24T20 L20
//#define IL24T21 L21
//#define IL24T22 L22
//#define IL24T23 L23
//#define IL24T24 L24
//#define IL24T25 L25
//#define IL24T26 L26
//
// 26 x 24 bit signed Temp. L-Variables Addresses
//
//L1->Y:$9FEF,0,24,S
//L2->X:$9FEF,0,24,S
//L3->Y:$9FEE,0,24,S
//L4->X:$9FEE,0,24,S
//L5->Y:$9FED,0,24,S
//L6->X:$9FED,0,24,S
//L7->Y:$9FEC,0,24,S
//L8->X:$9FEC,0,24,S
//L9->Y:$9FEB,0,24,S
//L10->X:$9FEB,0,24,S
//L11->Y:$9FEA,0,24,S
//L12->X:$9FEA,0,24,S
//L13->Y:$9FE9,0,24,S
//L14->X:$9FE9,0,24,S
//L15->Y:$9FE8,0,24,S
//L16->X:$9FE8,0,24,S
//L17->Y:$9FE7,0,24,S
//L18->X:$9FE7,0,24,S
//L19->Y:$9FE6,0,24,S
//L20->X:$9FE6,0,24,S
//L21->Y:$9FE5,0,24,S
//L22->X:$9FE5,0,24,S
//L23->Y:$9FE4,0,24,S
//L24->X:$9FE4,0,24,S
//L25->Y:$9FE3,0,24,S
//L26->X:$9FE3,0,24,S
//
// 48 x 1 bit Booleans Temp. L-Variables
//
//#define BL1T1 L27
//#define BL1T2 L28
//#define BL1T3 L29
//#define BL1T4 L30
//#define BL1T5 L31
//#define BL1T6 L32
//#define BL1T7 L33
//#define BL1T8 L34
//#define BL1T9 L35
//#define BL1T10 L36
//#define BL1T11 L37
//#define BL1T12 L38
//#define BL1T13 L39
//#define BL1T14 L40
//#define BL1T15 L41
//#define BL1T16 L42
//#define BL1T17 L43
//#define BL1T18 L44
//#define BL1T19 L45
//#define BL1T20 L46
//#define BL1T21 L47
//#define BL1T22 L48
//#define BL1T23 L49
//#define BL1T24 L50
//#define BL1T25 L51
//#define BL1T26 L52
//#define BL1T27 L53
//#define BL1T28 L54
//#define BL1T29 L55
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -