Acquire N Scans in Visual Basic .NET with Measurement Studio 6.0 ActiveX Controls
Downloads
Filename: acquire_n_scans.zip
Requirements: View
You can alter acquisition settings during run time from the user interface. The Device and Channel String specify the device and channel(s) from which you want to acquire data. Frequency, or scan rate, is the number of scans per second that you want to acquire. A higher scan rate can prevent a misrepresented waveform or an alias.
You can choose the Start and Stop conditions on the user interface as well. The Start condition choices are immediate, digital trigger, and analog trigger. If you choose the immediate option, then the acquisition begins as soon as the CWAI.Start method is called. If you choose digital trigger or analog trigger, the DAQ device waits for a trigger after the Start method is called. When the trigger occurs, the acquisition begins. Much like the Start condition, you can choose all scans acquired, continuous, or continuous with software trigger for the Stop condition. If you select the all scans acquired option, the acquisition stops after the set number of scans are acquired. If you choose continuous, then the acquisition does not stop until the you click the Stop button. If you choose continuous with software trigger, the acquisition returns data every time the trigger conditions are met. The acquisition continues until you click the Stop button.
NOTE: This program was converted from Visual Basic 6.0 with the Visual Studio .NET Upgrade Wizard utility. To convert an existing Visual Basic 6 project, open the *.vbp file inside Visual Studio .NET and follow the instructions on the screen. Some upgrade warnings are generated if the Visual Basic .NET compiler does not know how to convert certain pieces of code or where the programmer must change or add to the existing code. In this project, there were seven warnings that did not require any user action.
When using any ActiveX controls in Visual Studio .NET, keep the following differences in mind:
1.) Visual Studio .NET generates a Runtime Callable Wrapper (RCW) around each control, and you must go through the Interop layer to use the controls. As a result, some class names differ from the names in Visual Basic 6.0.
2.) Hosting an ActiveX control in Visual Studio .NET requires unmanaged code permissions.
3.) Hosting an ActiveX control in a Windows Form increases the size of your project files because the entire control is embedded in the form.
For more information about using ActiveX controls in Visual Studio .NET, refer to the Visual Studio .NET help.
Requirements
Filename: acquire_n_scans.zip
Software Requirements
Application Software: Measurement Studio Visual C++ Support 6.0
Language(s): Visual Basic .NET
Hardware Requirements
Hardware Group: Multifunction DAQ (MIO)
Driver: Traditional NI-DAQ (Legacy) 6.9.0
Reader Comments | Submit a comment »
Legal
This example program (this "program") was developed by a National Instruments ("NI") Applications Engineer. Although technical support of this program may be made available by National Instruments, this program may not be completely tested and verified, and NI does not guarantee its quality in any way or that NI will continue to support this program with each new revision of related products and drivers. THIS EXAMPLE PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND AND SUBJECT TO CERTAIN RESTRICTIONS AS MORE SPECIFICALLY SET FORTH IN NI.COM'S TERMS OF USE (http://ni.com/legal/termsofuse/unitedstates/us/).
