Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

Compiling instrument drivers without labview or labwindows?

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

0 Kudos
Message 1 of 6
(4,750 Views)

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

Message Edited by Adri K. on 03-26-2009 09:27 AM
Adri Kruger
National Instruments
LabVIEW Product Marketing
0 Kudos
Message 2 of 6
(4,736 Views)

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

Message Edited by Den nis on 03-26-2009 09:38 AM
0 Kudos
Message 3 of 6
(4,727 Views)

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 

Adri Kruger
National Instruments
LabVIEW Product Marketing
0 Kudos
Message 4 of 6
(4,723 Views)

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

 

 

0 Kudos
Message 5 of 6
(4,717 Views)
Hi Dennis,

The .NET wrapper class generates documentation for errors that were encountered when generating the instrument driver wrapper class. Inspect your .NET instrument driver wrapper file for any comments that begin with TODO. Does this file list any errors that were encountered during creation of the wrapper?

Could you also verify that you have examined the Calling an Instrument Driver Wrapper Class section within the Measurement Studio Help Instrument Driver Wizard topic. This example shows proper syntax for calling the Instrument Driver Wrapper Class.

-Adri K

Adri Kruger
National Instruments
LabVIEW Product Marketing
0 Kudos
Message 6 of 6
(4,692 Views)