Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

Where to find .NET samples and how to get DAQmx installed as a VS 2010 reference?

First, when I installed the NI USB-6525 v9.1.7 I had hoped that both sample code and the necessary drivers for control via the .NET framework (any version) would be installed.  I have spent some hours trying to find either sample code for .NET and/or some install process that would leave me with something I could add to my c# project references that would allow me to access the USB-6525.

 

By now, I could have wired up 8 toggle switches to do the same job that I need the USB-6525 to do that is, simply make open/close connections for some valves I need to control.

 

I'm figuring that there must be some significant mindset difference between me and NI because the whole install process works fine for their setup (the measurement and automation explorer works perfectly) but makes no sense to me for setting up the development and training environment needed to run the USB-6525 from my application.

 

Please throw me a bone here on how to get .NET sample code and get the DAQmx package installed so that it is visible to Visual Studio 2010 as a reference.

 

Thanks

 

CotBySloths

0 Kudos
Message 1 of 19
(6,729 Views)

CotBySloths,

 

I'm sorry to hear that you are having trouble using your device but I've outlined steps below that should get everything up and running for you.

 

If you will first navigate to Control Panel -> Add and Remove Programs -> National Instruments Software and select Uninstall/Change.  From there, select NI-DAQmx and click modify.  Once this loads, go to Data Acquisition -> NIDAQmx -> Application Development Support -> .NET Framework x.x Languages Support and left click on the X to the left then select 'Install this feature to a local drive.'  Underneath this, you can also select Examples to install C# examples as well.  

 

After the installation completes, you should be able to access the C# examples in C:\Users\Public\Documents\National Instruments\NI-DAQ\Examples.

 

That should get everything set up for you to use, good luck with your project!

 

Regards,

Trey C.

0 Kudos
Message 2 of 19
(6,707 Views)

I'm having a similar problem with:

 

Visual Basic 2010 Express

DAQmx 9.2.1

Win 7

 

I did as suggested below and modified DAQmx to include NET Framework 3.5 Languages Support. I thought that would take care of things but it didn't.

 

1. Are there any simple examples? The examples on the web and included with the DVD require 'updating' by VB NET and will not compile. VB NET cannot find NationalInstruments.DAQmx

 

2. How can I find NationalInstruments.DAQmx? I presume it's NationalInstruments.DAQmx.dll

 

Thanks

 

Doug

0 Kudos
Message 3 of 19
(6,598 Views)

I'm having a similar problem with:

 

Visual Basic 2010 Express

DAQmx 9.2.1

Win 7

 

I did as suggested below and modified DAQmx to include NET Framework 3.5 Languages Support. I thought that would take care of things but it didn't.

 

1. Are there any simple examples? The examples on the web and included with the DVD require 'updating' by VB NET and will not compile. VB NET cannot find NationalInstruments.DAQmx

 

2. How can I find NationalInstruments.DAQmx? I presume it's NationalInstruments.DAQmx.dll

 

Thanks

 

Doug

0 Kudos
Message 4 of 19
(6,597 Views)

Oops, found the .dll, now just need to figure out where to find DAQmxLoadTask() et al.

 

Doug

0 Kudos
Message 5 of 19
(6,595 Views)

I finally found the sample code after following the above instructions after a similar multi-hour search. I tried the sample named "SwitchControllingIndividualRelay" in all NET versions available and none of them work with my NI-6525 in VB2010 WinXP.

 

I tried the 6525 using NI MAX and it passes the self test and the test panel works fine. I also have two NI-6008s on the same 2.0 hub that are working fine using the VB samples. The 6525 shows up as Dev1 and the two 6008s appear as Dev2 and Dev3. The SwitchControllingIndividualRelay program does not enable the "Set Relay" button at startup. I went into the code and added a form load event to force the button enable on load. The Switch Device field shows Dev1 when I run the program, but fails with the error message "Device specified is not a valid switch device - Device:Dev1 - Status Code -200069. 

 

I have been fighting with this for two days.

0 Kudos
Message 6 of 19
(5,994 Views)

Have you tried any of the other examples provided? i.e. WriteDigPort or ReadDigPort to verify that you can control the device from visual studio? 

 

Also, which version of DAQmx do you have installed?

 

Mason M
Applications Engineer
National Instruments
0 Kudos
Message 7 of 19
(5,962 Views)

The NI-DAQ version is 9.7.5 came with the hardware. These are brand new units that I received within the last two weeks.

 

The original sample code is in VB2008 format. After opening and thus importing into VB2010, I get the following error for both WriteDigPort and ReadDigPort: "Warning 1 - Could not resolve this reference. Could not locate the assembly "NationalInstruments.Common, Version=13.0.35.188, Culture=neutral, PublicKeyToken=18cbae0f9955702a". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. WriteDigChan.2008"

 

Properties for the installed NationalInstruments.DAQmx reference: Version 9.6.35.292 runtime v2.0.50727

Properties for the installed NationalInstruments.Common reference: Version 0.0.0.0 (Copy Local = False & Specific version = True)

 

If I remove the failed NationalInstruments.Common reference and replace it with version 13.0.35.190 runtime v2.0.50727, ReadDigPort will read and WriteDigPort will write to the hardware without further error.

 

When SwitchControllingIndividualRelay is upgraded (original code also in VB2008), the reference NationalInstruments.common has the same error as above . When I do the remove and install thing to that project, the program refuses to work.

0 Kudos
Message 8 of 19
(5,932 Views)

ManiacFL,

 

Since this thread is from 2011, you should create a new thread for this question. 

Mason M
Applications Engineer
National Instruments
0 Kudos
Message 9 of 19
(5,919 Views)

New Tread???

 

I need an answer to this problem. This project has been on hold since I received the hardware, and it is beginning to make look like an idiot for selecting your product. This is VERY time critical.

0 Kudos
Message 10 of 19
(5,917 Views)