Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

how to program PCI-6509 with Delphi7?

I have to program a PCI-DIO-6509 board with Delphi but this board is only supported by NIDAQmx and NIDAQmx cannot be used with active X controls. How can I do?
0 Kudos
Message 1 of 14
(6,634 Views)
Hello niko72,

Unfortunately, there is no support for that board under Delphi. This driver does not support that operation. Here is a KB that docuemnts that. http://digital.ni.com/public.nsf/websearch/6DA2B77222315EE08525644B0077C1CA?OpenDocument. I would suggest that you use a different digital board with an older version of the driver that supports delphi.

Hope this helps!

Regards,
Steven B.
National Instruments
0 Kudos
Message 2 of 14
(6,622 Views)
thanks Steven and happy new year,
but the fact is that we need this board (high current) in our industrial application
I'm quite surprised to know that this new industrial board cannot be supported by delphi, one of the most useful language and so used in industrial applications...
Would it be possible in a near future? Are NI engineers working on it?
Another way to control this board with Delphi is to use a dll: I have nidaqmx.h on my computer resulting of the installation of nidaqmx and this file calls a dll NIDAQMX.DLL. But I CAN'T FIND it neither on my computer nor on the CD NI-DAQ 7.1 provided by NI when I bought the DIO-6509 board. Do you know where I could find it?????????

Regards,
Nicolas L.
Johnson Controls
0 Kudos
Message 3 of 14
(6,622 Views)
Hi Nicholas,

Happy New Years to you as well.

Currently, I am not aware of ongoing plans to support delphi with NI-DAQmx. If you would like to suggest this support to our R&D team, feel free to do so at www.ni.com, then select Contact NI, then click on the feedback link. This is the best way to get that suggestion to the right place.

Also, there is not an NIDAQMX.dll. The nidaqmx.h and nidaqmx.lib that are installed on your computer make calls to nicaiu.dll which can be found in the system32 folder on your system.

Hope this helps!

Regards,
Steven B.
National Instruments
0 Kudos
Message 4 of 14
(6,622 Views)
Hello Steven,
thanks a lot! it works better with this dll!
(in fact it was an error of the soft that converted my nidaqmx.h to nidaqmx.pas for delphi)

but do you know how to use the functions of this dll that are specified in "NI-DAQmx C Reference Help"?
In my project I want to control in output and input a ni dio 6509 board: what are the functions to use to put an I/O to a high level (5V) and what are the functions to read the voltage state of an I/O???

Regards,
Nicolas L.
Johnson Controls
0 Kudos
Message 5 of 14
(6,623 Views)
Nicolas,
No problem. I'm glad that worked. There a few functions you will need to use in order to output and input data from that board. It is probably easier if you take a look at a couple of examples that should be installed on your machine. Examples that show how to do this "C" can be found at C:\Program Files\National Instruments\NI-DAQ\Examples\DAQmx ANSI C\Digital.

Hope this helps!

Regards,
Steven B
National Instruments
0 Kudos
Message 6 of 14
(6,622 Views)
ok, thanks,

but that's what I thought, I have a problem->
in calling the following function:
"DAQmxWriteDigitalLines(taskHandle,1,1,10.0,DAQmx_Val_GroupByChannel,data,samps,0)" in order to put an I/O at 5V, the board answer me :"Reserved parameter must be NULL"
the reserved parameter is the last one in the list
do you know what I have to do?
this function is declared:
function DAQmxWriteDigitalLines(taskHandle: TASKHANDLE;
numSampsPerChan: INT32;
autoStart: BOOL32;
timeout: FLOAT64;
dataLayout: UINT32;
writeArray: array of UINT8;

var sampsPerChanWritten: int32;
var reserved: bool32): INT32; cdecl;{$IFDEF WIN32} stdcall;{$ENDIF} external Fichier_Dll;

did anybody try to use the dll with a soft wrtitten in delphi??

regards,
Nicolas L.
0 Kudos
Message 7 of 14
(6,622 Views)
See, unfortunately, that's where we might have a problem. That dll has ever been used with software written in delphi because it was never written for that. As for what has to be done with the last parameter, you have to pass a NULL. That paramter is reserved for future use and development.

Regards,
Steven B.
National Instruments
0 Kudos
Message 8 of 14
(6,622 Views)
ok Steven,
I have written a new dll with Labwindows/CVI-7.0 that allows me:
- to put any DIO at high level or at low level
- to read the level of any DIO
and now I can use it with Delphi7
here are the functions of the dll:
int __stdcall configurechannelecriture(const char chan[], unsigned long *taskhandle);
int __stdcall ecrirechannel(unsigned long taskhandle, int niveautension) ;
int __stdcall liberechannel(unsigned long taskhandle);
int __stdcall configurechannellecture(const char chan[], unsigned long *taskhandle);
int __stdcall lirechannel(unsigned long taskhandle, int *niveau);
and here the declarations in Delphi:
type
uInt32 = LongInt;
FICHIER_DLL = 'DIO6509.DLL';
functio
n configurechannelecriture(const chan: string; var taskhandle: uint32): uint32; cdecl;{$IFDEF WIN32} stdcall;{$ENDIF} external Fichier_Dll;
function configurechannellecture(const chan: string; var taskhandle: uint32): uint32; cdecl;{$IFDEF WIN32} stdcall;{$ENDIF} external Fichier_Dll;
function ecrirechannel(taskhandle: uint32;niveautension: integer): uint32; cdecl;{$IFDEF WIN32} stdcall;{$ENDIF} external Fichier_Dll;
function liberechannel(taskhandle: uint32): uint32; cdecl;{$IFDEF WIN32} stdcall;{$ENDIF} external Fichier_Dll;
function lirechannel(taskhandle: uint32; var niveau: integer): uint32; cdecl;{$IFDEF WIN32} stdcall;{$ENDIF} external Fichier_Dll;


I attach the dll to this message (DIO6509.dll).
If anybody needs more functions or help to use the NI DIO 6509 board with Delphi7, just reply this discuss

Regards,
Nicolas L.
0 Kudos
Message 9 of 14
(6,623 Views)
Hi Nicolas,

That is great. I'm glad you were able to get that working. Thanks for posting that dll as well. Good luck with your application.

Regards,

Steven B.
National Instruments
0 Kudos
Message 10 of 14
(6,622 Views)