Chapter 6 Application Programs

RS-232 Operation Using Turbo C

RS-232 Operation Using Turbo C

The following example shows how to program an AT personal computer for interrupt-driven COM port communications. SCPI commands can be sent to the Agilent 34401A and responses received for commands that query information. The following program is written in Turbo C and can be easily modified for use with Microsoft￿ Quick C.

RS-232 Operation Using Turbo C

#include <bios.h> #include <stdio.h> #include <string.h> #include <dos.h> #include <conio.h>

#define EVEN_7 (0x18

0x02 0x04)

/* Even parity, 7 data, 2 stop */

#define ODD_7

 

(0x08

0x02 0x04)

/* Odd parity, 7 data, 2 stop */

#define NONE_8 (0x00

0x03 0x04)

/* None parity, 8 data, 2 stop */

#define BAUD300

0x40

 

 

#define BAUD600

0x60

 

 

#define BAUD1200 0x80

 

 

#define BAUD2400 0xA0

 

 

#define BAUD4800 0xC0

 

 

#define BAUD9600 0xE0

 

 

/* 8250 UART Registers */

 

#define COM

0x3F8

/* COM1 base port address */

#define THR

COM+0

/* LCR bit 7 = 0 */

 

#define RDR

COM+0

/* LCR bit 7 = 0 */

 

#define IER

COM+1

/* LCR bit 7 = 0 */

 

#define IIR

COM+2

/* The rest are don’t care for bit 7 */

#define LCR

COM+3

 

 

#define MCR

COM+4

 

 

#define LSR

COM+5

 

 

#define MSR

COM+6

 

 

Continued on next page >

Microsoft is a U.S. registered trademark of Microsoft Corporation.

6

193

Page 199
Image 199
Agilent Technologies 34401A manual RS-232 Operation Using Turbo C

34401A specifications

Agilent Technologies 34401A is a highly reputable digital multimeter (DMM), renowned for its accuracy, versatility, and performance in a wide range of measurement applications. First introduced in the early 1990s, the 34401A has become a staple in laboratories, manufacturing environments, and educational institutions due to its robust build and comprehensive features.

One of the standout characteristics of the 34401A is its impressive accuracy, boasting a basic DC voltage accuracy of 0.0035%, making it ideal for precise measurements in electronic testing. The multimeter offers a wide range of measurement capabilities, including voltage (DC and AC), current (DC and AC), resistance, frequency, and continuity test, making it a highly versatile tool for engineers and technicians.

The 34401A utilizes a 6½-digit resolution, enabling the user to measure small changes in electrical signals with remarkable precision. With a sampling rate of up to 1000 readings per second, it can handle dynamic test requirements, providing timely results without sacrificing measurement integrity.

In terms of connectivity, the Agilent 34401A includes a GPIB (General Purpose Interface Bus) for remote operation, allowing users to automate their testing processes and integrate the multimeter easily into larger measurement systems. This feature is particularly beneficial in automated test environments, where speed and accuracy are paramount.

Additionally, the DMM incorporates advanced measurement functions, such as statistical analysis, including mean, standard deviation, and minimum/maximum readings, which provide users with valuable insights into their data. The instrument's user-friendly interface, complete with a clear digital display and intuitive controls, enhances usability and ensures that users can easily navigate its various functions.

Robust software support further extends the capabilities of the Agilent 34401A. It is compatible with a range of software tools for data logging and analysis, enabling users to efficiently document and analyze their measurements over time.

In summary, Agilent Technologies 34401A stands out in the realm of digital multimeters due to its high accuracy, extensive measurement functionalities, and user-friendly features. Whether for research and development, quality control, or educational purposes, the 34401A remains a preferred choice for professionals demanding reliable and precise measurement solutions. Its enduring legacy in the industry speaks to its performance and reliability, making it an essential tool for anyone involved in electronic testing and measurement.