Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

Connect Example Project to Device

I am a beginner in the NI world, so please bear with me:

 

I have a PXI-5402 function generator running in a PXI-1031 chassis. I am able to use the Test Panels in MAX to verify the generator is working. I am running Visual Studio 2008, and have installed Measurement Studio 2013. I have also installed FGEN, with it's associated drivers. I went to the Measurement Studio tab in Visual Studio, and then to one of the Measurement Studio Examples: BasicSignalGeneration. I built this project, and ran it. It creates a "virtual" function generator, but triggers no actual output/control of the PXI-5402.

 

And now I'm stuck: what do I actually need to do to modify the BasicSignalGeneration example to actually trigger an output on my PXI-5402? Do I need to add a specific class to the example project? I know the location of the PXI-5402 from MAX, but am not sure how to modify the example to erefernce an actual generator module. 

 

Thanks!

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

Hi jvavra,

 

The example you're using is a simulated function generation and is not intended to be used with hardware. The examples that ship with NI-FGEN can be found by navigating to Start»All Programs»National Instruments»NI-FGEN»Examples.  This has examples for C, the CVI , LabVIEW (multiple versions depending on your install settings), and Visual Basic. You can find more information on NI-FGEN examples in the NI-FGEN readme located at http://download.ni.com/support/softlib//Signal_Generators/NI-FGEN/NI-FGEN%2014.0/readme.htm#examples under the "Find Examples" section.

Regards,
0 Kudos
Message 2 of 6
(4,424 Views)

AC,

Thanks for the reply. Unfortunately, my install of FGEN (pulled from the NI site last week) only seems to have C examples, and I can't seem to find the other examples on the NI site. Any ideas?

Thanks,

-Josh

0 Kudos
Message 3 of 6
(4,421 Views)

AC,

Disregard, I finally found the examples.

Thanks,

-Josh

0 Kudos
Message 4 of 6
(4,411 Views)

So I've found a basic function generator example. I added the DotNET wrapper to the project, and added a reference to the niFgen_32.dll. Hiowever, when I try to build it, Studio complains that "InstrumentDriverInterop" is not declared. I'm not seeing it declared anywhere. Am I not linking to the dll correctly?

Thanks!

0 Kudos
Message 5 of 6
(4,387 Views)

Hi jvavra,

 

If you double click on the reference you added in the solution explorer, it will open up the object explorer window.  This will show you all of your references as well as what is accessible inside.  You will notice at the top of Form1.cs, there are a bunch of using statements. Note the using statements which references "NationalInstruments.Analysis...".  There are several using statements here referencing "NationalInstruments.Analysis" with different appended endings (EX. NationalInstruments.Analysis.Conversion).  If you then look into the object broswer and expand NationalInstruments.Analysis.Enterprise, you can see those same namespaces listed.  You will want to do this same thing for the reference you added.  Go look at the namespaces associated with the reference and include them with using statements similar to the ones for the analysis libraries already shown on Form1.cs.

Regards,
0 Kudos
Message 6 of 6
(4,326 Views)