03-15-2006 10:32 AM
03-16-2006
08:22 AM
- last edited on
09-24-2025
12:05 PM
by
Content Cleaner
Greetings Andy
It would be simpler to use the DAQmx .NET class if you are using managed C++. You would need to marshall unmanaged string arrays to managed ones.
The DAQmx .NET API is included with the DAQmx driver. It was written for .NET 1.1, but it works with .NET 2.0 as well.
To use it, you would need to make sure you install .NET support when you installed DAQmx. You can make sure of this if you rerun the driver installer from add/remove programs.
Once you install it, it will install the required assemblies under C:\Program Files\National Instruments\MeasurementStudioVS2003\DotNET\Assemblies\Current
Even though the path says Measurement Studio, you are not required to have it to install the DAQmx .NET API.
The required assemblies are NationalInstruments.Common.dll and NationalInstruments.DAQmx.dll. Once you add these assembly references to the VC++ project from the folder I mentioned above, add the namespace for it to your app as follows
using namespace NationalInstruments::DAQmx;
You can then query DAQmx for the device names
array<System::String^>^ devarray = DaqSystem::Local->Devices;
textBox1->Text = devarray[0];
If you only have VS 2005 installed, you will not be able to view the help files for the DAQmx .NET API, since they were designed to integrate with VS 2003 and the help system for VS 2005 is completely different.
We are working to release native .NET 2.0 DAQmx libraries soon. So you wont need to worry about needing to download a third party help viewer. Not to mention the library will be targetted specifically for .NET 2.0.
On a side note, as an ex-Delphi user, I would have figured C# would have been the preferred language of choice. I'm curious as to why you prefer managed C++ over C#.
I hope this helps. Let me know if you have any other questions.
03-16-2006 09:20 AM