Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I attach a MS8 control to a task?

I am new to data acquisition, and reading the "help" hasn't been much help.  Basically what I want to do is attach a thermometer control to a data stream from a DAQmx task so that it will update as the task acquires data.  I can do this with a single sample using a timer, but that is pretty crude.  I want to be able to do it using a continuous acquisition.  I've been looking at the examples, and they don't use a control directly.  It looks like the reader passes to an array, which passes to a datatable, which is bound to a datagrid.  Are all these steps necessary to get a usable stream of data?  Maybe I'm thinking too hard about this.  It just seems that there has to be an easier way to do this.
 
Joe White
0 Kudos
Message 1 of 3
(2,811 Views)

Ok.  Never mind.  I figured out how to use the async callback to retrieve my data.  My next question is:  Is the array overwritten each time the callback is called in the following  code snippet?

 

Try

If taskRunning = True Then

'Stop reading and pass the contents of the buffer

'to the array using the async callback

data = myreader.EndReadMultiSample(ar)

TextBox1.Text = data(0, 1)

myreader.BeginReadMultiSample(1000, callback,

Nothing)

End If

Thanks
0 Kudos
Message 2 of 3
(2,809 Views)
when you call ....end read...

the resultant samples overwrite your array named "data"

you can observe this behaviour in the datagrid example that you refer to

cheers
Philip Newman
General Dynamics
Electric Boat
0 Kudos
Message 3 of 3
(2,802 Views)