



下載本文檔
版權(quán)說(shuō)明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡(jiǎn)介
1、vb程序?qū)崿F(xiàn)串口通信,將接到的數(shù)據(jù)動(dòng)態(tài)保存,并可以圖表繪制曲線(X:時(shí)間,Y:數(shù)據(jù))將接到的數(shù)據(jù)賦值于全局變量,通過ADO數(shù)據(jù)控件連接數(shù)據(jù)庫(kù)及表,用以下代碼保存數(shù)據(jù): Private Sub Timer1_Timer() If Label1.Caption CStr(Time$) Then Label1.Caption = Time$ sum_zj = sum_zj + 1 Text3 = sum_zj 校準(zhǔn) If sum_zj = 3 Then sum_zj1 = sum_zj1 + 1 sum_zj = sum_zj - 3 Text4 = sum_zj1 Adodc1.Recordset
2、.AddNew 每3秒記錄一組數(shù)據(jù) Adodc1.Recordset(0) = shiYAnH Adodc1.Recordset(1) = Mid(Time$, 1, 2) & Mid(Time$, 4, 2) & Mid(Time$, 7, 2) 記錄time Adodc1.Recordset(2) = record_jm(0) 記錄數(shù)據(jù) Adodc1.Recordset(3) = record_jm(1) 記錄數(shù)據(jù) Adodc1.Recordset(4) = record_jm(2) 記錄數(shù)據(jù) Adodc1.Recordset(5) = record_jm(3) 記錄數(shù)據(jù) Adodc1.R
3、ecordset(6) = record_jm(4) 記錄數(shù)據(jù) Adodc1.Recordset(7) = record_jm(5) 記錄數(shù)據(jù) Adodc1.Recordset(8) = record_jm(6) 記錄數(shù)據(jù) Adodc1.Recordset(9) = record_jm(7) 記錄數(shù)據(jù) Adodc1.Recordset(10) = record_jm(8) 記錄數(shù)據(jù) Adodc1.Recordset(11) = record_jm(9) 記錄數(shù)據(jù) Adodc1.Recordset(12) = record_jm(10) 記錄數(shù)據(jù) Adodc1.Recordset(13) = r
4、ecord_jm(11) 記錄數(shù)據(jù) Adodc1.Recordset.Update End If End If End Sub Private Sub Timer2_Timer() Picture4.DrawStyle = 0 以下代碼繪制實(shí)時(shí)曲線(6點(diǎn)): Picture4.DrawWidth = 3 = dash Picture4.Line (sum_z1 * 18 + 500, record_jm(0) * -150 + 7900)-(sum_z1 * 18 + 500, record_jm(2) * -150 + 7900), vbRed , BF Picture4.Line (sum
5、_z1 * 18 + 500, record_jm(1) * -150 + 7900)-(sum_z1 * 18 + 500, record_jm(3) * -150 + 7900), vbCyan , BF Picture4.Line (sum_z1 * 18 + 500, record_jm(2) * -150 + 7900)-(sum_z1 * 18 + 500, record_jm(4) * -150 + 7900), vbBlack , BF Picture4.Line (sum_z1 * 18 + 500, record_jm(3) * -150 + 7900)-(sum_z1 *
6、 18 + 500, record_jm(5) * -150 + 7900), vbMagenta , BF Picture4.Line (sum_z1 * 18 + 500, record_jm(4) * -150 + 7900)-(sum_z1 * 18 + 500, record_jm(6) * -150 + 7900), vbGreen , BF Picture4.Line (sum_z1 * 18 + 500, record_jm(5) * -150 + 7900)-(sum_z1 * 18 + 500, record_jm(7) * -150 + 7900), vbBlue , B
7、F End Sub Private Sub Timer3_Timer() If Label32 CStr(Time$) Then Label1.Caption Label32.Caption = Time$ sum_z = sum_z + 1 Text31 = sum_z 校準(zhǔn) If sum_z = 5 Then sum_z = sum_z - 5 sum_z1 = sum_z1 + 1 Text30 = sum_z1 End If End If End Sub 以下代碼繪制曲線的坐標(biāo): Private Sub Form_Load() With Adodc1 Adodc1.Connection
8、String = Provider=Microsoft.Jet.OLEDB.4.0;Data Source= & App.Path & kongtiaocartemp.mdb;Persist Security Info=False Adodc1.RecordSource = select * form car_bm End With Text1 = Text2 = : Text3 = : Text4 = : Text5 = : Text6 = : Text7 = : Text12 = Text8 = : Text9 = : Text10 = : Text11 = Text13 = : Text
9、14 = : Text15 = : Text16 = Load frmMain colvb = vbBlack xx = 100 yy = 150 txt = wp = xp(colvb, xx, yy, txt) xx = 200 yy = 350 txt = 50 wp = xp(colvb, xx, yy, txt) xx = 200 yy = 1850 txt = 40 wp = xp(colvb, xx, yy, txt) yy = 3350 xx = 200 txt = 30 wp = xp(colvb, xx, yy, txt) xx = 200 yy = 4850 txt =
10、20 wp = xp(colvb, xx, yy, txt) xx = 200 yy = 6350 txt = 10 wp = xp(colvb, xx, yy, txt) Time坐標(biāo) colvb = vbRed yy = 6500 xx = 400 txt = 0 wp = xp(colvb, xx, yy, txt) xx = 1480 txt = 5 wp = xp(colvb, xx, yy, txt) xx = 2560 txt = 10 wp = xp(colvb, xx, yy, txt) xx = 3640 txt = 15 wp = xp(colvb, xx, yy, tx
11、t) xx = 4720 txt = 20 wp = xp(colvb, xx, yy, txt) xx = 5800 txt = 25 min wp = xp(colvb, xx, yy, txt) xx = 6880 txt = 30 wp = xp(colvb, xx, yy, txt) xx = 7960 txt = 35 wp = xp(colvb, xx, yy, txt) xx = 9040 txt = 40 wp = xp(colvb, xx, yy, txt) xx = 10120 txt = 45 wp = xp(colvb, xx, yy, txt) xx = 11200
12、 txt = 50 wp = xp(colvb, xx, yy, txt) 畫格 Picture1.DrawWidth = 1 = dash Picture1.DrawStyle = 0 Picture1.ForeColor = vbCyan For i = 0 To 39 Picture4.Line (450, 550 + i * 150)-(500, 550 + i * 150) Next Picture4.DrawStyle = 2 For i = 0 To 8 Picture4.Line (450, 400 + i * 750)-(11300, 400 + i * 750) Next
溫馨提示
- 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 跨國(guó)公司財(cái)務(wù)分析的國(guó)際化視角
- 2025年南平延平區(qū)區(qū)屬國(guó)有企業(yè)公開招聘筆試參考題庫(kù)附帶答案詳解
- 超市貨架的承重與穩(wěn)定性分析
- 備戰(zhàn)2025年高考生物一輪復(fù)習(xí)單元訓(xùn)練金卷第七單元生物的變異育種和進(jìn)化A卷含解析
- 知識(shí)產(chǎn)權(quán)保護(hù)在醫(yī)療健康的重要性
- 遼寧省示范校北票市尹湛納希高級(jí)中學(xué)高中政治6.1求索真理的歷程學(xué)案新人教版必修4
- 財(cái)務(wù)風(fēng)險(xiǎn)管理二十要點(diǎn)
- 遠(yuǎn)程辦公的在線溝通禮儀
- 部編版四年級(jí)《道德與法治》下冊(cè)全冊(cè)教學(xué)設(shè)計(jì)
- 湖南2024年12月湖南省漢壽縣部分事業(yè)單位公開招考60名工作人員筆試歷年典型考題(歷年真題考點(diǎn))解題思路附帶答案詳解
- 2022屆江蘇省南京師范大學(xué)附屬中學(xué)高三(下)考前最后一模物理試題(解析版)
- 辦公用品供貨服務(wù)計(jì)劃方案
- 《普通生物學(xué)教案》word版
- 貴州省就業(yè)失業(yè)登記表
- 預(yù)防電信詐騙網(wǎng)絡(luò)詐騙講座PPT幻燈片課件
- 反興奮劑知識(shí)試題及答案
- 初中八年級(jí)上冊(cè)音樂課件4.2欣賞沃爾塔瓦河(14張)ppt課件
- 人教版五年級(jí)數(shù)學(xué)下冊(cè)每個(gè)單元教材分析(共九個(gè)單元)
- 深圳氫燃料共享單車項(xiàng)目投資計(jì)劃書【參考范文】
- 主要腸內(nèi)營(yíng)養(yǎng)制劑成分比較
- 小學(xué)生如何理解句子的含義(課堂PPT)
評(píng)論
0/150
提交評(píng)論