Global TMW:
Login  |  Register          Free Newsletter Subscription
Subscribe
Email
Print
Reprint
Learn RSS

Software wrapper links Matlab to instruments

Martin Rowe, Senior Technical Editor -- Test & Measurement World, 12/1/2007

Matlab is a popular computing environment for electrical engineers. Many use it to analyze data, although they often save the data using another program, then import the data into Matlab. Mike Flaherty, an applications engineer at Agilent Technologies, wanted a direct programming interface from Matlab scripts to generate waveforms with an arbitrary waveform generator (AWG).

Flaherty needed Matlab scripts that generate numerous waveforms, including 7-bit Barker-coded radar pulses, and multitone signals. The software needed to work with two AWGs: one through Ethernet, the other through CompactPCI.

To provide an easy-to-understand programming interface, Agilent engineers developed several Matlab scripts to control the instruments. They used function names such as awg_open and awg_storewaveform.

A Matlab MEX file provides an interface between Matlab and LXI or CompactPCI instrument drivers.
These scripts call a Matlab MEX file, written in C, that in turn calls IVI-C drivers for the instruments. Those drivers then call the protocol stacks for the Ethernet and CompactPCI I/O ports (see figure).

“The waveform generators are 100% code compatible with this application,” said Flaherty.

Flaherty also developed a user interface that lets users select from a menu of signals, then select specific parameters. Using Matlab and Agilent Vee, he built prototypes of the user interface. He wanted to develop a compiled, stand-alone executable, though. Because Vee is an interpreted language, Agilent engineers ported the GUI and the control code to Microsoft C#. The waveform engine is still Matlab but is compiled and linked to the application when built.

“The key to the application is the Matlab interface,” explained Flaherty. “It communicates through a MEX file to an instrument's IVI-C driver. It passes a resource string to a CompactPCI or Ethernet stack.”

Email
Print
Reprint
Learn RSS

Talkback

We would love your feedback!

Post a comment

» VIEW ALL TALKBACK THREADS

Related Content

Related Content

 

By This Author

Sponsored Links



 
Advertisement
SPONSORED LINKS

More Content

  • Blogs
  • Podcasts

Blogs

  • Martin Rowe
    Rowe's and Columns

    August 29, 2008
    LEDs, Tubes, and Clay
    The Champlain Valley (Vermont) Exhibition, which runs until August 31, has many of the usual things ...
    More
  • Rick Nelson
    Taking the Measure

    August 28, 2008
    What’s your battery IQ?
    What features do you look for in a battery, and do you know which battery technologies to choose to ...
    More
  • » VIEW ALL BLOGS RSS

Podcasts

Advertisements





NEWSLETTERS
Click on a title below to learn more.

Test Industry News (3 Times Per Month)
Machine-Vision & Inspection (Monthly)
Communications Test (Monthly)
Design, Test & Yield (Monthly)
Automotive, Aerospace & Defense (Monthly)
Instrumentation (Monthly)
Resource Center E-Alert (Monthly)
©2008 Reed Business Information, a division of Reed Elsevier Inc. All rights reserved.
Use of this Web site is subject to its Terms of Use | Privacy Policy
Please visit these other Reed Business sites