Ejemplo n.º 1
0
        public virtual float[] TempMesure(int channel, out bool errors, int [] errorVector)
        {
            lock (this)
            {
                try
                {
                    errors = false;
                    uint   b          = (uint)(channel * 5);
                    ushort b1         = (ushort)(channel * 5);
                    int    count      = 4;
                    int    ErrorArea0 = 0;
                    int    ErrorArea1 = 0;
                    int    ErrorArea2 = 0;
                    int    ErrorArea3 = 0;
                    int    ErrorArea4 = 0;

                    while (count > 0)
                    {
                        errors      = false;
                        TempArea[0] = IPC2.GetTempMeasureArea(0, b + 0);
                        ErrorArea0  = ErrorTempArea(50, 20, 0);
                        TempArea[1] = IPC2.GetTempMeasureArea(0, b + 1);
                        ErrorArea1  = ErrorTempArea(50, 20, 1);
                        TempArea[2] = IPC2.GetTempMeasureArea(0, b + 2);
                        ErrorArea2  = ErrorTempArea(50, 20, 2);
                        TempArea[3] = IPC2.GetTempMeasureArea(0, b + 3);
                        ErrorArea3  = ErrorTempArea(50, 20, 3);
                        TempArea[4] = IPC2.GetTempMeasureArea(0, b + 4);
                        ErrorArea4  = ErrorTempArea(50, 20, b + 4);
                        if (TempArea[0] < 105)
                        {
                            break;
                        }
                        Thread.Sleep(10);
                        count--;
                    }


                    int[] pError = { ErrorArea0, ErrorArea1, ErrorArea2, ErrorArea3, ErrorArea4 };
                    errorVector = pError;
                    for (int i = 0; i < pError.Length; i++)
                    {
                        if (pError[i] > 0)
                        {
                            errors = true;
                        }
                    }
                    return(TempArea);
                }
                catch (Exception err)
                {
                    throw (new SystemException(err.Message));
                }
            }
        }
Ejemplo n.º 2
0
 public int ErrorTempArea(int MaxTemp, int MinTemp, uint Area)
 {
     try
     {
         if (IPC2.GetTempMeasureArea(0, Area) > MaxTemp || IPC2.GetTempMeasureArea(0, Area) < MinTemp)
         {
             return(1);
         }
         else
         {
             return(0);
         }
     }
     catch (Exception err)
     {
         throw (new SystemException(err.Message));
     }
 }