beautypg.com

Sample (reps, source, datatype), Samplemaxmin (reps, source, datatype, disablevar) – Campbell Scientific CR9000X Measurement and Control System User Manual

Page 216

background image

Section 6. Data Table Declarations and Output Processing Instructions

Sample (Reps, Source, DataType)

This instruction stores the current value(s) at the time of output from the
specified variable or array.

Parameter
& Data Type

Enter

SAMPLE PARAMETERS

Reps

Constant

The number of values to sample. When repetitions are greater than 1, the source must be an array.

Source

Variable

The name of the Variable to sample.

DataType

A code to select the data storage format. Read More: See Section 4.2.4.4 Data Types

Constant

Alpha Code

Numeric Code

Data Format

IEEE4

24

IEEE 4 byte floating point

FP2

7

Campbell Scientific 2 byte floating point

BOOL8

17

1 Byte Boolean value

Long

20

4 Byte Integer value

Nsec

8 Byte timestamp

String

Size set by variable declaration in program

UINT2

21

2 Byte Unsigned integer

SampleMaxMin (Reps, Source, DataType, DisableVar)

The SampleMaxMin instruction is used to sample one or more variable(s)
when another variable (or any variable in an array of variables) reaches its
maximum or minimum for the defined output period.

The SampleMaxMin instruction is placed inside a DataTable declaration,
following the Maximum or Minimum instruction that will be used trigger the
sample. SampleMaxMin samples whenever a new maximum or minimum is
detected in the preceding instruction. When a new sample is taken, the previous
value(s) are discarded. The sample(s) recorded in the data table will be those
recorded when the maximum or minimum, for the output interval, occurred.

The number of values output by SampleMaxMin is determined only by its
source and destination parameters; not by repetitions in the preceding
instruction. When the Repetitions parameter for the preceding Maximum or
Minimum instruction is greater than 1, SampleMaxMin will sample whenever
a new maximum or minimum occurs in any of the variables in the
Maximum/Minimum source array. To ensure the sample is taken only when a
new maximum or minimum occurs in a single specific variable, the preceding
Maximum or Minimum instruction must have repetitions=1.

6-32