05-09-2008 04:48 PM
05-12-2008 10:08 AM - edited 05-12-2008 10:13 AM
Hi Tim8w,
Assuming you are referring to the NI PCI-6503, the DAQmx drivers necessary to run the device natively support .Net 2.0. Note however, that you must make sure to install the .NET Framework support during the DAQmx driver installation. You may find more information in KnowledgeBase: Visual Studio .NET Applications Missing the NationalInstruments.DAQmx File.
Once you have installed support for the .NET Framework, you may then simply call the drivers using your language's respective directive; such as Using, Import or Include.
- In VisualBasic: Imports NationalInstruments.DAQmx
- In C#: using NationalInstruments.DAQmx
- In C/C++: #include <NIDAQmx.h>
If your interested in the DAQmx merge module, you may find it at: C:\Program Files\Common Files\Merge Modules\MStudioDAQmx.msm
The actual DAQmx .NET assemblies are commonly located at:
C:\Program Files\National Instruments\MeasurementStudioVS2005\DotNET\Assemblies\Current\NationalInstruments.DAQmx.dll
You may also find lots of examples at NI Developer Zone or on your local directory:
C:\Documents and Settings\All Users\Documents\National Instruments\NI-DAQ\Examples\DotNET2.0
Hope this helps Tim8w!
05-12-2008 10:45 AM - edited 05-12-2008 10:46 AM
Measurement Studio for VS2005 Integration not present
To use the NI-DAQmx .NET Support VS2005 Integration feature, you must install the Measurement Studio .NET 2.0 Languages Support>>Visual Studio Integration feature in the Measurement Studio installer.
05-12-2008 12:09 PM
05-12-2008 01:30 PM - edited 05-12-2008 01:31 PM
Nestor,
That worked! The problem I have now is that the functions under VB.Net apparantly aren't named the same as they were in VB6. In particular, what are the new VB.Net names for the following functions:
Init_DA_Brds(2, 7)
PortA
PortB
PortC
PortInput
PortOutput
DIG_Prt_Config
DIG_In_Port
DIG_Out_Port
05-12-2008 05:34 PM
These look like Traditional NI-DAQ function calls.
If so, then migrating from VB 6 to VB .NET with NI-DAQ (not NI-DAQmx) is not an easy transition. Please refer to the KnowledgeBase: Programming NI-DAQ in Microsoft Visual Studio .NET for further information. Essentially, National Instruments does not include native .NET libraries for Traditional NI-DAQ. You can use the Traditional NI-DAQ ActiveX controls to perform data acquisition. The ActiveX controls are provided with the Traditional NI-DAQ Driver and do not require Measurement Studio. Note that Traditional NI-DAQ (formally known as NI-DAQ) and NI-DAQmx are two different drivers - the newer being the latter.
It appears that the PCI-6503 supports NI-DAQmx. We strongly suggest to program in NI-DAQmx for future support; we are slowly fading support of Traditional NI-DAQ. The KnowledgeBase: What are the Terminology Changes in NI-DAQmx? discusses changes from Traditional NI-DAQ to NI-DAQmx.
05-12-2008 06:06 PM
The documentation is lousy and the examples don't run. All I want is to be able to do the following:
Initialize the 6503
Set PortA to Input
Set PortB and PortC to Output
Read PortA
Write to PortB and PortC
Is there no one at NI that can give me an example of how to do this?
05-12-2008 07:15 PM
Hi Tim,
Do understand that we do not have Traditional NI-DAQ examples for the .NET Framework. All of our .NET examples make use of our DAQmx drivers. I created an example code that allows you to do what you desire, but with DAQmx. Give the attachment a try.
This five-part article further helps you with the Traditional NI-DAQ transition to NI-DAQmx.
Transition from Traditional NI-DAQ (Legacy) to NI-DAQmx using Microsoft Visual Basic .NET
In the attached example, I give you the basic architecture to read and write to different ports. Feel free to customize it as you need. You identify your device by the name registered under Measurement and Automation Explore; for example, if my PCI-6503 is registered as Dev1 in Measurement and Automation Explorer, then in the example program I will use Dev1/port0 to read or write to Port0.