Search the Community
Showing results for tags 'analod'.
Found 1 result
SillyBoy posted a topic in MitsubishiHello all, I am trying to write one FB for Analog Scaling in GX Works 3 Software for my Mitsubishi FX5U Plc... Unfortunately i am not aware very much about ST Language instructions of Mitsubishi Softwares. So the Code is Giving 5 Errors, i think the error are due to incorrect data conversion expressions, Can you please correct me with my code ? Here are the Variables RAW_MIN Word [Signed] VAR_INPUT RAW_MAX Word [Signed] VAR_INPUT SCAL_MIN FLOAT [Single Precision] VAR_INPUT SCAL_MAX FLOAT [Single Precision] VAR_INPUT AI_RAW Word [Signed] VAR_INPUT SCALED_OP_REAL FLOAT [Single Precision] VAR_OUTPUT SCALED_OP_INT Word [Signed] VAR_OUTPUT Here is the Code SCALED_OP_REAL:=(((SCAL_MAX-SCAL_MIN)*(INT2FLT(AI_RAW)-INT2FLT(RAW_MIN)))/(INT2FLT(RAW_MAX)-INT2FLT(RAW_MIN)))+SCAL_MIN; SCALED_OP_INT:= FLT2INT(SCALED_OP_REAL);