04.01.2015 Views

CR1000 Manual - Campbell Scientific

CR1000 Manual - Campbell Scientific

CR1000 Manual - Campbell Scientific

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Appendix A. CRBasic Programming Instructions<br />

CRBasic Example 70.<br />

Dim input_val As Long<br />

Dim value_1 As Long<br />

Dim value_2 As Long<br />

Dim value_3 As Long<br />

Using Bit‐Shift Operators<br />

'read input_val somehow<br />

value_1 = (input_val AND &B11000000) >> 6<br />

value_2 = (input_val AND &B00110000) >> 4<br />

'note that value_3 does not need to be shifted<br />

value_3 = (input_val AND &B00001111)<br />

A.6.5 Logical Operators<br />

AND<br />

Performs a logical conjunction on two expressions.<br />

Syntax<br />

result = expr1 AND expr2<br />

EQV<br />

Performs a logical equivalence on two expressions.<br />

Syntax<br />

result = expr1 EQV expr2<br />

NOT<br />

Performs a logical negation on an expression.<br />

Syntax<br />

result = NOT expression<br />

OR<br />

Performs a logical disjunction on two expressions.<br />

Syntax<br />

result = expr1 OR expr2<br />

XOR<br />

Performs a logical exclusion on two expressions.<br />

Syntax<br />

result = expr1 XOR expr2<br />

IIF<br />

Evaluates a variable or expression and returns one of two results based on the<br />

outcome of that evaluation.<br />

Syntax<br />

Result = IIF (Expression, TrueValue, FalseValue)<br />

IMP<br />

Performs a logical implication on two expressions.<br />

Syntax<br />

result = expression1 IMP expression2<br />

495

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!