6 conditional output, Crbasic example 57. conditional output – Campbell Scientific CR3000 Micrologger User Manual
Page 256

Section 7. Installation
256
'Begin Program
BeginProg
'Load scaling array (multipliers and offsets)
Mult(1) = 1.8 : Offset(1) = 32
Mult(2) = 1 : Offset(2) = 2
Mult(3) = 1 : Offset(3) = 3
Mult(4) = 1 : Offset(4) = 4
Mult(5) = 1 : Offset(5) = 5
Mult(6) = 1 : Offset(6) = 6
Mult(7) = 1 : Offset(7) = 7
Mult(8) = 1 : Offset(8) = 8
Mult(9) = 1 : Offset(9) = 9
Mult(10) = 1 : Offset(10) = 10
Scan
(5,Sec,1,0)
'Measure reference temperature
PanelTemp
(PTemp_C,_60Hz)
'Measure 5 thermocouples on CR1000
'Note: because of the use of repetitions, an array can be used for the
'destination, multiplier and offset.
TCDiff
(Temp_C(),5,mV20C,1,TypeT,PTemp_C,True ,0,250,Mult(),Offset())
'Measure 5 thermocouples on an AM16/32 Multiplexer (2x32 mode)
PortSet
(1,1)
Count = 6
'Start with 6 since scaling arrays 1 – 5
'already used
SubScan
(0,uSec,5)
PulsePort
(2,10000)
TCDiff
(Temp_C(Count),1,mV20C,6,TypeT,PTemp_C,True,0,_60Hz,Mult(Count),Offset(Count))
Count = Count + 1
NextSubScan
PortSet
(1,0)
CallTable
(min_5)
NextScan
EndProg
7.8.17.6 Conditional Output
CRBasic example Conditional Output
(p. 256)
demonstrates programming to output
data to a data table conditional on a trigger other than time.
CRBasic Example 57. Conditional Output
'Programming example showing use of StationName instruction, use of units, and writing
'to a data table conditionally
'Declare Station Name (saved to Status table)
StationName
(Delta_Temp_Station)
'Declare Variables
Public
PTemp_C, AirTemp_C, DeltaT_C