Use VB to control Ethernet instruments
Martin Rowe, Senior Technical Editor -- Test & Measurement World, 12/1/2004
Instrument manufacturers regularly include Ethernet ports in their equipment. Because every PC also includes an Ethernet port, you can use the PC's I/O bus to control your test equipment. If an instrument doesn't come with software that works over Ethernet or if you want to write a custom application, you often need drivers and I/O libraries. But if you just want to write a simple application with Visual Basic (VB) or Visual C++, you don't need drivers or libraries; instead, you can use code developed by Werner Haussmann of Agilent Technologies (werner_haussmann@agilent.com).
Haussmann's software, available for download from the T&MW Web site, uses VB's Winsock control to provide access to a PC's Ethernet port. In a paper that accompanies the software, Haussmann shows you how to verify communications between the PC and the instrument before you use the VB code. The paper walks you through programming examples, showing you how to use the Winsock control.
As part of the download, you get a more extensive programming example, including a VB project that lets you communicate with an Agilent N6700A power supply. The sample VB project uses a button to initiate an IEEE 488.2 *IDN? command for identifying the instrument. A reply field lets you view the instrument's response. Although the VB project is written for the N6700A, you can modify the source code to fit any instrument.
You can download Haussmann's software at
www.reed-electronics.com/tmworld/contents/pdf/TMW_VB-60_LAN_Sockets.zip
(The project consists of several files in a .zip file.)
You can download the paper at www.tmworld.com/contents/txt/TMW_1204_vb_web.doc.


















