LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

LabVIEW drivers vs Normal I/O drivers?

I am new to LabVIEW and this forum so I apologize in advance if I did not follow all the rules but I am happy to learn those for future.

 

I am trying to figure out what does it take (driver wise) to support an I/O card to run under LabVIEW. For example, let's say I have an 12-bit A/D converter I/O card that is attached via an LPC bus on a x86 board. Right now, there are no Windows or Linux drivers (I/O Drivers) to talk to this card.

 

Now in order to support this card to run under LabVIEW (say on Linux OS), do we need to first write a basic Linux I/O driver for the ADC card and then write a LabVIEW driver on top of it? I am just trying to understand what does a LabVIEW driver means (or consist of) as opposed to a normal I/O driver for a ADC card? I looked into the developer zone section of the website but could not find any KB article that explains this.

0 Kudos
Message 1 of 7
(2,967 Views)

Typically, you would first have a device driver such as a dll, from the vendor and LabVIEW would use that (i.e. with a Call Library Function Node). That is how LabVIEW connects to NI DAQ cards. You do have the ability to use VISA to communicate with a PCI card but there is no support for LPC bus, as far as I know.

0 Kudos
Message 2 of 7
(2,959 Views)

@Dennis Knutson wrote:

Typically, you would first have a device driver such as a dll, from the vendor and LabVIEW would use that (i.e. with a Call Library Function Node). That is how LabVIEW connects to NI DAQ cards.


Thank you Dennis for your reply. So let's assume that we have a DLL for Windows (or .ko for Linux) driver for the particular DAQ card. After that we still need to create some sort of LabVIEW drivers on top of this dll driver so that end users can use LabVIEW graphical environment to create thier own custom applications?

 

Also what product (LabVIEW or LabWindows/CVI or ???) of NI should be used to create the LabVIEW drivers?

0 Kudos
Message 3 of 7
(2,957 Views)

At the most basic level the LabVIEW drivers would basically be shell VIs that call the individual functions in the DLL, providing controls and indicators to correspond to the function's arguments and return value. There is a Shared Library Import Wizard (Tools -> Import -> Shared Library) that you can try to use. Whether or not it will work depends on how the DLL was written.

 

Beyond the wrapper VIs for the functions you can write whatever else you want on top of that, like example VIs on using the library.

0 Kudos
Message 4 of 7
(2,950 Views)

@smercurio_fc wrote:

Whether or not it will work depends on how the DLL was written.


Is there a guideline document (from NI) that one should follow while writing the OS specific I/O driver so that it works with LabVIEW. I guess nobody wants to end up in a situation where they put in a whole lot of work in writing the I/O driver that is not compatible with LabVIEW.

 

Thank you for the valuable information, that makes things little bit more clearer.

0 Kudos
Message 5 of 7
(2,940 Views)

I guess I don't quite understand what you mean by "compatible with LabVIEW" in your case. Did you write the DLL? If not, you won't have much control over it. The only thing you'd be able to do is to write a wrapper DLL to provice the necessary interface translation between LabVIEW and the DLL. In general, you need a C DLL that uses simple data types. Multi-dimensional arrays are a pain. So are arrays of structures and things like that. Note that I said C DLL, and not a C++ DLL. While you can write it with a C++ compiler, you must make sure that the functions are exported properly.

 

There are several documents in the NI Knowledgebase, as well as information in the LabVIEW Help on calling code written in text-based languages. Have you looked? Some documents:

Message 6 of 7
(2,932 Views)

@smercurio_fc wrote:

I guess I don't quite understand what you mean by "compatible with LabVIEW" in your case. Did you write the DLL?


No, we do not have DLLs, but we have sample C code (based on ANSI C) that runs on Windows and Linux. Note that this C code is not a typical OS device driver. It is just an application level (example) code that initializes the hardware (memory, I/O, PCI config space) and does some other reading and writing functions.


smercurio_fc wrote:

There are several documents in the NI Knowledgebase, as well as information in the LabVIEW Help on calling code written in text-based languages. Have you looked? Some documents:


These documents are great, however, I am looking for something that shows high level steps specific to Linux. I am assuming that the steps to provide LabVIEW support in Linux are very similar to the ones metioned in above documents?

 

Once again, I greatly appreciate your helps so far!

0 Kudos
Message 7 of 7
(2,927 Views)