Campbell Scientific CR1000KD CR800 and CR850 Measurement and Control Systems - Page 231
Bin/Hex Is
View all Campbell Scientific CR1000KD manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 231 highlights
Section 7. Installation 'If bit in 'Flags Is '---------- ' 0 ' 0 ' 1 ' 1 OR bit in Bin/Hex Is ---------- 0 1 0 1 The result Is ---------- 0 1 1 1 'Binary equivalent of Hex: If Alarm(1) Then Flags = Flags OR &h1 If Alarm(3) Then Flags = Flags OR &h4 If Alarm(4) Then Flags = Flags OR &h8 If Alarm(5) Then Flags = Flags OR &h10 If Alarm(6) Then Flags = Flags OR &h20 If Alarm(7) Then Flags = Flags OR &h40 If Alarm(8) Then Flags = Flags OR &h80 If Alarm(9) Then Flags = Flags OR &h100 If Alarm(10) Then Flags = Flags OR &h200 If Alarm(11) Then Flags = Flags OR &h400 If Alarm(12) Then Flags = Flags OR &h800 If Alarm(13) Then Flags = Flags OR &h1000 If Alarm(14) Then Flags = Flags OR &h2000 If Alarm(15) Then Flags = Flags OR &h4000 If Alarm(16) Then Flags = Flags OR &h8000 If Alarm(17) Then Flags = Flags OR &h10000 If Alarm(18) Then Flags = Flags OR &h20000 If Alarm(19) Then Flags = Flags OR &h40000 If Alarm(20) Then Flags = Flags OR &h80000 If Alarm(21) Then Flags = Flags OR &h100000 If Alarm(22) Then Flags = Flags OR &h200000 If Alarm(23) Then Flags = Flags OR &h400000 If Alarm(24) Then Flags = Flags OR &h800000 If Alarm(25) Then Flags = Flags OR &h1000000 If Alarm(26) Then Flags = Flags OR &h2000000 If Alarm(27) Then Flags = Flags OR &h4000000 If Alarm(28) Then Flags = Flags OR &h8000000 If Alarm(29) Then Flags = Flags OR &h10000000 If Alarm(30) Then Flags = Flags OR &h20000000 If Alarm(31) Then Flags = Flags OR &h40000000 If Alarm(32) Then Flags = Flags OR &h80000000 ' &b10 ' &b100 ' &b1000 ' &b10000 ' &b100000 ' &b1000000 ' &b10000000 ' &b100000000 ' &b1000000000 ' &b10000000000 ' &b100000000000 ' &b1000000000000 ' &b10000000000000 ' &b100000000000000 ' &b1000000000000000 ' &b10000000000000000 ' &b100000000000000000 ' &b1000000000000000000 ' &b10000000000000000000 ' &b100000000000000000000 ' &b1000000000000000000000 ' &b10000000000000000000000 ' &b100000000000000000000000 ' &b1000000000000000000000000 ' &b10000000000000000000000000 ' &b100000000000000000000000000 ' &b1000000000000000000000000000 ' &b10000000000000000000000000000 ' &b100000000000000000000000000000 ' &b1000000000000000000000000000000 '&b10000000000000000000000000000000 'Note &HFF = &B11111111. By shifting at 8 bit increments along 32-bit 'Flags' (Long 'data type), the first 8 bits in the four Longs FlagsBool8(4) are loaded with alarm 'states. Only the first 8 bits of each Long 'FlagsBool8' are stored when converted 'to Bool8. 'Logical AND bitwise comparison 'If bit in 'Flags Is 0 ' 0 ' 1 ' 1 OR bit in Bin/Hex Is ---------- 0 1 0 1 The result Is ---------- 0 0 0 1 231