Specifications

Section 7. Measurement Instructions
port (the mask is "anded" with the port status; the "and" operation returns a 1 for
a digit if the mask digit and the port status are both 1 and a 0 if either or both is
0). CRBasic allows the entry of numbers in binary format by preceding the
number with "&B". For example if the mask is entered as &B100 (leading zeros
can be omitted in binary format just as in decimal) and ports 3 and 1 are high as
in the previous example, the result of the instruction will be 4 (decimal, binary =
100); if port 3 is low, the result would be 0.
Examples
ReadIO(Port3, &B100) ' read port 3 if port 3 is high then
‘Port3 = 4, if port 3 is low then Port3 = 0
SDI12Recorder (Dest, SDIPort, SDIAddress, SDICommand, Multiplier,
Offset)
The SDI12Recorder instruction is used to retrieve the results from an SDI-12
sensor.
Each execution of the SDI12Recorder instruction sends an (address)M! and
then an (address)D0!
M! instructs the sensor to make the measurement; D0! is a request for the data.
Parameter
& Data Type
Enter
Dest
Variable or
Array
The Dest parameter is a variable in which to store the results of the
measurement. Dest must have enough elements to store all the data that is
returned by the SDI-12 sensor or a 'variable out of range' error will result
during the execution of the instruction.
SDIPort
Constant
The SDIPort parameter is the port to which the SDI-12 sensor is connected.
A numeric value is entered:
Code Description
1 Control Port 1
3 Control Port 3
5 Control Port 5
7 Control Port 7
SDIAddress
Constant or
Variable
The address of the SDI12 sensor that will be affected by this instruction.
Valid addressses are 0 through 9, A through Z, and a through z.
Alphabetical characters should be enclosed in quotes (e.g., "A").
SDICommand
String
The command strings that will be sent to the sensor. The command should
be enclosed in quotes.
Command Description
?! Address query
An! Change address (where n = address)
C! Initiate concurrent measurements
CC! Initiate concurrent measurements (with checksum)
I! Send identification (destination variable must be formatted
as a string)
M! Initiate measurements
MC! Initiate measurements (with checksum)
M1! - M9! Additional measurement commands specified by the
SDI-12 sensor
7-24