Пример #1
0
static void mdlOutputs(SimStruct *S, int_T tid)
{
	double sp_original;
    double meas_scaled;
    double manip_original_in;
    double xi_in;
    int mode;
    double K;
    double Ti;
    double h;
    double LO_y;
    double HI_y;
    double LO_u;
    double HI_u;
    int action;
    int P_only;
    double rel_lo;
    double rel_hi;
    double hys;
    double hi_flag_in;

    double *manip_original;
    double *xi;
    double *hi_flag;
#ifdef DEBUG
	debug("mdlOutputs entered.\n");
#endif
	sp_original = SETPOINT(S);
	meas_scaled = INPUT(S);
	manip_original_in = MV(S);
	xi_in = XI(S);
	mode = MODE(S);
	K = GAIN(S);
	Ti = RESET(S);
	h = SAMPLING(S);
	LO_y = LOWMEAS(S);
	HI_y = HIGHMEAS(S);
	LO_u = LOWMV(S);
	HI_u = HIGHMV(S);
	action = PGAIN(S);
	P_only = PONLY(S);
	rel_lo = RELLO(S);
	rel_hi = RELHI(S);
	hys = HYS(S);
	hi_flag_in = HIFLAG(S);
	
	manip_original = &OUTPUT(S);
	xi = &XO(S);
	hi_flag = &FLAG(S);
	
	controller(manip_original, xi, hi_flag, sp_original, meas_scaled, manip_original_in, xi_in, mode, K, Ti, h, LO_y, HI_y, LO_u, HI_u, action, P_only, rel_lo, rel_hi, hys, hi_flag_in);

#ifdef DEBUG
	debug("mdlOutputs left.\n");
#endif
} /* mdlOutputs */
Пример #2
0
void FORTE_FB_HYST_3::alg_REQ(void){
  CIEC_REAL X;

X = HYS()*0.5f;

if((IN() < VAL1()-X)){
	Q1() = true;
}
else
  if((IN() > VAL1() + X)){
	Q1() = false;
};

if((IN() < VAL2()-X)){
	Q2() = false;
}
else
  if((IN() > VAL2()+X)){
	Q2() = true;
};
}