137 lines
2.6 KiB
C
137 lines
2.6 KiB
C
// âãâ
|
|
#ifndef _MEASURE
|
|
#define _MEASURE
|
|
|
|
void Init_sensors(void);
|
|
void Init_optic(void);
|
|
void Init_packMask(void);
|
|
void Temper_count(int chan);
|
|
void Current_count(int chan);
|
|
void Power_count(int chan);
|
|
|
|
typedef union
|
|
{
|
|
struct
|
|
{
|
|
unsigned int Tear :1;
|
|
unsigned int Stick :1;
|
|
unsigned int Wry :1;
|
|
unsigned int Out :1;
|
|
unsigned int Over :1;
|
|
unsigned int Hyper :1;
|
|
unsigned int Contr1 :1;
|
|
unsigned int Contr2 :1;
|
|
|
|
unsigned int Stop :1;
|
|
unsigned int Ready :1;
|
|
unsigned int res :3;
|
|
unsigned int Latch :1;
|
|
unsigned int Ignor :1;
|
|
unsigned int Bypas :1;
|
|
|
|
} bit;
|
|
unsigned int all;
|
|
|
|
} ERROR;
|
|
|
|
typedef union
|
|
{
|
|
struct
|
|
{
|
|
unsigned int Error :1;
|
|
unsigned int Alarm :1;
|
|
unsigned int OverHeat :1;
|
|
unsigned int SubHeat :1;
|
|
unsigned int OutHeat :1;
|
|
unsigned int Test_lamp :1;
|
|
|
|
} bit;
|
|
unsigned int all;
|
|
|
|
} FLAG;
|
|
|
|
#define NOER 0xE000
|
|
#define EROR 0x01FF
|
|
|
|
#define SIG_FREQ 4000 // Ãö
|
|
#define READY_FREQ 1000 // Ãö
|
|
#define BLINK_FREQ 2 // Ãö
|
|
#define ADC_FREQ 5000//3885//777//2000//20000 //777 //3885 // Ãö (777*5)
|
|
#define DAC_FREQ 50 // Ãö
|
|
|
|
#define LOAD_TIME 10 // sec
|
|
|
|
|
|
#define SENS_ERR_WAIT 10
|
|
|
|
#define maximum_bright 10
|
|
|
|
/*
|
|
#define SNOW 1720.0 //1920.0
|
|
#define BOIL 2360.0 //2561.0
|
|
|
|
#define tmp_T_0 0.0
|
|
#define tmp_T_1 200.00
|
|
#define tmp_A1_0 978.0
|
|
#define tmp_A1_1 1686.0
|
|
#define tmp_A2_0 1017.0
|
|
#define tmp_A2_1 1736.0
|
|
#define eta_A1 1002.0
|
|
#define eta_A2 1542.0
|
|
*/
|
|
|
|
#define tmp_T_0 84.31 // 68Om
|
|
#define tmp_T_1 234.19 // 100Om
|
|
#define tmp_A1_0 540.0 // êàíàë 1 68Îì
|
|
#define tmp_A2_0 500.0 // êàíàë 1 100Îì
|
|
#define tmp_A1_1 1055.0 // êàíàë 2 68Îì
|
|
#define tmp_A2_1 1060.0 // êàíàë 2 100Îì
|
|
|
|
|
|
#define ZERO 27
|
|
|
|
#define mka300 2040
|
|
#define mka400 2700
|
|
|
|
#define C100 650
|
|
#define C150 2370
|
|
|
|
#define Cooling 5 // (°Ñ) Ãèñòåðåçèñ ïî ñíàòèþ ïåðåãðåâà
|
|
|
|
#define COSPi6 0.86602540378443864676372317075294
|
|
|
|
#define RADIX2 1.4142135623730950488016887242097
|
|
|
|
#define CURRENT 1 // òîê
|
|
#define VOLTAGE 2 // íàïðàæåíèå
|
|
|
|
#define POWER_380 3 // ïèòàíèå 380Â
|
|
#define POWER_220 4 // ïèòàíèå 220Â
|
|
#define POWER_31 5 // ïèòàíèå 31Â
|
|
#define POWER_24 6 // ïèòàíèå 24Â
|
|
#define VIRT_24 7 // ïèòàíèå 24Â
|
|
#define POWER_15 8 // ïèòàíèå 15Â
|
|
#define TERMO_AD 9 // òåðìîäàò÷èê ìåëêîñõåìà
|
|
#define TERMO_RS 10 // òåðìîäàò÷èê ðåçèñòîð
|
|
#define OPTIC 11 // îïòîêàíàë ìåãîììåòðà
|
|
|
|
extern int MAX_TPL_CANAL;
|
|
|
|
extern FILTERBAT filter[];
|
|
|
|
extern ERROR * sens_error;
|
|
extern int * sens_hi_edge;
|
|
extern int * sens_lo_edge;
|
|
|
|
extern int adc0[],tmp0[];
|
|
|
|
#define Zero_lev (adc0+12) //((int *)&Modbus[0x74])
|
|
|
|
extern float tmpK[];
|
|
extern FLAG chk,sig;
|
|
extern int sens_type[];
|
|
|
|
extern int period_ready;
|
|
|
|
#endif //_MEASURE
|