예제 #1
0
 /// <summary>
 /// Reads ADCBuffer
 /// </summary>
 /// <param name="sp"></param>
 /// <returns></returns>
 private UInt16[] ReadADCBuffer(AdvancedSerialPort sp)
 {
     UInt16[] RxArray;
     try
     {
         sp.TransferProgressEvent += RaiseProgressChanged;
         RxArray = sp.ReadUInt16Array(adc_buffer_size, new TimeSpan(0, 0, 0, 0, ADCReadTimeout));
     }
     catch (TimeoutException ex)
     {
         Debug.WriteLine("[ReadADCBuffer ComPort Timeout]:{0} ", ex.Message);
         throw;
     }
     finally
     {
         sp.TransferProgressEvent -= RaiseProgressChanged;
     }
     return(RxArray);
 }
예제 #2
0
 /// <summary>
 /// Reads ADCBuffer 
 /// </summary>
 /// <param name="sp"></param>
 /// <returns></returns>
 private UInt16[] ReadADCBuffer(AdvancedSerialPort sp)
 {
     UInt16[] RxArray;
     try
     {
         sp.TransferProgressEvent += RaiseProgressChanged;
         RxArray = sp.ReadUInt16Array(adc_buffer_size, new TimeSpan(0, 0, 0, 0, ADCReadTimeout));
     }
     catch (TimeoutException ex)
     {
         Debug.WriteLine("[ReadADCBuffer ComPort Timeout]:{0} ", ex.Message);
         throw;
     }
     finally
     {
         sp.TransferProgressEvent -= RaiseProgressChanged;
     }
     return RxArray;
 }
 public AdvancedSerialPort Open()
 {
     SerialPortObject = new AdvancedSerialPort(CurrentPort.PortName, BaudRate, Parity.None, 8, StopBits.One);
     SerialPortObject.Open();
     return SerialPortObject;
 }
 public AdvancedSerialPort Open()
 {
     SerialPortObject = new AdvancedSerialPort(CurrentPort.PortName, BaudRate, Parity.None, 8, StopBits.One);
     SerialPortObject.Open();
     return(SerialPortObject);
 }