S7-1500 模擬量轉(zhuǎn)換 (SCL)

(*
Analog Conversion to Engineering Value to take part in program calculation
*)
IF #Analog_Input < #Analog_Input_Min
THEN
? ? #Analog_Min_Error := 1;
ELSIF #Analog_Input > #Analog_Input_Max
THEN
? ? #Analog_Max_Error := 1;
ELSE
? ? #Eng_Value := (#Eng_Value_Max - #Eng_Value_Min) / (#Analog_Input_Max - #Analog_Input_Min) * (#Analog_Input - #Analog_Input_Min) + #Eng_Value_Min;
END_IF;
標(biāo)簽: