• 大小: 0.29M
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2020-12-26
  • 语言: C#
  • 标签: 串口  C#  

资源简介

设定连续读取时间后,从COM口获取超声波传感器传来的数据,并把数据写入文本文件,以便3后续分析使用

资源截图

代码片段和文件信息

using System;  
 using System.Collections.Generic;  
 using System.ComponentModel;  
 using System.Data;  
 using System.Drawing;  
 using System.Text;  
 using System.Windows.Forms;  
 using System.IO.Ports;  
 using System.Threading;
using System.IO;
namespace CommTest2
{
    
    public partial class Form1 : Form
    {
    SerialPort MSComm1 = new SerialPort();
    string GetTxt = ““;
    Int32  rTextNum   = 0;
    Int32 SendCount = 0;
    Int32 GetCount  = 0;
    Int32 ErrCount  = 0;
    Int32 SendLen  = 0;
    Int32 SendTime  = 0;
    Int32 Allsum = 0;
    Int32 CloseCount = 0;
    Byte[] arr_command = new Byte[0];
    Queue  QU  = new Queue(480);
        public Form1()
        {
            InitializeComponent();
        }

        private 

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

    ..A..H.     29184  2018-12-10 13:42  超声波串口连续接收\.vs\CommTest3\v15\.suo

     文件          0  2018-12-10 10:58  超声波串口连续接收\.vs\CommTest3\v15\Server\sqlite3\db.lock

     文件     561152  2018-12-10 13:42  超声波串口连续接收\.vs\CommTest3\v15\Server\sqlite3\storage.ide

     文件        144  2013-09-09 20:18  超声波串口连续接收\CommTest3\app.config

     文件      39936  2018-12-10 10:59  超声波串口连续接收\CommTest3\bin\Debug\CommTest2.exe

     文件        144  2013-09-09 20:18  超声波串口连续接收\CommTest3\bin\Debug\CommTest2.exe.config

     文件      30208  2018-12-10 10:59  超声波串口连续接收\CommTest3\bin\Debug\CommTest2.pdb

     文件      11600  2017-09-20 15:54  超声波串口连续接收\CommTest3\bin\Debug\CommTest2.vshost.exe

     文件        144  2013-09-09 20:18  超声波串口连续接收\CommTest3\bin\Debug\CommTest2.vshost.exe.config

     文件        490  2016-07-16 19:44  超声波串口连续接收\CommTest3\bin\Debug\CommTest2.vshost.exe.manifest

     文件      47694  2017-08-21 09:56  超声波串口连续接收\CommTest3\bin\Debug\Debug.rar

     文件       8306  2018-12-10 12:53  超声波串口连续接收\CommTest3\bin\Debug\LOG\-4.7°.txt

     文件       8466  2018-12-10 12:48  超声波串口连续接收\CommTest3\bin\Debug\LOG\0°.txt

     文件       8426  2018-12-10 12:52  超声波串口连续接收\CommTest3\bin\Debug\LOG\10°.txt

     文件       8330  2018-12-11 15:58  超声波串口连续接收\CommTest3\bin\Debug\LOG\12_11155837.txt

     文件       8386  2018-12-11 15:59  超声波串口连续接收\CommTest3\bin\Debug\LOG\12_11155957.txt

     文件       8386  2018-12-11 16:00  超声波串口连续接收\CommTest3\bin\Debug\LOG\12_1116056.txt

     文件       8370  2018-12-11 16:10  超声波串口连续接收\CommTest3\bin\Debug\LOG\12_1116100.txt

     文件       8402  2018-12-11 16:02  超声波串口连续接收\CommTest3\bin\Debug\LOG\12_111627.txt

     文件       8314  2018-12-11 16:04  超声波串口连续接收\CommTest3\bin\Debug\LOG\12_1116457.txt

     文件       8338  2018-12-11 16:05  超声波串口连续接收\CommTest3\bin\Debug\LOG\12_1116557.txt

     文件       8282  2018-12-11 16:07  超声波串口连续接收\CommTest3\bin\Debug\LOG\12_1116722.txt

     文件       8378  2018-12-10 12:49  超声波串口连续接收\CommTest3\bin\Debug\LOG\2.5°.txt

     文件       8338  2018-12-10 12:50  超声波串口连续接收\CommTest3\bin\Debug\LOG\5°.txt

     文件       8442  2018-12-10 12:51  超声波串口连续接收\CommTest3\bin\Debug\LOG\7.5°.txt

     文件      53248  2006-01-14 10:24  超声波串口连续接收\CommTest3\bin\Debug\XPanderControl.dll

     文件       3691  2013-09-09 20:18  超声波串口连续接收\CommTest3\CommTest3.csproj

     文件      11014  2017-08-18 15:18  超声波串口连续接收\CommTest3\Form1.cs

     文件      25428  2017-08-18 14:53  超声波串口连续接收\CommTest3\Form1.Designer.cs

     文件      32767  2017-08-18 14:53  超声波串口连续接收\CommTest3\Form1.resx

............此处省略43个文件信息

评论

共有 条评论