![Campbell SDMS40 Скачать руководство пользователя страница 33](http://html1.mh-extra.com/html/campbell/sdms40/sdms40_product-manual_3916973033.webp)
CRBasic Example 1: CR1000X SDI-12 program to measure the SDMS40
NextScan
EndProg
B.2 RS-232 program
Wiring for this example program is shown in
Table B-2: Wiring for RS-232 example program
Wire color
Function
CR1000X connection terminal
Red
Power
SW12-1
Black
Power ground
G
Brown
Signal ground
⏚
(analog ground)
Blue
RS-232 Tx (output)
C1
Yellow
RS-232 Rx (input)
C2
CRBasic Example 2: CR1000X RS-232 program to measure the SDMS40
'**************************************************************************
'SDMS40 RS232 Sample Program (CR1000X)
'**************************************************************************
SequentialMode
'**************************************************************************
'User entered constants
'**************************************************************************
Const
SDMS40_Interval = 1
'measurement and data output interval (in minutes)
Const
SDMS40_COMport = ComC1
'Communications port used for connection to SDMS40
Const
SDMS40_baud_rate = 57600
'Diagnostic variables
'**************************************************************************
Public
PTemp, batt_volt
Unit
s PTemp = deg C
Units
batt_volt = volts
'**************************************************************************
'Variables for WeatherPia SDMS40 Scanning Laser Sensor
'**************************************************************************
Public
SDMS40_Measure_Now
As Boolean
'the user can set this to TRUE to request a measurement
SDMS40 Multipoint Scanning Snowfall Sensor
27