From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Access .dll within LabVIEW 8.6

Hello everyone. I have a question about accessing a .dll file in LabVIEW. I am using a spectrometer by Newport Oriel and this spectrometer comes with its own software. The software is installed on a PC and can only run when the spectrometer is connected to the PC via USB.  The problem is that I am using this spectrometer remotely and therfore can not connect it directly to the PC, and thus the software will not open. I have the spectrometer connected to an NI Wireless Module (WLS-9163), and the PC connected to this via wi-fi. The software that comes with the spectrometer was built using LabVIEW, but I only have access to the .dll file and not the code itself. I want to access this .dll so that I can somehow incorporate it into a VI that I will create and ultimately run the spectrometer software. Any suggestions on how I can go about doing this?

 

Thanks...

0 Kudos
Message 1 of 11
(3,654 Views)

Speaking on general basis you can call the DLL from Labview. But you will need to know the function prototype for each function in the DLL that you are going to call. If you have this you can create our own controller program. Maybe I am wrong but your setup seem to me somewhat strange. The WLS-9163 is made for wireless daq units so doing instrument control is hard to do. Perhaps you will be better of with a wireless USB port/hub. Google "wireless USB port" or "wireless USB hub" these devices do not cost much



Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
(Sorry no Labview "brag list" so far)
0 Kudos
Message 2 of 11
(3,647 Views)

Hey vmuro,

 

You can incorporate your .dll within your own LabVIEW code through a call library function node. However, as Coq rouge mentioned, you are going to need to know about the function prototypes to effectively use this method. Check out this Tutorial and NI Community for a little more information on the call library function node and incorporating .dll's in your LabVIEW code.

Hope this helps.
-Ben

WaterlooLabs
0 Kudos
Message 3 of 11
(3,618 Views)
Thank you very much for your advice. I have purchased a wireless usb hub to connect my spectrometer. Now, I can't get NI-VISA to detect it. I tried to use this tutorial(http://zone.ni.com/devzone/cda/tut/p/id/4478) to create a driver using the DDW, but  I get an error messege when it tries to install it. Any advice on how I can get labview to recognize this device would be really appreciated. Thanks in advance.
0 Kudos
Message 4 of 11
(3,534 Views)

Hey vmuro,

 

Are you having trouble installing the INF file created through the Driver Development Wizard (DDW) or are you having trouble installing NI VISA itself? Do you have any more information on what the error is? A screenshot, a more detailed description of the error, and an idea of when the error actually occurred would be helpful.

Hope this helps.
-Ben

WaterlooLabs
0 Kudos
Message 5 of 11
(3,512 Views)
The problem is installing the .inf file I created with DDW. The error occurs after the Windows Found New Hardware Wizard tries to install the .inf file. It normally tells me that there was an error installing the driver and the device may not work properly, but I tried it again today and the computer auto shut off and said that an error occured and the computer turned off to prevent damage. This is really strange and I didn't think it would be this complicated since I followed the online instructions. Is there a problem with the usb device im trying to use maybe? This device already has its own driver and software supplied by the manufacturer, but I don't want to use it directly like that, I want to use it in a VI and build around it. Thanks for your help.
0 Kudos
Message 6 of 11
(3,474 Views)

Hey vmuro,

 

It is strange that you are having such problems as your computer turning off when trying to install an .inf file. My first question, however, is did this device come with some software? Can you communicate with your device using this software? Can you communicate with your device via this wireless USB connected with the software that came with the actual device? Once you plug in your wireless USB, can you see it in Device Manager?

 

The first thing I would try is insure that the wireless USB device is working properly with any software that came with it. Then I would worry about incorporating it in LabVIEW.

Hope this helps.
-Ben

WaterlooLabs
0 Kudos
Message 7 of 11
(3,447 Views)
Thanks for the help. Yes, it works fine if I connect it directly to the PC or into the wireless hub. The computer recognizes it and the software is useable which ever way I connect it. It would be nice to incorporate the software that came with the device into a VI, but unfortuneately I do not know the function prototype, so attempting to use it with the use of NI-VISA was my alternative. Any help is appreciated. Thank you.
0 Kudos
Message 8 of 11
(3,440 Views)

vmuro wrote:
Thanks for the help. Yes, it works fine if I connect it directly to the PC or into the wireless hub. The computer recognizes it and the software is useable which ever way I connect it. It would be nice to incorporate the software that came with the device into a VI, but unfortuneately I do not know the function prototype, so attempting to use it with the use of NI-VISA was my alternative. Any help is appreciated. Thank you.

You will not have much luck. In order to control an USB device through NI-VISA you have to know the USB protocol very intimately to actually write the correct stuff to the correct USB control pipes and understand what the instrument returns. This is basically impossible without a thorough protocol description and such a description is notoriosly hard to get at.

The alternative is to use an USB protocol analyzer and log the data transfer that occures when using the native software. This is however a very tedious way of reverse engeineering and doomed to fail without some previous and serious understanding of USB operation.

 

Look for a post from Intaris here in this forum where he documents the steps and complications about developing an USB driver based on NI-VISA! Only if you have digged everything in there you can start to hope to be successful in trying to get your device to work over NI-VISA.

 

A more promising way would be to access the DLL through the Call Library Node IF AND ONLY IF you can get at the DLL interface documentation.

 

Rolf Kalbermatter

Message Edited by rolfk on 07-14-2009 11:34 AM
Rolf Kalbermatter
My Blog
Message 9 of 11
(3,425 Views)

"A more promising way would be to access the DLL through the Call Library Node IF AND ONLY IF you can get at the DLL interface documentation"

 

This was my first attempt. The native software was created using LabVIEW, but unfortunately the manufacturer/developer does not want to provide this code. Then, I though since it was created in LV, maybe I could reverse engineer it or recreate it. It turns out that it is more complex than I imagined. Thanks for all the help...

0 Kudos
Message 10 of 11
(3,402 Views)