> i.e. an accessible block of memory acting as a circular buffer with a means of obtaining the latest sample collected (previously via DAQ_Check)?
i.e. an accessible block of memory acting as a circular buffer with a means of obtaining the latest sample collected (previously via DAQ_Check)?
You have to do it reading several scans at once to fill a buffer you have control over it and then creating a thread only to read from this buffer what you want.
In other words:
1- Using a slow frequency continious callback you read some hundred scans at once each time and fill a large circular buffer. You fill this buffer by blocks of, let's say, 300 scans (I mean by scan a set of N channels reading).
2- And parallel thread keeps picking up from this circular large buffer what you want to do the same thing your older routines did directly in the board buffer because you had the buffer address - now, because you do not have the board buffer address, you need to copy the data into another buffer first inside the callback.
> Is there example code available to do this already?
The only examples I got from National documentation were very simple routines to create a task, read some floats and stop. Very dumb.
> Finally a question about the non-linearity of the ADCs. I would very much prefer to work with 16 bit integers rather than floats - they would need to get turned back into integers anyway to satisfy file format requirements. Am I correct in assuming that if I use simple linear scaling, the non-linearity of the M-series cards is no worse than that of the E-series equivalents?
Ahhhhhhhhh... here we have another serious problem for using Nidaqmx.
There are several analog binary read functions. And only a couple of analog Float read functions. The dumb examples? They use ONLY the float readings. Never the binary readings.
Yes, I also did assume that the binary readings were linear ... but our first real board running program with the Nindaqmx is giving us a serious reading inacurracy. A problem that the E series board did not have.
We are trying to figure out how to solve this new problem caused by the nidaqmx M boards... using calibrations arrays, to keep using the binary readings instead of the very inefficient float readings. This problem is very cumbersome.
On other message I asked some Nat guy who mentioned the binary UNSCALED non linearity of the M series...how we can use the binary reading functions and get realiable readings, but I had not response.
I would like to know HOW can we use the binary analog reading functions, if they are non linear and the documentatin does not tell us how to get THE CORRECTION COEFFICIENTS. Then what they exist for? To read wrong numbers we cannot fix?
To use the float analog readings (scaled funcions) is VERY inefficient and stupid on several circunstances, specially inside callbacks and processing a lot of numbers in real time!
I would like to be wrong on something. But I do not see any good solution from the documentation and the nidaqmx functions we can use. The binary analog reading functions just do not give us the right readings and we cannot get the correction coefficients.
> I use Delphi as, in my experience, it provides a much better framework and facilities for developing the UI parts of applications than Visual C++.)
The same we did.
🙂