Appendix a, Caution, Hardware setup – BNC 630 User Manual

Page 83: Example remote control host program

Advertising
background image

78

Appendix A

Example remote control host program

This chapter contains an example program written in Microsoft QuickBasic for remotely controlling the 630. 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 630 with a control program. The program begins by
showing how to detect the presence of the 630 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 630 to the host computer and displays that
information on the screen.

Hardware Setup

You must connect a serial cable between your computer and the RS232 port connector on the rear of the 630. 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 630 baud rate is set to 9600. To check the 630 baud rate, press
the Mode then Offset keys.

This example program switches the 630 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 630.

This program does the following:

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

To
Ext Mod In
Connector

To
Telephone
Line

Advertising