Example #1
0
        public double GetLowFreq(string channel)
        {
            HandlerError.ClearErrors();
            double measures = 0;

            try
            {
                //GPIBVisa.WriteCommand("SENS:DIG:DATA:BYTE? (@" + Channel + ")");
                WriteCommand("CONF:FREQ  (@" + channel + ")");
                WriteCommand("SENS:FREQ:RANG:LOW 3,  (@" + channel + ")");
                WriteCommand("INIT");
                WriteCommand("FETCh?");

                //System.Threading.Thread.Sleep(2000);
                ReadCommand(out measures);
                //return measures;
            }
            catch (Exception e)
            {
                HandlerError.ErrorOccurred = true;
                HandlerError.ErrorMsg      = "Data Adquisition Agilent 34970A. " + e.Message;
                throw new Exception(HandlerError.ErrorMsg);
            }
            return(measures);
        }
Example #2
0
 public virtual void Initialization()
 {
     HandlerError.ClearErrors();
     try
     {
         //SeaMaxDeviceHandler = new SeaMAX();
     }
     catch (Exception e)
     {
         throw new Exception("SEA LEVEL Error: " + e.Message);
     }
 }
Example #3
0
 public void Close()
 {
     HandlerError.ClearErrors();
     try
     {
         _serialPort.Close();
     }
     catch (Exception ex)
     {
         HandlerError.ErrorOccurred = true;
         HandlerError.ErrorMsg      = "Closed port. " + ex.Message;
         throw new Exception(HandlerError.ErrorMsg);
     }
 }
Example #4
0
 public void Write(string message)
 {
     HandlerError.ClearErrors();
     try
     {
         _serialPort.Write(message);
     }
     catch (Exception ex)
     {
         HandlerError.ErrorOccurred = true;
         HandlerError.ErrorMsg      = "Write port. " + ex.Message;
         throw new Exception(HandlerError.ErrorMsg);
     }
 }
Example #5
0
File: Visa.cs Project: tomyqg/EPTS
 /// <summary>
 /// Reset Device
 /// </summary>
 public void Reset()
 {
     HandlerError.ClearErrors();
     try
     {
         WriteCommand("*RST");
     }
     catch (Exception ex)
     {
         HandlerError.ErrorOccurred = true;
         HandlerError.ErrorMsg      = "Reset command VisaCom Method. " + ex.Message;
         throw new Exception(HandlerError.ErrorMsg);
     }
 }
Example #6
0
File: Visa.cs Project: tomyqg/EPTS
 /// <summary>
 /// Abort Device
 /// </summary>
 public void Abort()
 {
     HandlerError.ClearErrors();
     try
     {
         ResourceIO.WriteString("ABOR", true);
     }
     catch (Exception ex)
     {
         HandlerError.ErrorOccurred = true;
         HandlerError.ErrorMsg      = "Abort command VisaCom Method. " + ex.Message;
         throw new Exception(HandlerError.ErrorMsg);
     }
 }
Example #7
0
File: Visa.cs Project: tomyqg/EPTS
 /// <summary>
 /// Clear Device
 /// </summary>
 public void ClearDevice()
 {
     HandlerError.ClearErrors();
     try
     {
         ResourceIO.IO.Clear();
     }
     catch (Exception ex)
     {
         HandlerError.ErrorOccurred = true;
         HandlerError.ErrorMsg      = "Clear Device command VisaCom Method. " + ex.Message;
         throw new Exception(HandlerError.ErrorMsg);
     }
 }
Example #8
0
File: Visa.cs Project: tomyqg/EPTS
 /// <summary>
 /// Poll
 /// </summary>
 public void Poll()
 {
     HandlerError.ClearErrors();
     try
     {
         ResourceIO.WriteString("*STB?", true);
     }
     catch (Exception ex)
     {
         HandlerError.ErrorOccurred = true;
         HandlerError.ErrorMsg      = "Find Device command VisaCom Method. " + ex.Message;
         throw new Exception(HandlerError.ErrorMsg);
     }
 }
Example #9
0
 public virtual void Initialization()
 {
     HandlerError.ClearErrors();
     try
     {
         _serialPort = new SerialPort(PortName, BaudRate, Parity, DataBits, StopBits);
         _serialPort.DataReceived += DataReceivedHandler;
     }
     catch (Exception ex)
     {
         HandlerError.ErrorOccurred = true;
         HandlerError.ErrorMsg      = "Open port. " + ex.Message;
         throw new Exception(HandlerError.ErrorMsg);
     }
 }
Example #10
0
File: Visa.cs Project: tomyqg/EPTS
 /// <summary>
 /// Triger Device
 /// </summary>
 public void Trigger()
 {
     HandlerError.ClearErrors();
     try
     {
         ResourceIO.IO.AssertTrigger(Ivi.Visa.Interop.TriggerProtocol.TRIG_PROT_ON);
         HandlerCpu.Delay(1);
     }
     catch (Exception ex)
     {
         HandlerError.ErrorOccurred = true;
         HandlerError.ErrorMsg      = "Trigger command VisaCom Method. " + ex.Message;
         throw new Exception(HandlerError.ErrorMsg);
     }
 }
Example #11
0
File: Visa.cs Project: tomyqg/EPTS
 /// <summary>
 /// Clean the Device Buffer
 /// </summary>
 public void Flush()
 {
     HandlerError.ClearErrors();
     try
     {
         ResourceIO.FlushWrite(false);
         ResourceIO.IO.Clear();
     }
     catch (Exception ex)
     {
         HandlerError.ErrorOccurred = true;
         HandlerError.ErrorMsg      = "Flush command VisaCom Method. " + ex.Message;
         throw new Exception(HandlerError.ErrorMsg);
     }
 }
Example #12
0
 public void SM_Close()
 {
     HandlerError.ClearErrors();
     try
     {
         SeaMaxDeviceHandler.SM_Close();
     }
     catch (Exception e)
     {
         HandlerError.ErrorCode     = -1;
         HandlerError.ErrorOccurred = true;
         HandlerError.ErrorMsg      = "Close Returned Error Code: " + HandlerError.ErrorCode + ", when try to Open Port";
         throw new Exception(e.Message);
     }
 }
Example #13
0
 public double Fetch()
 {
     HandlerError.ClearErrors();
     try
     {
         WriteCommand("INIT");
         WriteCommand("FETCh?");
         double measure = 0;
         ReadCommand(out measure);
         return(measure);
     }
     catch (Exception e)
     {
         HandlerError.ErrorOccurred = true;
         HandlerError.ErrorMsg      = "Data Adquisition Agilent 34970A. " + e.Message;
         throw new Exception(HandlerError.ErrorMsg);
     }
 }
Example #14
0
        public double GetMeasure(MeasType command, int channel)
        {
            HandlerError.ClearErrors();
            double measures = 0;

            try
            {
                WriteCommand(MeasureType.GetMeasure(command) + " (@" + channel + ")");
                ReadCommand(out measures);
            }
            catch (Exception e)
            {
                HandlerError.ErrorOccurred = true;
                HandlerError.ErrorMsg      = "Data Adquisition Agilent 34970A. " + e.Message;
                throw new Exception(HandlerError.ErrorMsg);
            }
            return(measures);
        }
Example #15
0
 public void Open()
 {
     HandlerError.ClearErrors();
     try
     {
         if (_serialPort.IsOpen)
         {
             throw new Exception("its Open the ports");
         }
         _serialPort.Open();
     }
     catch (Exception ex)
     {
         HandlerError.ErrorOccurred = true;
         HandlerError.ErrorMsg      = "Open port. " + ex.Message;
         throw new Exception(HandlerError.ErrorMsg);
     }
 }
Example #16
0
File: Visa.cs Project: tomyqg/EPTS
        /// <summary>
        /// Device Agilent Initialization
        /// </summary>
        public virtual void Initialization()
        {
            HandlerError.ClearErrors();

            ResourceManager = new ResourceManagerClass();
            ResourceIO      = new FormattedIO488Class();
            try
            {
                ResourceManager.Open(DeviceAddress, AccessMode.NO_LOCK, 0, "");
                ResourceIO.IO = (IMessage)ResourceManager.Open(DeviceAddress, AccessMode.NO_LOCK, 0, "");
            }
            catch (Exception e)
            {
                HandlerError.ErrorOccurred = true;
                HandlerError.ErrorMsg      = "Init resource Agilent Method. " + e.Message;
                throw new Exception(HandlerError.ErrorMsg);
            }
        }