EasyManua.ls Logo

Campbell CR800 Series - Data Output: Using Data Type Bool8; FIGURE 42: Data from Trigvar Program

Campbell CR800 Series
598 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Section 7. Installation
193
FIGURE 42: Data from TrigVar Program
Using TrigVar to Trigger Data Storage
'This program example demonstrates the use of the TrigVar parameter in the DataTable()
'instruction to trigger data storage. In this example, the variable Counter is
'incremented by 1 at each scan. The data table, which includes the Sample(), Average(), and
'Totalize() instructions, is called every scan. Data are stored when TrigVar is true, and
'TrigVar is True when Counter = 2 or Counter = 3. Data stored are the sample, average,
'and total of the variable Counter, which is equal to 0, 1, 2, 3, or 4 when the data table
'is called.
Public Counter
DataTable(Test,Counter=2 or Counter=3,100)
Sample(1,Counter,FP2)
Average(1,Counter,FP2,False)
Totalize(1,Counter,FP2,False)
EndTable
BeginProg
Scan(1,Sec,0,0)
Counter = Counter + 1
If Counter = 5 Then
Counter = 0
EndIf
CallTable Test
NextScan
EndProg
7.7.7 Data Output: Using Data Type Bool8
Variables used exclusively to store either True or False are usually declared As
BOOLEAN. When recorded in final-data memory, the state of Boolean
variables is typically stored in BOOLEAN data type. BOOLEAN data type uses
a four-byte integer format. To conserve final-data memory or comms band, you
can use the BOOL8 data type. A BOOL8 is a one-byte value that holds eight bits

Table of Contents

Related product manuals