Using Special Tags for Special Purposes

Usually the IF and MAKE commands are used to check data from the network before sending a message or taking an action. However, the script can also use other inputs to trigger a conditional statement.

You can define your own "constant" tag with the CONSTANT command. The format is CONSTANT TAG "VALUE" , and the effect is similar to a DEFINE command except that the value is set instead of being read from the network. The main use of the CONSTANT if for testing the script, but it can also be handy for simplifying long scripts.

The PARAMS tag provides the list of parameters specified in the scripts .rvc companion file. Sometimes it is useful to create one script for several purposes, and invoke the script with different .rvc files. Each version of the .rvc file would have different parameters listed. By checking this parameter list in the script, the same script can have multiple results.

When using PARAMS, the "==" and "!=" have a different meaning. [PARAMS == value] will be true if the value is anywhere within the parameter list.

For example, consider the following script:


: disable the indicated furnaces
IF [PARAMS == FURN1] {SEND 1FFE3 01 FC FF FF FF FF FF FF}
IF [PARAMS == FURN2] {SEND 1FFE3 02 FC FF FF FF FF FF FF}
IF [PARAMS == FURN3] {SEND 1FFE3 03 FC FF FF FF FF FF FF}

This script can be invoked with several different .rvc files, each with a Params line such as:


: Disable furnace 1 and furnace 2
Params = FURN1 FURN2

For testing purposes, Omniscope also includes several commands for working with the parameter list.

CLEARPARAMS empties the parameter list.

SETPARAMS param1 param2 ... adds the indicated parameters to the list.

ASKFORPARAMS brings up a box that allows the user to modify the parameter list.

Finally, the MENU command allows another way for the user to select parameters. It is explained in another section.

Other special tags include the following.

MINVERSION

This tag indicates the Omniscope verion require to run the script. As Omniscope evolves new features are often added to the scripting, and scripts that use the new features need to check whether the user is running an up-to-date version of Omniscope. Therefore, it is a good idea to start each script with:


IF [MINVERSION != 1.00.28] {ABORT "Needs version 1.00.28 or more recent"}

TARGETMODEL checks the PRODUCT_ID of the target node. The indicated value must be anywhere within the Model designation. Note that spaces are not allowed in the expression.


IF [TARGETMODEL != VMS440] {ABORT "Target must be a VMS 440 "}

TARGETMAKE is similar, but checks the Make designation (usually this is the manufacturer.)


IF [TARGETMAKE != SILVERLEAF] {ABORT "Target must be a SilverLeaf product"}