Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

delphi and USB 6008 measurements

I use the following procedure to read (try to) analog ch. from 6008. from delphi.
I get the errors next to the showmessage call.
Can someone post a pascal sequence that works.
Thanks.
 
procedure TForm1.Button1Click(Sender: TObject);
var
error: longword;
taskHandlev: TaskHandle;
numSampsPerChan: INT32;
autoStart: BOOL32;
timeout: FLOAT64;
dataLayout: BOOL32;
sampsPerChanWritten: INT32;
reserved: BOOL32;
begin
   try
      error := DAQmxBaseCreateTask('test',taskHandlev);
      showmessage('A' + inttostr(error)); // error = 0
      error := DAQmxBaseCreateAIVoltageChan(taskHandlev,
                                            'Dev1/ai0',
                                            'PD',
                                            DAQmx_Val_RSE,
                                            -10,
                                            10,
                                            DAQmx_Val_Volts,
                                            nil);
      showmessage('B' + inttostr(error)); // error = 4294767076
      error := DAQmxBaseStartTask(taskHandlev);
      showmessage('C' + inttostr(error)); //error = 4294766868
      edit1.text := inttostr(error);
   except
      showmessage('Problem!');
   end;
end;
0 Kudos
Message 1 of 2
(3,385 Views)
Welcome to the discussion forums, Kipod!

National Instruments doesn’t officially support the Delphi development environment. However, let me point you to some resources that exist.

There’s a KnowledgeBase (KB) that describes the use of a wrapper DLL that calls NI-DAQmx: Can I Make NI-DAQmx Calls From Borland Delphi? It should be compatible with NI-DAQmx 8.6 as well and just needs to be updated.

I also searched the discussion forums for “Delphi USB 6008” and came up with a few hits. This can be a good place to see how other users have had success with their applications. Good luck.

 

Mark E.
Precision DC Product Support Engineer
National Instruments

0 Kudos
Message 2 of 2
(3,369 Views)