Section 7. Installation
264
CRBasic
Example
61.
PT100
in
Four
‐
Wire
Full
‐
Bridge
'See FIGURE. PT100 in Four-Wire Full-Bridge
(p.
263
)
for wiring diagram.
Public
BrFullOut
Public
Rs_Ro
Public
Deg_C
BeginProg
Scan
(1,Sec,0,0)
'BrFull(Dst,Reps,Range,DfChan,Vx1,MPS,Ex,RevEx,RevDf,Settle,Integ,Mult,Offset)
BrFull
(BrFullOut,1,mV25,1,Vx1,1,2500,True,True,0,250,.001,.02344)
'BrTrans = Rf*(X/(1-X))
Rs_Ro = 50 * (BrFullOut/(1 - BrFullOut))
'PRTCalc(Destination,Reps,Source,PRTType,Mult,Offset)
PRTCalc
(Deg_C,1,Rs_Ro,2,1.0,0)
NextScan
EndProg
7.8.19 Running Average
The
AvgRun()
instruction calculates a running average of a measurement or
calculated value. A running average is the average of the last N values where N is
the number of values, as expressed in figure
Running-Average Equation
(p. 264),
Figure 82: Running-average equation
where X
N
is the most recent value of the source variable and X
N-1
is the previous
value (X
1
is the oldest value included in the average, i.e., N-1 values back from
the most recent). NANs are ignored in the processing of
AvgRun()
unless all
values in the population are NAN.
AvgRun()
uses high-precision math, so a 32-bit extension of the mantissa is saved
and used internally resulting in 56 bits of precision.
Note
This instruction should not normally be inserted within a
For
/
Next
construct with the
Source
and
Destination
parameters indexed and
Reps
set to
1
.
Doing so will perform a single running average, using the values of the different
elements of the array, instead of performing an independent running average on
each element of the array. The results will be a running average of a spatial
average of the various source array elements.
A running average is a digital low-pass filter; its output is attenuated as a function
of frequency, and its output is delayed in time. The amounts of attenuation and
phase shift (time delay) depend on the frequency of the input signal and the time
length (which is related to the number of points) of the running average.
Summary of Contents for CR850
Page 2: ......
Page 4: ......
Page 6: ......
Page 26: ...Table of Contents 26...
Page 30: ...Section 2 Cautionary Statements 30...
Page 32: ...Section 3 Initial Inspection 32...
Page 35: ...Section 4 Quickstart Tutorial 35 Figure 2 Wiring panel...
Page 55: ...Section 4 Quickstart Tutorial 55 Figure 24 PC200W View data utility...
Page 78: ...Section 5 System Overview 78...
Page 80: ...Section 6 CR800 Specifications 80...
Page 267: ...Section 7 Installation 267 Figure 84 Running average signal attenuation...
Page 268: ...Section 7 Installation 268...
Page 384: ...Section 8 Operation 384 Figure 113 Using the keyboard display...
Page 387: ...Section 8 Operation 387 Figure 116 Real time custom...
Page 388: ...Section 8 Operation 388 8 8 1 3 Final Storage Tables Figure 117 Final storage tables...
Page 389: ...Section 8 Operation 389 8 8 2 Run Stop Program Figure 118 Run Stop Program...
Page 390: ...Section 8 Operation 390 8 8 3 File Display Figure 119 File display...
Page 396: ...Section 8 Operation 396...
Page 402: ...Section 9 Maintenance 402...
Page 450: ...Section 11 Glossary 450...
Page 504: ...Appendix A CRBasic Programming Instructions 504...
Page 526: ...Appendix B Status Table and Settings 526...
Page 530: ...Appendix C Serial Port Pinouts 530...
Page 536: ...Appendix E FP2 Data Format 536...
Page 550: ...Appendix F Other Campbell Scientific Products 550...
Page 565: ......