Creating a Downloadable Program

The FUNCDEF (de￿ne function) command consolidates a series of OSA commands into one operation and gives it a name. Executing the function name is the same as executing the series of commands contained in the function.

Reserved Words

Do not use the reserved words (as listed in Chapter 8 of this manual) as DLP names. Using reserved words interrupts the de￿ning process and executes the invoked function. For example, if a DLP is named \ALL," the reserved word would disrupt the operation of any function modi￿ed by ALL, such as

DISPOSE ALL.

Any names created by the VARDEF, ACTDEF, TRDEF, or FUNCDEF commands become reserved words until they are erased from internal memory.

A function must be stored in internal memory before it can be executed. In the example below, the FUNCDEF command stores a DLP named HIGH PEAK in internal memory. Notice the matching delimiter characters (@) mark the beginning and end of a command series assigned to HIGH PEAK.

10 CLEAR 723

20 OUTPUT 723;"IP;";

30 OUTPUT 723;"FUNCDEF HIGH_PEAK,@";

40OUTPUT 723;"STARTWL 700NM;STOPWL 1200NM;";

50OUTPUT 723;"TS;MKPK HI;";

60OUTPUT 723;"@;"

The simplest way to store new functions in internal memory is with a computer program. However, if you have the auxiliary HP-HIL keyboard, you can easily store DLPs without the use of a computer.

The following ￿gure illustrates a program structure that simpli￿es the process. The model simpli￿es debugging and documentation, and conserves memory.

6-4