| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1902 人关注过本帖
标题:VB数据采集中脉冲信号怎样处理呢?
只看楼主 加入收藏
davidzhuzhu
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2008-2-2
收藏
 问题点数:0 回复次数:1 
VB数据采集中脉冲信号怎样处理呢?
下面是数据采集卡的采集程序的TIMER(记数用,),不知道怎样才能用一个按钮控件将计数值count清零,而且每次采集开始count的值也不是从0开始,很奇怪
Private Sub Timer1_Timer()
Dim overflow As Integer
  Dim Count As Long
  ErrCde = DRV_DeviceOpen(0, DeviceHandle)
If (ErrCde <> 0) Then
DRV_GetErrorMessage ErrCde, szErrMsg
Response = MsgBox(szErrMsg, vbOKOnly, Error)
Exit Sub
End If
  lpCounterEventRead.counter = lpCounterEventStart.counter
  lpCounterEventRead.overflow = DRV_GetAddress(overflow)
  lpCounterEventRead.Count = DRV_GetAddress(Count)
  ErrCde = DRV_CounterEventRead(DeviceHandle, lpCounterEventRead)
  If (ErrCde <> 0) Then
        DRV_GetErrorMessage ErrCde, szszErrMsg
        Response = MsgBox(szszErrMsg, vbOKOnly, "Error!!")
        Exit Sub
End If
Text1.Text = Str(Count)
End Sub
搜索更多相关主题的帖子: 数据采集 脉冲 信号 DRV overflow 
2008-07-11 20:49
weqr1082
Rank: 1
等 级:新手上路
帖 子:5
专家分:0
注 册:2010-1-28
收藏
得分:0 
Dim Count As Long
Count =1
Private Sub Timer1_Timer()
Dim overflow As Integer

 if Count >=50 then
    Count =1
end if
  ErrCde = DRV_DeviceOpen(0, DeviceHandle)
If (ErrCde <> 0) Then
DRV_GetErrorMessage ErrCde, szErrMsg
Response = MsgBox(szErrMsg, vbOKOnly, Error)
Exit Sub
End If
  lpCounterEventRead.counter = lpCounterEventStart.counter
  lpCounterEventRead.overflow = DRV_GetAddress(overflow)
  lpCounterEventRead.Count = DRV_GetAddress(Count)
Count=Count+1
  ErrCde = DRV_CounterEventRead(DeviceHandle, lpCounterEventRead)
  If (ErrCde <> 0) Then
        DRV_GetErrorMessage ErrCde, szszErrMsg
        Response = MsgBox(szszErrMsg, vbOKOnly, "Error!!")
        Exit Sub
End If
Text1.Text = Str(Count)
End Sub
2010-02-03 10:19
快速回复:VB数据采集中脉冲信号怎样处理呢?
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.010734 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved