Chapter 3 Programming Your Universal Counter for Remote Operation

Programming Examples

Programming Examples

In this section, you will see how to program the HP 53131A/132A to make many common measurements. Examples are provided in the following programming languages:

HP BASIC

Microsoft® QuickBASIC (version 4.5)*

Borland® Turbo C**

Using HP BASIC

This guide uses doubles quotes to enclose string parameters in syntax descriptions, but uses single quotes in the HP BASIC programming examples for readability.

The Counter allows string parameters to be enclosed by either double or single quotes. Each method is discussed in the following sub-sections.

To Send a Double-Quoted String

For the HP BASIC OUTPUT statements, remember that strings enclosed in

double quotes need special consideration. For example, send the FUNC “FREQ 1” command with the following:

OUTPUT 703;"FUNC ""FREQ 1"""

Note that a pair of double quotes (as shown in bold) is required by HP BASIC to embed a double quote within an HP BASIC string.

To Send a Single-Quoted String

For more readable HP BASIC OUTPUT statements, you may send, for example, the following:

OUTPUT 703;"FUNC 'FREQ 1'"

Note the pair of single quotes (as shown in bold) is more readable.

___________________________

*Microsoft is a U.S. registered trademark of Microsoft Corporation. **Turbo C is a product of Borland International, Inc.

3-58

Programming Guide