예제 #1
0
 internal override void CalculateReturnValue()
 {
     if (FloatConverter == null)
     {
         throw new NullReferenceException();
     }
     else
     {
         if (modbusValueData.Values.Count > 1)
         {
             int      indexno = 0;
             ushort[] values  = new ushort[2];
             foreach (var item in base.modbusValueData.Values)
             {
                 values[indexno] = item;
                 indexno++;
                 if (indexno == 2)
                 {
                     break;
                 }
             }
             InnerValue = FloatConverter.ConvertToFloat(values[0], values[1]);
         }
         else
         {
             throw new IndexOutOfRangeException();
         }
     }
 }