Pacific Research Solutions RI-300e User Manual
Page 85
S-Cmd 65 CONDITIONAL STATEMENTS (IF / THEN / ELSE)
This command is used to test system variables in a conditional statement and branch based on a true or false outcome. The
conditional statements have various parts. Within these parts, the conditional statement will test the EXPRESSION part THEN
execute the STATEMENT part that follows the EXPRESSION if TRUE, ELSE the first STATEMENT is skipped and the
second STATEMENT is executed. The macro terminator (S-Command 64 or "D") is used to separate the first STATEMENT
from the second. A STATEMENT is nothing more then a group of S-Commands.
IF EXPRESSION THEN STATEMENT ELSE STATEMENT
Or:
IF EXPRESSION BIND EXPRESSION THEN STATEMENT ELSE STATEMENT
You can even nest conditional statements, but the controller will completely terminate the macro or conditional statement once
the first macro terminator is encountered after a group of S-Commands.
IF The S-Command itself (65).
EXPRESSION The expression has up to 4 parts as follows
Variable An internal value that is tested in the conditional statement. See the tables on the following two pages for a
list of all variables.
Index Some variables must be indexed. Example, the enabled tone decode is indexed by the actual tone number.
Operation Compares the variable to the reference. (Equal, Not equal, Less than, Greater than) The outcome of the
compare is either true or false.
Reference This is the value that is compared to the variable. When compared, the outcome will be either true or false.
BIND Binding is optional and is used to bind multiple expressions together. Binding is a logical OR/AND of two or
more expressions. The only limit in the number of items that you can bind is a total of 34 characters.
THEN The THEN part of the macro is executed because of a true outcome of the expression. This part includes all
S-Commands between the conditional statement and an end of macro terminator (S-Cmd 64, ā€œDā€).
ELSE The ELSE part of the macro is executed because of a false outcome of the expression. This part includes all
S-Commands following the first macro terminator (S-Cmd 64, ā€œDā€) though the next macro terminator.
SYNTAX: 65 [Variable] <Index> [Operation] [Reference] (Then) (Else)
65 [Variable] <Index> [Operation] [Reference] [Bind] [Variable] [Operation] [Reference] (Then) (Else)
READ BACK N/A
STORAGE: EEPROM
PARAMETERS: S-Cmd 65 (IF)
Variable 00-99, See table in this section
Index 0-999
Operation 0 = Equal to (=), 1 = Not equal to (<>), 2 = Less then (<), 3 = More than (>)
Reference 0-99999
Bind * = Logical OR, # = Logical AND
DEFAULT: N/A
EXAMPLE 1: 65 25 0 13 C (S-Cmd1) C (S-Cmd2) C D (S-Cmd3) C (S-Cmd4) C D
IF Current CTCSS Decode = 13 (100.0Hz) THEN execute S-Commands 1 and 2 ELSE execute S-
Commands 3 and 4. Each "D" occurs because of the S-Command 64.
This conditional statement is entered as:
65 25 0 13 Conditional statement
(S-Cmd1) The first S-Command if the statement is TRUE.
(S-Cmd2) T he next S-Command if the statement is TRUE.
64 Terminate the TRUE part of the macro.
(S-Cmd3) The first S-Command if the statement is FALSE.
(S-Cmd4) T he next S-Command if the statement is FALSE.
64 Terminate the FALSE part of the macro.
Continued on next page.