Campbell Scientific CR510 Basic Datalogger User Manual

Page 118

Advertising
background image

SECTION 9. INPUT/OUTPUT INSTRUCTIONS

9-14

SDI-12 data line attached to Port 2, but if the
Break and the specified address are not
received by Instruction 106, the remainder of
the subroutine is not executed.

Two programming techniques exist for obtaining
measurement values to be transferred by the
sensor Instruction 106. The first technique
makes the requested measurements "on
demand" in response to the recorders request.
The measurement instructions are located in
Subroutine 98 and are executed only when the
SDI-12 recorder requests measurements. This
technique is preferred when measurements are
to be made at the recorder's command.

The second technique transfers measurement
values previously obtained by instructions in
Table 1 or Table 2. Subroutine 98 contains only
Instructions 106 (SDI-12 sensor) and 95 (End).
When the recorder requests measurements,
values already in the specified input locations
are used. The advantage of this technique is
that the sensor CR510 can be making and
storing measurements independent of the SDI-
12 recorder. The data is also returned slightly
faster since the sensor CR510 does not make
measurements when the recorder requests
data, but rather uses measurements made at
the last regular table execution.

These two techniques can be combined allowing
the sensor CR510 to function as an SDI-12
sensor and to make independent measurements.
While Subroutine 98 is being executed, normal
Table 1 or 2 execution scheduling may be altered
or missed since Subroutine 98 is not interrupted.
This is likely to occur if Subroutine 98 execution
takes longer than the scan interval programmed
for Table 1 or 2. It is also possible for instructions
in Table 1 or 2 to prevent Subroutine 98 from
being called in time for Instruction 106 to receive
the address information from the recorder. This
is likely to occur only if Table 1 or 2 is executed
often and has instructions that take longer than
1/3 second to execute. For example, Instruction
4 (Excite-Delay-SE) with a 1/2 second delay could
cause Subroutine 98 to miss the SDI-12 address
information if it were executing when the SDI-12
data line became active. If this occurs the sensor
CR510 will not respond to the SDI-12 recorder.
Most instructions execute fast enough that when
Instruction 106 misses the initial SDI-12 address,
a subsequent retry by the recorder will work.

PARAM.

DATA

NUMBER

TYPE

DESCRIPTION

01:

4

ADDRESS (0-9, †10-126)

02:

4

TIME/VALUES
ttnn: tt=time(sec)
nn=no. values

03:

4

LOCATION starting
loc. for values

Input locations altered: 0

Intermediate locations required: 182. To
accommodate this number, increase the value in
*A window 2, if keying program steps in by hand.

PARAMETER 1. ADDRESS

Enter the address for the CR510 acting as an
SDI-12 sensor (0-9, †10-126 decimal value for
ASCII character, see Appendix E). Each SDI-
12 sensor connected to a control port must
have a unique address.

PARAMETER 2. TIME/VALUES

Enter the time in seconds required for the
sensor CR510 to complete subroutine 98
followed by the number of input locations to be
returned to the SDI-12 recorder. The format is
ttnn where tt specifies the time in seconds and
nn (maximum 63) is the number of values from
Input Locations to be sent.

Enter a time of 0 to transfer the values already
stored in input locations. With a time of zero,
the remaining instructions in Subroutine 98 are
not executed.

The actual time to complete subroutine 98 is the
time required to execute all instructions from
Instruction 106 (SDI-12 sensor) to the final
Instruction 95 (End).

For response to the ‘M’ command, the entered
time may be longer than the actual time without
slowing the data exchange because the sensor
CR510 signals the SDI-12 data recorder when
the data is ready for transfer.

For response to either the ‘M’ or the ‘C’
command, if the entered time is too short the
sensor CR510 will not respond and the data
values will not be transferred. Similarly, no
response occurs if the SDI-12 recorder queries
the sensor CR510 before the entered time has
elapsed.

Advertising