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 />

Figure 78: Bool8 data from bit-shift example (PC data file)<br />

CRBasic Example 47.<br />

Public Alarm(32)<br />

Public Flags As Long<br />

Public FlagsBool8(4) As Long<br />

Programming with Bool8 and a bit‐shift operator<br />

DataTable(Bool8Data,True,-1)<br />

DataInterval(0,1,Sec,10)<br />

'store bits 1 through 16 in columns 1 through 16 of data file<br />

Sample(2,FlagsBool8(1),Bool8)<br />

'store bits 17 through 32 in columns 17 through 32 of data file<br />

Sample(2,FlagsBool8(3),Bool8)<br />

EndTable<br />

BeginProg<br />

Scan(1,Sec,3,0)<br />

'Reset all bits each pass before setting bits selectively<br />

Flags = &h0<br />

'Set bits selectively. Hex is used to save space.<br />

'Logical OR bitwise comparison<br />

229

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

Saved successfully!

Ooh no, something went wrong!