beautypg.com

Campbell Scientific CS410 Shaft Encoder User Manual

Page 7

background image

CS410 Shaft Encoder

'Define Data Tables
DataTable (Stage,1,-1)
DataInterval

(0,15,Min,10)

Sample

(1,Stage_lvl,FP2)

Sample

(1,offset,FP2)

Minimum

(1,batt_volt,FP2,0,False)

EndTable

'Main Program
BeginProg
FtPerCount = Pulley_circ/PulsesPerRev

Scan

(5,Sec,0,0)

Battery

(Batt_volt)

PulseCount

(Count(),2,1,0,0,1.0,0)

Stage_lvl = Stage_lvl + (Up * FtPerCount) - (Down * FtPerCount)
'If Stage_lvl does not equal the observed gage height, simply enter
'the actual value in the numeric display for "Enter_obs_gage_ht"

'calculate offset when gage height is observed and entered
'into

numeric

display

If enter_obs_gage_ht <> old_gage_ht then
offset = enter_obs_gage_ht - stage_lvl
Stage_lvl

=

Stage_lvl + offset

old_gage_ht

=

enter_obs_gage_ht

endif

'Call

Output

Tables

CallTable

Stage

NextScan
EndProg

After downloading the program to the datalogger, test the direction of the float
movement by raising the float above the water level and note the stage value.
If it decreases, the direction is incorrect. This can be corrected in two ways: 1)
reverse the float and counterweight on the pulley, or 2) reverse the green and
white wires going into the > pulse ports of the datalogger.

3