Caution, Appendix a, Example remote control host program – B&K 4070A User Manual

Page 77: Hardware setup

Advertising
background image

BK Precision 4070A User Manual Rev.2.2

72

Appendix A

Example remote control host program

This chapter contains an example program written in Microsoft QuickBasic for remotely controlling the 4070A. It

can be used as a starting point for writing your own remote control applications.

The program illustrates several basic techniques for remotely controlling the 4070A with a control program. The
program begins by showing how to detect the presence of the 4070A on the serial port. It also shows how to set the
operating mode and enter parameters such as frequency and level. The program also parses information sent from
the 4070A to the host computer and displays that information on the screen.

Hardware Setup

You must connect a serial cable between your computer and the RS-232 port connector on the rear of the 4070A.
For more information on how to do this, refer to chapter 6.0.

The program assumes you are using serial port 1 (COM1). If you are using another serial port, change the OPEN
COM1... statement in the beginning of this program. It also assumes that the 4070A baud rate is set to 9600. To
check the 4070A baud rate, press the Mode then offset keys.

This example program switches the 4070A to DTMF Detection mode and displays the detected DTMF digits to
the screen. To detect DTMF digits, the DTMF signal must be applied to the Ext Mod Input jack on the rear of the
unit. A schematic diagram, which takes these tones from a telephone line, is shown below:

Telco Tip

Telco Ring

.001

200V

.001

200V

475K

1%

475K

1%

-12V

3

2

6

7

4

LM741

115K

1%

+12V

115K

1%

Figure A-1: Telephone line amplifier

*** Caution ***

Do NOT connect the Ext. Mod In input directly to a telephone line. High voltages exist on a telephone line, which

will cause permanent damage to the 4070A.

This program does the following:

1. Clear the screen
2. Open the serial communications port for communicating with the 4070A.
3. Make sure there is a 4070A connected to the serial port. If we can't find one, wait until it is connected up.
4. Command the 4070A to generate 18.432 MHz at 0.0 dBm.
5. Wait for the user to press a key.
6. Switch the 4070A to DTMF Detection mode.
7. Wait for the 4070A to detect a DTMF digit and print it to the terminal.

To
Ext Mod In
Connector

To
Telephone
Line

Advertising