Ejemplo n.º 1
0
        public ushort ReadADC(NameOfADC enumName, int channel)
        {
            lock (syncRoot)
            {
                try
                {
                    string name = enumName.ToString();
                    DUTCoeffControlByPN.CoeffInfo coeffInfo = dataTable_DUTCoeffControlByPN.GetOneInfoFromTable(name, channel);

                    EnterEngMode(coeffInfo.Page);
                    UInt16 valueADC = EEPROM_SNOEC.readadc(DUT_USB_Port, 0xA0, coeffInfo.StartAddress);
                    //Log.SaveLogToTxt("Current TXPOWERADC is " + valueADC);
                    return(valueADC);
                }
                catch (Exception ex)
                {
                    //Log.SaveLogToTxt(ex.ToString());
                    return(Algorithm.MyNaN);
                }
            }
        }
Ejemplo n.º 2
0
        public string GetCoeff(Coeff coeff, int channel)
        {
            lock (syncRoot)
            {
                string coeffName = coeff.ToString();
                try
                {
                    DUTCoeffControlByPN.CoeffInfo coeffInfo = dataTable_DUTCoeffControlByPN.GetOneInfoFromTable(coeffName, channel);

                    EnterEngMode(coeffInfo.Page);
                    string value = EEPROM_SNOEC.ReadCoef(DUT_USB_Port, 0xA0, coeffInfo.StartAddress, coeffInfo.Format);

                    //Log.SaveLogToTxt("Get " + coeffName + " is " + value);
                    return(value);
                }
                catch
                {
                    //Log.SaveLogToTxt("Failed to get value of " + coeffName);
                    return(Algorithm.MyNaN.ToString());
                }
            }
        }