03-25-2009 02:51 PM
Is there a tutorial somewhere that goes through compiling the instrument drivers found on the instrument driver network without using LabView or LabWindows? I am using Measurement Studios 8.5 with Visual Studios 2008 and I would like to use the instrument drivers without having to also purchase LabView / LabWindows just for the purpose of compiling the drivers.
Thanks in advance,
Dennis
03-26-2009 09:26 AM - edited 03-26-2009 09:27 AM
Hi Dennis,
You can use the Instrument Driver Wizard that ships with Measurement Studio to create a wrapper class for calling into the DLL that is part of the driver you would like to use. You can access the Instrument Driver Wizard by selecting Measurement Studio»Measurement Studio Online Resources»Instrument Driver Network from within the Microsoft Visual Studio development environment.

This will launch the Instrument Driver Network and you will be able to browse to the driver you would like to use. If driver does not offer support for your Application Development Environment (ADE), you can use the instrument driver converter.
-Adri K
03-26-2009 09:36 AM - edited 03-26-2009 09:38 AM
Hello Adri,
Thank you for the response, but I am looking for a way to compile the driver files (.c , .h, and .fp) into an actual DLL that can be used with the Instrument Driver Wizard. I wish to be able to do this without using LabWindows or LabView to compile them.
It seems all of the drivers found on the Instrument Driver Network comes in the non-compiled form (.c, .h, and .fp). Is there a procedure in which I can compile these into DLLs using Visual Studio 2008 or another compiler?
You mentioned an Instrument Driver Converter, may I ask where I can obtain this? Is this free or does it come with LabView / LabWindows?
Thank you,
Dennis
03-26-2009 10:01 AM
Hi Dennis,
Yes, the following information can be found in the NI Measurement Studio Help for Calling Instrument Driver from .NET Languages. You can also find detaild information for Inspecting an Instrument Driver Wrapper Class and Calling an Instrument Driver Wrapper Class
Generating an Instrument Driver Wrapper Class with the .NET Instrument Driver Wizard
1. Open the Visual Basic .NET or Visual C# project in which you want to generate an instrument driver wrapper class.
2. Select Project»Add New Item to launch the Add New Item dialog box.
3. In the Templates pane, select NI Instrument Driver.
4. Specify a name for the .NET instrument driver and click Add. The name you choose for the file becomes the name of the source file.
5. In the New .NET Instrument Driver dialog box, select which instrument driver you want to create by browsing to the .fp filename. Click Next.
6. Configure the code generation options. Default values are given based on information from the instrument driver .fp file.
7. Click Finish.
After you complete these steps, a new instrument driver wrapper class is added to the project and opened in the source code editor. Now you can edit and compile this file the same as any other source file in your project.
-Adri K
03-26-2009 01:28 PM
Adri,
Perhaps I am not doing this correctly, I've followed the steps to generate the wrapper class. In my main form, I've instantiated the wrapper class and encountered an error when it's trying to invoke the driver DLL. I thought the driver DLL has to be compiled first before a wrapper class can be created for it?
My problem is that I cannot compile the driver DLL from the driver source files (.c, .h, .fp) without having to use LabWindows and compiling the actual DLL file for me to use in Visual Studios.
As you can see from the screenshot below, the wrapper class is trying to invoke the DLL file which does not exist at this point.
Thank you for your help,
Dennis
03-27-2009 11:06 AM