So, here is the story:
1. I have read a post by a NI staff member (or got the same impression), that
NIDAQmxBase has problems even with VC++ and VB6, and that some people had success in running
NIDAQmx in Delphi. So we should better forget about the
BASE version and use
NIDAQmx.
2. Finally I came across
that.
I took two files from there:
NIDAQmxCAPI_TLB.pas and
nidaqmx.pas and fixed one of them a bit (removed three brackets).
So a working snippet is attached to the post.
It is running on Lazarus 1.1; SVN revision 40379; FPC version: 2,6,1 on Windows XP.
I have installed the latest NIDAQmx, I think it is 9.7.0. A file named
nicaiu.dll shall be in the
c:\windows\system32 folder.
The snipped works with a virtual DAQ NI PCI-6052E. I still have not tested it on a real one.
3. BTW, I tried to contact Antillasoft on the email, but it was returned to me buy the mail server. I suppose they are defunct.
EDIT: There is a
bug in the snippet. I will update it when I have the time, but so far
line
DAQmxError:=DAQmxReadAnalogF64(taskHandle,SamplesPerChannel,10,{DAQmx_Val_GroupByScanNumber}DAQmx_Val_GroupByChannel,@DAQData[0],SamplesCount,@SampsPerChanRead,nil);shall become
DAQmxError:=DAQmxReadAnalogF64(taskHandle,SamplesPerChannel,TimeOut,{DAQmx_Val_GroupByScanNumber}DAQmx_Val_GroupByChannel,@DAQData[0],SamplesCount,@SampsPerChanRead,nil);where
var
Timeot: double'
begin
...
TimeOut:=SamplesPerChannel/RefreshRate+1;
+1 seems to be enough for me, but I am not sure if it does not depend on the PC.