![Campbell SDMS40 Скачать руководство пользователя страница 30](http://html1.mh-extra.com/html/campbell/sdms40/sdms40_product-manual_3916973030.webp)
Appendix B. Example programs
B.1 SDI-12 program
Wiring for this example program is shown in
Table B-1: Wiring for SDI-12 example program
Wire color
Function
CR1000X connection terminal
Black
Power ground
G
Red
Power
SW12-1
Green
SDI-12 signal
C1
Brown
Signal ground
⏚
(analog ground)
CRBasic Example 1: CR1000X SDI-12 program to measure the SDMS40
'**************************************************************************
'SDMS40 SDI-12 Sample Program (CR1000X)
'**************************************************************************
SequentialMode
'**************************************************************************
' Constants
'**************************************************************************
Const
SDMS40_Interval = 1
'in minutes
Const
SDI12_PORT1 = C1
' C1 is the Communications port used for connection to SDMS40
'**************************************************************************
' Diagnostic variables
'**************************************************************************
Public
PTemp, batt_volt
Units
PTemp = deg C
Units
batt_volt = volts
'**************************************************************************
' Sensor Variables
'**************************************************************************
Public
Snow_Depth_Avg
As Float
SDMS40 Multipoint Scanning Snowfall Sensor
24