"Howard, John" <[EMAIL PROTECTED]> wrote:

>I am considering using a PCI card (Sabtech NTDS interface card for those
>interested), and it doesn't seem to have a nice simple DLL like I am use to. 
>Instead it has a kernel mode Windows 2000 device driver, and I am expected to
>use "...normal Windows I/O system calls..." to talk to it.  The driver is
>written to be part of the Serial Port driver class, BUT it can not be treated
>simply as a serial port since "...there are several restrictions on the I/O
>calls...", and "...it has its own set of DeviceIoControl functions."
>
>I know so little about Windows device drivers that I don't really even
>understand the paragraph I just wrote.  Does this mean I can't talk to the
>card directly from LabVIEW?  If I can, is it difficult for someone who uses
>DLL's fairly often?  Can I use the Win32 API to talk to it?  Does anyone have
>any suggestions on how to approach this?

Well, you load a device driver by calling CreateFile() with the device driver
name (usually something like \\\\.\\MyDevice). Newer device drivers do not use
a hardcoded device name but a class GUID which you have to translate into the
appropriate device name through the setupapi functions before loading the driver.

After that you basically call DeviceIOControl() and eventually ReadFile() and 
WriteFile() on the handle returned from CreateFile(). At the end you close the
handle with the CloseHandle() function. It is not impossible to call all this 
functions directly from LabVIEW with the Call Library Node but especially the
DeviceIOControl() gets nasty very fast.

So it is possible but unless you only have to implement one or two simple
DeviceIOControl() calls it would be probably better to implement the interface
in a DLL with a more LabVIEW friendly call interface.

Rolf Kalbermatter
CIT Engineering Nederland BV    tel: +31 (070) 415 9190
Treubstraat 7H                           fax: +31 (070) 415 9191
2288 EG Rijswijk        http://www.citengineering.com
Netherlands             mailto:[EMAIL PROTECTED]
 


Reply via email to