01-25-2011 11:09 AM
Hi,
I am working on a program for the PXI chassis. I'm trying to code an interrupt routine for the various NI-DAQmx C Library functions at the beginning of my program (basically in an effort to
Import and re-cast 488.2 functions that will benefit from .NET types). But the problem I seem to be running into is that I'm either not using the right DLL or I don't have the right DLL with me. Can anyone explain to me which would me the correct DLL that has all the NI-DAQmx C Library functions like DAQmxCreateDOChan, DAQmxCreateDIChan, etc? I'm using Microsoft VS C++ .NET 2003. I'm very new to this, and would really appreciate the help. I hope this is the right forum to ask this question to.
Thanks,
Nilotpal
01-26-2011 11:48 AM
Hi Nilotpal,
I am including paths for examples of DAQmx tasks that you can use to identify the necessary libraries and their locations. If you are using .NET then you can find various examples by navigating to Start»All Programs»National Instruments»NI-DAQ»Text-Based Code Support. From here you will see two folders, one for .NET Examples and the other for ANSI C Examples. If you do not see these folders it is because they were not included when you installed the DAQmx driver, this can be remedied by opening the Control Panel and depending on the operating system either going to Add/Remove Programs for Windows XP or Programs and Features for Windows 7. From here find National Instruments Software and double-click it. A separate window should appear with all installed National Instruments software, find NI-DAQmx. Select Modify and under Data Acquisition»NI-DAQmx»Application Development Support ensure that the examples are included for ANSI C Support and .NET Framework Languages Support. Once you have these examples you can use them as a reference to identify and locate the proper libraries for DAQmx function calls using either platform.
01-27-2011 10:38 AM
Thanks for the reply. I did the modifications to National Instruments software, as you had asked. The Examples folder did show up then with a folder for DotNET1.1 Examples. But in that, there is no file that has any piece of code where functions like DAQmxCreateDOChan is being used. In fact, did a search of the whole folder for "DAQmxCreateDOChan", and returned "No items". The folder for DotNET1.1 Examples had the following sub-folders in it: Analog In, Analog Out, Control, Counter, Digital, Switches, Synchronization. Am I missing any folders?
I guess, basically my question is where can I find the DLLs that have the definitions for DAQmxCreateDOChan? I'm attempting to write code as follows:
[CODE]
using namespace System;
using namespace System::Runtime::InteropServices;
//using NationalInstruments.DAQmx;
// Import and re-cast 488.2 functions that will benefit from .NET types
[DllImport("REQUIRED DLL FILE.dll", EntryPoint="DAQmxCreateDOChan", CharSet=CharSet::Ansi)]
extern int __stdcall DAQmxCreateDOChan (int DioPort, String*, String*, int Val);
[/CODE]
The "REQUIRED DLL FILE" in the code is what I'm looking for, so I can re-cast at the entry points for DAQmxCreateDOChan and DAQmxCreateDIChan. Could you please help me with this?
Thanks
01-27-2011 02:22 PM
Hi,
You can find those functions under the header file nidaqmx.h which is located in C:\Program Files\National Instruments\Shared\ExternalCompilerSupport\C\Include\NIDAQmx.h. You need to include this in your source code. If you open the ANSI C example Start»All Programs»National Instruments»NI-DAQ»Examples»ANSI C»Digital, there are various digital generation examples here that use these functions and show the included header file.