Creating Downloadable Programs
Branching, Looping, and Interrupting
To use a looping constructUse the REPEAT/UNTIL command
In this example, repetition is controlled with a
10 | CLEAR 723 |
|
| Initialize OS A. |
|
| ||
20 | OUTPUT | 723;"IP;" |
|
|
|
|
|
|
30 | OUTPUT | 723;"STARTWL 750NM;STOPWL | 1450NM;" | Activate | and | |||
40 | OUTPUT | 723;"SNGLS;TS;" |
| sweep. |
|
|
| |
50 | OUTPUT | 723;"DISPOSE ALL;" |
| Clear internal memory. (Op- | ||||
|
|
|
|
| tionalsee \Memory" section | |||
|
|
|
|
| in this chapter .) |
|
| |
60 | OUTPUT 723;"TRDEF TR_AMP,10;" |
| Dene |
| AMP. | |||
|
| |||||||
70 | OUTPUT | 723;"VARDEF N,0;" |
| Dene variable , N, equal to 0. | ||||
80 | OUTPUT | 723;"MKPK | HI;" |
| Place marker on highest peak. | |||
90 | OUTPUT | 723;"REPEAT;" |
| Begin | repeat loop. |
|
| |
100 | OUTPUT | 723;"ADD | N,N,1;" |
| Add 1 to N. |
|
| |
110 | OUTPUT | 723;"MKPK | NH;" |
| Move marker to next highest | |||
|
|
|
|
| peak. |
|
|
|
120 OUTPUT | 723;"MOV | TR_AMP[N],MEASU | MKA;" | Store | amplitude in nth | ele- | ||
|
|
|
|
| ment of trace . |
|
| |
130 | OUTPUT | 723;"UNTIL N,EQ,3;" |
| Mark end of repeat loop. Loop- | ||||
|
|
|
|
| ing ends when N equals 3. |
|
|
Use the ABORT command to continue at the next commands after the function.
Use the RETURN command to continue from the point at which the current function was called.