G.1.9, 50 hz measurement example — one cdm-vw305, eight, Appendix g. crbasic program library – Campbell Scientific CDM-VW300 Series Dynamic Vibrating-Wire Analyzer System User Manual

Page 106: G-14

Advertising
background image

Appendix G. CRBasic Program Library

G.1.9 50 Hz Measurement Example — One CDM-VW305, Eight

Channels, Rainflow Histogram

'===RFH-50HzExample8Ch_4-25-13.CR3===

'CR3000 datalogger

'CDM-VW305 vibrating-wire analyzer

'Program to read 50-Hz dynamic data from one CDM-VW305 analyzer measuring eight channels.

'Demonstrate use of rainflow histogram.

'IMPORTANT -- Ensure that the CPI address coded on the following line matches the address

'reported for the attached analyzer in the DevConfig or DVWTool software.

Const

CPI_ADDR

=

1

'<<<<<<<<<<<<<<SET CPI ADDRESS HERE

Public

Freq(8)

Public

Diag(8)

As Long

Public

StaticFreq(8)

Public

Therm(8)

Public

DynStdDev(8)

'Rainflow : Mean Bins and Amplitude Bins dimensions

Const

MBINS

=

10

Const

ABINS

=

10

'Rainflow-Histogram Outputs - 2 dimensional arrays

Public

RF1(MBINS,ABINS)

Public

RF2(MBINS,ABINS)

Public

RF3(MBINS,ABINS)

Public

RF4(MBINS,ABINS)

Public

RF5(MBINS,ABINS)

Public

RF6(MBINS,ABINS)

Public

RF7(MBINS,ABINS)

Public

RF8(MBINS,ABINS)

Dim

Enable(8)

As Long

=

{ 1, 1, 1, 1, 1, 1, 1, 1}

Dim

Max_AMP(8)

=

{ 0.002, 0.002, 0.002, 0.002, 0.002, 0.002, 0.002, 0.002}

Dim

F_Low(8)

=

{ 300, 300, 300, 300, 300, 300, 300, 300}

Dim

F_High(8)

=

{ 6000, 6000, 6000, 6000, 6000, 6000, 6000, 6000}

Dim

OutForm(8)

As Long

=

{ 0, 0, 0, 0, 0, 0, 0, 0}

Dim

Mult(8)

=

{ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0}

Dim

Off(8)

=

{ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0}

Dim

SteinA(8)

=

{ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0}

Dim

SteinB(8)

=

{ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0}

Dim

SteinC(8)

=

{ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0}

'Rainflow-Histogram configuration

Dim

RF_mean_bins(8)

As Long

=

{ MBINS, MBINS, MBINS, MBINS, MBINS, MBINS, MBINS, MBINS}

'Mean

Bins

Dim

RF_amp_bins(8)

As Long

=

{ ABINS, ABINS, ABINS, ABINS, ABINS, ABINS, ABINS, ABINS}

'Amplitude

'Bins

Dim

RF_Lo_lim(8)

=

{ 400.0, 400.0, 400.0, 400.0, 400.0, 400.0, 400.0, 400.0}

'Low

Limit

Dim

RF_Hi_lim(8)

=

{4000.0,4000.0,4000.0,4000.0,4000.0,4000.0,4000.0,4000.0}

'High

'

Limit

Dim

RF_Hyst(8)

=

{ 0.005, 0.005, 0.005, 0.005, 0.005, 0.005, 0.005, 0.005}

'Hysteresis

'Output format consists of three digits ABC, that can be either 1 or 0

Dim

RF_OutForm(8)

As Long

=

{ 110, 110, 110, 110, 110, 110, 110, 110}

'RF Histogram Digit Code Histogram output result

'----------------------- ------------------------

'A = 0 Reset histogram after each output.

'A = 1 Do not reset histogram.

'B = 0 Divide bins by total count.

'B = 1 Output total in each bin.

'C = 0 Open form. Include outside range values in end bins.
'C = 1 Closed form. Exclude values outside range.

CDM_VW300Config

(1,CPI_ADDR,0,Enable(),Max_AMP(),F_Low(),F_High(), _

OutForm(),Mult(),Off(), SteinA(),SteinB(),SteinC(), _

RF_mean_bins(),RF_amp_bins(),RF_Lo_lim(), _

RF_Hi_lim(),RF_Hyst(),RF_OutForm())

DataTable

(static,true,-1)

Sample

(8,StaticFreq(),IEEE4)

Sample

(8,Therm(),IEEE4)

Sample

(8,DynStdDev(),IEEE4)

EndTable

G-14

Advertising