08-31-2007 03:08 PM
08-31-2007 05:22 PM
09-04-2007 10:26 PM
Hello,
In response to your second question (it seems that you have already answered the first), I would recommend that you use the AnalogMultiChannelReader class in your application. I do not think that this class is obsolete; in fact, the NI-DAQmx shipping examples for VB .NET 2005 make use of the AnalogReader and AnalogWriter classes. By default, the AnalogMultiChannelReader class is geared towards performing asynchronous reads (using asynchronous callbacks).
The DAQ Assistant (wizard) makes use of another set of classes (ComponentModel) when it automatically scripts code. Off hand, I am not sure exactly how these classes compare with the AnalogReader and AnalogWriter classes used in the example programs, but I would definitely recommend using the AnalogReader and AnalogWriter classes if you are starting from scratch and not using the DAQ Assistant.
To get started, you may want to take a look at the examples located under "c:\Documents and Settings\All Users\Shared Documents\National Instruments\NI-DAQ\Examples\DotNET 2.0\Analog In\Measure Voltage\". I hope this helps!
Regards,
Casey Weltzin
Applications Engineer
National Instruments
09-09-2007 08:21 AM
09-10-2007 09:51 AM
HI Ira / ifisch,
There are a few things I wanted to clarify after reading
through both Casey's and your post. First off, I notice that you and
Casey are referring to different examples locations for Measurement
Studio. This is because in Measurement Studio 8.1.1, the example
locations changed. In previous versions of Measurement Studio, the
examples were installed to Program Files\National
Instruments\MeasurementStudioVS2005\DotNET\Examples. In Measurement Studio 8.1.1, the examples
are installed to a subfolder of the My Documents folder on Windows XP and the All
Users\Documents directory
on Windows Vista. In the Measurement Studio help, we have a Where to Find Examples help topic which has been
updated to show the different directories for Measurement Studio, DAQ, VISA,
GPIB and SCOPE. Now, if you look at your "Where to Find
Examples" help topic and don't have this update, this just means that you
don't have Measurement Studio 8.1.1 or some of our latest hardware drivers. In
that case, check out the NI-DAQmx,
NI-VISA and NI-488.2 .NET Example Locations KnowledgeBase that has 2
screenshots attached that show these updated locations.
Secondly, Visual Studio 2005 only targets the .NET Framework 2.0 and Visual
Studio .NET 2003 targets the .NET Framework 1.1. Visual Studio 2008 (still in
beta) is changing this restriction in that you can now target multiple .NET
Frameworks within the same Visual Studio IDE. Measurement Studio provides
support for both the .NET Framework 1.1 and .NET Framework 2.0. When you
install Measurement Studio, you will notice two different setup.exe's named
setupVS2003.exe and setupVS2005.exe. If you were using Visual Studio 2005, then
always select the setupVS2005.exe installer.
Third, the DAQ Assistant does use the
Reader/Writer classes. For example, if you chose to do some Analog Input, the
DAQ Assistant generated code would be use the AnalogMultiChannelReader class. See snapshot
AnalogMultiChannelReader.jpg
Now I could go into detail about how the DAQ component works but our help does
a great job of this so I am going to refer you to there. See the help topic Creating
a Measurement Studio DAQ .NET Application under NI Measurement Studio Help
>> Developing Measurement Studio >> Developing with Measurement
Studio NI-DAQmx >> Creating a Measurement Studio DAQ Application.
There are several topics under there that discuss the DAQ component. Also,
check out the Walkthrough: Creating a Measurement
Studio NI-DAQmx Application under the Getting Started with
Measurement Studio Class Libraries >> Measurement Studio Walkthroughs
section which actually uses the DAQ Assistant.
Also note that in the Configure DAQ Component UI dialog, you set up the
callback functions as shown in the screenshot Generate DAQ UI.jpg.
If after reading through all that material, you are still having some difficult
(again its great material and documentation), please let me know. Honestly I
would run through the walkthrough first to get comfortable.
Hope this helps!!
Best Regards,
09-10-2007 10:25 AM