Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

usb-6008 and delphi

Hey.
 
I just got a NI usb-6008, and plan on using it in an installation I'm making.
Now I use Borland Delphi (v7 and v9(2005)), for all my development.
So the question is if there is a way to communicate with the 6008 from delphi.
 
regards Martin
0 Kudos
Message 1 of 10
(6,994 Views)

Hi,

there is - you have to interface the NIDAQMXBASE.dll. Actually it works in a way, but it seems that only the basic functions are supported. NI obviously has to release few versions of BASE driver before they get to the level of NIDAQ drivers (which are great by the way).

We have rewritten the header file for use in Delphi, if you are interested.

Jure

0 Kudos
Message 2 of 10
(6,914 Views)
I would be interested in the delphi translation.

Thanks,
Gabriel
0 Kudos
Message 3 of 10
(6,837 Views)

Hay


I didn't see your post before now. Well I written my own interface to the NIDAQMXBASE.dll.
But only partial ( just translated the parts I needed). But I you have a complete translation I be very grateful for it.


Regards Martin

0 Kudos
Message 4 of 10
(6,832 Views)
Hi,
I posted in a standalone thread; maybe more people need it.

Regards,
Gabriel
0 Kudos
Message 5 of 10
(6,814 Views)
Hi All,

What version of Delphi do you use to work using NI-DAQms driver? Can D7 be used or this driver works only with D2005 (.net application)?
I tried to import NI-DAQms 7.3  ActiveX controls into D7 and this worked out Ok, but NIDAQ card (M-series multifunction) complains that driver and hardwatre are incompatible.


Sincerely,
Boris
0 Kudos
Message 6 of 10
(6,773 Views)

Hi,

I'm try use Delphi 6 and 7 with NI-DAQmx USB 6009.

But I have problems to pass a a reserved null parameter to a function call.

Can someone help me?

This is a exemple of I doing:

 

uses ...., NIDAQMXBASE;

....

function DAQmxWriteDigitalU8 (taskHandle: TASKHANDLE;
   numSampsPerChan: INT32;
   autoStart: BOOL32;
   timeout: FLOAT64;
   dataLayout: BOOL32;
   writeArray: PUINT8;
   var sampsPerChanWritten: INT32;
   reserved: PBOOL32): INT32; stdcall; external 'nicaiu.dll' name 'DAQmxWriteDigitalU8';
.....

procedure TForm1.Button1Click(Sender: TObject);
var
error: longword;

taskHandle: TASKHANDLE;
numSampsPerChan: INT32;
autoStart: BOOL32;
timeout: FLOAT64;
dataLayout: BOOL32;
writeArray: UINT8;
sampsPerChanWritten: INT32;
reserved: BOOL32;

begin
   writearray := $01;
   try
      error := DAQmxCreateTask('saida',taskHandle);
      showmessage(inttostr(error));
      error := DAQmxCreateDOChan(taskHandle,'Dev1/port0/line0','teste',DAQmx_Val_ChanForAllLines);
      showmessage(inttostr(error));
      error := DAQmxStartTask(taskHandle);
      showmessage(inttostr(error));
      error := DAQmxWriteDigitalU8(taskHandle, 1, 1, 10.0, DAQmx_Val_groupByChannel, @writearray, sampsPerChanWritten, @reserved);
      edit1.text := inttostr(error);
   except
      showmessage('Nao deu certo!');
   end;
end;

The three error messages are zero, but the last show the error code: ErrorCAPIReservedParamNotNULL = $FFFCF0D4; 4294766804;

Thanks

Message Edited by Josemar on 03-18-2006 08:23 PM

0 Kudos
Message 7 of 10
(6,516 Views)

Hi,

To me it seems you just need to pass nil as the last parameter, not @reserved.

Gabriel

Message 8 of 10
(6,503 Views)
Thank you, Gabriel!!!
 
You shot at spot!!!
 
 
0 Kudos
Message 9 of 10
(6,491 Views)
Hi,
 
I'm a french studient and i use too the USB 6008 .
I want to develop a program with Delphi 7 but I don't find any examples.
Maybe, you've got few examples what will help me much.
I will be able to give you more explanations if it is not very clear.
 
regards
Adrien
0 Kudos
Message 10 of 10
(6,421 Views)