/////以下为源程序
//阶码处理
WORD_BYTE(IN:=ROL(IN:=BYTE_WORD(LOW:=var_in,HIGH:=00), N:=4), LOW=>var_low, HIGH=>var_high);(*var_in为阶码字节*)
var1:=INT_TO_REAL(IN:=BYTE_TO_INT(IN:=SWAP(IN:=var_low)));
var2:=GE(IN1:=BYTE_TO_INT(IN:=var_high), IN2:=1);
var3:=INT_TO_REAL(IN:=ADD(IN1:=BYTE_TO_INT(IN:=SWAP(IN:=var_low)), IN2:=16));
IF var2=1 THEN
var_out:=EXPT(IN1:=2, IN2:=var3);
ELSE
var_out:=EXPT(IN1:=2, IN2:=var1);
END_IF ;
//符号位处理
BYTE_BIT(IN:=var_in1, Q08=>BIT_Q8);(*var_in1为符号位字节*)
var2_1:=GE(IN1:=BIT_Q8, IN2:=1);
IF var2_1=1 THEN
var2_out:=MUL2_REAL(IN1:=1, IN2:=-1.00);
ELSE
var2_out:=MUL2_REAL(IN1:=1, IN2:=1.00);
END_IF;
//计算
WORD_BYTE(IN:=ROL(IN:=BYTE_WORD(LOW:=var_in1,HIGH:=00), N:=4), LOW=>var_low1, HIGH=>var_high1);
IF var2_1=1 THEN
WORD_BYTE(IN:=ROR(IN:=BYTE_WORD(LOW:=var_low1, HIGH:=SUB(IN1:=var_high1, IN2:=08)), N:=4), LOW=>var_low2);
ELSE
var_low2:=var_in1;
END_IF;
//最终结果
var_out_over:=MUL3_REAL(IN1:=var_out, IN2:=var2_out, IN3:=DIV(IN1:=DINT_TO_REAL(IN:=DWORD_TO_DINT(IN:=WORD_DWORD(LOW:=BYTE_WORD(LOW:=var_in3, HIGH:=var_in2), HIGH:=BYTE_WORD(LOW:=var_in1, HIGH:=00)))), IN2:=8388607.00));(*var_in2为第二个字节,var_in3为第三个字节*)