4 sdmcvo4 instruction example, 4 sdm-cvo4 instruction example – Campbell Hausfeld 4-Channel Current/Voltage SDM-CVO4 User Manual

Page 27

Advertising
background image

Instruction Manual

be cycled on the device to return it to its default state. Otherwise,
if 0 or 1 is entered it will be ignored and the device will remain in
its last override state. Refer to Section 4.2.2 for connection
details.

6.4 SDM-CVO4 Instruction Example

This program example is for a weather station measuring wind speed, wind
direction, temperature, and relative humidity. Each parameter is scaled to 0 to
10000 mVDC, and output to a SCADA system through the SDM-CVO4.

Public WS_ms
Public WD_0_360
Public Temp_C
Public RH
Public WD_0_540
Public Flag
Public CVO4Output(4)
Alias CVO4Output(1) = WSOut
Alias CVO4Output(2) = WDOut
Alias CVO4Output(3) = TempOut
Alias CVO4Output(4) = RHOut

'Code for DataTable OneMin
DataTable(OneMin,1,-1)
DataInterval(0,1,Min,0)

WindVector (1, WS_ms,WD_0_360, IEEE4, 0, 0, 0, 0)

Average(1,Temp_C,IEEE4,0)
Sample(1,RH,

IEEE4)

EndTable

BeginProg
Scan(1,Sec,1,0)

' Code for 03001 wind measurements, WS_ms & WD_0_360:


PulseCount(WS_ms, 1, 1, 1, 1, 0.75, 0.2)

BrHalf(WD_0_360, 1,mV1000, 1, 1, 1, 1000, True, 1000, 250, 355, 0)

' Code for CS500 measurement, AirTC and RH:

VoltSE(Temp_C,1,mV1000,3,0,

0,

_60Hz,0.1,-40.0)

VoltSE(RH,1,mV1000,2,0, 0, _60Hz,0.1, 0)

' Call Data Table

CallTable(OneMin)

' Convert 0-360 WD to 0-540:

If WD_0_540 >= 270 and WD_0_360 <180 Then

WD_0_540 = WD_0_360 + 360

Else

WD_0_540

=

WD_0_360

21

Advertising