高手进来救命啊~!温度采集!!
我想基于VB设计一个采集界面,通过232串口采集实时温度 并每10秒保存进数据库,界面要显示温度和时间~!救救我啊,,我是个初哥,但是我答应了要帮一个大四的师兄忙,他这几天就要毕业答辩了,,
昨晚熬夜找了很久代码,还是找不到我要的东西,
我知道对于高手来说这个很简单啊,但是我什么都不懂,又急着要,,所以才来求救,希望有高手能帮我~! --------------------编程问答-------------------- 既然你什么都不懂,那难道整个程序都靠别人来给你写? --------------------编程问答-------------------- 建议外包给华为 --------------------编程问答-------------------- 同问..... --------------------编程问答-------------------- 还要看你的下位机,是自己开发的,还是现在设备
--------------------编程问答--------------------
--------------------编程问答-------------------- 关键是看你的temperature = get_temper()
Dim left_time As Date
Dim end_time As Date
Dim Measure_Time As Integer
Dim s As Double
Dim temperature As Double
end_time = Now() + Measure_Time
opendb cnn
Do While (left_time > 0)
s = DateDiff("s", starttime, t)
temperature = get_temper()
cnn.Execute ("INSERT INTO biao ( field ) VALUES ( & temperature)")
t = DateAdd("s", Measure_STEP_s, Now())
Do While (DateDiff("s", 10, Now()) < 0)
DoEvents
Loop
left_time = end_time - Now()
Loop
补充:VB , 基础类