02-23-2017 09:40 AM
Hello,
I'm trying to read a NI9213 in real time. I can read some value but I have an issue.
My code is :
myTask = DaqSystem.Local.LoadTask("TaskNIMAX")
'Verify the Task
myTask.Control(TaskAction.Verify)
analogInReader = New AnalogMultiChannelReader(myTask.Stream)
' Use SynchronizeCallbacks to specify that the object
' marshals callbacks across threads appropriately.
analogInReader.SynchronizeCallbacks = True
analogInReader.BeginReadWaveform(1, myAsyncCallback, myTask)
Private Sub AnalogInCallback(ByVal ar As IAsyncResult)
Try
If (Not (runningTask Is Nothing)) AndAlso runningTask Is ar.AsyncState Then
data = analogInReader.EndReadWaveform(ar)
analogInReader.BeginMemoryOptimizedReadWaveform(1, myAsyncCallback, myTask, data)
Debug.Print((data(0).Samples(0).Value).ToString)
End If
Catch exception As DaqException
MessageBox.Show(exception.Message)
myTask.Dispose()
End Try
End Sub
The task is configure with continuous sampling (1 sample at 500 Hz). You can see the value read on the file debug.txt.
My question is why I have many time the same value ? What is wrong in my code ?
Thanks
02-24-2017 06:48 AM
Hello
My problem is solved. I use a thermocouple card and it's not possible to get the value at 500hz