beautypg.com

Fieldnames “list of fieldnames – Campbell Scientific CR5000 Measurement and Control Module User Manual

Page 109

background image

Section 6. Data Table Declarations and Output Processing Instructions

6-15

DataTable(IFFT,1,1) 'inverse FFT
fft(y,IEEE4,SIZE_FFT,10 msec,5)
EndTable

BeginProg

Scan(10, msec,0,SIZE_FFT)
i=i+1
X(i) = DC + Sin(PI/8+2*PI*CYCLESperT*i/SIZE_FFT) * AMPLITUDE + Sin(PI/2+PI*i)
Next Scan

CallTable(Amp)
CallTable(AmpPhase)
CallTable(Power)
CallTable(PSD)
CallTable(FFT)
for i = 1 to SIZE_FFT ' get result back into y()
y(i) = FFT.x_fft(i,1)
next
CallTable(IFFT) ' inverse, result is the same as x()

EndProg

FieldNames “list of fieldnames”

The FieldNames instructions may be used to override the fieldnames that the
CR5000 generates for results sent to the data table. Fieldnames must
immediately follow the output instruction creating the data fields. Field names
are limited to 19 characters. Individual names may be entered for each result
generated by the previous output instruction or an array may be used to name
multiple fields. When the program is compiled, the CR5000 will determine
how many fields are created. If the list of names is greater than the number of
fields the extra names are ignored. If the number of fields is greater than the
number names in the list of fieldnames, the default names are used for the
remaining fields.

Example

Sample(4, Temp(1), IEEE4)
FieldNames “ IntakeT, CoolerT, PlenumT, ExhaustT”

The 4 values from the variable array temp are stored in the output table with
the names IntakeT, CoolerT, PlenumT, and ExhaustT.

Sample(4, Temp(1), IEEE4)
FieldNames “ IntakeT, CoolerT”

The 4 values from the variable array Temp are stored in the output table with 2
individual names and the remainder of the default array Temp:
IntakeT, CoolerT, Temp(3), and Temp(4),