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