Creating Downloadable Programs

Creating a Downloadable Program

Program Structure for Storing DLPs to Internal Memory

In the model, the ￿rst part tells what the program does and gives other appropriate information such as the author's name, the date, and a ￿le name.

The second part initializes the OSA in order to form a good starting point for measurements. CLEAR 723 and IP set the OSA to a known state. DISPOSE ALL clears internal memory to maximize storage space for functions, variables, and traces. (Omit DISPOSE ALL if you do not wish to erase all of internal memory.)

The third part de￿nes all user-de￿ned variables and traces that are utilized by any of the user-de￿ned functions, specifying a size for each trace and a value for each variable. To avoid memory-over￿ow problems, de￿ne variables and traces apart from any user-de￿ned functions. For instance, if the user-de￿ned function allocates memory for several trace arrays, memory is not allocated to the traces until the function has been executed. Thus, if

the amount of available internal memory is checked with the MEM? command or the NcatalogNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN& MSI softkey before the function has been run, the value

returned or displayed accounts only for the space occupied by the function, not for the space occupied by the function plus the traces.

The fourth part is reserved for user-de￿ned functions that are incorporated into and executed by a main user-de￿ned function, which is the last part of the program. When a series of commands are consolidated in a function, they can be executed many times, even though they are stored in the OSA only once. This conserves memory and simpli￿es programming.

6-5