Chapter 7 Application Programs

Example Programs for Excel 7.0

Sub makeDataTable(Channel As Integer, columnIndex As Integer)

This routine will take the parsed data in row ’1’ for a channel and put it into a

table. ’Channel’ determines the row of the table and ’columnIndex’ determines the

column (scan sweep count).

The number of comma-delimited fields returned per channel is determined by the

FORMat:READing commands. The number of fields per channel is required to locate

the data in row 1. In this example, there are three cells (fields) per channel.

Set up the heading while scanning the first channel.

If Channel = 1 Then

Label the top of the data column and time stamp column Cells(4, columnIndex * 2) = "Scan " & Str(columnIndex) Cells(4, columnIndex * 2).Font.Bold = True

Cells(3, columnIndex * 2 + 1) = "time stamp" Cells(4, columnIndex * 2 + 1) = "min:sec"

End If

Get channel number, put in column ’A’ for first scan only If columnIndex = 1 Then

Cells(Channel + 4, 1) = Cells(1, 3) End If

Get the reading data and put into the column Cells(Channel + 4, columnIndex * 2) = Cells(1, 1)

Get the time stamp and put into the column to the right of data; to convert relative

time to Excel time, divide by 86400.

Cells(Channel + 4, columnIndex * 2 + 1) = Cells(1, 2) / 86400

Cells(Channel + 4, columnIndex * 2 + 1).NumberFormat = "mm:ss.0"

End Sub

Function ConvertTime(TimeString As String) As Date

This routine will take the string returned from the SYSTem:TIME:SCAN? command and

return a number compatible with the Excel format. When loaded into a cell, it can

be formatted using the Excel ’Format’ menu.

Dim timeNumber As Date

’ Decimal or time portion of the number

Dim dateNumber As Date

’ Integer or date portion of the number

Cells(1,

1).ClearContents

 

Cells(1,

1) = TimeString

 

Range("a1").TextToColumns Destination:=Range("a1"), comma:=True dateNumber = DateSerial(Cells(1, 1), Cells(1, 2), Cells(1, 3)) timeNumber = TimeSerial(Cells(1, 4), Cells(1, 5), Cells(1, 6)) ConvertTime = dateNumber + timeNumber

End Function

Sub GetErrors()

Call this routine to check for instrument errors. The GPIB address variable

’VISAaddr’ must be set.

Dim DataString As String OpenPort

SendSCPI "SYSTEM:ERROR?" ’ Read one error from the error queue Delay (0.1)

DataString = GetSCPI()

MsgBox DataString7 ClosePort

End Sub

327

Page 329
Image 329
Agilent Technologies 34970A manual 327

34970A specifications

Agilent Technologies 34970A is a versatile data acquisition and measurement system that has gained popularity in various industries, including research and development, manufacturing, and education. The primary purpose of the 34970A is to offer an efficient solution for data collection, monitoring, and analysis, which can significantly enhance productivity and accuracy in testing applications.

One of the main features of the 34970A is its modular design, allowing users to customize the system according to their specific measurement needs. The mainframe can accommodate up to three plug-in measurement modules, which can include various types of measurements such as analog, digital, temperature, and frequency. This modularity provides flexibility for users to tailor the system to their requirements, making it highly adaptable to different applications.

Another notable characteristic of the Agilent 34970A is its impressive channel configuration. The system can support up to 120 measurement channels when fully configured, enabling extensive data acquisition without the need for multiple devices. This capability is essential for applications requiring simultaneous monitoring of multiple parameters or locations.

The 34970A utilizes advanced signal processing technologies to ensure high-accuracy measurements. The internal 6.5-digit resolution multimeter provides precise readings, while the device also supports various input types, such as thermocouples and RTDs for temperature measurements. The ability to perform mathematical functions, such as summation and averaging, on the acquired data further enhances its usability.

For data storage and management, the Agilent 34970A features built-in memory for storing up to 20,000 readings. Users can also easily transfer data to a PC through the RS-232 interface or GPIB (IEEE 488) for further analysis and reporting. Additionally, it offers the capability to program automatic data logging and scheduling of measurements, which streamlines the testing process and reduces manual intervention.

In terms of user interface, the 34970A is equipped with a large graphical display that provides clear visualization of measurement data and easy navigation through settings and options. The menu-driven interface makes it accessible for users of all skill levels, simplifying the setup and operation of the device.

Overall, the Agilent Technologies 34970A stands out for its modularity, high channel capacity, advanced measurement technologies, and user-friendly interface. As a reliable and efficient data acquisition system, it is well-suited for a wide range of applications, making it an essential tool for engineers and technicians looking to enhance measurement precision and efficiency.