数据可保存于数据库也可保存于文本文件,各自实现代码不同.
使用TIMER控件定时保存数据代码:
Private Sub Timer3_Timer()
If Label5.Caption <> CStr(Time$) Then
Label5.Caption = Time$
sum_zj = sum_zj + 1
'校准
If sum_zj >= 60 Then
sum_zj = sum_zj - 60 '每分钟记录一组数据
Adodc1.Recordset.AddNew
Adodc1.Recordset(0) = shiyan_sj(0)
Adodc1.Recordset(1) = Mid(Date$, 3, 2) & Mid(Date$, 6, 2) & Mid(Date$, 9, 2) & "-" & Time$ 'Mid(Time$, 1, 2) & Mid(Time$, 4, 2) & Mid(Time$, 7, 2) '记录time
Adodc1.Recordset(2) = Val(Label3(0).Caption) '记录数据
Adodc1.Recordset(3) = Val(Label3(1).Caption) '记录数据
Adodc1.Recordset.Update
End If
End If
End Sub
只要数据能保存于数据库.曲线图无须保存,通过数据检索画图:
◆◆
评论读取中....
请登录后再发表评论!
◆◆
修改失败,请稍后尝试