Contents

Previous

Next

Last

Operators

The CMS supplies "Operators" for both analog and bit variables. This section discusses those operators and how they're used in the CMS scripting facility.

Analog Operators

For analog variables, the supported operators are the standard "+", "-", "*", and "/" symbols which provide the standard arithmetic functions:

JS1.A1 + 100   // Addition
CMS.A1 - A27   // Subtraction
A2 * 5         // Multiplication
JS1.A1 / 2     // Division

are all valid producing an analog result that can be assigned to any analog variable (except JSx variables).

Logical Operators

For logical operations, the CMS provides the functions AND, OR, and NOT. For those unfamiliar with logical operators, the operations are really fairly simple. For example:

JS1.B1 AND JS1.B4

will be TRUE when both b1 and b4 on js1 are TRUE.

The OR operator is similar in usage:

JS1.B1 OR JS1.B4

will be TRUE if either B1 or B4 on JS1 is TRUE.

The NOT operator simply inverts the state of whatever value it's applied to. For instance:

NOT JS1.B1

will be TRUE if JS1.B1 is FALSE, and vice-versa.

Comparison Operators

Comparison operators are used to compare the values of analog variables. There are six such operators. Each has to forms, one using characters, the other using symbols that may be more familiar to those users who have some programming experience. Both forms produce exactly the same result and can be used interchangeably.

Function Symbol
Less Than LT;
Less Than or Equal To LE
Equal To EQ
Greater Than GT
Not Equal NE

The use of these operators will be covered in more detail in the sections on creating script files.

Assignment Operator

The assignment operator is the "=" sign. It is used to allow you to set the a variable to some particular value. That might be a constant, the value of an axis, or another stored value. This will be covered later in the section on Statements.