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.

Section 7. Installation<br />

'If bit in OR bit in The result<br />

'Flags Is Bin/Hex Is Is<br />

'---------- ---------- ----------<br />

' 0 0 0<br />

' 0 1 1<br />

' 1 0 1<br />

' 1 1 1<br />

'Binary equivalent of Hex:<br />

If Alarm(1) Then Flags = Flags OR &h1 ' &b10<br />

If Alarm(3) Then Flags = Flags OR &h4 ' &b100<br />

If Alarm(4) Then Flags = Flags OR &h8 ' &b1000<br />

If Alarm(5) Then Flags = Flags OR &h10 ' &b10000<br />

If Alarm(6) Then Flags = Flags OR &h20 ' &b100000<br />

If Alarm(7) Then Flags = Flags OR &h40 ' &b1000000<br />

If Alarm(8) Then Flags = Flags OR &h80 ' &b10000000<br />

If Alarm(9) Then Flags = Flags OR &h100 ' &b100000000<br />

If Alarm(10) Then Flags = Flags OR &h200 ' &b1000000000<br />

If Alarm(11) Then Flags = Flags OR &h400 ' &b10000000000<br />

If Alarm(12) Then Flags = Flags OR &h800 ' &b100000000000<br />

If Alarm(13) Then Flags = Flags OR &h1000 ' &b1000000000000<br />

If Alarm(14) Then Flags = Flags OR &h2000 ' &b10000000000000<br />

If Alarm(15) Then Flags = Flags OR &h4000 ' &b100000000000000<br />

If Alarm(16) Then Flags = Flags OR &h8000 ' &b1000000000000000<br />

If Alarm(17) Then Flags = Flags OR &h10000 ' &b10000000000000000<br />

If Alarm(18) Then Flags = Flags OR &h20000 ' &b100000000000000000<br />

If Alarm(19) Then Flags = Flags OR &h40000 ' &b1000000000000000000<br />

If Alarm(20) Then Flags = Flags OR &h80000 ' &b10000000000000000000<br />

If Alarm(21) Then Flags = Flags OR &h100000 ' &b100000000000000000000<br />

If Alarm(22) Then Flags = Flags OR &h200000 ' &b1000000000000000000000<br />

If Alarm(23) Then Flags = Flags OR &h400000 ' &b10000000000000000000000<br />

If Alarm(24) Then Flags = Flags OR &h800000 ' &b100000000000000000000000<br />

If Alarm(25) Then Flags = Flags OR &h1000000 ' &b1000000000000000000000000<br />

If Alarm(26) Then Flags = Flags OR &h2000000 ' &b10000000000000000000000000<br />

If Alarm(27) Then Flags = Flags OR &h4000000 ' &b100000000000000000000000000<br />

If Alarm(28) Then Flags = Flags OR &h8000000 ' &b1000000000000000000000000000<br />

If Alarm(29) Then Flags = Flags OR &h10000000 ' &b10000000000000000000000000000<br />

If Alarm(30) Then Flags = Flags OR &h20000000 ' &b100000000000000000000000000000<br />

If Alarm(31) Then Flags = Flags OR &h40000000 ' &b1000000000000000000000000000000<br />

If Alarm(32) Then Flags = Flags OR &h80000000 '&b10000000000000000000000000000000<br />

'Note &HFF = &B11111111. By shifting at 8 bit increments along 32-bit 'Flags' (Long<br />

'data type), the first 8 bits in the four Longs FlagsBool8(4) are loaded with alarm<br />

'states. Only the first 8 bits of each Long 'FlagsBool8' are stored when converted<br />

'to Bool8.<br />

'Logical AND bitwise comparison<br />

'If bit in OR bit in The result<br />

'Flags Is Bin/Hex Is Is<br />

'---------- ---------- ----------<br />

' 0 0 0<br />

' 0 1 0<br />

' 1 0 0<br />

' 1 1 1<br />

230

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

Saved successfully!

Ooh no, something went wrong!