SDI-12 command basics
SDI-12 commands have three components:
- Sensor address (a) – a single character and the first character of the command. Use the default address of zero (0) unless multiple sensors are connected to the same port.
- Command body – an uppercase letter (the “command”), optionally followed by one or more alphanumeric qualifiers.
- Command termination (!) – an exclamation mark.
An active sensor responds to each command. Responses have several standard forms and always terminate with <CR><LF> (carriage return and line feed). Standard SDI-12 commands are listed in Campbell Scientific sensor SDI-12 command and response set.
|
Name |
Command1 |
Response |
|---|---|---|
| Acknowledge active | a!
|
a<CR><LF> |
| Send identification | aI!
|
allccccccccmmmmmmvvvxxx...xx <CR><LF> |
| Start verification | aV!
|
atttn<CR><LF> |
| Address query | ?!
|
a<CR><LF> |
| Change address | aAb!
|
b<CR><LF> |
| Start measurement | aM!
aM1!...aM9!
|
atttn<CR><LF> |
| Start concurrent measurement | aC!
aC1!...aC9!
|
atttnn<CR><LF> |
| Send data | aD0!...aD9!
|
a<values><CR><LF> or a<values><CRC><CR><LF> |
| Continuous measurement | aR0!...aR9!
|
a<values><CR><LF> |
| Extended commands | aXNNN!
|
a<values><CR><LF> |