Prt (dest, reps, source, mult, offset) – Campbell Scientific CR9000X Measurement and Control System User Manual
Page 314

Section 8. Processing and Math Instructions
Peak Valley Example
Public PeakV(2), Change(3),Deg
Public Dim XY(2)
Const Pi=4*ATN(1)
‘Define Pi for converting degrees to radians
DataTable(PV1,Change(1),500)
‘Peaks and valleys for 1rst signal, triggered when Change(1)<>0
Sample(1,PeakV(1),IEEE4)
‘DataTable PV1 holds the peaks and valleys for XY(1)
EndTable
DataTable(PV2,Change(2),500)
‘Peaks and valleys for 2nd signal, triggered when Change(2)<>0
Sample(1,PeakV(2),IEEE4)
‘DataTable PV2 holds the peaks and valleys for XY(2)
EndTable
‘
The Following stores both signals whenever there is a new peak or valley in either signal. The
' The value stored for the signal that does not have a new peak will be a repeat of its last peak or
' valley. Normally a program would not have a table storing peaks and valleys for several
' signals but, would use individual tables for each signal.
DataTable(PVBoth,Change(3),500)
Sample(2,PeakV(1),IEEE4)
EndTable
BeginProg
Scan(500,mSec,0,0)
Deg=Deg+5
XY(1)=Cos(Deg*Pi/180)
‘Compute the cosine as input XY(1)
XY(2)=Sin(Deg*Pi/180)
‘Compute the sine as input XY(2)
PEAKVALLEY
(PeakV(1),Change(1),2,XY(1),0.1)
‘Find the peaks and valleys for both inputs. Hysteresis = 0.1
CallTable PV1
CallTable PV2
CallTable PVBoth
Next
Scan
EndProg
PRT (Dest, Reps, Source, Mult, Offset)
PRT is used to calculate temperature from the resistance of an RTD.
Syntax
PRT(Dest, Reps, Source, Mult, Offset)
Remarks
This instruction uses the result of a previous RTD bridge measurement to calculate
the temperature. The input (Source) must be the ratio R
S
/R
0
, where R
S
is the RTD
resistance and R
0
the resistance of the RTD at 0
° C.
The temperature is calculated according to the DIN 43760 specification adjusted
(1980) to the International Electrotechnical Commission standard. The range of
linearization is -200
° C to 850° C. The error in the linearization is less than 0.001° C
between -200 and +300
° C, and is less than 0.003° C between -180 and +830° C.
The error (T calculated - T standard) is +0.006
° at -200° C and -0.006° at +850° C.
8-28