Programming Example; Cr1000X Program Example; Cr1000X Sdm-Ao4A Program Example - Campbell SDM-AO4A Product Manual

Four-channel analogue output module
Hide thumbs Also See for SDM-AO4A:
Table of Contents

Advertisement

7.2

Programming Example

7.2.1 CR1000X Program Example

CRBasic Exampe 7-1. CR1000X SDM-AO4A Program Example

'CR1000X SDM-AO4A Program Example

'Measure wind speed, wind direction, temperature, and humidity.
'Scale measurements to 0 to 1000 mV range and output to a strip chart recorder
'through the SDM-AO4A.
'Declare variables
'Example wind variables WS_ms and WD_0_360
Public
WS_ms
Public
WD_0_360
Public
WD_0_540
'Example temperature and relative humidity variables
Public
Temp_C
Public
RH
'Example SDM-AO4A variables
Public
AO4AOutput(4)
Public
AO4AResponse
Alias
AO4AOutput(1) = WSOut
Alias
AO4AOutput(2) = WDOut
Alias
AO4AOutput(3) = TempOut
Alias
AO4AOutput(4) = RHOut
'Wiring
'Data logger to SDM-AO4A
'G- G
Equation for CR800 series and CR1000:
bit_rate = INT((k × 72)/625) × Resolution
Where:
k = the value entered in BitPeriod
Resolution = 8.68 microseconds
Equation for CR6, CR3000, CR1000X:
bit_rate = INT((k × 144)/625) × Resolution
Where:
k = the value entered in BitPeriod
Resolution = 4.34 µsec
The following program example is given to help the user understand the
general principles involved in the use of the SDM-AO4A with Campell
Scientific data loggers.
This example program is for weather stations with a data logger measuring
wind speed, wind direction, temperature, and relative humidity. Each parameter
is then scaled to 0 to 1000 mVDC, and output to a strip chart recorder through
the SDM-AO4A.
Although this program is for a CR1000X data logger, programming for other
CRBasic data loggers is similar.
SDM-AO4A Four-Channel Analogue Output
9

Advertisement

Table of Contents
loading

Table of Contents