Language Reference
IF/THEN
Example Print a message depending on the level of a measured signal.
20 | CLEAR 723 | Initialize analyzer . |
30 | OUTPUT 723;"IP;" |
|
40 | OUTPUT 723;"SNGLS;" | Activate |
50 | OUTPUT 723;"PA 250,500;" | Set pen position |
60 | OUTPUT 723;"SP 50NM;CENTERWL 750NM;" | Set measurement range . |
70 | OUTPUT 723;"TS;MKPK HI;" | Measure , then mark highest signal. |
80 | OUTPUT 723;"IF MKA,LT, 010.5DBM;THEN;TEXT @FAIL@ |
|
90 | OUTPUT 723;"ELSIF MKA,GT, 09.5DBM;THEN;TEXT @FAIL@;" |
|
100 OUTPUT 723;"ELSE TEXT @LEVEL OK.@;ENDIF;" | If signal level is between 010.5 and 09.5 dBm, | |
|
| print \LEVEL OK." If otherwise , print \FAIL" |
Description The IF/THEN/ELSIF/ELSE/ENDIF commands compare the values of two operands according to the following conditions:
Less than (LT)
Greater than (GT)
Less than or equal to (LE)
Greater than or equal to (GE)
Equal to (EQ)
Not equal to (NE)
The operations are as follows:
If the operand values satisfy the specied condition, the analyzer commands that follow \THEN" are executed. If the specied condition is not satised, the analyzer commands that follow \ELSE" or \ELSIF" are executed. The command \THEN" is a
The \IF" and \ELSE" commands delimit two operands and their comparison condition. \ELSIF" delimits an alternate comparison test. \ELSE" and \ENDIF" delimit analyzer commands that are executed if the condition(s) are not satised.
\ENDIF" ends the comparison construct.