1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
|
PrivateSub BackgroundWorker1_DoWork(ByVal sender As System.Object, ByVal e As System.ComponentModel.DoWorkEventArgs) Handles BackgroundWorker1.DoWork
Dim worker As System.ComponentModel.BackgroundWorker = CType(sender, System.ComponentModel.BackgroundWorker)
e.Result = delais1(worker, e.Result)
EndSub
PrivateSub backgroundWorker1_RunWorkerCompleted(ByVal sender AsObject, ByVal e As System.ComponentModel.RunWorkerCompletedEventArgs) Handles BackgroundWorker1.RunWorkerCompleted
Delai1.Text = e.Result.ToString
EndSub
PublicFunction delais1(ByVal worker As System.ComponentModel.BackgroundWorker, ByVal e As System.ComponentModel.DoWorkEventArgs) AsDouble
Dim max AsDouble = 0.3
Dim min AsDouble = 0.001
Dim valeurdelai AsString
myTask = New Task
myTask.CIChannels.CreateTwoEdgeSeparationChannel("Dev2/ctr0", "", min, _
max, CITwoEdgeSeparationFirstEdge.Rising, CITwoEdgeSeparationSecondEdge.Rising, CITwoEdgeSeparationUnits.Seconds)
counterInReader = New CounterReader(myTask.Stream)
Dim data AsDouble = counterInReader.ReadSingleSampleDouble()
valeurdelai = data.ToString
Return valeurdelai
EndFunction
|
Partager