- Products
- Product Reviews
- Product How Tos
- New Product Releases
- Product Categories
Product Brief
How Test Engineers Can Use Microsoft .NET
Ken Colasuonno1/13/2003 12:00 AM EST
Superior results are obtained by employing a single set of developer tools, automating common low-level programming tasks and building and reusing libraries and components that work across many programming languages and computing devices.
Over the years engineers developing applications to control test and measurement (T&M) equipment have employed a variety of languages and development environments. Often it is the comfort level of workersrather than overall value, productivity, ease of use, scalability or capabilitiesthat determines just which programming language they choose. Since a number of individuals or groups support products through the entire product life cycle, companies must often manage and maintain multiple, homegrown applications, including the various in-house experts with their numerous programming languages. Also, some 90 percent of all test equipment connects to a computer or a network.
Given all of these points, it is clear that productivity in the T&M world would benefit greatly from a move to a programming environment based on an open software standard. In addition, by adopting an open standard established by the computer industry, T&M engineers could then fully exploit the gains in computer technology that have blossomed over the last decade.
The .NET environment, which is indeed an open software standard, will enable T&M programmers to boost productivity, reduce costs, and accelerate time-to-market. They will now be able to work with an open software standard to install, manage, and grow their environment. Developers who choose to work within the .NET platform to create and test new products will be able to focus their creativity on solutions and leverage a development platform created by 4000 Microsoft engineers. As for managers, they will be able to draw upon a larger pool of developers and protect their investment in the creation of intellectual property.
This article explores the portions of the .NET platform that are most important to the daily lives of the design and test engineer.
Figure 1: .NET and its major components |
Microsoft did do a very good job of backwards-compatibility here. One of the new nice features of the CLR is that all .NET objects are garbage collected. You will not have to deal with stray pointers, memory leaks, missing object releases, and so on. Memory leaks in managed code will be a thing of the past. This problem has consumed a fair amount of time in development teams and is the source of many bugs. It also makes exception handling a first-class class concept. This means you don't have to check function return values using Boolean data types or HRESULTs. These are built into the languages and you will learn to use the structures of TRY/CATCH/FINALLY in your codingthis is much better than what you needed to do in the past.
The CLR is also usable on any language that is built for .NET. You can write application components in multiple languages and use them in multiple other languages. It is far easier to share the components between different languages. The tools are also the same for all languages; hence the debuggers, profilers, code coverage analyzers, and the like, work for all languages. There is also exactly one development environment.
Figure 2: Programming API migration over time |
With approximately 167,000 methods, 37,000 properties, and 13,000 events inside this framework, the FCL is enormous. Therefore, a challenge for those who want to become proficient in .NET is to find the parts of the .NET framework that are going to be useful to them and learning those well. We have found that we have implemented a class or data structure thinking that it did not exist in the FCL, but later found out it did, indeed, exist. It pays to spend some time searching the documentation and asking other .NET-savvy programmers embarking on a new class/data structure design.
If you want, you can pretty easily extend the .NET Framework components. Microsoft is providing Visual Basic, C++, C#, and JScript. Third parties are building FORTRAN, APL, COBOL, Pascal, Eiffel, Haskell, ML, Oberon, Perl, Python, Scheme, and Smalltalk. At the time of this article, there are already more than 26 supported programming languages.
Dim X As Integer = 1
is equivalent to these statements:
Dim X As Integer
X = 1
in VB6, or prior versions. The runtime, VBRUNxx.DLL, is replaced by .NET Framework and every feature of the .NET Framework is directly available. The Framework is substantially larger than the old VB runtime. When moving your existing code to the .NET Framework, Microsoft provides an Upgrade Wizard that will "upgrade" your code to Visual Basic .NET code. Anything the upgrade wizard does not know how to convert is marked with "TODO" in your upgraded code as well as building a report of any issues that it has found.
Note that this wizard is only available in Visual Studio, .NET Professional, and higher editions. The wizard is not available in the Visual Basic .NET Standard Edition. Also, the initial version of VB.NET does not support converting VB6 User Control Projectsthese will have to be rewritten in .NET or else just used directly by the .NET interoperation abilities.
VS.NET IDE has a new feature called dynamic help. This is where the IDE "knows" what language keyword/component you are working on and changes the dynamic help pane accordingly. Debugging with different languages is done easilyin the same debugger. You won't have to hassle with the mechanics of debugging a project with VB and C++ components. Remote debugging is also a lot easier. This was possible in C++, but non-trivial and it was not possible in VB6. The bottom line for debugging is that you can debug multiple programs, using multiple languages, on multiple machines, all at the same time.
We have created the Agilent T&M Programmers Toolkit for Visual Studio .NET. The Toolkit is a series of tools and APIs that are part of the .NET programming environment. Our set of extensions to the .NET Framework Class Library is the T&M Framework, a programming API targeting the T&M programmer. Just as the FCL was built to handle the mundane tasks you deal with in programming, the T&M Programmers Toolkit was built to handle the mundane tasks of T&M programming.
Project wizardsAn extension of the VS.NET New Project Wizard with guided steps to create skeleton programs. These programs include all the necessary references to T&M Assemblies against which you will need to program.
Instrument explorerAn integrated tool to search for and configure instruments on USB, GPIB, RS-232, VXI, and LAN. Instrument Explorer also allows drag and drop from the explorer to your code buffer. Just drop an instrument icon into your work window to generate code to talk to the instrument (Figure 3).
Driver wrappers and wizardsYou use these to create a .NET wrapper to easily call VXIplug&play and IVI C-based drivers. This makes it possible to use these drivers in the .NET environment as if they were actual .NET objectsinstead of calling out to a C DLL. These tools enable the convenient use any of the hundreds of drivers available from Agilent and other instrument vendors in .NET applications.
Interactive IOThis API is used for communicating with instruments with calls such as ReadIEEEBlockAsString( ) and overloaded Write( ) methods. The API provides an easy way to control instruments using the instrument's native command set (SCPI).
Integrated helpFully integrated with Visual Studio.NET help system with dynamic help, along with IntelliSense to shorten the programming learning curve (Figure 4).
IO monitorTracks and aids in instrument IO debugging. This is a stand-alone tool that is called via a button on the toolbar or as a menu pick.
Engineering graph objectsThese .NET graphs allow the visualizing, scaling, and tracking data from measurement and data stores. There are display types for X vs Y, Y only, Waveform, Complex, Magnitude Spectrum, Phase Spectrum graphs and Strip-Chart graphs.
Data analysisAn API is included for math and data analysis.
Digital signal processing (DSP) functionsIncludes the usual list such as Bartlett, Blackman, Hanning, Convolution, Rectangular and Hamming windowing functions; FFT and IFFT; Bessel functions; Statistical functions (Gamma, Mean, Median, Mode, Beta, Binomial, Factorial, Perm, Comb, RMS, Standard Deviation, and Variance); and Regression functions (Lin, Log, Exp, and Power Curve).
Complex number classThere is a .NET structure for representing complex numbers as might be returned from a network analyzer.
Engineering FormatterAn extension to the .NET formatter enables printing in engineering units such as exponent value which is always a multiple of three such as "123.5E3". Another mode allows for a full SI prefix name such as "123.5 kilo".
Developers who choose to work within the .NET platform to create and test new products will be able to focus their creativity on T&M solutions and leverage a development platform created by a huge number of Microsoft engineers over the last 5 years. As for managers, they will be able to draw upon a larger pool of developers who know this standard environment and protect their investment in the creation of intellectual property. Finally, for those using VEE or Labview, it makes sense to stay with them. However, the T&M Programmers Toolkit provides a way to call and utilize code already created in VEEin such cases it will be easier to generate that code from VEE.
|
About the Author
Ken Colasuonno is a Software Project Manager at Agilent Technologies responsible for the development of the Agilent T&M Programmers Toolkit. He has been part of T&M software development in Agilent and HP for 13 years. Ken has a MCS from Rice University in Houston, TX and a BS Chemical Engineering from the University of Missouri-Rolla.
|
Most Popular
Datasheets.com Parts Search
185 million searchable parts
(please enter a part number or hit search to begin)
Our technical library houses over 4,000 high-quality sponsored white papers, application notes, reference guides, use cases—all organized by company.

