输入参数P1,P2代表PLC中浮点数储存的两个寄存器获取的数据
public static float GetFloat(ushort P1, ushort P2) { int intSign, intSignRest, intExponent, intExponentRest; float faResult, faDigit; intSign = P1 / ; intSignRest = P1 % ; intExponent = intSignRest / ; intExponentRest = intSignRest % ; faDigit = ( + P2) / ; faResult = (, intSign) * (, intExponent - ) * (faDigit + ); return faResult; }