Campbell Scientific CR5000 Measurement and Control Module User Manual

Page 191

Advertising
background image

Section 8. Processing and Math Instructions

8-19

Remarks
The following table illustrates how Result is determined:

If expr is

The result is

True

False

False

True

Null

Null

The NOT operator also inverts the bit values of any variable and sets the
corresponding bit in result according to the following truth table:

If bit in expr1 is

The result is

0

1

1

0

NOT Operator Example

The example sets the value of the variable Msg depending on the state of
Flag(1).

Dim A, B, C, Flag(8)

'Declare variables.

Public Msg
If NOT Flag(1) Then

'Evaluate expressions.

Msg = 10

Else

Msg = 100.

End If

Or

Used to perform a logical disjunction on two expressions.

Syntax
result = expr1 Or expr2

Remarks
If either or both expressions evaluate True, result is True. The following table
illustrates how result is determined:

If expr1 is

And expr2

The result

is

is is

True True

True

True False

True

False True

True

False False

False

The Or operator also performs a bit-wise comparison of identically positioned
bits in two numeric expressions and sets the corresponding bit in result
according to the following truth table:

Advertising