// SR71M : Version No - 1.0 /****************************************** GSL & BRP ***************************************/ //LATEST MODIFICATION BY GSL & BRP : 02.05.2005 /****************************************** GSL & BRP ***************************************/ /******************************************************************/ /* This file contains all global variables LATEST MODIFICATION BY GBM : 29.08.2001 4:15 LATEST MODIFICATION BY NDC : LATEST MODIFICATION BY RMP : /******************************************************************/ /*Menu Related constants*/ /* Multiplication factors for -*/ /* eg. for long time current setting if value entered is 0.7 then the value stored must be 70. Hence LONGTIME_CURRENT_MF=100*/ #define LONGTIME_CURRENT_MF 100 #define LONGTIME_DELAY_MF 2 // MF 2 OR 10 ? #define LONGTIME_PREALARM_MF 100 /*#define HEAT_COOL_RATIO_MF 100 #define COOLING_CONST_MF 100*/ //srn...VerR7 not used #define PHASESEQUENCE_DELAY_MF 10 #define SHORTTIME_CURRENT_MF 100 #define SHORTTIME_DELAY_MF 100 #define SHORTTIME_PREALARM_MF 100 #define INST_CURRENT_MF 10 #define GNDFAULT_CURRENT_MF 100 #define GNDFAULT_DELAY_MF 100 #define GNDFAULT_PREALARM_MF 100 #define NEUTRAL_CURRENT_MF 100 #define UNDERCURRENT_MF 100 #define UNDERCURRENT_DELAY_MF 1000 #define UNBALANCE_CURRENT_MF 100 #define UNBALANCE_DELAY_MF 10 #define UNBALANCE_DELAY_CONVERT_MF 100 #define VOLT_VOLTAGE_MF 100 #define VOLT_DELAY_MF 10 #define VOLT_RESETVOLT_MF 100 #define VOLT_DELAY_CONVERT_MF 100 #define FREQ_MF 100 #define FREQ_DELAY_MF 100 #define FREQ_DELAY_CONVERT_MF 10 #define REVERSEPOWER_POWER_MF 100 #define REVERSEPOWER_DELAY_MF 100 #define REVERSEPOWER_DELAY_CONVERT_MF 10 #define BKRFAIL_DELAY_MF 100 #define BKRFAIL_DELAY_CONVERT_MF 10 #define INTLOCK1_DELAY_MF 10 #define INTLOCK1_DELAY_CONVERT_MF 100 /***********************************GSL & BRP ********************************************/ //TAG - MD_EXCEED_SCREEN //SR71M #define MD_DELAY_CONVERT_MF 1000 //Multiplying Factor for MD Delay is 1000. #define MD_EXCEED_PICKUP_MF 1 //Multiplying Factor for MD Pickup is 1 /**********************************GSL & BRP ********************************************/ #define EL_CURRENT_MF 10 #define EL_DELAY_MF 10 #define OSCILLO_SAMPLES_PER_CYCLE 16 //since 16 samples of each current & voltages per cycle are taking for calculations. #define NO_OF_CYCLE 16 //since 16 cycles data of All currents,voltages,digital input has to be stored. #define CLEAR 0x00 #define SET 0x01 #define R_PHASE 0x00 #define Y_PHASE 0x01 #define B_PHASE 0x02 #define CURRENT_ROUNDOFF 100 #define VOLTAGE_ROUNDOFF 10 #define ACCUMULATING_CYCLES 100 #define NOMINAL_CURRENT (float)SUMOFSQUARES_I*INTCTCONST/4 #define POWER_ROUNDOFF 100 #define ENERGY_ROUNDOFF 100 #define POWERFACTOR_ROUNDOFF 100 #define CURRENT_ACCURACY_ROUNDOFF 100 /*16FEB02_GBM...*/ #define INT_CTPTCONST (INTCTCONST*INTPTCONST) #define INTCT_ROUNDOFF (INTCTCONST*25.0)/*CURRENT_ROUNDOFF/4*/ #define INTPT_ROUNDOFF (INTPTCONST*2.5)/*VOLTAGE_ROUNDOFF/4*/ #define SEQUENCE_CONST (INTCT_ROUNDOFF/2.828) /* jpg - PHASE iii */ #define IFUNDARMSCONST (1.414/(16 * 4096)) #define IFUNDARMS_ROUNDOFF ((INTCTCONST * 100 * IFUNDARMSCONST)) #define VFUNDARMSCONST (1.414/ (16 * 4096)) #define VFUNDARMS_ROUNDOFF ((10 * INTPTCONST * VFUNDARMSCONST)) #define THD_ROUNDOFF 100 #define COSOFRY 0.99919 #define COSOFYB 0.99839 #define COSOFBR 0.99718 #define SINOFRY 0.04013 #define SINOFYB 0.03489 #define SINOFBR 0.07497 /* jpg - PHASE iii */ /*...16FEB02_GBM*/ #define FREQ_ROUNDOFF 100 /*DPLL TIMER PERIOD 2M Hz */ #define CLOCK_PERIOD 2000000 #define DPLL_FREQROUNDOFF CLOCK_PERIOD*FREQ_ROUNDOFF #define NOMINAL_VOLTAGE (float)SUMOFSQUARES_V*INTPTCONST/4 #define NOMINAL_POWER_CONSTANT (NOMINAL_CURRENT*NOMINAL_VOLTAGE) #define SIZE_OF_BE_VER 5 #define QUATERCYCLE (BYTE)4 #define ONE_MINUTE (60*1000) /*minutes in terms of mili seconds */ #define DAY2MINS(mins,hours,days) (((LONG)mins) + ((LONG)hours*60) + ((LONG)days*60*24)) #define DAY2SECS(secs,mins,hours) ((long)secs + (long)mins*60 + (long)hours*3600) /*********************************************** MFS *************************************/ //SR71M //TAG : RATING_PLUG // multiplying factors for rating plug frame settings /***********************************************MFS******************************************/ //SR71M //TAG : RATING_PLUG // factors will not be requires. rating plug hard ware will take care and give neccesary input as per frame /* #define UNITYMULTFACTOR 100 #define MULTFACTOR1 79.365 #define MULTFACTOR2 80 #define MULTFACTOR3 78.125 #define MULTFACTOR4 62.5 #define MULTFACTOR5 50 #define MULTFACTOR6 39.375 #define MULTFACTOR7 39 */ /***********************************************MFS******************************************/ /*********************************************** MFS *************************************/ /*****************************************GSL & BRP ********************************/ // SR71M (Bug of UN-RS3) // TAG - FACTORY_DEFAULT_SETTINGS // ALARM definition and TRIP definition are changed to match the BackEnd ALARM and TRIP definition //#define TRIP 1 //#define ALARM 2 #define ALARM 1 #define TRIP 2 /*****************************************GSL & BRP ********************************/ #define PICKUP 3 #define DIGITAL_IP 4 #define EXT_DIGITAL_IP 5 //Ritu #define LOADMNGMENT 6 //SRN #define ACTIVE 0x00 #define REACTIVE 0x01 #define APPARENT 0x02 #define JAN 1 #define FEB 2 #define MAR 3 #define APR 4 #define MAY 5 #define JUN 6 #define JUL 7 #define AUG 8 #define SEP 9 #define OCT 10 #define NOV 11 #define DEC 12 #define DAYS_28 28 #define DAYS_29 29 #define CONVERTASCIIBUF_SIZE 0x08 /************************************************************************** SETTING STEP SIZES USED FOR ROUNDINGOFF THE SETTING DISPLAY used in convertBEsetting to FE format. during power on. *************************************************************************/ /*Long time current pickup step size in terms of %*/ #define LT_CSTEP 0x05 /*Long time pre trip alarm current step size in terms of %*/ #define LT_PASTEP 0x05 /*Short time current pickup step size in terms of %*/ #define SH_CSTEP 0x05 /*Short time pre trip alarm current step size in terms of %*/ #define SH_PASTEP 0x05 /*Ground fault pre trip alarm current step size in terms of %*/ #define GND_PASTEP 0x05 /*Neutral current pickup step size in terms of %*/ #define NUT_CSTEP 0x05 /*Under current pickup step size in terms of %*/ #define UC_CSTEP 0x05 /*Unbalance current pickup step size in terms of %*/ #define UNB_CSTEP 0x05 /*Under voltage pickup step size in terms of %*/ #define UV_PSTEP 0x05 /*Over volatge pickup step size in terms of %*/ #define OV_PSTEP 0x05 /********************************************************************************************* Following are the macro defination define by Rakesh panchal for Modbus Protocol Implementation **********************************************************************************************/ /* Macro defination */ #define ENABLE 1 #define DISABLE 0 #define ERROR 1 #define DATA_ERROR 0x03 #define ADDR_ERROR 0x02 #define ILLEGAL_FUNCTION_CODE 0x01 #define READ_INPUT_REGISTER 0x04 #define READ_HOLDING_REGISTER 0x03 #define PRESET_SINGLE_REGISTER 0x06 #define SLAVE_BUSYMESSAGE 0X06 #define PRESET_MULTIPLE_REGISTER 0x10 #define METER_ADDRESS_ZERO 0x00 #define BROADCAST_MESSAGE 0x00 #define BUF_SIZE 260 #define COM_BUF_SIZE 264 #define E2BUF_SIZE 6 #define TIMEOUT_MODBUS 150 #define TIMEOUT 500 #define MAXWORDCOUNT 127 #define NO_OF_BYTE_WRITE 8 #define BAUD1200 1200 #define BAUD2400 2400 #define BAUD4800 4800 #define BAUD19200 19200 #define BAUD9600 9600 #define EN_PARITY 1 #define DI_PARITY 0 #define EVEN_PARITY 0 #define ODD_PARITY 1 #define NO_OF_OSCILLOGRAPHY_RECORDS 32 /*Ritu...*/ #define NO_OF_EVENT_RECORDS 128 #define NO_OF_TRIP_RECORDS 5 /*...Ritu*/ #define NO_OF_MAINTENANCE_RECORDS 5 //PORTING SRN //#define EnableInterrupts WritePSR(ReadPSR() | IE | EE & ~PSR_S)// WritePSR(ReadPSR() | IE ) #define EnableInterrupts WritePSR(ReadPSR() | IE | FIE | EE & ~PSR_S)/*FI*/ #define DisableInterrupts WritePSR(ReadPSR() & ~FIE & ~IE & ~EE)//WritePSR(ReadPSR() & ~IE ) /***************************************************************** FOLLOWING ARE THE MACRO DEFINE BY RITU. *****************************************************************/ #define SYS_CLK_DIVISOR 0x05 // 0x05 corresponds to sys clock/32 #define SYS_CLK_DIVISOR_F 0x0f //0x0f corresponds to sysclock/32768 //#define SYS_CLK_DIVISOR 0x0F // 0x05 corresponds to sys clock/32 #define RELOAD_COUNTER 1 //if 1 = PMR is reloaded when it reaches 0 value. #define RELOAD_DISABLE 0 //if 0 PMR is not laoded .15.07.02 #define TIMER_MODULUS_VALUE 0x0E10 #define ENABLE_TIMER (reg_PCSR1.bit.EN=ENABLE) #define DISABLE_TIMER (reg_PCSR1.bit.EN=DISABLE) #define LOAD_PMR1 (reg_PMR1 = PMR1rldval) // Load PMR1 register with Timer Modulus Value. //#define WATCHDOG_REFRESH reg_PORTE.bit.PIN4 ^= 0x01 #define WATCHDOG_REFRESH reg_EPDR.bit.EPD4 ^= 0x01 #define METERING_REC 1 #define TRIP_REC 2 #define OSC_REC 3 #define EVENT_REC 4 #define MAINT_REC 5 #define DIGIRELAY_REC 6 #define ALLSETTING_REC 7 #define COMMAND_REC 8 #define TRIPCOUNT_REC 9 // Added on 12-07-02 //Ritu... //#define PHASEII_REC 10 #define PHASEIII_REC 10 // JPG - PHASE III //...Ritu //#define METERING_REC_SIZE 98 //#define METERING_REC_SIZE 90 //srn...VerR7 metering record size is 90 //#define METERING_REC_SIZE 108 // JPG - Phase III /* JPG Phase III*/ /* Two reserved location below percentage load currents are removed and EarthLeakage Current and Phase Sequence bytes are shifted to those locations. */ /* JPG Phase III*/ //#define METERING_REC_SIZE 106 // JPG - Phase III /*******************************************GSL & BRP ************************************************/ //TAG - ADD_RISING_DEMAND //TAG - READ_MODBUS //SR71M //2 words are added for Rising Demand. /*#define METERING_REC_SIZE 108 // JPG Phase III _ changed again to 200 to accomodate change in size of THD from // BYTE to WORD. This change is done to implement two decimal point for THD*/ #define METERING_REC_SIZE 110 //Added Rising Demand in Metering Memory Map /******************************************GSL & BRP ************************************************/ //#define TRIP_REC_SIZE 28 #define TRIP_REC_SIZE 32 // JPG - Phase III //#define OSC_REC_SIZE 65 //SRN not used 28july03 POW0136 //#define EVENT_REC_SIZE 6 #define EVENT_REC_SIZE 8 // JPG - PHASE iii #define MAINT_REC_SIZE 8 /*VerR7*/ //All Settings record size is 76 //#define ALLSETTING_REC_SIZE 72 //#define ALLSETTING_REC_SIZE 76 #define ALLSETTING_REC_SIZE 78 //jpg - PHASE iii CHANGES /*VerR7*/ #define RTC_DATA_SIZE 4 // 20.07.02 //#define MAX_TRIP_REC 112 #define MAX_TRIP_REC 96 // JPG - PHASE iii #define MAX_EVENT_REC 120 /*VerR7*/ //#define MAX_MAINT_REC 40 //Max record size is 48, include running maintenance record #define MAX_MAINT_REC 48 /*VerR7*/ /********************************************************************** FOLLOWING ARE THE MACRO DEFINE BY RAKESH PANCHAL FOR LCD DRIVER ***********************************************************************/ #define LCD_DATA_INST 0x02 //Data/Instruction Signal #define LCD_READ_WRITE 0x01 //Data Read/Write #define LCD_ENABLE 0x08 //Lcd module enable #define LCD_CHIPSELECT 0x04 //Lcd Chip select #define LCD_RESET 0x80 //Reset Signal. #define LCD_PORT_ENABLE 0 /*constant for portcontrol */ #define LCD_PORT_DISABLE 1 /*active low signals ? */ #define LCD_DATA 1 /*constant for lcdData*/ #define LCD_INST 0 /* Lcd line constant*/ #define ZEROTHROW 0 #define FIRSTROW 16 #define SECONDROW 32 #define THIRDROW 48 #define FOURTHROW 64 #define FIFTHROW 80 #define SIXTHROW 96 #define SEVENTHROW 112 #define EIGTHROW 128 #define NINTHROW 144 #define TENTHROW 160 #define ELEVENTHROW 176 #define TWEVELTHROW 192 #define TIRHTEENTHROW 208 #define FOURTEENTHROW 224 #define FIFTEENTHROW 240 /*--------------------------------------------------------------------------*/ /* LCD COMMAND - MODE CONTROL */ /*--------------------------------------------------------------------------*/ #define CURSOR_OFF 0x20 // Cursor Off #define CURSOR_ON 0X24 // Cursor on #define CURSOR_OFF_CHAR_BLINK 0x28 // CURSOR_OFF_CHAR_BLINK #define CURSOR_BLINK 0x2C //CURSOR_BLINK #define GRAPHIC_MODE 0x22 //GraphicMode #define CHARACTER_DISPLAYMODE 0x24 //CharacterDisplayMode #define BLANK_CHARACTER 0xA0 //BlankCharacter #define DummyData 0x00 //DummyData /*--------------------------------------------------------------------------*/ /* LCD COMMAND - GENERAL CONTROL */ /*--------------------------------------------------------------------------*/ #define CHAR_PITCH_INST 0x01 //CharPitchInst #define NO_CHAR_INST 0x02 //NoCharInst #define DISPLAYDUTY_INST 0x03 //DisplayDutyInst #define CURSOR_POSITION_INST 0x04 //CursorPositionInst #define DISP_START_LOWER_ADD_INST 0x08 //DisplayStartLowerAddressInst #define DISP_START_UPPER_ADD_INST 0x09 //DisplayStartUpperAddressInst #define CURSOR_LOWER_ADD_INST 0x0A //CursorLowerAddressInst #define CURSOR_UPPER_ADD_INST 0x0B //CursorUpperAddressInst #define DATA_WRITE_INST 0x0C //DataWriteInst #define DATA_READ_INST 0x0D //DataReadInst #define BIT_CLEAR_CINST 0x0E //BitClearCInst #define BIT_SET_CINST 0x0F //BitSetCInst /*----------------------------------------------------------------------------*/ /******************************************************************************/ /* User defined LCD Configuration Settings */ /******************************************************************************/ #define CHAR_PITCH_DATA 0x77 // Set Vp = 8 & Hp = 8 #define NO_CHAR_DATA 0x0f // Number of charcter Per Line #define DISPLAYDUTY_DATA 0x7f //Display Duty Data #define CURSOR_POSITION_DATA 0x07 //Set Cursor position to 8 for 5*7 font #define DISP_START_LOWER_ADD_DATA 0x00 // Set display starting address to the Zeroth location #define DISP_START_UPPER_ADD_DATA 0x00 #define CURSOR_LOWER_ADD_DATA 0x00 // Set the cursor Address to the Zeroth Row & Zeroth lication #define CURSOR_UPPER_ADD_DATA 0x00 #define CHAR_BLINKOFF_DATA 0x24 //Blink off the character /****************************************************************************** GRAPHICAL DISPLAY MODE RELATED MACRO ********************************************************************************/ #define FORMAT_8By8 1 #define FORMAT_8By10 2 #define FORMAT_8By14 3 #define FORMAT_16By16 4 #define GAPBETWEENLINES 2 #define MAXLINES 128 #define SIXTEEN 16 #define EIGHT 8 #define MAXNOOFCOLUMNS 16 #define DATA 0x01 #define HORZTWOCYCLES 0 #define HORZFOURCYCLES 1 #define HORZEIGHTCYCLES 2 #define VERT50PERCENT 0 #define VERT75PERCENT 1 #define VERT100PERCENT 2 #define DATAFF 0xff #define MAXROW 107 #define LCDDATA 0x03 /********END OF LCD DRIVER MACRO DEFINATION BY RAKESH PANCHAL*****************/ /**************************************************************** MENU RELATED MACRO DEFINE BY PNS *****************************************************************/ /*************************************************************************/ // MENU RELATED DEFINES /************************************************************************/ #define ONLINEMETERING 1 #define OFFLINEMETERING 2 #define SETTING 1 #define DISPLAYS 2 #define COMMAND 3 #define MENU 4 #define IFDATE 1 #define IFTIME 2 #define DAYS 1 #define MONTHS 2 #define YEARS 3 #define HOURS 1 #define MINUTES 2 #define SECONDS 3 /******************************************************************/ //#define MAXMETERINGSCREEN 15 //#define MAXMETERINGSCREEN 16 //16.10.02 Phase2 #define MAXMETERINGSCREEN 22 //07.01.04 Phase3 - JPG #define METERINGSCREEN1 1 #define METERINGSCREEN2 2 #define METERINGSCREEN3 3 #define METERINGSCREEN4 4 #define METERINGSCREEN5 5 #define METERINGSCREEN6 6 #define METERINGSCREEN7 7 #define METERINGSCREEN8 8 #define METERINGSCREEN9 9 #define METERINGSCREEN10 10 #define METERINGSCREEN11 11 #define METERINGSCREEN12 12 #define METERINGSCREEN13 13 #define METERINGSCREEN14 14 #define METERINGSCREEN15 15 #define METERINGSCREEN16 16 //16.10.02 2nd Phase #define METERINGSCREEN17 17 //7.01.04 3rd Phase - JPG #define METERINGSCREEN18 18 //7.01.04 3rd Phase - JPG #define METERINGSCREEN19 19 //7.01.04 3rd Phase - JPG #define METERINGSCREEN20 20 //7.01.04 3rd Phase - JPG #define METERINGSCREEN21 21 //7.01.04 3rd Phase - JPG #define METERINGSCREEN22 22 //7.01.04 3rd Phase - JPG /******************************************************************/ // TripStatusScreenPointer //#define MAXTRIPSCREENPOINTER 3 #define MAXTRIPSCREENPOINTER 4 /*srn..Phase III*/ #define TRIPSTATUSSCREEN1 1 #define TRIPSTATUSSCREEN2 2 #define TRIPSTATUSSCREEN3 3 #define TRIPSTATUSSCREEN4 4/*Phase III*/ /******************************************************************/ /*IO Modules pooja...*/ /*As the IO Status screens will also include the status screens for all 4 IO Modules the total IO status screens are now 6*/ //#define MAXIOSTATUSSCREEN 2 /********************************************** MFS ********************************************************/ //TAG:DELETE_IO_MODULE //SR71M //maximum io screens are now reduced from 6 to 3 //#define MAXIOSTATUSSCREEN 6 #define MAXIOSTATUSSCREEN 3 /********************************************** MFS ********************************************************/ /*...IO Modules pooja*/ #define FIXED_IOSCREEN1 1 #define FIXED_IOSCREEN2 2 #define IOSCREEN3 3 #define IOSCREEN4 4 #define IOSCREEN5 5 #define IOSCREEN6 6 /*****************************************************************/ #define KEY1 1 #define KEY2 2 #define KEY3 3 #define KEY4 4 #define NOKEY 0 /****************************************************************/ #define DATE1 1 #define COMMUNICATION 2 #define EVENTRECORDER 3 /**************************************** BRP ***********************************************/ //TAG - REMOVE_OSCILLOGRAPHY //As Oscillography Feature does not function properly and has not been verified further, it is disabled //from display & modbus. /*#define OSCILLOGRAPHY 4 #define CHANGEPASSWORD 7 #define MDPERIOD 5 #define LOGODISPLAY 6 #define COMMAND_PASSWORD 8 #define VOLT_CONNECTED 9 //SGT_PH3*/ #define CHANGEPASSWORD 6 #define MDPERIOD 4 #define LOGODISPLAY 5 #define COMMAND_PASSWORD 7 #define VOLT_CONNECTED 8 //SGT_PH3 /******************************************* BRP ********************************************/ #define MAINTENANCE 1 #define TRIP_RECORDINGS 2 /*****************************************GSL & BRP ***********************************/ //TAG - REM_VIEW_EVENT_REC //Remove Event Records from View Records Screen #define EVENT_RECORDINGS 3 #define OSCILLOGRAPHY_DISPLAY 4 /**************************************GSL & BRP *************************************/ #define PROG_MODE 1 #define VIEW_MODE 2 #define UNIT_SETTING 1 #define SYSTEM_SETTING 2 #define PROTECTION 3 #define LSIG_SETTINGS 4 #define SET_GROUP1 1 #define SET_GROUP2 2 #define FREQUENCY 1 //Added by PNS on 12/10/2001. /****************************************MFS ***************************************/ //SR71M //tag: IN_MULTIPLIER //InMULTIPLIER case is not there.. so shifter all other case values up /*#define InMULTIPLIER 3 #define PTRATIO 4*/ /* Hari 22.04.02..*/ /*#define I2TREFVALUE 2 #define MAINTENANCEPERIOD 5 #define CURRENT_DIRECTION 6*/ //#define InMULTIPLIER 3 #define PTRATIO 3 /* Hari 22.04.02..*/ #define I2TREFVALUE 2 #define MAINTENANCEPERIOD 4 #define CURRENT_DIRECTION 5 /****************************************MFS ***************************************/ /****************************************GSL & BRP ***************************************/ // SR71M // TAG - REMOVE_POLES // Change the definition of PH_SEQ to 7 and delete the definiton of POLES //#define POLES 7 //#define PH_SEQ 8//SrN...Phase III Changes /*************************************************MFS***************************************/ //InMULTIPLIER case is not there.. so shifter all other case values up //tag :IN_MULTIPLIER //#define PH_SEQ 7//SrN...Phase III Changes #define PH_SEQ 6//SrN...Phase III Changes /*************************************************MFS***************************************/ /****************************************GSL & BRP ***************************************/ #define MILLION (LONG)1000000 /* ..Hari 22.04.02*/ /* ADDEd feature for addition of feature of 3 pole 4 pole selection 15/07/03 GK*/ //#define DemoOffLineVariableMax 5 /*srn....Phase III #define LONGTIME 1 #define SHORTTIME 2 #define INSTANTANEOUS_1 3 #define GROUND_FAULT 4 #define NEUTRAL 5 #define UNDERCURRENT 6 #define CURRENTUNBALANCE 7 #define UNDERVOLTAGE 8 #define OVERVOLTAGE 9 #define UNDERFREQUENCY 10 #define OVERFREQUENCY 11 #define REVPOWER 12 #define BKRFAILURE 13 */ /**********************************************GSL & BRP *********************************************/ //TAG - PROTECTION_SCREEN //TAG - PROG_RELAY //TAG - RELAY_MODULE //TAG - MD_EXCEED_PROTECTION //SR71M /*#define LONGTIME 1 #define SHORTTIME 2 #define INSTANTANEOUS_1 3 #define GROUND_FAULT 4 #define EARTH_LEAKAGE 5 #define NEUTRAL 6 #define UNDERCURRENT_1 7 #define CURRENTUNBALANCE 8 #define UNDERVOLTAGE_1 9 #define OVERVOLTAGE_1 10 #define UNDERFREQUENCY_1 11 #define OVERFREQUENCY_1 12 #define REVPOWER 13 #define PHASE_SEQUENCE 14 //phase sequence settings #define BKRFAILURE 15 //SeK For Testing.. //#define DISCRIMINATION 14 //#define ZONESELECT 15 // //#define ZONESELECT 14 //#define DISCRIMINATION 15 #define ZONESELECT 16 //srn..Phase III #define DISCRIMINATION 17 //..SeK For testing //17.10.02 Phase2... // //#define TCS_MODULE 16 //#define TEMP_MODULE 17 //#define IO_MODULE 18 //Phase III #define TCS_MODULE 18 #define TEMP_MODULE 19 #define IO_MODULE 20*/ #define LONGTIME 1 #define SHORTTIME 2 #define INSTANTANEOUS_1 3 #define GROUND_FAULT 4 #define NEUTRAL 5 #define UNDERCURRENT_1 6 #define CURRENTUNBALANCE 7 #define UNDERVOLTAGE_1 8 #define OVERVOLTAGE_1 9 #define UNDERFREQUENCY_1 10 #define OVERFREQUENCY_1 11 #define REVPOWER 12 #define PHASE_SEQUENCE 13 //phase sequence settings #define BKRFAILURE 14 #define DISCRIMINATION 15 #define MD_EXCEED 16 //MD Exceed Protection is the 16th parameter in the protection screen #define RLY_MODULE 17 //Relay Module is the 17th parameter in the protection screen #define PROG_RELAY 18 //Prog Relay is the 18th parameter in the protection screen. /*******************************GSL & BRP ***************************/ //..SeK For testing //17.10.02 Phase2... // //#define TCS_MODULE 16 //#define TEMP_MODULE 17 //#define IO_MODULE 18 //Phase III #define TCS_MODULE 18 #define TEMP_MODULE 19 #define IO_MODULE 20 /*Phse III*/ /*...17.10.02 Phase2*/ /*balaji28/12/2002...*/ #define IO_MODULE1 1 #define IO_MODULE2 2 #define IO_MODULE3 3 #define IO_MODULE4 4 #define INTERLOCK_SET 5 #define L_MANAGEMENT_1 6 #define L_MANAGEMENT_2 7 /*...balaji28/12/2002*/ //#define UPDATE 14 //03-06-02 #define CLRMAINTREQURD 1 //31-05-02 /*OnLineSettings change pooja...*/ //#define NOTACPTD 2 //28-05-02 /*...OnLineSettings change pooja*/ #define IMPROPERCOMBINATION 3 #define LOW_BAT 4 //22.07.02 #define MAINT 5 #define LOWBATCLEAR 6 //01.08.02 /**************************************GSL & BRP *******************************/ // SR71M // TAG - VREF_VALIDITY #define REF_FAIL 7 /**************************************GSL & BRP *******************************/ /****************************************************************/ #define X0 0 #define X1 1 #define X2 2 #define X3 3 #define X4 4 #define X5 5 #define X6 6 #define X7 7 #define X8 8 #define X9 9 #define X10 10 #define X11 11 #define X12 12 #define X13 13 #define X14 14 #define X15 15 #define Y0 0 #define Y1 1 #define Y2 2 #define Y3 3 #define Y4 4 #define Y5 5 #define Y6 6 #define Y7 7 #define Y8 8 #define Y9 9 #define Y10 10 #define Y11 11 #define Y12 12 #define Y13 13 #define Y14 14 #define Y15 15 #define EVENTRECORD 1 #define TRIPRECORD 2 /****************** MACROS for MIN & MAX ranges of settings ***************/ /*................PROTECTION SETTING..........*/ /*LONG TIME*/ #define LONGTIME_CURRENT_MIN 40 //STEPSIZE_5 #define LONGTIME_CURRENT_MAX 100 //#define LONGTIME_HEAT_COOL_RATIO_MIN 20 //STEPSIZE_10 //#define LONGTIME_HEAT_COOL_RATIO_MAX 80//srn....VerR7 not used #define LONGTIME_COOLING_CONSTANT_MIN 25 //STEPSIZE_5 #define LONGTIME_COOLING_CONSTANT_MAX 400 /*Pooja...*/ //#define LONGTIME_PRETRIP_ALARM_MAX 100 //STEPSIZE_5 #define LONGTIME_PRETRIP_ALARM_MAX 95 //STEPSIZE_5 /*...Pooja*/ #define LONGTIME_PRETRIP_ALARM_MIN 50 /*LONG TIME DELAY */ /* Phase Sequence - Phase III - JPG */ #define PHASESEQUENCE_DELAY_MAX 50 #define PHASESEQUENCE_DELAY_MIN 00 /***********************************GSL & BRP *****************************/ // TAG - SC_COLDLOAD_DELAY // SR71M // Declaring the maximum and minimum cold load delay setting. #define SHORTTIME_COLDLOAD_DELAY_MIN 1 #define SHORTTIME_COLDLOAD_DELAY_MAX 100 /***********************************GSL & BRP *****************************/ /*SHORT TIME*/ /***********************************GSL & BRP *****************************/ // TAG - SC_LOWLIMIT // Change the pickup lower limit from 0.5 to 2 //#define SHORTTIME_CURRENT_MIN 50 //STEPSIZE_5 #define SHORTTIME_CURRENT_MIN 200 //STEPSIZE_5 /***********************************GSL & BRP *****************************/ #define SHORTTIME_CURRENT_MAX 1000 /*Pooja...*/ //#define SHORTTIME_PRETRIP_ALARM_MAX 100 //STEPSIZE_5 #define SHORTTIME_PRETRIP_ALARM_MAX 95 //STEPSIZE_5 /*...Pooja*/ #define SHORTTIME_PRETRIP_ALARM_MIN 50 #define SHORTTIME_DELAY_MAX 400 //STEPSIZE_100 /********************************** NVN ***********************************/ // SR71M // TAG - MIN_SHRT_CKT_DLY // Minimum short circuit delay is changed from 0 msec to 20 msec //#define SHORTTIME_DELAY_MIN 00 #define SHORTTIME_DELAY_MIN 20 /********************************** NVN ***********************************/ /*EARTH FAULT*/ #define GND_FAULT_PICKUP_MAX 60 //STEPSIZE_1 #define GND_FAULT_PICKUP_MIN 10 #define GND_FAULT_DELAY_MAX 50 //STEPSIZE_1 #define GND_FAULT_DELAY_MIN 01 #define GND_FAULT_DELAY_I2T_MAX 04 //Pooja /*Pooja...*/ //#define GND_FALUT_PRETRIP_ALARM_MAX 100 //STEPSIZE_5 #define GND_FALUT_PRETRIP_ALARM_MAX 95 //STEPSIZE_5 /*...Pooja*/ #define GND_FALUT_PRETRIP_ALARM_MIN 50 /***********************************GSL & BRP *****************************/ /*INSTANTANEOUS*/ // TAG - INST_UPPERLIMIT // SR71M // Change the pickup upper limit from 56In to 16In //#define INST_CURRENT_MAX 560 //STEPSIZE_1 TILL 100 THEN STEPSIZE_20 #define INST_CURRENT_MAX 160 //STEPSIZE_1 TILL 100 THEN STEPSIZE_20 // TAG - INST_LOWLIMIT // SR71M // Change the pickup lower limit from 1.5In to 2In //#define INST_CURRENT_MIN 15 #define INST_CURRENT_MIN 20 /***********************************GSL & BRP *****************************/ /***********************************GSL & BRP *****************************/ /*NEUTRAL*/ // TAG - NEUTRAL_UPPERLIMIT // SR71M // Change the pickup upper limit from 2.0 to 1.0 //#define NEUTRAL_CURRENT_MAX 200 //STEPSIZE_5 #define NEUTRAL_CURRENT_MAX 100 //STEPSIZE_5 /***********************************GSL & BRP *****************************/ #define NEUTRAL_CURRENT_MIN 50 /*UNDER CURRENT*/ #define UNDER_CURRENT_MIN 15 //STEPSIZE_5 #define UNDER_CURRENT_MAX 80 #define UNDER_CURRENT_DELAY_MAX 255 //STEPSIZE_1 #define UNDER_CURRENT_DELAY_MIN 01 /*srn..Phase III*/ #define EL_CURRENT_MIN 5 #define EL_CURRENT_MAX 300 #define EL_DELAY_MIN 0 #define EL_DELAY_MAX 50 /*************************************GSL & BRP ********************************************/ //TAG - PROTECTION_SCREEN //SR71M #define MD_EXCEED_MIN 40 //Minimum Pickup Setting #define MD_EXCEED_MAX 1600 //Maximum Pickup Setting. #define MD_EXCEED_MIN_100KW 100 //Minimum Pickup Setting for Step Size of 100kW #define MD_DELAY_MIN 01 #define MD_DELAY_MAX 255 #define MD_STEP_MIN 10 //Minimum Step Size #define MD_STEP_MAX 100 //Maximum Step Size. /**************************************GSL & BRP *******************************************/ #define PS_DELAY_MIN 0 #define PS_DELAY_MAX 50 /*CURRENT UNBALANCE*/ #define CURRENT_UNBALANCE_MAX 100 //STEPSIZE_5 #define CURRENT_UNBALANCE_MIN 10 #define CURRENT_UNBALANCE_DELAY_MAX 100 //STEPSIZE_5 #define CURRENT_UNBALANCE_DELAY_MIN 10 /*UNDER FREQUENCY-OVER FREQUENCY */ #define FREQ50_MAX 5500 //STEPSIZE_1 #define FREQ50_MIN 4500 /*srn..Phase III*/ #define FREQ50 5000 #define FREQ60 6000 //#define FREQ60_MAX 6500//STEPSIZE_1 //#define FREQ60_MIN 5500 /*********************************************GSL & BRP ************************************/ // Commenting this line - Changing the Freq Max Range of 60Hz protection - from 63Hz to 62Hz //#define FREQ60_MAX 6300 #define FREQ60_MAX 6200 /*********************************************GSL & BRP ************************************/ #define FREQ60_MIN 5700 #define UNDERFREQ_50HZ 4800 #define UNDERFREQ_60HZ 5900 #define OVERFREQ_50HZ 5200 #define OVERFREQ_60HZ 6100 /*Phase III*/ #define FREQ_DROPOFF_MAX 100 //STEPSIZE_10 #define FREQ_DROPOFF_MIN 20 #define FREQ_DELAY_MAX 10000 //STEPSIZE_1 #define FREQ_DELAY_MIN 10 /****************************************GSL & BRP *************************************/ /*UNDER VOLTAGE*/ // TAG - UNDERVOLTAGE_UPPERLIMIT // SR71M // Change the pickup upper limit from 95% to 65% //#define UNDER_VOLTAGE_MAX 95 //STEPSIZE_5 #define UNDER_VOLTAGE_MAX 65 //STEPSIZE_5 // TAG - UNDERVOLTAGE_LOWLIMIT // SR71M // Change the pickup lower limit from 70% to 45% //#define UNDER_VOLTAGE_MIN 70 #define UNDER_VOLTAGE_MIN 45 /****************************************GSL & BRP *************************************/ #define UNDER_VOLTAGE_DELAY_MAX 50 //STEPSIZE_1 #define UNDER_VOLTAGE_DELAY_MIN 01 #define UNDER_VOLTAGE_RESETVOLT_MAX 115 //STEPSIZE_1 #define UNDER_VOLTAGE_RESETVOLT_MIN 102 /*OVER VOLTAGE*/ #define OVER_VOLTAGE_MAX 150 //STEPSIZE_5 #define OVER_VOLTAGE_MIN 105 #define OVER_VOLTAGE_DELAY_MAX 1000 //STEPSIZE_1 #define OVER_VOLTAGE_DELAY_MIN 1 #define OVER_VOLTAGE_RESETVOLT_MAX 98 //STEPSIZE_1 #define OVER_VOLTAGE_RESETVOLT_MIN 85 /*REVERSE POWER*/ #define REVERSE_POWER_MAX 40 //STEPSIZE_1 #define REVERSE_POWER_MIN 02 #define REVERSE_POWER_DELAY_MAX 10000 //STEPSIZE_1 #define REVERSE_POWER_DELAY_MIN 100 /*BREAKER FAILURE*/ #define BREAKER_DELAY_MAX 200 //STEPSIZE_1 #define BREAKER_DELAY_MIN 05 /*..........SYSTEM SETTING.....*/ /*FRAME CURRENT*/ #define I_FRAME_INDEX_MAX 11 //STEPSIZE_1 #define I_FRAME_INDEX_MIN 0 /*OPERATING VOLTAGE*/ /****************************************** SSS ******************************************/ // TAG - Ue_REMOVAL_LESS_THAN_415 // SR71M // Ue setting for less than 415 has been removed hence max values hass been changed from 8 to 6 #define Ue_INDEX_MAX 8 //STEPSIZE_1 //#define Ue_INDEX_MAX 6 //STEPSIZE_1 /****************************************** SSS ******************************************/ #define Ue_INDEX_MIN 0 /*In Multiplier*/ #define In_X_MAX 100 //STEPSIZE_25 //#define In_X_MIN 50 //srn...Phase III /******************************************GSL & BRP ***************************************/ /*To set the absolute maximum and minimum value of % Error */ // Commenting the following definitions as Software Calibration screen is to be removed //#define PRIME_CT_MIN 0 //#define PRIME_CT_MAX 50 /******************************************GSL & BRP ***************************************/ //In multiplier min value is changed from 0.5 to 0.25 /******************************************** SSS *****************************************/ //TAG - IN_MULTIPLIER_RESERVE_BYTE //SR71M //In Multiplier location while writing through Modbus was not allowing to write 0 since all //the reserver bytes are written as 0 (becoz IN multiplier feature is not there in SR71M) //#define In_X_MIN 25 #define In_X_MIN 0 /******************************************** SSS *****************************************/ /*...............UNIT SETTING..........*/ /*COMMUNICATION*/ /*Bug in Phase 1 RS Pooja...*/ //#define METERADDRESS_MAX 254 //STEPSIZE_1 #define METERADDRESS_MAX 255 //STEPSIZE_1 /*...Bug in Phase1 RS*/ #define METERADDRESS_MIN 01 #define BAUD_RATE_MAX 4 #define BAUD_RATE_MIN 1 /*OSCILLOGRAPHY*/ #define PRE_TRIG_CYCLES_MAX 16 //STEPSIZE_1 #define PRE_TRIG_CYCLES_MIN 04 /*INTER LOCK PROTECTION*/ #define INTERLOCK_DELAY_MAX 1000 //STEPSIZE_1 #define INTERLOCK_DELAY_MIN 01 /*DATE TIME*/ #define YEAR_MAX 99 //STEPSIZE_1 #define YEAR_MIN 00 #define MONTH_MAX 12 //STEPSIZE_1 #define MONTH_MIN 01 #define DATE_MAX 31 //STEPSIZE_1 #define DATE_MIN 01 #define DAY_MAX 07 //STEPSIZE_1 #define DAY_MIN 01 #define HOURS_MAX 23 //STEPSIZE_1 #define HOURS_MIN 00 #define MINUTES_MAX 59 //STEPSIZE_1 #define MINUTES_MIN 00 #define SEC_MAX 59 //STEPSIZE_1 #define SEC_MIN 00 #define MSEC_MAX 99 //STEPSIZE_1 #define MSEC_MIN 00 #define SYSTEM_FREQ_50Hz 50 #define SYSTEM_FREQ_60Hz 60 //SRN CR1.0 #define NO_POLES_3 3 #define NO_POLES_4 4 /*18.10.02 Phase2...*/ #define TEMP_DELAY_MIN 0 //STEPSIZE_1 #define TEMP_DELAY_MAX 15 /*...18.10.02 Phase2*/ /*24.04.03 Phase2...*/ #define MOD_DIS_EN_MAX 0x7F #define MOD_DIS_EN_MIN 0 #define ALRMTRPBOTH_MAX 3 #define ALRMTRPBOTH_MIN 1 /*...24.04.03 Phase2*/ /*STEP SIZE*/ #define STEPSIZE_1 01 #define STEPSIZE_5 05 /*********************************************GSL & BRP **********************************/ // TAG - NEUTRAL_STEPSIZE #define STEPSIZE_50 50 /*********************************************GSL & BRP **********************************/ #define STEPSIZE_10 10 #define STEPSIZE_20 20 #define STEPSIZE_25 25 #define STEPSIZE_100 100 /*NMI Initialization Constants*/ #define LEVEL_SENSITIVE 0x00 /*19-04-02...*/ //#define WATCHDOG_REFRESH reg_PORTE.bit.PIN0 ^= 0x01 /*28-04-02...*/ //#define MINIMUMRMSPHASECURRENT 16000 //(160*100)RMS Current 160A * Mulitplication factor(100) //#define MINIMUMRMSNEUTRALCURRENT 16000 //#define MINIMUMRMSGROUNDCURRENT 8000 //(160*100)GROUND Current 80A * Mulitplication factor(100) /*..28-04-02*/ //srn...VerR8 #define MINIMUMRMSPHASECURRENT 10 //(10*1/100) * 100 Min RMS Current(0.1A) * Mulitplication factor(100) #define MINIMUMRMSNEUTRALCURRENT 10 #define MINIMUMRMSGROUNDCURRENT 5 //(5*1/100)*100 //srn...VerR8 /*08-05-02...*/ /*Version A8*/ //#define MINIMUMRMSPHASEVOLTAGE 480 //(48*10)20%of RMS voltage * Mulitplication factor(10) //#define MINIMUMRMSLINEVOLTAGE (415*20.0/100) //415*20%of RMS line voltage * Mulitplication factor(10) /*..Version A8*/ /*...08-05-02*/ /*04-05-02...*/ #define LONG_TIME_CUR 0x01 #define SHORT_TIME_CUR 0x02 #define GROUND_CUR 0x04 #define UNDER_CUR 0x08 #define NEUTRAL_CUR 0x10 #define UNBALANCE_CUR 0x20 #define UNDER_VOLT 0x40 #define OVER_VOLT 0x80 #define UNDER_FREQ 0x100 #define OVER_FREQ 0x200 #define BREAKER_FAILURE 0x400 #define REV_POWER 0x800 #define INTERLOCK 0x1000 #define INSTANTANEOUS_CUR 0x2000 /*Fault Status Screens pooja...*/ #define TCS_BE 0x4000 #define TEMP 0x8000 /***************************** MFS *******************************************************************/ //SR71M //TAG:ADD_MD_EXCEED // maximum demand bit position to check from the data coming from BE;this is to update the md exceed status #define MAX_DMD_EXCEED 0x40000 /***************************** MFS *******************************************************************/ /*...Fault Status Screens pooja*/ /*...04-05-02*/ #define RUNNINGMAINTRECORD 5 //01-05-02 /*OSCILLOGRAPHY_HARI10thMay2K2..*/ //define MAXROGOSKYRMS 62.8 //#define MAXROGOSKYRMS (MAX_CURRENT_ROG/1600) /*MAX_CURRENT_ROG is converted to interms of In therefore 1600 need not be divided to get the maximum rogowski RMS Value*/ #define MAXROGOSKYRMS MAX_CURRENT_ROG #define MAXCT2RMS 6.84 #define MAXCT1RMS 1.945 #define MAXSAMPLEVALUE 2048 #define BITJOINING /*..OSCILLOGRAPHY_HARI10thMay2K2*/ /*OSCILLOGRAPHY_HARI10thMay2K2..*/ //#define MAXROGOSKYRMS 62.8 //#define MAXCT2RMS 6.84 //#define MAXCT1RMS 1.945 //#define MAXSAMPLEVALUE 2048 //#define BITJOINING /*..OSCILLOGRAPHY_HARI10thMay2K2*/ /*11.06.02...*/ #define START_RAM (WORD *)0X800000 /*RAM start at 0X800000h*/ //#define END_RAM (WORD *)0X8017D4 /*RAM start at 0X8017D4h*/ //17.06.02...End of RAM(INTERNAL SRAM) #define END_RAM (WORD *)0X801FFF /*RAM end at 0X801FFFh*/ /*Calibration..*/ /*SeK Calibration clearing of FRAM to be done after the calib values which should not be cleared to 0 on initialisation.*/ /*External RAM Clear can be done fot the entire External Ram as the settings and calibration values are sent to front end once during initalisation. In Mocre 1. Initialised variables are declared first by the compiler from from top to bottom in th order of the declarations in the file 2. After the Initialised variables, Uninitialisd variables are taken from bottom to top of the file. 3. Inside a structure variables are declared from top to bottom. */ #define START_XRAM (WORD *)0x81000000 /*RAM start at 0x81000000h*/ //#define START_XRAM (WORD *)0x81000084 /*RAM start at 0x81000000h*/ //#define END_XRAM (WORD *)0x81004650 /*RAM end at 0x81004650h*/ //17.06.02...End of F-RAM(EXTERNAL FRAM) #define END_XRAM (WORD *)0x81007FFF /*RAM end at 0x81007FFFh*/ /*...11.06.02*/ /*..Calibration*/ /*OSCILLOGRAPHY_HARI 23rdJune 2K2..*/ //#define MAXROGOSKYPEAKVALUE 88.799 //62.8*1.414 #define MAXROGOSKYPEAKVALUE (MAXROGOSKYRMS*1.414) #define MAXCT1PEAKVALUE 9.671 //6.84 #define MAXCT2PEAKVALUE 2.75 //1.945 /*SGT_PH3..*/ //#define MAXVOLTAGEPEAKVALUE 678.72 //480 x 1.414 #define MAXVOLTAGEPEAKVALUE 975.66 // 690 x 1.414 /*..SGT_PH3*/ /*VersionA3..*/ //#define MAXGROUNDCURRENTPEAKVALUE 0.8484 //0.6 /*07.03.03...*/ //#define MAXGROUNDCURRENTPEAKVALUE (float)(1.15*1.414) //1.15(2.5*2500/120/16/2/1.414) #define MAXGROUNDCURRENTPEAKVALUE (float)(MAXGROUNDCURRENT * 1.414) //1.15(2.5*2500/120/16/2/1.414) /*...07.03.03*/ //#define MAXNEUTRALCURRENTPEAKVALUE 2.799 //1.98 #define MAXNEUTRALCURRENTPEAKVALUE (float)(2.946*1.414) //2.946 /*..VersionA3*/ /*..OSCILLOGRAPHY_HARI 23rdJune 2K2*/ /*18.08.02 DOUBLE_2_STRING...*/ #define MAX_DIGITS 7 /*...18.08.02 DOUBLE_2_STRING*/ /*Phase2 balaji 4/2/2003...*/ /*used for Test Key check*/ #define TESTFAIL 0x00 #define TESTPASS 0x01 #define TESTSTART 0x02 #define TESTABORT 0x03 /*...Phase2 balaji 4/2/2003*/ /*balaji8/1/2003...*/ #define LOAD_MANAGEMENT_LOADTYPE_MAX 4 #define LOAD_MANAGEMENT_LOADTYPE_MIN 1 #define LOAD_MANAGEMENT_PN_MAX 150 #define LOAD_MANAGEMENT_PN_MIN 20 #define LOAD_MANAGEMENT_IR_MAX 150 #define LOAD_MANAGEMENT_IR_MIN 50 #define LOAD_MANAGEMENT_DELAY_MAX 100 #define LOAD_MANAGEMENT_DELAY_MIN 10 /*...balaji8/1/2003*/ /*phase2 balaji 2/2/2003...*/ #define CLEAR_UP 0 #define UP_ARROW 1 #define CLEAR_DOWN 2 #define DOWN_ARROW 3 #define UNIT_SETTINGS 1 #define PROTECTIONS 2 #define OSCILLOGRAPHYS 3 #define MODULES 4 #define GF_SETTING 5 /*srn..Phase III*///used for Scroll up-down arrrow display for GF menu #define SYSTEM_SETTINGS 6 /*srn...Phase III*/ #define SPI_FAILURE 99 /*...phase2 balaji 2/2/2003*/ /*14.01.03 current direction pooja...*/ //On default the normal current flow direction will be TOP to BOTTOM.So TOP should be 0. #define TOP 0 #define BOTTOM 1 /*...14.01.03 current direction pooja*/ /*IO Modules pooja...*/ #define UP 1 #define DOWN 2 #define NO_IO_MODULES 4 #define DIGITALINPUT_MAX 16 //17 Digital input options so (17-1) as it starts from 0. #define DIGITALOUTPUT_MAX 29 //30 Digital output options so (30-1) as it starts from 0. #define DIP1 0 #define DIP2 1 #define DIP3 2 #define DOP1 3 #define DOP2 4 /*Ritu...*/ #define EXTIO_MOD1 0 #define EXTIO_MOD2 1 #define EXTIO_MOD3 2 #define EXTIO_MOD4 3 /*...Ritu*/ /*This is used in the avialable list to replace input or the output which is selected from that lilst*/ #define DIDO_BLANK 100 #define TCS_INPUT 14 /*...IO Modules pooja*/ /*Used to Block Both Open and Close commands through Modbus*/ #define BREAKER_CLOSE 0x10 #define BREAKER_OPEN 0x08 /*Used for Range Check on Maintenance Months in Modbus*/ #define MAIN_MONTHS_MAX 12 #define MAIN_MONTHS_MIN 1 /*Used for Range Check on Oscillography trigger source in Modbus*/ /*************************************GSL & BRP ************************************/ // SR71M // TAG - REMOVE_INLKIP_OSCILLOGRAPHY //#define OSC_TRIG_SOURCE_MAX 3 #define OSC_TRIG_SOURCE_MAX 2 /*************************************GSL & BRP ************************************/ #define OSC_TRIG_SOURCE_MIN 1 /*Used for Range Check on Parity in Modbus*/ #define PARITY_MAX 2 #define PARITY_MIN 0 //SRN Load Management #define LOAD_CURRENT 1 #define LOAD_ACTIVE 2 #define LOAD_REACTIVE_LAG 4 #define LOAD_REACTIVE_LEAD 3 //SRN Load Management #define OFFSET_FOR_SETGROUP2 100 //sek 17Mar.. #define DI 0 #define DO 1 //#define debug //uncomment this to block SPI..srn testing //..sek 17Mar//SRN for Modbus25/3/03 #define INDEX_ZERO 0 #define SETGROUP2_START_ADDR 165 //#define SETGROUP2_LAST_ADDR 240 #define SETGROUP2_LAST_ADDR 242 // JPG - Phase III #define MODBUS_SETGROUP1 0 #define MODBUS_SETGROUP2 1 #define ILR1_START_ADDR 111 #define ILR2_START_ADDR 117 #define ILR3_START_ADDR 123 /*VerR7*/ //Start address of Interlock rename 4 and 5 are 129 and 135 respectively //#define ILR4_START_ADDR 128 //#define ILR5_START_ADDR 134 #define ILR4_START_ADDR 129 #define ILR5_START_ADDR 135 #define ILR5_LAST_ADDR 140 /*VerR7*/ #define ILR1 0 #define ILR2 1 #define ILR3 2 #define ILR4 3 #define ILR5 4 #define ILR_CHAR0 0 #define ILR_CHAR1 1 #define ILR_CHAR2 2 #define ILR_CHAR3 3 #define ILR_CHAR4 4 #define ILR_CHAR5 5 #define ILR_CHAR6 6 #define ILR_CHAR7 7 #define ILR_CHAR8 8 #define ILR_CHAR9 9 #define ILR_CHAR10 10 #define ILR_CHAR11 11 #define UNIT_SETTING_START_ADDR 8 #define COMMAND_SETTING_START_ADDR 61 #define MODBUS_NULL 0x00 /*Used to Check parity error in the SCI Status Register.*/ //version R6. #define PARITY_ERROR_FLAG 0x01 /*SGT_PH3..*/ #define MIN_RYBCUR_VALUE 10 // 100mA with a multiplication of 100 so 0.1 x 100 = 10. //SrN...Phase III changed to 0.1A coz in display also N //less than 0.1 is shown as 0. Also comparison is done before multiplying with CT constants //hence min value is div by ct constant here //#define MIN_NEUTRAL_VALUE 5 #define MIN_NEUTRAL_VALUE (float)(10/INTCT_ROUNDOFF) //#define MIN_GND_VALUE 5 #define MIN_GND_VALUE (float)(5/INTCT_ROUNDOFF) #define I_NOMINAL (float)1.0 /*..SGT_PH3*/ /*Phase III*/ //38% nominal = 0.38A -> 0.38*100(MF) = 38 //40% nominal = 0.4A -> 0.4*100(MF) = 40 #define NOMINAL_38PER 38 #define NOMINAL_40PER 40 /*Phase III*/ //srn...17-jan-04 #define SCI_RDRF 0x20 #define SCI_PE_FE 0x03 #define DISABLE_VG_FUNCTIONS 0x1F1C /* JPG - phaseIII */ #define RYB 0X01 #define RBY 0X02 //#define ENERGYOFFSET 200 //#define ENERGYOFFSET 196 // JPG Phase III __ changed for shifting of EarthLeakage Current & PhaseSequence // bytes below the PercentageLoadCurrent value in MemoryMap. #define ENERGYOFFSET 200 // JPG Phase III _ changed again to 200 to accomodate change in size of THD from // BYTE to WORD. This change is done to implement two decimal point for THD //srn...Phase III #define MIN_QUERY_LENGHT 0x08 //srn...Phase III //for Trip Records #define TRIP_TIMESTAMP 1 #define TRIP_CURRENTS 2 #define TRIP_VOLTAGES 3 //Back Navigation #define ONLINE_DEFAULT 0 #define ONLINE_METERING 1 #define ONLINE_TRIP 2 #define ONLINE_IO 3 //for blocking current display in trip records for Instantaneous faults #define TRIPCAUSE_INSTANTANEOUS 0x00000004 //srn...Phase III /***********************************************GSL & BRP ******************************************************/ //TAG - PROG_RELAY //SR71M #define PROG_RELAY1 1 #define PROG_RELAY2 2 // TAG - POWERON_BACKLIGHT // BackLight should be OFF for the initial 5 cycles of FE Power On. #define BACKLIGHT_OFF_COUNT 5 // TAG - MD_EXCEED_PROTECTION //Since the settings made are in terms of kW, and the measured value is in terms of watts, //this conversion factor is used before comparing the measured value with the set pickup value. #define CONVERT_MD_KW_TO_WATTS 1000 /**********************************************GSL & BRP ********************************************************/