Campbell Scientific CR6 CR6 Measurement and Control System - Page 202
Data Output: Using Data Type NSEC
![]() |
View all Campbell Scientific CR6 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 202 highlights
Section 7. Installation 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 ' &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 FlagsBool8(1) = Flags AND &HFF FlagsBool8(2) = (Flags >> 8) AND &HFF FlagsBool8(3) = (Flags >> 16) AND &HFF FlagsBool8(4) = (Flags >> 24) AND &HFF 'AND 1st 8 bits of "Flags" & 11111111 'AND 2nd 8 bits of "Flags" & 11111111 'AND 3rd 8 bits of "Flags" & 11111111 'AND 4th 8 bits of "Flags" & 11111111 CallTable(Bool8Data) NextScan EndProg 7.9.10 Data Output: Using Data Type NSEC Data of NSEC data type reside only in final memory. A datum of NSEC consists of eight bytes - four bytes of seconds since 1990 and four bytes of nanoseconds into the second. Nsec is declared in the Data Type parameter in final-data memory output-processing instructions (p. 520). It is used in the following applications: • Placing a time stamp in a second position in a record. • Accessing a time stamp from a data table and subsequently storing it as part of a larger data table. Maximum(), Minimum(), and FileTime() instructions produce a time stamp that may be accessed from the program after being written to a data table. The time of other events, such as alarms, can be stored using the RealTime() instruction. • Accessing and storing a time stamp from another datalogger in a PakBus 202
![](/manual_guide/products/campbell-scientific-cr6-cr6-measurement-control-a476969/202.png)