超声波测试仪电路及其程序.docx
- 文档编号:28150984
- 上传时间:2023-07-08
- 格式:DOCX
- 页数:303
- 大小:101KB
超声波测试仪电路及其程序.docx
《超声波测试仪电路及其程序.docx》由会员分享,可在线阅读,更多相关《超声波测试仪电路及其程序.docx(303页珍藏版)》请在冰豆网上搜索。
超声波测试仪电路及其程序
笔者开发了一种动弹模测定仪,这款产品可以发出10000HZ的超声波用来测试混凝体的动弹模量。
该产品由安装有WINCE的CORTEXA8的嵌入式电脑控制。
COXTEXA8模组产生150HZ-1000HZ的占空比为50%的PWM信号,该信号经过电路放大以后驱动超声波探头对混凝土试件发射超声波。
超声波信号经过混凝土试件反射后,被测试探头接收。
由于接收的信号非常弱,所以该信号经过微小电压放大电路后放大,最终被COXTEXa8模组接收,并存储。
CORTEXA8比较计算后最终得到这个混凝土试件的动弹模量。
仪器的电路如下图所示:
COXTEXa8模组由WINCE下的上位机软件控制,软件源码下载XX网盘地址链接:
密码:
jfbq该软件的程序为:
usingSystem;
usingSystem.Linq;
usingSystem.Collections.Generic;
usingSystem.Text;
usingSystem.Drawing;
usingSystem.Drawing.Imaging;
namespaceSmartDeviceProject5
{
classClass1
{
}
publicclassRealTimeImageMaker
{
privateintwidth;//要生成的曲线图的宽度
privateintheight;//要生成的曲线图的高度
privatePoint[]pointList;//用来绘制曲线图的关键点,依次将这些点连接起来即得到曲线图
privateRandomrandom=newRandom();//用于生成随机数
privateBitmapcurrentImage;//当前要绘制的图片
privateColorbackColor;//图片背景色
privateColorforeColor;//图片前景色
///
///图片的高度
///
publicintHeight
{
get{returnheight;}
set{height=value;}
}
///
///图片的宽度
///
publicintWidth
{
get{returnwidth;}
set{width=value;}
}
///
///构造函数,指定生成的曲线图的宽度和高度
///
///
///
publicRealTimeImageMaker(intwidth,intheight)
:
this(width,height,Color.Gray,Color.Blue)
{
}
///
///构造函数,指定生成的曲线图的宽度、高度及背景色和前景色
///
///
///
///
///
publicRealTimeImageMaker(intwidth,intheight,ColorbackColor,ColorforeColor)
{
this.width=width;
this.height=height;
this.backColor=backColor;
this.foreColor=foreColor;
pointList=newPoint[width];
PointtempPoint;
//初始化曲线上的所有点坐标
for(inti=0;i { tempPoint=newPoint(); //曲线的横坐标沿x轴依次递增,在横向位置上每个像素都有一个点 tempPoint.X=i; //曲线上每个点的纵坐标随机生成,但保证在显示区域之内 tempPoint.Y=random.Next()%height; pointList[i]=tempPoint; } } /// ///获取当前依次连接曲线上每个点绘制成的曲线 /// /// publicImageGetCurrentCurve() { //currentImage=historyImage.Clone(newRectangle(1,0,width-1,height),PixelFormat.Format24bppRgb); //currentImage=newBitmap(width,height); currentImage=newBitmap(800,600); Pointp; //将当前定位曲线图的坐标点前移,并且将横坐标减1, //这样做的效果相当于移除当前第一个点 for(inti=0;i { p=pointList[i+1]; pointList[i]=newPoint(p.X-1,p.Y); } PointtempPoint=newPoint(); //新生成曲线图定位点的最后一个点的坐标 tempPoint.X=width; //曲线上每个点的纵坐标随机生成,但保证在显示区域之内 tempPoint.Y=random.Next(DateTime.Now.Millisecond)%height; //在最后再添加一个新坐标点 pointList[width-1]=tempPoint; Graphicsg=Graphics.FromImage(currentImage); g.Clear(backColor); //绘制曲线图 g.DrawLines(newPen(foreColor),pointList); g.Dispose(); returncurrentImage; } } } usingSystem; usingSystem.Linq; usingSystem.Collections.Generic; usingSystem.Text; usingSystem.Drawing; usingSystem.Drawing.Imaging; namespaceSmartDeviceProject5 { classClass2 { } /// 说明: 实时图片生成类,在本例中横向坐标上每个像素都会有一个控制点 /// 实际开发中可以减少控制点,比如每5个像素用一个控制点 /// 这样的效果或许更加逼真 // /// 首发地址: /// public class RealTimeImageMaker { private int width;//要生成的曲线图的宽度 private int height;//要生成的曲线图的高度 private Point[] pointList;//用来绘制曲线图的关键点,依次将这些点连接起来即得到曲线图 private Random random = new Random();//用于生成随机数 private Bitmap currentImage;//当前要绘制的图片 private Color backColor;//图片背景色 private Color foreColor;//图片前景色 /// /// 图片的高度 /// /// /// public int Height { get { return height; } set { height = value; } } /// /// 图片的宽度 /// public int Width { get { return width; } set { width = value; } } /// /// 构造函数,指定生成的曲线图的宽度和高度 /// /// 要生成的曲线图的宽度 /// 要生成的曲线图的高度 public RealTimeImageMaker(int width, int height): this(width,height,Color.Gray,Color.Blue) { } /// /// 构造函数,指定生成的曲线图的宽度、高度及背景色和前景色 /// /// 要生成的曲线图的宽度 /// 要生成的曲线图的高度 /// 曲线图背景色 /// 曲线图前景色 public RealTimeImageMaker(int width, int height, Color backColor, Color foreColor) { this.width = width; this.height = height; this.backColor = backColor; this.foreColor = foreColor; pointList = new Point[width]; Point tempPoint; //初始化曲线上的所有点坐标 for (int i = 0; i < width; i++) { tempPoint = new Point(); //曲线的横坐标沿x轴依次递增,在横向位置上每个像素都有一个点 tempPoint.X = i; //曲线上每个点的纵坐标随机生成,但保证在显示区域之内 tempPoint.Y = random.Next() % height; pointList[i] = tempPoint; } } /// /// 获取当前依次连接曲线上每个点绘制成的曲线 /// /// public Image GetCurrentCurve() { //currentImage = historyImage.Clone(new Rectangle(1, 0, width - 1, height), PixelFormat.Format24bppRgb); currentImage = new Bitmap(width, height); Point p; //将当前定位曲线图的坐标点前移,并且将横坐标减1, //这样做的效果相当于移除当前第一个点 for (int i = 0; i < width-1; i++) { p = pointList[i + 1]; pointList[i] = new Point(p.X-1,p.Y); } Point tempPoint = new Point(); //新生成曲线图定位点的最后一个点的坐标 tempPoint.X = width; //曲线上每个点的纵坐标随机生成,但保证在显示区域之内 tempPoint.Y = random.Next(DateTime.Now.Millisecond) % height; //在最后再添加一个新坐标点 pointList[width-1]=tempPoint; Graphics g = Graphics.FromImage(currentImage); g.Clear(backColor); //绘制曲线图 g.DrawLines(new Pen(foreColor), pointList); g.Dispose(); return currentImage; } } } usingSystem; usingSystem.Linq; usingSystem.Collections.Generic; usingSystem.Text; using System; using System.Collections.Generic; using System.Text; using System.Drawing; using System.Drawing.Imaging; namespaceSmartDeviceProject5 { classClass3 { } /// /// 说明: 实时图片生成类,在本例中横向坐标上每个像素都会有一个控制点 /// 实际开发中可以减少控制点,比如每5个像素用一个控制点 /// 这样的效果或许更加逼真 /// 作者: 周公 } usingSystem; usingSystem.Linq; usingSystem.Collections.Generic; usingSystem.Text; usingSystem.Collections.Generic; usingSystem.Text; usingSystem.Drawing; usingSystem.Drawing.Imaging; namespaceSmartDeviceProject5 { classClass4 { } } usingSystem; usingSystem.Collections.Generic; usingSystem.Linq; usingSystem.Text; usingSystem.Drawing; usingSystem.Windows.Forms; namespaceDrawPlane { classDraw { //publicBitmapmybitmap;//用于双缓冲的位图,和画布等大 //publiccharj;//用于双缓冲的位图,和画布等大 Randomrm=newRandom(); publicvoidcd() { charj;//用于双缓冲的位图,和画布等大 } } } usingSystem; usingSystem.Linq; usingSystem.Collections.Generic; usingSystem.ComponentModel; usingSystem.Data; usingSystem.Drawing; usingSystem.Text; usingSystem.Windows.Forms; usingSystem.Runtime.InteropServices; usingSystem.Drawing.Drawing2D; usingSystem.Data.SQLite; usingSystem.IO; usingSystem.IO.Ports; namespaceSmartDeviceProject5 { publicunsafepartialclassForm1: Form { [DllImport("HDI_API.dll")] publicstaticexternboolAPI_PWM_SetDiv(intchannel,intdiv); [DllImport("HDI_API.dll")] publicstaticexternboolAPI_PWM_Start(intchannel,intcntb,intcmpb); [DllImport("HDI_API.dll")] publicstaticexternboolAPI_PWM_Stop(intchannel); [DllImport("HDI_API.dll")] publicstaticexternboolAPI_PWM_GetFrequency(intchannel,intfrequency); [DllImport("HDI_API.dll")] publicstaticexternboolAPI_ADC_Read(intchannel,int*plevel); [DllImport("HDI_API.dll")] publicstaticexternboolAPI_GPIO_Output(bytechannel,bytelevel); [DllImport("HDI_API.dll")] publicstaticexternboolAPI_GPIO_Input(bytechannel,byte*level); [DllImport("HDI_API.dll")] publicstaticexternboolAPI_BEEP_Delay(intchannel); [DllImport("HDI_API.dll")] publicstaticexternboolAPI_GPIO_Output(intch,intlevel); [DllImport("HDI_API.dll")] publicstaticexternboolAPI_GPIO_Input(intch,int*pLevel); privateSerialPortcomport=newSerialPort(); privateintDataMode=1; delegatevoidHandleInterfaceUpdateDelegate(stringtext); publicint*level0; publicint*level1; publicint*level2; publicint*level3; stringDbName="ResidentFlash2\\test.db"; publicForm1() { InitializeComponent(); //comport.DataReceived+=newSerialDataReceivedEventHandler(comport_DataReceived); } privatevoidForm1_Load(objectsender,EventArgse) { API_GPIO_Output(0,0); API_GPIO_Output(1,0); API_GPIO_Output(2,0); API_GPIO_Output(3,0); API_GPIO_Output(4,0); API_GPIO_Output(5,0); API_GPIO_Output(6,0); API_GPIO_Output(7,0); this.timer2.Enabled=true;//可以使用 SQLiteConnection.CreateFile(DbName); //MessageBox.Show("数据库创建完成。 "); //连接数据库 stringconnStr="datasource="+DbName+";Pooling=true;FailIfMissing=false"; SQLiteConnectionconn=newSQLiteConnection(connStr); conn.Open(); //MessageBox.Show("数据库连接完成。 "); //创建表 SQLiteCommandcmd=newSystem.Data.SQLite.SQLiteCommand(); stringsql="CREATETABLEtest(usernamevarchar(20),passwordvarchar(20))"; cmd.CommandText=sql; cmd.Connection=conn; cmd.ExecuteNonQuery(); //MessageBox.Show("数据表创建完成。 "); } privatevoidbutton1_Click(objectsender,EventArgse) { //line(); API_BEEP_Delay(50); //this.timer1.Enabled=true;//可以使用 //stringresult=GlobalFld.fldl; //sjbh.Text=result; //MessageBox.Show(result); //stringresult=GlobalFld.Fld1; //MessageBox.Show(result); //GlobalFld.Fld1="aaa"; //GlobalFld.Fld1="aaa"; //DrawLineS(); //cd.j="aaa"; //cd(); //rm="aaa"; //DateTimedt=DateTime.Now; //datagrid(); //stringstrtxt=textBox4.Text.ToString(); //FileStreamfs1=newFileStream("ResidentFlash2\\dtm.txt",FileMode.Create,FileAccess.Write);//创建写入文件 //StreamWritersw=newStreamWriter(fs1); //sw.WriteLine(this.textBox3.Text.Trim()+"+"+this.textBox4.Text);//开始写入值 //sw.Write(strtxt);//开始写入值 //sw.Write(textBox3.Text);//开始写入值 //sw.Close(); //fs1.Close(); //表示清空txt //StreamWritersw=newStreamWriter("D: \\1.txt"); //stringw=""; //sw.Wr
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 超声波 测试仪 电路 及其 程序
![提示](https://static.bdocx.com/images/bang_tan.gif)