Hi,
I'm trying to program (Visual Basic .NET) a semiperiod measurement with PCI-6601 to measure time. Should I connect some terminal to some other explicitly to accomplish this task? Or what is wrong with my code?
MyTask = New Task()
MyCallBack = New AsyncCallback(AddressOf CounterInCallback)
MyTask.Stream.Timeout = 15
MyTask.CIChannels.CreateSemiPeriodChannel("Dev1/ctr0", "", 0.0001, 4.01, CISemiPeriodUnits.Seconds)
MyTask.Timing.ConfigureImplicit(SampleQuantityMode.FiniteSamples)
CTR = New CounterReader(MyTask.Stream)
CTR.BeginReadMultiSampleDouble(1, MyCallBack, Nothing)
' I tried something like this;
' DaqSystem.Local.ConnectTerminals("/Dev1/Ctr1Out", "/Dev1/Ctr0Gate")
Private Sub CounterInCallback(ByVal ar As IAsyncResult)
Try
Dim d = DateAndTime.Timer
While d + 4 > DateAndTime.Timer
‘ Odotetaan neljä sekuntia
End While
Dim values() As Double = CTR.EndReadMultiSampleDouble(ar)
Catch exception As DaqException
MyTask.Dispose()
MessageBox.Show(exception.Message)
End Try
End Sub
Running this code produces an error which says "
Measurements: Some or all of the samples requested have not yet been acquired (and so on) “.
Any suggestions what might be the problem, if the terminal connections are not the case?
Thanks for listening,
Teemu