Hi,
I have an application that acquires an analog signal asynchronously and uses a callback to process the data when the read finishes. The reason I am doing this is asynchronously is so that I can use the parallel port data output as an external clock source for the DAQPad-6016 used to acquire the data (for a number of reasons). If I press a button on the GUI whose code calls a routine to perform the read and then use a subroutine called from within the callback to display the data, all is fine. However, if instead I try to access the data array from outside the callback (i.e. from the sub that calls the acquisition sub) I get a "System.NullReferenceException" error, perhaps because the callback has not returned the data array yet (although this does not appear to be time dependent). I would like to be able to loop through and acquire data several times before displaying or further processing the data. This would mean getting the data array from the callback, transferring it to another array and then running the acquisition routine again. However, I cannot find a way of doing this, yet it seems like it should be a common need. If anybody has any ideas how to do this I would be grateful.
Thanks,
Nathan