80
(DEPARTMENT OF DEFENCE IOSIO DEFENCE SCIENCE' TECHNOLOGY ORGANISATION A Replacement Database for the CH 47 D Spectrometric Oil Analysis Program Paul Marsden and Andrew Becker DSTO-TN-0412 DISTRIBUTION STATEMENT A Ap pr ov ed for Pub lic Release Distribu tio n Unl imi ted 20020708 1 1 6

A Replacement Database for the CH-47D Spectrometric Oil Analysis Program

Embed Size (px)

Citation preview

Page 1: A Replacement Database for the CH-47D Spectrometric Oil Analysis Program

8/4/2019 A Replacement Database for the CH-47D Spectrometric Oil Analysis Program

http://slidepdf.com/reader/full/a-replacement-database-for-the-ch-47d-spectrometric-oil-analysis-program 1/80

OF DEFENCE IOSIOSCIENCE' TECHNOLOGY ORGANISATION

A Replacement Database for theCH • 47D Spectrometric Oil

Analysis Program

Paul Marsden and Andrew Becker

DSTO-TN-0412

DISTRIBUTION STATEMENTAApproved forPublicRelease

Distribution Unlimited

20020708 116

Page 2: A Replacement Database for the CH-47D Spectrometric Oil Analysis Program

8/4/2019 A Replacement Database for the CH-47D Spectrometric Oil Analysis Program

http://slidepdf.com/reader/full/a-replacement-database-for-the-ch-47d-spectrometric-oil-analysis-program 2/80

A Replacement Database for the CH-47DSpectrometric Oil Analysis Program

Paul Marsden and Andrew Becker

Airframes and Engines Division

Aeronautical and Maritime Research Laboratory

DSTO-TN-0412

ABSTRACT

A Spectrometric Oil Analysis Program (SOAP) operateson selected Australian Defence

Force platforms to assist in the prediction of incipient machinery failure. Historically,

the data from the Australian Army CH-47D helicopters has been stored on a simple

Microsoft Excel spreadsheet . DSTO was tasked by the Army Aircraft Logistic

Management Squadron to assess the usefulnessof this database. This report contains a

detailed description of the replacementSOAP database designedby DSTO.

RELEASE LIMITATION

Approved for public release

rDEPARTM ENT 0 F DEFEN eE lOSlO.mlCE SCIENCE 1 TEUIOLon OIUIISATlON

Page 3: A Replacement Database for the CH-47D Spectrometric Oil Analysis Program

8/4/2019 A Replacement Database for the CH-47D Spectrometric Oil Analysis Program

http://slidepdf.com/reader/full/a-replacement-database-for-the-ch-47d-spectrometric-oil-analysis-program 3/80

Published by

DSTO Aeronautical and Maritime Research Laboratory

506 Lorimer StFishermans Bend, Victoria 3207 Australia

Telephone: (03) 9626 7000

Fax: (03) 9626 7999

© Commonwealth ofAustralia 2002

AR-012-161

March 2002

APPROVED FORPUBLICRELEASE

Page 4: A Replacement Database for the CH-47D Spectrometric Oil Analysis Program

8/4/2019 A Replacement Database for the CH-47D Spectrometric Oil Analysis Program

http://slidepdf.com/reader/full/a-replacement-database-for-the-ch-47d-spectrometric-oil-analysis-program 4/80

A Replacement Database for the CH-47D

Spectrometric Oil Analysis Program

Executive Summary

This report contains a detailed description of a replacement Spectrometric Oil Analysis

Program (SOAP) database that has been designed and developed by DSTO for use

with the AustralianArmy CH-47D helicopter fleet.

Spectrometric Oil Analysis(SOA)

is conductedon

gearbox, engineand

hydraulic oilsamples that are taken periodically from all aircraft in the CH-47D fleet. The trends

gained from the SOA can assist with the detection of incipient failure of mechanical

components (bearings, gears etc). As mechanical components wear they shed small

particles of metal that become entrained in the oil. As a wear related failure

progresses, the quantity of particulate entrained in the oil increases. SOA is used to

detect increasing trends for particular elements and hence assist in identifying the

component prior to catastrophic failure.

CH-47D SOA samples are analysed by a local contractor in Townsville. The Army

Aircraft Logistic Management Squadron (AALM SQN) and 'C ' Squadron maintainhardcopies of the reports producedby the contractor. Historically, the AALM SQN

also used a simple Microsoft Excel spreadsheet to collate and record all SOAP data inan attempt to identify trends. The format of this spreadsheetwas not user-friendly and

was found to contain significant structural flaws.

After assessing the condition of the old database,it was decided that a completely new

database was required. Microsoft Excel was retained as the underlying program,

however, a Visual Basic interface was created that made entering and viewing data

easier for untrained operators. Another advantagewas that no new software licenses

needed to be purchasedor maintained since Excelwas an existing part of the computer

network at AALM SQN. The DSTO-designed database has been commissioned at the

AALMSQN.

Page 5: A Replacement Database for the CH-47D Spectrometric Oil Analysis Program

8/4/2019 A Replacement Database for the CH-47D Spectrometric Oil Analysis Program

http://slidepdf.com/reader/full/a-replacement-database-for-the-ch-47d-spectrometric-oil-analysis-program 5/80

Contents

1. INTRODUCTION 1

2. BACKGROUND 1

2.1SpectrometricOil Analysis (SOA) 12.2 The Original SOAP Database 1

2.3 DSTO-Designed SOAP Database 2

2.3.1 Introduction Screen 2

2.3.2 Data InputScreens 3

2.3.3 View Trends Screen 4

2.3.4 Change Component Screen 52.3.5 Help Screen 6

2.4 Database Structure 6

2.5 Other Applications 7

3. CONCLUSION 7

APPENDIX A: VISUAL BASICUSER-INTERFACE PROGRAM DESCRIPTION. 9

A.1. Main form: fmAircraft 9A.2. System choice form (Enter Data): fmChooseTX 12A.3. Enter transmission SOAP data form: fmSoapData 17A.4. Enter hydraulics SOAP data form: fmHydraulics 23

A.5. View trends form: fmTrends 29

A.6. View not-fitted component form: fmNotFitted 55

A.7. Change transmission component form: fmTransmission 61

A.B. Set alarm levels form: fmLevels 69

A.9. Help form: fmHelp 72

Page 6: A Replacement Database for the CH-47D Spectrometric Oil Analysis Program

8/4/2019 A Replacement Database for the CH-47D Spectrometric Oil Analysis Program

http://slidepdf.com/reader/full/a-replacement-database-for-the-ch-47d-spectrometric-oil-analysis-program 6/80

DSTO-TN-0412

1. Introduction

DSTO was tasked by the Army Aircraft Logistic Management Squadron (AALM SQN)to assess the usefulness of an existing Spectrometric Oil Analysis Program (SOAP)

database. The database is used to store and trend SOAP data pertaining to CH-47D

helicopters. Upon initial examination, the existing database was found to contain some

significant structural flaws and did not have a user-friendly interface. A new database

written in Microsoft Excel, and encompassing a Visual Basic user-interface, was

produced for the AALM SQN. This report describes the functionality of the DSTO

designed SOAP database as well as the Visual Basic user-interface program.

2. Background

2.1 Spectrometric Oil Analysis (SOA)

Spectrometric Oil Analysis (SOA) is an analytical technique for identifying the

elemental composition of particles (up to approximately 8 micron) entrained in

machinery oil samples. As mechanical components wear they shed small metallic

particles that become entrained in the oil. As a wear related failure initiates and then

progresses, the quantity of particular elements increases and this can be observed in

the SOA trends. Knowledge of the constituent metals in a particular system is then

used to determine the likely origin of the wear particles. Original Equipment

Manufacturers (OEMs) of aircraft usually set quantity and rate-of-increase limits for

each element.

SOA is conducted on gearbox oil (5 samples/aircraft), engine oil (2 samples/aircraft)

and hydraulic oil (3 samples/aircraft) samples that are taken every 25 airframe hours

from all aircraft in the Australian Army CH-47D fleet. The 100 ml samples are sent to a

local contractor where spectrometric oil analysis is conducted. Hardcopies of the

contractor reports are kept by 'e ' Squadron and the AALM SQN. In addition to

hardcopies, AALM SQN personnel mainta in an electronic SOAP database. This

database was intended to enable fleet wide trends to be observed and comparison

within the fleet to be made.

2.2 The Original SOAPDatabase

The original SOAP database was an Excel spreadsheet with a limited plotting

capability. Unfortunately the database had been set up to trend results based on

airframe tail number. For a SOAP to be meaningful the major assemblies (gearboxes,

engines etc) should be individually trended. This is possible since all major assemblies

have an individual serial number. Trending by serial number enables incipient faults

within a particular assembly to be correctly identified. Trending based on tail number

can lead to inaccurate diagnosis or confusion since the major assemblies are

periodically replaced.

1

Page 7: A Replacement Database for the CH-47D Spectrometric Oil Analysis Program

8/4/2019 A Replacement Database for the CH-47D Spectrometric Oil Analysis Program

http://slidepdf.com/reader/full/a-replacement-database-for-the-ch-47d-spectrometric-oil-analysis-program 7/80

DSTO-TN-0412

2.3 DSTO-Designed SOAP Database

After assessing the condition of the existing SOAP database, it was decided to create anew and improved database. It was also decided to use the existing AALM SQN

network version of Microsoft Excel as the database foundation since this would avoid

the need to purchase new software. It was also felt that personnelwould be more likely

to feel comfortable using the database i f it was a familiar program.

An important element of the new database was the inclusion of a Visual Basic user

interface. A detailed description of the Visual Basic program is contained in Appendix

A. The interface greatly simplifies the input of new data, the viewing of trends and the

manipulation of data as assemblies are fitted to or removed from various aircraft.

The trend plotting function was significantly enhanced in the new database by the

amalgamation of oil top-up quantit ies and SOA data on a single trend plot. This

enables easy correlation between trend fluctuations and oil top-up quantities.

2.3.1 Introduction Screen

Figure 1 shows the first screen that appears when the database is opened. The five

large buttons on the right enable the user to:

1. Enter SOAP data for the aircraft tail number currently selected.

2. ViewSOA trends for aircraft transmissions and hydraulic systems.

3. Add a new transmission serial number to the database.

4. Remove and replace transmission components in aircraft.

5. Set MARGINAL and ABNORMAL alarm limits for each transmission type.

CH47 SOAP Database EJ

2

Aircraft Tail Number:

IA15-102 3

'. . ~ ,~ ~ : ~ 1 J ~ . a ~ ~ , ~ · .._.-.-- ._.-, " , .- . _ ~ " _ . " - - - - - _ . _ - - - - - -

Figure 1. Introduction screen

Enter Data

View Trends

Set Alarm Levels

Page 8: A Replacement Database for the CH-47D Spectrometric Oil Analysis Program

8/4/2019 A Replacement Database for the CH-47D Spectrometric Oil Analysis Program

http://slidepdf.com/reader/full/a-replacement-database-for-the-ch-47d-spectrometric-oil-analysis-program 8/80

DSTO-TN-0412

2.3.2 Data Input Screens

There are separate data entry screens for each of the five transmissions (gearboxes),

both engines and each of the three hydraulic systems per aircraft. Figure 2 shows a

typical data entry screen for a gearbox. The hydraulic systems have measurements for

water and viscosity in addition to the SOA elements that are listed down the right side

of the screen.

In both cases the SOAP data will be trended by hours: component hours for

transmissions, and aircraft hours for the hydraulic systems. The database will therefore

not accept an entry unless the Equipment Hours field has been filled in.

Transminion SOAP Data ," ; ~ ~ : ; ; ~ " \ t , , ' ' >

Parent Equipment SIN 1 A15-102!

Equipment Hours I.

~ - 2 JCancel I

OK I

;1'-NOTE: r::.Jj

, Check that thetransrflission SiN

is current.

FWD TXMN

Transmission SIN IA7690Sample Number I

Sample Date 1-----

Oil Added Ic O d e l - - - - ~

Fe

CuI

I

Mg II

I

Cr III

AII

IAg

I

SniII

I

Ni II

Qts, TiiII

I

SII

___._ .._.__.____JFigure 2. Typical data entry screen for a gearbox

/,\.i l lI t is ESSENTIAL tha t the correct transmission serial number is selected

for each aircraf t. Installed component serial numbers can be altered via

the Change Component form (Section 2.3.4).

3

Page 9: A Replacement Database for the CH-47D Spectrometric Oil Analysis Program

8/4/2019 A Replacement Database for the CH-47D Spectrometric Oil Analysis Program

http://slidepdf.com/reader/full/a-replacement-database-for-the-ch-47d-spectrometric-oil-analysis-program 9/80

DSTO-TN-0412

2.3.3 View TrendsScreen

From the View Trends screen (Figure 3) the SOA trends for any installed transmissioncomponent or hydraulic system may be selected. The trends may be shown on a single

plot showing the results for one element in a particular component. By selecting Al l

Aircraft from the Aircraft Tail Number list, the results for one SOA element in all the

currently installed transmission components of one type may be viewed

simultaneously.

SOA trends for transmission components that are not currently fitted to any aircraft

may be viewed by selecting the View Not-Fitted Component button. Once this button

has been pushed, the specific component can be selected from a list of all components

not currently fitted to aircraft.

View Trends EJ

Aircraft Tail Number:

IA15-102 JSOA Element:

I Iron (Fe) J

View Not-Fitted

Component

Figure 3. View Trends screen

Transmissions IHydraulics I

FWDTXMN

AFTTXMN

COMB TXMN

ENGTXMN #1

ENGTXMN #2

ENG #1

ENG #2

Serial Number:

A7690MG

A9685MG

A8736

All1587

All1493

LE19788K

LE19781K

Figure 4 shows an example of a SOA trend plot for a single component; in this case it

shows the trend for iron in the forward gearbox. The thin vertical bars indicate the

amount of top-up oil tha t has been added and are measured against the right hand

vertical scale. The two thick dashed lines indicate the quant ity alarm levels for the

chosen element in this transmission. The lower line is the MARGINAL level and the

upper line is the ABNORMAL level. The two buttons on the right hand side of the plot

take the user back to the View Trends screen or to a print preview screen.

If the All Aircraft option has been selected a separate trend plot will be produced for the

selected component from each aircraft. Each of these trend plots will have the same

form as that shown below and will be displayed on a single page.

4

Page 10: A Replacement Database for the CH-47D Spectrometric Oil Analysis Program

8/4/2019 A Replacement Database for the CH-47D Spectrometric Oil Analysis Program

http://slidepdf.com/reader/full/a-replacement-database-for-the-ch-47d-spectrometric-oil-analysis-program 10/80

DSTO-TN-0412

Fe SOA Trend'" A15·106 Fwd. Txmn.... SIN: A7687MGBack

45 . , . .----------------------r 30.0 Print

25.0----------------------------

10 - - - - - - - -

15 - - - - - - - - - - - - - - - - -

..,.

us20.0 G-"5.0

10.0 _

o-------/--- -L : 5.0

--;*' -------

. . . 30

25A.

;; 20

IL

oo<.D

oo

:!

ooN

ooo

ooo::l

oo<.D

oo'<;1'

ooN

o 4 - - . . L . . t , . . . . . ~ ~ L W . u . J ~ ~ ~ ~ ~ 1 . J . . . . . . . . L . . _ l . . u . - J 4 _ L - _ 1 _ 0.0o

Equipment Hours

Figure 4. Example of a SOA trend plot

2.3.4 Change Component Screen

Any SOAP data that is entered for a particular aircraf t tail number is s tored with the

component serial numbers that are currently assigned to that aircraft. In the event that

a transmiss ion is removed from an aircraft or is replaced, the database must be

updated to reflect this change using the Component Change screen (Figure 5).

Transmission Select EJ

Serial Number

Fwd TXMN IA7690MG 3Aft TXMN l'A9685MG j

Combining TXMN IA8736 jEngine No, 1 TXMN IA111587 3Engine No.2 TXMN IA111493 3

Engine No, 11LE19788K 3Engine No. 21 LE19781K J

Cancel

Change

Aircraft Tail Number

IA15-102

Date

I!

I

I

I_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _- - - - - ._--- - - -- - - - - - - - - - - - -- - - - - - - - - - - -_---- .1

Figure 5. Change Component screen

5

Page 11: A Replacement Database for the CH-47D Spectrometric Oil Analysis Program

8/4/2019 A Replacement Database for the CH-47D Spectrometric Oil Analysis Program

http://slidepdf.com/reader/full/a-replacement-database-for-the-ch-47d-spectrometric-oil-analysis-program 11/80

DSTO-TN-0412

The Change Component screen displays a list of available components for each of the

seven locations on the aircraft. The component number initially shown on the list is theone currently attributed to that aircraft by the database. The dropdown menus then list

replacement options from those components that are currently not fitted to any aircraft.

If the component has not yet been replaced there is also a Removed option. This

indicates that the aircraft does no t currently have a component fitted in that location. In

either case, the component that was initially fitted in that position then becomes Not

Fitted. Trends for such components may be accessed via the View Not-Fitted

Component option on the View Trends screen (Section 2.3.3).

2.3.5 Help Screen

The Help screen (Figure 6) was included so that problems or questions about the

database could be directed to DSTO for resolution.

H a

D [P ,f; H'I MEN TO r DE F E ~ eEl0STOOfFENCE SClftlCf & H C H ~ O L O G \ ' O R G ~ ' I I S n i O N ,

CH47 SOAP Database

Designed by: Paul Marsden DSTO-AMRL

Version 1.0 - q (November 2001 )

I f you have any comments or questions about this database, please

contact the Machine Dynamics Group, Aeronautical and Maritime

Research Laboratory:

Paul Marsden: Email: [email protected]

~ ~ ~ : ~ ~ ; ~ ~ ~ ~ ~ ; ~ ~ ; I""":·::=:::::::::=O=K=.··=··.·.=·.••=·J\

Figure 6. Help screen

2.4 Database Structure

Each component is allocated a separate worksheet in the Excel file (named by serial

number) where the data for that particular component is stored. An example of a data

sheet is shown in figure 7. During the normal operation of the database these sheets

will remain hidden from the operator.

A master list of all component serial numbers and their type is kept on a sheet named

Transmissions. A separate sheet called Aircraft contains the serial numbers of thetransmissions that are currently fitted to each aircraft. A transmission that appears in

the master list, bu t is not currently associated with any particular aircraft is considered

to be Not-Fitted. The Transmissions and Aircraft sheets are also hidden from the

operator during normal operation of the database.

6

Page 12: A Replacement Database for the CH-47D Spectrometric Oil Analysis Program

8/4/2019 A Replacement Database for the CH-47D Spectrometric Oil Analysis Program

http://slidepdf.com/reader/full/a-replacement-database-for-the-ch-47d-spectrometric-oil-analysis-program 12/80

DSTO-TN-0412

IX. _ii.'Si"fiu.!#JIMf _lsI xl

Si Code

0.2 R

0.07 R0.D1 R0.07 R0.09 R0.06 R

0.D3 R0.02 R

CrAl SnNiTI

0.21 0.49 0.6 0.11 0.07 0.020.08 0.55 0.6 0.27 0.11 0.02

0.06 0.7 0.54 0.29 0.13 0.01

0.04 0.87 0.35 0.3 0.13 0.02

0.29 0.47 0.39 0.28 0.09 0.01

0.21 0.85 0.53 0.31 0.15 0.D1

0.34 1.1 0.5 0.28 0.14 0.03

0.42 1 11 0.48 0.38 0.15 0.D3

M3.37

3.37

3.6

3.864.02

4.024.684.81

Fe Cu

7 ] 0.28

8.38 0.41

9.14 0.42

9.9 0.291.5 9.82 0.37

1 11.62 0.56

11.62 0 .3812.58 0 .39

Sample 011

D.te Added27111.00 Nil

11102.1Jl Nil

14.1J3.1Jl NIL

02.1J4.1Jl Nil

D2.1J5.1Jl

16.1J5.1Jl

09.1J6.1Jl Nil

27.1J6.1Jl Nil

SampleNumber

15

16

17

18

19

20

21

22

EquipmentHours

335.9

360

363.4410

434.5457.5

484.8

506.9

ji[} Ele ,4> [ns.rt F!lfIMt roofs 11". !OJndow !j.1p ... . . . . . . .. .:.l.ECI.1SJ'

19 ~ _ I I I - ~ . j ~ ~ J - ; - ~ _ ~ ~ T 0 ~ 0 ~ = : J . ~ i f ~ I G E n - ; ~ - - ' : l?) ~ : L ~ _ t ~ Y - i ~ : ; - . : ! . ~ T ~ ~ ! - ~ ~ ~ : : ~ [ ~ - 2 : . ~ ~ ~ ]j Arlal ;"" 10 : ' ,100% : ,, ': B .r 11 ! iF =!! m! $ % J ~ 0 ; ~ 'f;F:! ... .. 4. i, - A45 . .. -;,-..-- •. ,..... - .. -.--,.-- . .- - - . - - . -..-.- ..---.-.--....., . - . -.. ~ - - - - . - - - . _ - _ j

... ABC D . [. J '_ G H i IJ.ii<. L ~ ' M ' . NLQ P .1.:1g' i" ;Component Serial No A7562' .- . -- .- - ... I ..

.1:.'Component Model FWD TXMN

EP .l.'

P' 4 Parent E ui men. SIN

r;;; 21 iA15·104

-J .:1ijAl5-104

r . ~ J ~ ~ ~ : ~ ~ :2 5 ~ A l 5 - 1 0 4.:16'A15-104

... 27 :A15·104r- -:i8'iA15.104

.! l j [ :

Figure 7. Example of a data sheet for a component

This structure enables the SOAP trends for a component to be followed, even in the

event tha t i t is removed from one aircraft and fitted to another. Since each installed

component is associated with a particular aircraft, all of the components on an aircraftare accessible for both data entry and trend viewing.

2.5 Other Applications

The DSTO-designed SOAP database can be readily applied to other aircraft types as

requi red. The basic s tructure of the database can also be appl ied to o ther condi tion

monitoring functions. An example of this is the application of the core database to oil

condition monitoring for the Royal Australian Air Force TF30 engines. The database

has been modified so that oil chemical parameters can be easily input and trends

viewed. It is intended that this version reside on a web page server and hence will

allow the laboratory chemist to input the data whilst simultaneously allowing

squadron and support personnel (located interstate) to view the data.

3. Conclusion

This report has described a DSTO-designed SOAP database intended for use by (butnot limited to) the Australian Army CH-47D helicopter fleet. This database is being

used by the AALM SQN and has replaced an original database that contained some

structural flaws. The improved functionality of the new database has been describedand the user-interface program has been documented in detail (Appendix A) for future

reference.

7

Page 13: A Replacement Database for the CH-47D Spectrometric Oil Analysis Program

8/4/2019 A Replacement Database for the CH-47D Spectrometric Oil Analysis Program

http://slidepdf.com/reader/full/a-replacement-database-for-the-ch-47d-spectrometric-oil-analysis-program 13/80

DSTO-TN-0412

8

Page 14: A Replacement Database for the CH-47D Spectrometric Oil Analysis Program

8/4/2019 A Replacement Database for the CH-47D Spectrometric Oil Analysis Program

http://slidepdf.com/reader/full/a-replacement-database-for-the-ch-47d-spectrometric-oil-analysis-program 14/80

DSTO-TN..Q412

Appendix A: Visual Basic User-Interface Program

Description

A.t. Main form: fmAircraft

11 -+ - 2

r -+ -5

t - + - 6

7

8

Private Sub UserForm_QueryClose _(cancel As Integer , CloseMode As Integer)Prevents use of th e Close button

I f CloseMode = vbFormControlMenu Then

cancel TrueEnd If

End Sub

NOTES:

Disables the close button (1) in the top right corner of the form

Private Sub change_component_Click()

Application.ScreenUpdating = FalsefmAircraft.Hide

Load fmTransmission

fmTransmission.lnit ial izefmTransmission.Show

End Sub

NOTES:

Called ,,,,hen Change Component button (5) is pressed. Displays the form

fmTransmission - used to change transnussions into and out of aircraft.

9

Page 15: A Replacement Database for the CH-47D Spectrometric Oil Analysis Program

8/4/2019 A Replacement Database for the CH-47D Spectrometric Oil Analysis Program

http://slidepdf.com/reader/full/a-replacement-database-for-the-ch-47d-spectrometric-oil-analysis-program 15/80

DST0-TN-0412

Private Sub Levels_Click()

fmAircraft.Hide

Load fmLevels

fmLevels. lnit ial izefmLevels.Show

End Sub

NOTES:

Called when Set Alarm Levels button (6) is pressed. Displays the form fmLcvels

which is used to set the I\1ARGINAL and ABNORtdAL alarm levels.

Private Sub enter_data_Click()

Dim AC_row As Integer

fmAircraft.Hide

AC_row=tai l_no.List lndex

+2

'AC data s tar ts at row2fmChooseTX.tail_no.ControlSource = "Aircraft!A" & AC row

Load fmChooseTXfmChooseTX.Show

End Sub

NOTES:

Called when the Enter Data button (2) is pressed. Displays the form fmChooseTX

and loads the selected aircraft tail number from tlw lisl-box (9).

Private Sub EXIT_Button_Click()

Unload fmAircraftActiveWorkbook.Close

End Sub

NOTES:

Called when the Exit button (8) is pressed. Closes the V\'orkbook - if changes have

been made the option will be given to save before exit.

Sub Ini t ia l ize ()

Application.ScreenUpdating

Sheets ("Aircraft") .VisibleFalseTrue

, P op ula te th e a i r c r a f t tail numbe:>-' list bo:,

, from th e list of a l l a i r c r a f t tail numbers .

Sheets ("Aircraf t") .Act ivate

ActiveSheet .Range ("A2") .Select

While (ActiveCell.Value <> " " )

ta i l_no.Addltem ActiveCell .Value

ActiveCell .Offset(l , 0) .Select

W ~ n dt a i l no.List lndex = 1

10

Page 16: A Replacement Database for the CH-47D Spectrometric Oil Analysis Program

8/4/2019 A Replacement Database for the CH-47D Spectrometric Oil Analysis Program

http://slidepdf.com/reader/full/a-replacement-database-for-the-ch-47d-spectrometric-oil-analysis-program 16/80

Sheets ("Aircraft") .VisibleApplication.ScreenUpdating

End Sub

False

True

DSTO-TN-0412

NOTES:Initialises data displayed on the form fmAircraft.

Private Sub help_button_Click()

Load fmHelpfmHelp.Show

End Sub

NOTES:

Called when the Help button (7) is pressed. Displays the form fmHelp.

Private Sub view_trends_Click()

fmAircraft.Hide

Load fmTrendsfmTrends.lnitializefmTrends.Show

End Sub

NOTES:

Called when the View Trends button (3) is pressed. Displays the form fmTrends.

Private Sub new_component_Click()

fmAircraft.Hide

Load fmNewComponentfmNewComponent.lnitialize

fmNewComponent.Show

End Sub

NOTES:

Called when the New Component button (5) is pressed. Displays the form fmTrends.

11

Page 17: A Replacement Database for the CH-47D Spectrometric Oil Analysis Program

8/4/2019 A Replacement Database for the CH-47D Spectrometric Oil Analysis Program

http://slidepdf.com/reader/full/a-replacement-database-for-the-ch-47d-spectrometric-oil-analysis-program 17/80

DSTD-TN-0412

A.2. System choice form (Enter Data): fmChooseTX

91011

12 --fI-"

13

Pr iva te Sub UserForm_QueryClose _

(cancel As In tege r , CloseMode As In teger )

I f CloseMode = vbFormControlMenu Then

cancel = True

End I f

End Sub

NOTES:

Disables the close button (1) in the top right corn!.:.'r of the form

Pr iva te Sub af t_txmn_Cl ick()

fmChooseTX.Hide

Cal l SOAP_data ("AFT TXMN" I "C")

End Sub

NOTES:

Called ,,,'hen AFT TXMN button (3) is pressed. Calls the SOAP_data function to

initialise and display the data enh'y form for the selected aft transmissinn.

Pr iva te Sub comb_txmn_Click()

fmChooseTX.Hide

Ca l l SOAP_data ("COMB TXMN" I "0")End Sub

NOTES:

Called when COMB TXMN button (4) is pressed. Calls the SOAP_data function to

initialise and display the data entry form for the selected combining transmission.

12

1

2

3

45

6

7

B

Page 18: A Replacement Database for the CH-47D Spectrometric Oil Analysis Program

8/4/2019 A Replacement Database for the CH-47D Spectrometric Oil Analysis Program

http://slidepdf.com/reader/full/a-replacement-database-for-the-ch-47d-spectrometric-oil-analysis-program 18/80

DSTD-TN-D412

Private Sub eng_txmnl_Click()

fmChooseTX.Hide

Call SOAP_data("ENG TXMN I" , "E")

End Sub

NOTES:

Called when ENG TXMN #1 button (5) is pressed. Calls the SOAP_data function to

initialise and display the data enh'y form for the selected engine h'ansmission.

Private Sub eng_txmn2_Click()

fmChooseTX.Hide

Call SOAP_data ("ENG TXMN 2", "F")

End Sub

NOTES:

Called when ENG TXMN #2 button (6) is pressed. Calls the SOAP_data function to

initialise and display the data entry form for the selected engine transmission.

Private Sub engl_Click()

fmChooseTX.HideCall SOAP_data ("ENG I" , "G")

End Sub

NOTES:

Called when ENG #1 button (7) is pressed. Calls the SOAP_data function to initialise

and display the data enh-y form for the selected engine,

Private Sub eng2_Click()

fmChooseTX.HideCall SOAP_data ("ENG 2", "H")

End Sub

NOTES:

Called when ENG #2 button (14) is pressed. Calls the SOAP_data function to

initialise and display the data entry form for the selected engine.

Private Sub fwd_txmn_Click()

fmChooseTX.HideCall SOAP_data ("FWD TXMN", "B")

End Sub

NOTES:

Called ,·\Then FWD TXMN button (2) is pressed. Calls the SOAP_data function to

initialise and display the data entry form for the selected forward transmission.

13

Page 19: A Replacement Database for the CH-47D Spectrometric Oil Analysis Program

8/4/2019 A Replacement Database for the CH-47D Spectrometric Oil Analysis Program

http://slidepdf.com/reader/full/a-replacement-database-for-the-ch-47d-spectrometric-oil-analysis-program 19/80

DSTO-TN-D412

Private Sub HYD_data(caption As String, HYD col As String)Dim HYD_row As Integer

App li ca ti on .Scr ee nUpdati ng Fal seLoad fmHydraulics

fmHydraulics.tail_no.Value fmAircraf t . tai l no . Value

fmHydraulics.HYD_lable.caption = caption

Sheets (fmAircraft .tai l_no.Value) .Visible True

Sheets (fmAircraf t. ta il_no.Value) .Act ivate

HYD_row = 5 ' Hydraulics data s tar ts on r o 5ActiveSheet.Range(HYD_col & HYD_row) .SelectWhile (ActiveCell.Value <> 1111)

HYD_row = HYD_row + 1ActiveCell .Offset( l , 0) .Select

Wend

f m H y d r a u ~ i c s . S e t C o n t r o l s

Call fmHydraulics.Initialize(HYD_row, HYD_col)

Sheets (fmAircraft .tai l_no.Value) .Visible = False

Application.ScreenUpdating = True

fmHydraulics.Show

End Sub

NOTES:

Initialises the data entry page for hydraulic systems. Is passed a str ing descrihing the

system (for display) and the column in which the datcl for that system is stored.

Private Sub nOl_hyd_sys_Click()

fmChooseTX.HideCall HYD_data(IINo. 1 HYD. SYS.", "A")

End Sub

NOTES:

Called 'when #1 HYD SYS button (11) is pressed. Calls the HYD__data function to

initialise and display the data enb"y form for the selected hniraulic system.

Private Sub n02_hyd_sys_Click()

fmChooseTX.HideCall HYD_data ("No. 2 HYD. SYS. ", "R")

End Sub

NOTES:Called when #2 HYD SYS button (10) is pressed. Calle: the I - I Y D ~ d a t a function to

initialise and display the data entry form for the selected hydraulk system.

14

Page 20: A Replacement Database for the CH-47D Spectrometric Oil Analysis Program

8/4/2019 A Replacement Database for the CH-47D Spectrometric Oil Analysis Program

http://slidepdf.com/reader/full/a-replacement-database-for-the-ch-47d-spectrometric-oil-analysis-program 20/80

D510-TN-0412

Private Sub utility_hyd_Click(}

fmChooseTX.Hide

Call HYD_data ("UTILITY HYD. ", "AI")

End Sub

NOTES:

Called when UTILITYHYD button (9) is pressed. Calls the HYD_data function to

initialise and display the data entry form for the selected hydraulic system.

Private Sub SOAP_data(caption As String, TX_co l As String}Dim AC_row As IntegerDim SOAP_row As Integer

Dim TXMN As StringDim response As String

Application.ScreenUpdating False

I AC data s t a r t s at row 2AC_row = fmAircraf t . ta i l_no.Lis t Index + 2Load fmSoapData

Sheets ("Aircraft") .Visible = True

I Ge t transmission type and se r i a l numberfmSoapData.TX_lable.caption = captionfmSoapData. transmission. ControlSource - ...

..."Aircraft!" & TX_col & AC_rowSheets ("Aircraf t") .Act ivateRange(TX_col & AC_row} .SelectTXMN = ActiveCell .Value

If (TXMN <> "REMOVED") ThenSOAP row = 5 'SOAP Data s ta r t s on row 5Sheets (TXMN) .Visible = True

Sheets (TXMN) .ActivateActiveSheet.Range("A" & SOAP_row} .Select

I Find l a s t empty rowan data-sheet .While (ActiveCell.Value <> " " )

SOAP_row = SOAP_row + 1ActiveCell .Offset(l , O} .Se lec t

Wend

fmSoapData.tail_no.ControISource = "A" & SOAP_rowSheets ("Aircraf t") .Act ivateActiveSheet.Range("A" & AC_row} .SelectfmSoapData.tail_no.Value = ActiveCell.Value

Sheets (TXMN) .Visible = False

Call fmSoapData.Initialize(SOAP_row, TXMN}

Sheets ("Aircraft") .Visible = False

fmSoapData.SetControls

fmSoapData.Show

15

Page 21: A Replacement Database for the CH-47D Spectrometric Oil Analysis Program

8/4/2019 A Replacement Database for the CH-47D Spectrometric Oil Analysis Program

http://slidepdf.com/reader/full/a-replacement-database-for-the-ch-47d-spectrometric-oil-analysis-program 21/80

DSTO-TN-Q412

Else

response = MsgBox ("This

... vbOKOnlyfmChooseTX.Show

EndI f

Sheets ("Aircraft") .Visible

Application.ScreenUpdating

End Sub

t ransmission has been removed.", ...

+ vbExclamation + vbApplicationModal)

FalseTrue

NOTES:

Initialises the data entry page for transmissions. Is passed a string descrihing the

b"ansmission (for display) and the column in which the data for that system is stored.

Private Sub back_Click()

Unload fmChooseTX

fmAircraft.Show

End Sub

NOTES:

Called when Back button (13) is pressed. Returns to the main form, fmAircrafL

16

Page 22: A Replacement Database for the CH-47D Spectrometric Oil Analysis Program

8/4/2019 A Replacement Database for the CH-47D Spectrometric Oil Analysis Program

http://slidepdf.com/reader/full/a-replacement-database-for-the-ch-47d-spectrometric-oil-analysis-program 22/80

A.3. Enter transmission SOAP data form: fmSoapData

DSTO-TN..()412

3

4

5

6

78

9

10

12 13

Dim SOAP_row As In tege r

Dim MIN_row As In tege r

Dim MAX_row As In tege rDim the_sheet As St r ing

NOTES:

Variables local to the form fmSoapData

Private Sub UserForm_QueryClose _

(cancel As In tege r , CloseMode As Integer )

P re ve nts u se of the Close but ton

I f CloseMode = vbFormControlMenu Then

cance l True

End IfEnd Sub

NOTES:

Disables the close button (1) in the top r ight corner of the form

17

Page 23: A Replacement Database for the CH-47D Spectrometric Oil Analysis Program

8/4/2019 A Replacement Database for the CH-47D Spectrometric Oil Analysis Program

http://slidepdf.com/reader/full/a-replacement-database-for-the-ch-47d-spectrometric-oil-analysis-program 23/80

DSTD-TN-0412

Sub SetControls()

Application.ScreenUpdating = False

Sheets (the_sheet) .Visible = TrueSheets ( the_sheet) .Activate

Range("D" & SOAP_row).Select

ActiveCell.NumberFormat = "@"

fmSoapData.tail_no.ControlSource = "A" & SOAP row

fmSoapData.hours.ControlSource = "B" & SOAP row

fmSoapData.sample_no.ControlSource = "C" & SOAP rowfmSoapData.sample_date.ControlSource = "D" & SOAP rowfmSoapData.oil_added.ControlSource = "E" & SOAP row

fmSoapData.Fe.ControlSource

fmSoapData. Cu. ControlSourcefmSoapData.Mg.ControlSource

fmSoapData. Cr . ControlSource

fmSoapData.Al.ControlSource

fmSoapData.Ag.ControlSource

fmSoapData.Sn.ControlSource

fmSoapData.Ni.ControlSourcefmSoapData.Ti.ControlSource

fmSoapData.Si.ControlSource

"F" & SOAP row

"G" & SOAP row"H" & SOAP row

"I" & SOAP row"J " & SOAP row

"K" & SOAP row

"L" & SOAP row

"M" & SOAP row"N" & SOAP row

"0" & SOAP row

fmSoapData.code.ControlSource = "P" & SOAP row

Sheets (the_sheet) .Visible = FalseEnd Sub

NOTES:This routine l inks the appropriate data in the worksheet to the textboxes displayed

on the form (2, 4, 7, 8, 12, 13). It is required when the scroll forward and scroll bad.

features are used.

Private Sub forward_Click(}

Application.ScreenUpdating = FalseSheets (the_sheet) .Visible = True

Sheets (the_sheet) .Activate

I f (SOAP_row < MAX_row) ThenSOAP_row SOAP row + 1

End I f

SetControls

ActiveSheet.Range("D" & SOAP_row) .Selectreformat_dates

18

Sheets (the_sheet) .Visible

End SubFalse

Page 24: A Replacement Database for the CH-47D Spectrometric Oil Analysis Program

8/4/2019 A Replacement Database for the CH-47D Spectrometric Oil Analysis Program

http://slidepdf.com/reader/full/a-replacement-database-for-the-ch-47d-spectrometric-oil-analysis-program 24/80

DST0-TN-0412

NOTES:

Called when the 1/>" button (9) is pressed. Displays the data from the next entry for

the current component in the database. The data displayed may be edited.

Sub reformat_dates{)Dim the_date As Date

Dim tmp_day As Str ing

Dim tmp_month As Str ing

Dim tmp_year As Str ing

Dim tmp_date As Str ing

I f ActiveCell .Value <> Empty Then

the_date = ActiveCell.Value

tmp_day = Day{the_date)

tmp_month = Month{the_date)

tmp_year = Year{the_date)

, Reformat to give day-month-year

Selec t Case tmp_monthCase "1"

tmp_month "Jan"

Case "2 "

tmp_month "Feb"

Case "3 "

tmp_month "Mar"

Case "4 "

tmp_month "Apr"

Case "5"

tmp_month "May"

Case "6"

tmp_month "Jun"

Case "7 "

tmp_month "Jul"

Case "8 "

tmp_month "Aug"Case "9 "

tmp_month "Sep"

Case "10"

tmp_month "Oct"

Case "11"

tmp_month "Nov"Case "12"

tmp_month "Dec"

End Se lec t

tmp_date = tmp_day & "/" & tmp_month & "/" & tmp_year

ActiveCell.NumberFormat = "@"

ActiveCell.FormulaR1C1 = tmp date

ActiveCell.NumberFormat "dd/mm/yy"

ActiveCell.NumberFormat = "@"End If

End Sub

19

Page 25: A Replacement Database for the CH-47D Spectrometric Oil Analysis Program

8/4/2019 A Replacement Database for the CH-47D Spectrometric Oil Analysis Program

http://slidepdf.com/reader/full/a-replacement-database-for-the-ch-47d-spectrometric-oil-analysis-program 25/80

DSTO-TN-0412

NOTES:

Used to reformat the date entered, forcing it to stay in the Australian format:

(day/month/year).

Sub In i t i a l ize {the_row As Integer, the_soap_sheet As String)Application.ScreenUpdating = False

the_sheet = the_soap_sheet

SOAP_row = the_row

MIN_row = 5 I Data s ta r t s at r o 5the sheet = t ransmission.Value

Sheets (the_sheet) .Visible = True

Sheets (the_sheet) .Activate

MAX row = MIN row- -ActiveSheet.Range{"A" & MIN_row) .SelectWhile (ActiveCell.Value <> " " )

MAX row = MAX row + 1

- -ActiveCell.Offset{l, 0) .SelectWend

Range ("A" & SOAP row) .SelectActiveCell.Value fmAircraf t . ta i l no . Value

SetControls

Sheets (the_sheet) .VisibleEnd Sub

False

NOTES:

Sets the form variables that descrihe ·which nw: is active and which component has

been selected. The sheet corresponding to the selected transmission serial n u m b ~ ' r is

made current.Determines where the

lastdata

entry for the selectedsystem

is locatl'd- nev,' data is entered on this rO\\' (SOAP_roVI·).

Private Sub Cancel_Click{)

Dim i As Integer

Application.ScreenUpdating = False

Sheets ( the_sheet) .Visible = True

Sheets ( the_sheet) .Activate

ActiveSheet.Range{"A" & MAX row & ":P" & MAX_row) .SelectSelection.Delete

For i = 5 To MAX row - 1

ActiveSheet.Range{"D" & i ) .Selectreformat_dates

Next i

Sheets (the_sheet) .Visible = False

Application.ScreenUpdating = True

Unload fmSoapData

20

Page 26: A Replacement Database for the CH-47D Spectrometric Oil Analysis Program

8/4/2019 A Replacement Database for the CH-47D Spectrometric Oil Analysis Program

http://slidepdf.com/reader/full/a-replacement-database-for-the-ch-47d-spectrometric-oil-analysis-program 26/80

DSTO-TN-0412

fmChooseTX.ShowEnd Sub

NOTES:

Called when the Gance/button (10) is pressed. Exits from the SOAP data entry pagewithout making a new entry and returns to the system selection page (fmChooseTX).

Any changes made to previous data are retained.

Private Sub OK_Button_Click{)

Dim hours_flag As Boolean

Dim response As Str ing

Application.ScreenUpdating False

hours_flag = True

Sheets (the_sheet) .Visible True

Sheets{the_sheet).Activate

I Component hours f rom co lumn BA c t i ~ e S h e e t . R a n g e { I I B I I & MAX_row) .Select

If ActiveCell .Value = Empty Then

SOAP_row = MAX_row

SetControls

response = MsgBox ( IIPlease ensure component hours are ...

... entered. II I vbOKOnly + vbExclamation +

... vbApplicationModal)

hours_flag FalseEnd I f

Sheets (the_sheet) .Visible = FalseApplication.ScreenUpdating = True

I f (hours_flag = True) Then

Unload fmSoapData

fmChooseTX.ShowEnd I f

End Sub

NOTES:

Caned when the OK button (11) is pressed. Exits from the SOAP data entry page and

returns to the system selection page fmChooseTXr A new entry is made in the

database and any changesmade to previous data are retained.

Private Sub back_Click{)

Application.ScreenUpdating

I f (SOAP_row > MIN_row) Then

SOAP_row SOAP_row - 1End I f

SetControls

False

21

Page 27: A Replacement Database for the CH-47D Spectrometric Oil Analysis Program

8/4/2019 A Replacement Database for the CH-47D Spectrometric Oil Analysis Program

http://slidepdf.com/reader/full/a-replacement-database-for-the-ch-47d-spectrometric-oil-analysis-program 27/80

DSTO-TN-Q412

Sheets (the_sheet) .Visible = True

Sheets ( the_sheet) .Activate

ActiveSheet.Range("D" & SOAP_row) .Select

reformat_dates

Sheets ( the_sheet) .Visible

End Sub

False

NOTES:

Called when the II<" button (9) is pressed. Displays the data from the previous entry

for the current component in the database. The data displayed may he edited.

22

Page 28: A Replacement Database for the CH-47D Spectrometric Oil Analysis Program

8/4/2019 A Replacement Database for the CH-47D Spectrometric Oil Analysis Program

http://slidepdf.com/reader/full/a-replacement-database-for-the-ch-47d-spectrometric-oil-analysis-program 28/80

A.4. Enter hydraulics SOAP data form: fmHydraulics

DSTO-TN-0412

3

4

5

6

7

8

9

10

11 12 13

Dim HYD_row As In tege r

Dim HYD_col As Str ing

Dim MIN_row As In tege r

Dim MAX_row As In tege r

Dim the_sheet As St r ing

NOTES:

Variables local to the form fmHydraulics

Private Sub UserForm_QueryClose _(Cancel As In tege r , CloseMode As Integer )

Prevents use of the Close but ton

I f CloseMode = vbFormControlMenu Then

Cancel True

End IfEnd Sub

@k', . / * ' / [ - ~ , ; , ~ y ~ " ~ , . - , , ' . ~

NOTES:

Disables the close button (l) in the top right comer of the form

23

Page 29: A Replacement Database for the CH-47D Spectrometric Oil Analysis Program

8/4/2019 A Replacement Database for the CH-47D Spectrometric Oil Analysis Program

http://slidepdf.com/reader/full/a-replacement-database-for-the-ch-47d-spectrometric-oil-analysis-program 29/80

nsrD-TN-D412

Private Sub back_Click()

Application.ScreenUpdating

I f (HYD_row > MIN_row) ThenHYD row HYD_row - 1

End I f

False

Sheets ( the_sheet) .Visible = True

Sheets ( the_sheet) .Activate

Range(HYD_col & HYD_row) .SelectSetControls

Range(HYD_col & HYD_row) .SelectActiveCell .Offset(O, 1) .Select

reformat_dates

Sheets ( the_sheet) .Visible False

'Application.ScreenUpdating = True

End Sub '

NOTES:

Called when the"<" button (8) is pressed. Displays the data from tlK prcvious entry

for the Cllrrent component in the database. The data displayed mol' be' l'ditl,J.

Private Sub Cancel_Click()Application.ScreenUpdating = FalseSheets ( the_sheet) .Visible = True

Sheets ( the_sheet) .Activate

ActiveSheet.Range(HYD_col & MAX_row) .SelectActiveSheet.Range(HYD_col & MAX_row & ":" &

... ActiveCell .Offset(O, 16) .Address) .SelectSelection.ClearContents

Sheets ( the_sheet) .Visible = False

Application.ScreenUpdating = True

Unload fmHydraulics

fmChooseTX.ShowEnd Sub

NOTES:

Called when the Cance/button (9) is pressed. Exits from the Hydraulics s\,s[e111 datc1

entrypage VI'ithout making a

new entryand returns to tIll' 51'stem selection page

(fmChooseTX). Any changes madc to prei'ious data mC' retained.

24

Page 30: A Replacement Database for the CH-47D Spectrometric Oil Analysis Program

8/4/2019 A Replacement Database for the CH-47D Spectrometric Oil Analysis Program

http://slidepdf.com/reader/full/a-replacement-database-for-the-ch-47d-spectrometric-oil-analysis-program 30/80

DSTD-TN-0412

Private Sub forward_Click()

Application.ScreenUpdating

I f (HYD_row < MAX_row) ThenHYD_row = HYD_row + 1

End If

False

Sheets(the_sheet).Visible = True

Sheets (the_sheet) .Activate

Range(HYD_col & HYD_row) .SelectSetControls

Range(HYD_col & HYD_row) .SelectActiveCell.Offset(O, 1) .Select

reformat_dates

Sheets (the_sheet) .VisibleEnd Sub

False

NOTES:

Called when the ">" button (8) is pressed. Displays the data from the next enh"y for

the current component in the database. The data displayed may be edited.

Sub Ini t ia l ize (the_row As Integer, the_col As String)

Application.ScreenUpdating = False

HYD_row the_row

HYD_col the_col

MIN_row 5 I Data s ta r t s at row 5the_sheet = fmAircraft .tai l_no.ValueSheets (the_sheet) .Visible = True

Sheets (the_sheet) .Activate

MAX_row = MIN_rowActiveSheet.Range(HYD_col & MIN row) .SelectWhile (ActiveCell.Value <> 1111)

MAX row = MAX row + 1- -ActiveCell .Offset(l , 0) .Select

Wend

Sheets (the_sheet) .VisibleEnd Sub

False

NOTES:

Sets the form variables that describe which row is active and which hydraulic system

has been selected, these are used to refer to the correct data in the worksheets.

Determines \,vhere the last data enh"y for the selected system is located.

25

Page 31: A Replacement Database for the CH-47D Spectrometric Oil Analysis Program

8/4/2019 A Replacement Database for the CH-47D Spectrometric Oil Analysis Program

http://slidepdf.com/reader/full/a-replacement-database-for-the-ch-47d-spectrometric-oil-analysis-program 31/80

DSTO-TN-D412

Private Sub OK_Button_Click()

Dim the date As Date

Dim tmp_sheet As String

Dim tmp_day As StringDim tmp_month As String

Dim tmp_year As StringDim tmp_date As String

Dim tmp_row As IntegerDim tmp_col As StringDim i As IntegerDim hours_flag As Boolean

Dim response As String

hours_flag = True

tmp_sheet = the_sheet

tmp_row MAX_row

tmp_col = HYD_col

Sheets (tmp_sheet) .Visible True

Sheets (tmp_sheet) .Activate

ActiveSheet.Range(tmp_col & MAX_row) .SelectActiveCell.Value = "X"

ActiveSheet.Range(tmp_col & MAX_row) .SelectActiveCell .Offset(O, 2) .Select ' Select t:he hours column . . .

I f ActiveCell.Value = Empty Then

HYD_row = MAX_row

SetControlsresponse = MsgBox ("Plea se ensur e component hours ...

... are entered." , vbOKOnly + vbExclamation + ...

... vbApplicationModal)

hours_flag FalseEnd I f

Sheets (tmp_sheet) .Visible = False

Application.ScreenUpdating = True

I f (hours_flag = True) Then

Unload fmHydraulics

fmChooseTX.ShowEnd I f

End Sub

NOTES:

Called v,·hen theOK

button (10) is pressed. Exits from the Hydraulics system dataentry page and n ~ t u r n s to the system selection page fmChooseTX, A nc\\' entry is

made in the database and any changes m8dc' to pn'\-ious dMa art:' retained

26

Page 32: A Replacement Database for the CH-47D Spectrometric Oil Analysis Program

8/4/2019 A Replacement Database for the CH-47D Spectrometric Oil Analysis Program

http://slidepdf.com/reader/full/a-replacement-database-for-the-ch-47d-spectrometric-oil-analysis-program 32/80

OSTO-TN-0412

Sub SetControls()ActiveCell.Offset(O, 1) .SelectActiveCell.NumberFormat = I I@II

fmHydraulics.sample_date.ControlSource = ActiveCell.AddressActiveCell.Offset(O, 1) .Select

fmHydraulics.hours.ControlSource = ActiveCell.Address

ActiveCell.Offset(O, 1) .SelectfmHydraulics.sample_no.ControlSource = ActiveCell.Address

ActiveCell.Offset(O, 1) .SelectfmHydraulics.water.ControlSource = ActiveCell.Address

ActiveCell.Offset(O, 1) .SelectfmHydraulics.Fe.ControlSource = ActiveCell.Address

ActiveCell.Offset(O, 1) .SelectfmHydraulics.Cu.ControlSource = ActiveCell.AddressActiveCell.Offset(O, 1) .SelectfmHydraulics.Mg.ControlSource = ActiveCell.AddressActiveCell.Offset(O, 1) .SelectfmHydraulics.Cr.ControlSource = ActiveCell.AddressActiveCell.Offset(O, 1) .SelectfmHydraulics.Al.ControlSource = ActiveCell.Address

ActiveCell.Offset(O, 1) .SelectfmHydraulics.Ag.ControlSource = ActiveCell.AddressActiveCell.Offset(O, 1) .SelectfmHydraulics.Sn.ControlSource = ActiveCell.AddressActiveCell.Offset(O, 1) .SelectfmHydraulics.Ni.ControlSource = ActiveCell.AddressActiveCell.Offset(O, 1) .SelectfmHydraulics.Ti.ControlSource = ActiveCell.AddressActiveCell.Offset(O, 1) .SelectfmHydraulics.Si.ControlSource = ActiveCell.Address

ActiveCell.Offset(O, 1).SelectfmHydraulics.viscosity.ControlSource = ActiveCell.Address

ActiveCell.Offset(O, 1) .SelectfmHydraulics.code.ControlSource = ActiveCell.Address

End Sub

NOTES:

This routine links the appropriate data in the worksheet to the textboxes displayed

on the form (2, 4, 6, 7, 11, 12, 13). It is required when the scroll forward and scroll

back features are used.

Sub reformat_dates()

Dim th e date As Date

Dim tmp_day As StringDim tmp_month As StringDim tmp_year As StringDim tmp_date As String

I f ActiveCell.Value <> Empty Then

the date = ActiveCell.Value

27

Page 33: A Replacement Database for the CH-47D Spectrometric Oil Analysis Program

8/4/2019 A Replacement Database for the CH-47D Spectrometric Oil Analysis Program

http://slidepdf.com/reader/full/a-replacement-database-for-the-ch-47d-spectrometric-oil-analysis-program 33/80

DSTO-TN-D412

tmp_day = Day (the_date)

tmp_month = Month(the_date)

tmp_year = Year (the_date)

I Reformat to give day-month-year

Selec t Case tmp_month

Case "1"

tmp_month "Jan"

Case "2 "

tmp_month "Feb"

Case "3 "

tmp_month "Mar"

Case "4"tmp_month "Apr"

Case "5"tmp_month "May"

Case "6"

tmp_month "Jun"

Case"7"tmp_month "Jul"

Case "8"tmp_month "Aug"

Case "9"tmp_month "Sep"

Case "10"

tmp_month "Oct"

Case "11"

tmp_month "Nov"

Case "12"

tmp_month "Dec"

End Se lec t

tmp_date = tmp_day & "I" & tmp_month & "I" & tmp_year

ActiveCell .NumberFormat = "@"

ActiveCell .FormulaR1Cl = tmp date

ActiveCell .NumberFormat "dd/mm/yy"

ActiveCell .NumberFormat = "@"

End IfEnd Sub

NOTES:

Used to reformat the date entered, forcing i t to stay in the Australian format:

(day/month/year).

28

Page 34: A Replacement Database for the CH-47D Spectrometric Oil Analysis Program

8/4/2019 A Replacement Database for the CH-47D Spectrometric Oil Analysis Program

http://slidepdf.com/reader/full/a-replacement-database-for-the-ch-47d-spectrometric-oil-analysis-program 34/80

A.5. View trends form: fmTrends

4 3

DSTO-TN-Q412

5

6

7

8

Dim OIL_flag As Boolean

Dim cur -p lo t_shee t As Str ing

Const N_AC As In teger = 6 'number of a i r c r a f t in f l ee t

Const remove_st r As St r ing = "REMOVED"

NOTES:

Variables local to the form fmTransmission

Pr iva te Sub UserForm_QueryClose _

(cancel As Integer , CloseMode As Integer )

Prevents use of the Close button

I f CloseMode = vbFormControlMenu Thencancel True

End IfEnd Sub

NOTES:

Disables the close button (1) in the top right corner of the form

Pr iva te Sub back_Click()

Unload fmTrends

fmAircraft .ShowEnd Sub

NOTES:

Unloads the View Trends form and returns to the main form: fmAircraft.

29

Page 35: A Replacement Database for the CH-47D Spectrometric Oil Analysis Program

8/4/2019 A Replacement Database for the CH-47D Spectrometric Oil Analysis Program

http://slidepdf.com/reader/full/a-replacement-database-for-the-ch-47d-spectrometric-oil-analysis-program 35/80

DSTQ..TN-Q412

Private Sub tail_no_Change()

set_captions

End Sub

NOTES:

Resets the component serial numbers displayed on the Transmissions page ,,,-hen a

new aircraft is selected.

Sub In i t ia l ize ()Sheets ("Aircraf t") .ActivateActiveSheet .Range ("A2") .Select

tai l_no.AddItem "All Aircraft"

While (ActiveCell .Value <> " " )

ta il_no.AddItem ActiveCel l .Value

ActiveCell .Offset(l , 0) .Select

Wend

ta i l_no.ListIndex = fmAirc ra f t . t a i l no.ListIndex + 1

SOA_element.AddItem "Iron (Fe)"

SOA_element.AddItem "Copper (Cu)"

SOA_element.AddItem "Magnesium (Mg)"SOA_element.AddItem "Chromium (Cr)"

SOA_element.AddItem "Aluminium (AI)"

SOA_element.AddItem "Silver (Ag)"SOA_element.AddItem "Tin (Sn)"

SOA_element.AddItem "Nickel (Ni)"

SOA element .AddI tem "Titanium (Ti)"SOA element.AddItem "Si l icon (Si)"SOA-element.ListIndex = 0

set_captionsMultiPagel_Change

End Sub

NOTES:

Populates the aircraft tail number selection list-box (5) and sets the currently selected

aircraft to the same as the main form, fmAircraft. PopuJutes the SOA element list-hox

(6) v,!jth the elements for which plots are available'.

Sub set_cur-plot_sheet(CPS As Str ing)

cur-plot_sheet = CPS

End Sub

NOTES:

Resets the form variable" clfi_pJot_51wct, \\'hich (ontwJs w]lich charts are used. The

sheet Plot is used for single pll)i";, and the' sheet Plots is used for multiple pJ,\ts,

30

Page 36: A Replacement Database for the CH-47D Spectrometric Oil Analysis Program

8/4/2019 A Replacement Database for the CH-47D Spectrometric Oil Analysis Program

http://slidepdf.com/reader/full/a-replacement-database-for-the-ch-47d-spectrometric-oil-analysis-program 36/80

DSTD-TN-0412

Private Sub MultiPage1_Change{)Dim tmp_index As Integer

I f(SOA_element.ListIndex 10) Thentmp_index 0

Else

tmp_index SOA element.ListIndex

End I fSOA_element.Clear

Select Case MultiPage1.ValueCase 0

SOA_element .AddItem "Iron (Fe)"

SOA_element.AddItem "Copper (Cu)"

SOA_element.AddItem "Magnesium (Mg)"SOA_element.Addltem "Chromium (Cr)"

SOA_element.Addltem "Aluminium (AI)"

SOA_element.Addltem "Si lver (Ag)"SOA_element.AddItem "Tin (Sn)"

SOA_element.Addltem "Nickel (Ni)"

SOA_element.Addltem "Titanium (Ti)"

SOA_element.Addltem "Si l icon (Si)"Case 1

SOA_element.Addltem "Iron (Fe)"

SOA_element.Addltem "Copper (Cu)"SOA_element.Addltem "Magnesium (Mg)"SOA_element.Addltem "Chromium (Cr)"

SOA_element.Addltem "Aluminium (AI)"

SOA_element.AddItem "Si lver (Ag)"SOA_element.AddItem "Tin (Sn)"

SOA_element.Addltem "Nickel (Ni)"

SOA_element.Addltem "Ti tanium (Ti )"

SOA_element.Addltem "Si l icon (Si)"

SOA_element.AddItem "Water"End SelectSOA_element.Listlndex = tmp_index

End Sub

NOTES:

Resets the SOA element listwhen a ne",,' tab, either Hydraulics (3) or Transmissions

(4) is selected on the page conb'ol (2). This is required as water is tested for in the

hydraulic systems, bu t not in the b'ansmissions.

31

Page 37: A Replacement Database for the CH-47D Spectrometric Oil Analysis Program

8/4/2019 A Replacement Database for the CH-47D Spectrometric Oil Analysis Program

http://slidepdf.com/reader/full/a-replacement-database-for-the-ch-47d-spectrometric-oil-analysis-program 37/80

DSTO-TN-D412

Private Sub aft_txmn_Click()

Dim TXMN As StringDim the_offset As Integer

Dim i As Integer

Application.ScreenUpdating = False

the offset = SOA element.List lndexSheets ("Aircraft7.") .ActivateRange("C" & ( ta i l_no.List lndex + 1» .Select

TXMN = ActiveCell.Value

OIL_flag = True

I f ((TXMN <> remove_str) And ( t a i l no.List lndex <> 0» Then

curylot_sheet = "Plot"

Sheets (curylot_sheet) .Visible = True

Sheets (curylot_sheet) .Activate

dele teylo t s (1)

Call ge t_s ing ley lo t (TXMN, tai l_no. Value &•••

... " Aft Txmn. - SIN: " , the_offset + 6, 4, 2)Call get_oil_data(TXMN, 1)Call add_warning (curylot_shee t , 1, 1, the_offset)Call fo rmaty lo t_ t i t l e s ( l , 18, 14)

Application.ScreenUpdating = True

fmTrends.HideActiveSheet.Select

Elsel f ( ta i l_no.L is t lndex = 0) Then

curylot_sheet = "Plots"Sheets (cury lo t_sheet ) .Visible = True

Sheets (cury lo t_sheet ) .ActivateFo r i = 1 To 6

dele teylo t s (i )

Next iCall get_mul t ip leylots ("C", "Aft Transmis sion " ,

the offset + 6, 4, 2)For i = 1 To 6

Call add_warning (curylot_shee t , i , 1, the_offset)Next i

Application.ScreenUpdating

fmTrends.Hide

ActiveSheet.SelectEnd If

End Sub

True

NOTES:

Called by the AFT TXMN button on the Transmissions tab (4). Either a s i n ~ ~ l c plot

will be produced, or multiple plots (one for each aircraft) \\'il1 be produced

depending on the selection of aircraft tuil number (5). Existing pInt series are

removed by ddctl'_ploI5, fol lowed by a call tn ( 'l1l ' of the plotling functions. Oil top-up

data and the abnormal/warning limits arc then added by separClte function calls.

32

Page 38: A Replacement Database for the CH-47D Spectrometric Oil Analysis Program

8/4/2019 A Replacement Database for the CH-47D Spectrometric Oil Analysis Program

http://slidepdf.com/reader/full/a-replacement-database-for-the-ch-47d-spectrometric-oil-analysis-program 38/80

DSTO-TN..()412

Private Sub comb_txmn_Click()

Dim TXMN As StringDim the_offset As Integer

Dim i As Integer

Application.ScreenUpdating = False

th e offset = SOA element.ListlndexS h e ~ t s ("Aircraft70") .Activate

Range("D" & (tail_no.Listlndex + 1)) .SelectTXMN =ActiveCell.Value

OIL_flag = True

I f «TXMN <> remove_str) And ( ta i l no.List lndex <> 0)) Thencury lo t_shee t = "Plot"

Sheets(cur-plot_sheet) .Visible = True

Sheets (cur-plot_sheet) .Act ivatedelete-plots (1)

Callget_single-plot{TXMN,

tai l_no.Value& •••

... " Comb. Txmn. - SiN: " , the_offset + 6, 4, 2)Call get_oil_data{TXMN, 1)

Call add_warning {cur-plot_sheet, 1, 2, the_offset)Call format-plot_ti t les{l , 18 , 14)

Application.ScreenUpdating = True

fmTrends.Hide

ActiveSheet.SelectEIseIf (tail_no.Listlndex = 0) Then

cury lo t_shee t = "Plots"Sheets (cur-plot_sheet) .Visible = True

Sheets (cur-plot_sheet) .ActivateFor i = 1 To 6

delete-plots (i )

Next iCall get_multiple-plots ("D", "Comb. Transmission", ...

the_offset + 6, 4, 2)For i = 1 To 6

Call add_warning {cur-plot_sheet, i , 2, the_offset)Next i

Application.ScreenUpdating True

fmTrends.Hide

ActiveSheet.SelectEnd I f

End Sub

NOTES:

Called by the COMB TXMNbutton on the Transmissions tab (4). Either a single plotv-rill be produced, or multiple plots (one for each aircraft) 'will be produced

depending on the selection of aircraft tail number (5). Existing plot series are

removed by delete ...plots, followed by a call to one of the plotting functions. Oil top-up

data arid the abnormaljvvarning limits are then added by separate function calls.

33

Page 39: A Replacement Database for the CH-47D Spectrometric Oil Analysis Program

8/4/2019 A Replacement Database for the CH-47D Spectrometric Oil Analysis Program

http://slidepdf.com/reader/full/a-replacement-database-for-the-ch-47d-spectrometric-oil-analysis-program 39/80

DSTD-TN-0412

Private Sub eng_txmn1_Click()

Dim TXMN As String

Dim the_offset As IntegerDim i As Integer

Application.ScreenUpdating = False

the_offset = SOA_element.Listlndex

Sheets ("Aircraft") .Activate

Range("E" & ( ta i l_no.List lndex + 1)) .SelectTXMN = ActiveCell.Value

OIL_flag = True

I f ((TXMN <> remove_str) And ( ta i l no.List lndex <> 0) ) Then

curylot_sheet = "Plot"

Sheets (curylot_sheet) .Visible = True

Sheets (curylot_sheet) .Activate

de le tey lo t s (1)Call get_singleylot (TXMN, tai l_no. Value & •••

... " Eng. #1 Txmn. - SiN: ", the_offset + 6, 4, 2)Call get_oil_data(TXMN, 1)Call add_warning (curylot_sheet , 1, 3, the_offset)Call formatylo t_ t i t les( l , 18 , 14)

Application.ScreenUpdating = True

fmTrends.Hide

ActiveSheet.SelectElseI f ( ta i l_no .L i st lndex = 0) Then

curylot_sheet = "Plots"Sheets (curylot_sheet) .Visible = True

Sheets (curylot_sheet) .ActivateFo r i = 1 To 6

de le tey lo t s ( i)

Next i

Call get_multipleylots("E", "Engine #1 Transmission"the_offset + 6, 4, 2)

Fo r i = 1 To 6

Call add_warning (curylot_sheet , i , 3 , the_offset)Next i

Application.ScreenUpdatingfmTrends.Hide

ActiveSheet.SelectEnd I f

End Sub

True

NOTES:

Called by the ENG TXMN #1 hutton on the Transmissions tab (4). Either a single plot

will be produced, or multiple plots (one for each aircraft) will be produced

depending on the selection of aircraft tail number (5). Existing plot series arc

removed b:-' deletc_plols. followed by a call to one of tlw plotting functions, Oil top--up

data and the abnormal/warning limits are then addljd by separate function G1Ils.

Private Sub eng txmn2 Click()

34

Page 40: A Replacement Database for the CH-47D Spectrometric Oil Analysis Program

8/4/2019 A Replacement Database for the CH-47D Spectrometric Oil Analysis Program

http://slidepdf.com/reader/full/a-replacement-database-for-the-ch-47d-spectrometric-oil-analysis-program 40/80

DSTD-TN-0412

Dim TXMN As StringDim the_offset As IntegerDim i As Integer

Application.ScreenUpdating = Falsethe_offset = SOA_element.Listlndex

Sheets ("Aircraft") .Activate

Range("F" & (tail_no.Listlndex + 1» .SelectTXMN = ActiveCell.Value

OIL_flag = True

I f «TXMN <> remove_str) And ( t a i l no.List lndex <> 0» Then

cur.. ,plot_sheet = "Plot"

Sheets (cur..,plot_sheet) .Visible = True

Sheets (cur"'plot_sheet) .Activate

delete"'plots (1)Call get_single"'plot (TXMN, tai l_no.Value & •••

... " Eng. #2 Txmn. - SiN: " , the_offset + 6, 4, 2)Call get o i l data (TXMN, 1)Call add_warning (cur..,plot_sheet, 1, 3, the_offset)Call format.. ,plot_ti t les(l , 18 , 14)

Application.ScreenUpdating = True

fmTrends.Hide

ActiveSheet.SelectElself (tail_no.Listlndex = 0) Then

cur"'plot_sheet = "Plots"Sheets(cur"'plot_sheet).Visible = True

Sheets(cur. . ,plot_sheet) .Activate

For i = 1 To 6delet e. ., plot s ( i)

Next iCall get_multiple. .,p lots("F", "Engine #2 Transmiss ion"

the_offset + 6, 4, 2)For i = 1 To 6

Call add_warning (cur..,plot_sheet, i , 3, the_offset)Next i

Application.ScreenUpdating True

fmTrends.Hide

ActiveSheet.Select

End IfEnd Sub

NOTES:

Called by the ENG TXMN #2 button on the Transmissions tab (4). Either a single plot

will be produced, or multiple plots (one for each aircraft) will be produced

depending on the selection of aircraft tail number (5). Existing plot series are

removed by delete_plots, followed by a can to one of the plotting functions. Oil top-up

data and the abnormaljwarning limits are then added by separate function calls.

Private Sub eng1_Click()

Dim TXMN As String

35

Page 41: A Replacement Database for the CH-47D Spectrometric Oil Analysis Program

8/4/2019 A Replacement Database for the CH-47D Spectrometric Oil Analysis Program

http://slidepdf.com/reader/full/a-replacement-database-for-the-ch-47d-spectrometric-oil-analysis-program 41/80

DSTD-TN-0412

Dim the_offset As IntegerDim i As Integer

Application.ScreenUpdating = False

the_offset = SOA_element.Listlndex

Sheets ("Aircraf t") .Act ivate

Range("G" & ( ta i l_no.List lndex + 1)) .SelectTXMN = ActiveCell.Value

OIL_flag = True

I f «TXMN <> remove_str) And ( ta i l nO.Listlndex <> 0) ) Then

cur""plot_sheet = "Plot"Sheets (cur...,plot_sheet) .Visible = True

Sheets (cur...,plot_sheet) .Activate

delete""plots (1)Call get_single""plot (TXMN, t a i l no.Value & •••

... " Eng. #1 - SIN: " , the_offset + 6, 4, 2)Call get_oil_data(TXMN, 1)

Call add_warning (cur...,plot_sheet, 1, 4, the_offset)Call format...,plot_titles(l, 18 , 14)

Application.ScreenUpdating = True

fmTrends.Hide

ActiveSheet.SelectElself ( ta i l_no.List lndex = 0) Then

cur""plot_sheet = "Plots"Sheets (cur...,plot_sheet) .Visible = TrueSheets (cur...,plot_sheet) .ActivateFor i = 1 To 6

delete...,plots (i)

Next iCall get_multiple...,plots("G", "Engine #1 II

For i = 1 To 6Call add_warning (cur""plot_sheet, i , 4,

Next i

the offse t + 6,4 , 2)

Application.ScreenUpdating

fmTrends.Hide

ActiveSheet.SelectEnd I f

End Sub

True

NOTES:

Called b ~ the ENG #1 button on the Transmissions tab (4). Either a single plot will be

produced. or multiple plots (one for each aircraft) will he produced depending on

the selection of aircraft tail number (5). Existing plot series are removed bydeletc_plots, followed by a call to one of the plotting functions. Oil top-up data and

the abnormal/''''arning limits are then added b !"C"paratl' function calis.

36

Page 42: A Replacement Database for the CH-47D Spectrometric Oil Analysis Program

8/4/2019 A Replacement Database for the CH-47D Spectrometric Oil Analysis Program

http://slidepdf.com/reader/full/a-replacement-database-for-the-ch-47d-spectrometric-oil-analysis-program 42/80

DSTD-TN-Q412

Private Sub eng2_Click()

Dim TXMN As StringDim the_offset As Integer

Dim i As Integer

Application.ScreenUpdating = False

the_offset = SOA_element.ListIndex

Sheets ("Aircraft") .ActivateRange("H" & (tai l_no.List lndex + 1)) .SelectTXMN = ActiveCell.Value

OIL_flag = True

If ((TXMN <> remove_str) And ( ta i l nO.Listlndex <> 0)) Thencurylot_sheet = "Plot"Sheets (curylot_sheet) .Visible = True

Sheets (curylot_sheet) .Activatede le tey lo t s (1)

Call get_s ingleylot(TXMN,

t a i l no. Value& •••

... " Eng. #2 - -S iN : " , the_offset + 6, 4, 2)Call get o i l data (TXMN, 1)

Cal l add=warning(cury lo t_sheet , 1, 4, the_offset )Call formatylot_ t i t les( l , 18 , 14)

Application.ScreenUpdating = True

fmTrends.Hide

ActiveSheet.SelectElself (tai l_no.List lndex = 0) Then

curylot_sheet = "Plots"Sheets (curylo t_shee t ) .Visib le = True

Sheets (curylot_sheet) .ActivateFor i = 1 To 6

de le tey lo t s (i)

Next iCall get_mult ipleylots("H", "Engine #2 "

Fo r i = 1 To 6Call add_warning (curylot_shee t , i , 4,

Next i

Application.ScreenUpdating True

fmTrends.Hide

ActiveSheet.SelectEnd If

End Sub

the_offset + 6,

4 , 2)

NOTES:

Called by the ENG #2 button on the Transmissions tab (4). Either a single plot ,·\Till beproduced, or multiple plots (one for each aircraft) v'lill be produced depending on

the selection of aircraft tail number (5). Existing plot series are removed by

deletcplots, followed by a call to one of the plotting functions. Oil top-up data and

the abnormal/warning limits are then added by separate function calls.

37

Page 43: A Replacement Database for the CH-47D Spectrometric Oil Analysis Program

8/4/2019 A Replacement Database for the CH-47D Spectrometric Oil Analysis Program

http://slidepdf.com/reader/full/a-replacement-database-for-the-ch-47d-spectrometric-oil-analysis-program 43/80

DSTO-TN-0412

Private Sub fwd_txmn_Click()

Dim TXMN As StringDim the_offse t As IntegerDim i As Integer

Application.ScreenUpdating = False

the_offset = SOA_element.ListIndex

Sheets ("Aircraft") .Act ivate

Range("B" & (tai l_no.ListIndex + 1» .SelectTXMN = ActiveCell.Value

OIL_flag = True

I f ((TXMN <> remove_str) And ( t a i l no.List lndex <> 0» Then

cury lo t_shee t = "Plot"

Sheets (curylot_sheet) .Visible = True

Sheets (curylot_sheet) .Activatede l e t ey lo t s (1)

Call get_singleylot (TXMN, tai l_no. Value & ...

... " Fwd. Txmn. - SIN: ", the_offset + 6, 4, 2)Call get_oil_data(TXMN, 1)Call add_warning (cury lo t_sheet , 1, 0, the_offset)

Call fo rmaty lo t_ t i t l e s ( l , 18 , 14)

Application.ScreenUpdating = True

fmTrends.Hide

ActiveSheet.SelectElseI f ( ta il _no .L i st Index = 0) Then

cury lo t_shee t = "Plots"Sheets (curylot_sheet) .Visible = True

Sheets (curylot_sheet) .ActivateFo r i = 1 To 6

de le tey lo t s (i)Next i

Call get_mult ip leylots ("B", "Fwd. Transmiss ion", ...the_offset + 6, 4, 2)

For i = 1 To 6

Call add_warning (curylot_sheet , i , 0, the_offset)

Application.ScreenUpdating = FalseNext i

Application.ScreenUpdating

fmTrends.Hide

ActiveSheet.SelectEnd I f

End Sub

True

NOTES:

Called by the FWD TXMN button on the Transmissions t211, (4). Either a single plot

,,,,ill be produced: or multiple plots (one for C'iJch aircraft) wil1ilL' produced

depending on the selection of aircraft tail number (5 j. Existing plot series are

removed by delete_plots: followed by a call to one of the plotting functions. Oil top-up

data and the abnorma1rwarning limits are then added by' separate function calls.

38

Page 44: A Replacement Database for the CH-47D Spectrometric Oil Analysis Program

8/4/2019 A Replacement Database for the CH-47D Spectrometric Oil Analysis Program

http://slidepdf.com/reader/full/a-replacement-database-for-the-ch-47d-spectrometric-oil-analysis-program 44/80

DST0-TN-D412

Private Sub n01_hyd_sys_Click()

Dim data_col As IntegerDim i As Integer

Application.ScreenUpdating = False

Select Case SOA element.Listlndex

Case Is <= 9data_col SOA_element.Listlndex + 6

Case Is = 10data_col 5

End Select

True

True

End I f

Application.ScreenUpdating True

fmTrends.HideEnd Sub

data_col, ...

... 2 , 3)

Call

Elsecury lo t_shee t = "Plots"Sheets (cur-plot_sheet) .VisibleSheets (cur-plot_sheet) .ActivateFor i = 1 To 6

delete-plots (i)Next iCall ge t_mult ip l e-p lo t s( " ", "No .1 Hyd. System"

OIL f lag = False

I f ( tai l_no.List lndex <> 0) Thencury lo t_shee t = "Plot"Sheets (curylo t_shee t ) .Visib leSheets (curylot_sheet) .Activatede le tey lo t s (1)Call get_singleylot( tai l_no.Value,

... IINo. 1 Hyd. System - ..

fo rmaty lo t_ t i t l e s ( l , 18 , 14)

NOTES:

Called by the #1 HYD SYS button on the Hydraulics tab (3). Either a single plot v,'ill

be produced, or multiple plots (one for each aircraft) vvill be produced depending on

the selection of aircraft tail number (5). Existing plot series are removed by

delete_plots, followed by a call to one of the plotting functions.

39

Page 45: A Replacement Database for the CH-47D Spectrometric Oil Analysis Program

8/4/2019 A Replacement Database for the CH-47D Spectrometric Oil Analysis Program

http://slidepdf.com/reader/full/a-replacement-database-for-the-ch-47d-spectrometric-oil-analysis-program 45/80

DSTD-TN-0412

Pr ivate Sub n02_hyd_sys_Click{)

Dim data_col As In teger

Dim i As In tege r

Applicat ion.ScreenUpdating = False

Se lec t Case SOA element .Lis t Index

Case Is <= 9

data_col SOA element .Lis t Index + 23

Case Is = 10

data col 22

End Selec t

OIL f l ag = False

I f ( t a i l_no .Lis t lndex <> 0) Then

cury lo t_shee t = "Plo t"

Sheets (cury lo t_shee t ) .Vis ible True

Sheets (cury lo t_shee t ) .Act ivate

de l e t ey l o t s (1 )Cal l ge t _ s i ng l ey l o t ( ta i l_no .Value, "No. 2 Hyd. System - ", ...

data_col , 19, 20 )

Cal l f o rma ty l o t _ t i t l e s { l , 18, 14 )

Else

cury lo t_shee t = "Plots"

Sheets (cury lo t_shee t ) .Vis ible True

Sheets (cury lo t_shee t ) .Act ivate

For i = 1 To 6

de l e t e y l o t s ( i)

Next iCal l ge t_mu l t i p l ey lo t s ('" ' , "No.2 Hyd. System"

End I f

Applicat ion.ScreenUpdating True

fmTrends.Hide

End Sub

data_col , ...

... 19 , 20 )

NOTES:

Called by the #2 HYO SYS button on the Hydraulics tah (:'). Either a single plot will

be produced, or multiple plots (one for each aircraft) ,'1'ill be produced depending on

the selection of aircraft tail number (5). Existing plot series are rernoved by

delete_plots, folIo'wed by a call to one of the plotting functions.

40

Page 46: A Replacement Database for the CH-47D Spectrometric Oil Analysis Program

8/4/2019 A Replacement Database for the CH-47D Spectrometric Oil Analysis Program

http://slidepdf.com/reader/full/a-replacement-database-for-the-ch-47d-spectrometric-oil-analysis-program 46/80

DSTO-TN-0412

Private Sub util i ty_hyd_Click()Dim data_col As IntegerDim i As Integer

Application.ScreenUpdating = FalseSelect Case SOA_element.Listlndex

Case Is <= 9data_col SOA_element.Listlndex + 40

Case Is = 10

data_col 39

End Select

OIL flag = FalseI f ( tai l_no.List lndex <> 0) Then

cury lo t_sheet = "Plot"Sheets (curylot_sheet) .Visible True

Sheets (curylot_sheet) .Activatede le tey lo t s (1)

Call get_singleylot( tai l_no.Value,... "Uti l i ty Hyd. System - ", data_col, 36, 37)

Call fo rmaty lo t_ t i t l e s ( l , 18, 14 )

Elsecury lo t_sheet = "Plots"Sheets (curylot_sheet) .Visible True

Sheets (curylot_sheet) .ActivateFor i = 1 To 6

de le tey lo t s (i)Next iCall get_mul t ip ley lo ts ("", "Uti l i ty Hyd. System", ...

data_col, 36, 37)

End IfApplication.ScreenUpdating True

fmTrends.HideEnd Sub

NOTES:

Called by the UTILITY HYD button on the Hydraulics tab (3). Either a single plot will

be produced, or multiple plots (one for each aircraft) will be produced depending on

the selection of aircraft tail number (5). Existing plot series are removed by

ddeu--J11ots, followed by a call to one of the plotting functions.

41

Page 47: A Replacement Database for the CH-47D Spectrometric Oil Analysis Program

8/4/2019 A Replacement Database for the CH-47D Spectrometric Oil Analysis Program

http://slidepdf.com/reader/full/a-replacement-database-for-the-ch-47d-spectrometric-oil-analysis-program 47/80

DSTD-TN-Q412

Sub set_captions{)Dim AC_row As IntegerApplication.ScreenUpdating False

AC row = ta i l_no. ListIndex + 1 I p.e data s ta r t s at rov: 2(ListIndex 0 is ".L.ll J:-.ircraft")

If ( ta i l_no.ListIndex = 0) Then

fWd_txmn_sn.caption = "All Aircraft"aft_txmn_sn.caption = "All Aircraft"comb_txmn_sn.caption "All Aircraft"eng_txmn1_sn.caption = "All Aircraft"eng_txmn2_sn.caption = "All Aircraft"engl_sn.caption "All Aircra f t "eng2_sn.caption = "All Aircraft"

Else

Sheet s ("Aircraf t ") .Activate

Range ( "B" & AC_row) .Select I F'Nd Transmission is. in co] unm B

fWd_txmn_sn.caption=

ActiveCell.ValueActiveCell.Offset{O, 1) .Select

aft_txmn_sn.caption = ActiveCell.Value

ActiveCell.Offset{O, 1) .Selectcomb_txmn_sn.caption = ActiveCell.ValueActiveCell.Offset{O, 1) .Selecteng_txmn1_sn.caption = ActiveCell.Value

ActiveCell.Offset{O, 1) .Selecteng_txmn2_sn.caption = ActiveCell.ValueActiveCell.Offset{O, 1) .Selecteng1_sn.caption = ActiveCell.ValueActiveCell .Offset(O, 1) .Selecteng2_sn.caption = ActiveCell.Value

End I f

End Sub

NOTES:

This function sets the captions displaying the component serial numbers on the

Transmissions tab (4) of the page control (2). This function is ca]]C'd any time a new

aircraft tail number (5) is selected.

42

Page 48: A Replacement Database for the CH-47D Spectrometric Oil Analysis Program

8/4/2019 A Replacement Database for the CH-47D Spectrometric Oil Analysis Program

http://slidepdf.com/reader/full/a-replacement-database-for-the-ch-47d-spectrometric-oil-analysis-program 48/80

DSTO-TN..Q412

Sub get-plot( the-plot_sheet As String, plot_index As Integer,

the t i t l e As String, y t i t l e As String, refX As String, ...

refY As String) -

Dim series_index As Integer

Application.ScreenUpdating = FalseSheets(the-plot_sheet) .Visible = True

Sheets ( the-plot_sheet) .Act ivateWorksheets (the-plot_sheet) .ChartObjects(plot_index) .Activate

ActiveChart.SeriesCollection.NewSeries

series_index = ActiveChart.SeriesCollection.Count

With ActiveChart

.ChartTit le.Characters.Text = the_t i t le

.Axes(xlValue, xlPrimary) .HasTitle = True

.Axes (xlValue, xlPrimary) .AxisTitle.Text = y_t i t le

.Axes (xlCategory, xlPrimary) .HasTitle = True

.Axes(xlCategory, xlPrimary) .AxisTitle.Text= "Equipment

... Hours"

.SeriesCollection(series_index) .XValues = re fX

.SeriesCollection(series_index) .Values = refY

End With

With ActiveChart.Axes(xlValue)

.MinimumScaleIsAuto = True

.MaximumScaleIsAuto = True

.MinorUnitIsAuto True

.MajorUnitIsAuto = True

End With

With ActiveChart.Axes(xlCategory).MinimumScaleIsAuto = True

.MaximumScaleIsAuto = True

.MinorUnitIsAuto True

.MajorUnitIsAuto = True

End With

ActiveChart .PlotArea.SelectWith Selection. Border

.Weight = xlThin

.LineStyle = xlAutomaticEnd With

ActiveChart. PlotArea. SelectSelection. Top = 40Selection.Width = 550Selection. Left = 40

Select ion. Interior.ColorlndexActiveChart.DeselectActiveSheet.Select

End Sub

xlNone

43

Page 49: A Replacement Database for the CH-47D Spectrometric Oil Analysis Program

8/4/2019 A Replacement Database for the CH-47D Spectrometric Oil Analysis Program

http://slidepdf.com/reader/full/a-replacement-database-for-the-ch-47d-spectrometric-oil-analysis-program 49/80

DSTO-TN-0412

NOTES:

This function creates one new plot series on a particular plot VJlot_illdcx) on the

worksheet specified (thc-J11ot_sllcet). The strings RiP:: and 1-(I:n" point to the cells that

contain the data to be plotted.

Private Sub not_fit ted_Click()

fmTrends.Hide

Load fmNotFitted

fmNotFit ted. lnit ial isefmNotFitted.Show

End Sub

NOTES:

Called by the View Not-Fitted Component button (7). Loads and initialises the form

fmNotFitted. This form enables the data from components not currently fitted in any

aircraft to plotted.

Sub ge t_s ing ley lo t (TXMN As String, TX_type As Str ing , ...

the_col As Integer, date_col As Integer, hours col As Integer)

Dim re fX As StringDim refY As StringDim the_t i t le As StringDim y_ t i t l e As StringDim SOAP_row As Integer

App lic at io n.Scr ee nUpdat in g Fal seSheets (TXMN) .Visible = True

Sheets (TXMN) .Select

SOAP row = 5 'SOAP Data s ta r t s on rol'.' ;::,

Sheets (TXMN) .Activate

ActiveSheet.Range{"A" & SOAP_row) .Select

While (ActiveCell.Value <> " " )

SOAP row = SOAP row + 1- -

ActiveCell .Offset(l , 0) .SelectWend

SOAP_row = SOAP_row - 1

Range ("A4") .SelectActiveCe ll .Of fse t{O, the_co l - 1) .Selectthe t i t l e = ActiveCell.Value & " SOA Trend - " & TX_type & TXMN

y_ t i t l e = ActiveCell.Value & " [PPM]"

re fX "='" & TXMN & '" !RSC" & hours col & ":R" &SOAP row & "C" & hours col

refY "= '" & TXMN & '" !RSC" & th e col & ":R" &

SOAP row & "C" & the col

Sheets (TXMN) .Visible = FalseCall getylo t{"Plot" , 1, th e_ ti t le , y _ti t le , re fX, refY)

Sheets ("Plot") .Activate

44

Page 50: A Replacement Database for the CH-47D Spectrometric Oil Analysis Program

8/4/2019 A Replacement Database for the CH-47D Spectrometric Oil Analysis Program

http://slidepdf.com/reader/full/a-replacement-database-for-the-ch-47d-spectrometric-oil-analysis-program 50/80

Range (IIA1 II) .Select

ActiveWindow.Zoom = 75Range (IIA1 II) .Select

ActiveSheet.ChartObjects(l) .ActivateActiveChart .Deselect

ActiveSheet.Select

End Sub

I Removes focus . . .

DSTD-TN-0412

NOTES:

This function is called when only one plot is required. The transmission serial

number, TXMN is used to refer to the sheet where the data is stored. The

h'ansmission type TX_tlJpc is used to create the chart title. The plot data is referred to

by the columns datcJol and hoursJol which are integers (eg: 1=A, 2=B etc.)

Sub get_mul t ip leylots (TX_col As String, TX_type As Str ing, ...

... the_col As I nt eg er , d at e_ co l As Integer , hours col As Integer)Dim re fX As StringDim refY As StringDim the_t i t le As StringDim y_ t i t l e As StringDim SOAP_row As Integer

Dim i As IntegerDim TXMN As StringDim AC As StringDim element As String

Application.ScreenUpdating

i = 1

False

While ( i <= N_AC)

I Get the aircraf t -> transmission

Sheets (IIAircraft II) .Activate

Range ("A" & (i + 1)) . SelectAC = ActiveCell.Value

If (TX_col <> 1111) Then

Range(TX_col & (i + 1)) .SelectTXMN ActiveCell .Value

ElseTXMN AC

End I f

I f (TXMN <> remove_str) Then

SOAP_row = 5 I SOAP Data s ta r t s on row 5Sheets(TXMN).Visible = True

Sheets (TXMN) .SelectSheets (TXMN) .ActivateActiveSheet.Range("A" & SOAP_row) .SelectWhile (ActiveCell.Value <> 1111)

SOAP row = SOAP row + 1A c t i ~ e C e l l . O f f s e t ( l , 0) .Select

Wend

SOAP row = SOAP row - 1

45

Page 51: A Replacement Database for the CH-47D Spectrometric Oil Analysis Program

8/4/2019 A Replacement Database for the CH-47D Spectrometric Oil Analysis Program

http://slidepdf.com/reader/full/a-replacement-database-for-the-ch-47d-spectrometric-oil-analysis-program 51/80

DSTD-TN-0412

Range ("A4") .SelectActiveCell.Offset(O, the col - 1) .Select

& •••

hours col

the col

hours_col & ":R"

SOAP row & "C" &the col & ":R" &SOAP row & "C" &

& TXMN & " '! RSC" &1=' IfrefY

the_t i t le = ActiveCell.Value &

... " SOA Trend - Aircraf t : " & AC & vbCr & TX_typeIf (TX_col <> ",,) Then

the_t i t le = the_t i t le & " - SIN: " & TXMNEnd I f

element = ActiveCell.Value

y t i t l e = element & " [PPM]"refX "='" & TXMN & '" !RSC" &

Sheets (TXMN) .Visible = False

Call gety lo t("Plo ts" , i , the_t i t le , y t i t l e , refX, refY)

Application.ScreenUpdating = False

I f (OIL_flag) ThenCall get_oil_data(TXMN, i )

End I f

Endi

Wend

Application.ScreenUpdatingCall format-p1ot_ti t les( i ,Application.ScreenUpdatingI fi + 1

= False12 , 10)

= False

Sheets ("Plots") .ActivateRange ("A1") .SelectActiveWindow.Zoom = 32Range ("A1") .SelectActiveCell.Value = element & " SOA Trend - All Aircraf t - " ...

••• & TX_type

ActiveSheet.ChartObjects(l) .Activate 'R emov es fo cu s . . .

ActiveChart.DeselectActiveSheet.Select

End Sub

NOTES:

This function is called when a plot for each aircraft is required. The required

transmission serial number from each aircraft is read off theAircraft

sheet,TXJol

conb'ols which type of transmission this is. The plot data is referred to by the

columns !fatrJol and llOilrsJo! which are integers (eg: 1=A. 2=B etc.)

46

Page 52: A Replacement Database for the CH-47D Spectrometric Oil Analysis Program

8/4/2019 A Replacement Database for the CH-47D Spectrometric Oil Analysis Program

http://slidepdf.com/reader/full/a-replacement-database-for-the-ch-47d-spectrometric-oil-analysis-program 52/80

DSTO-TN-0412

Sub get_oil_data(TXMN As String, chart_index As Integer)

Dim MAX_row As Integer

Dim the_hours As Double

Dim oil_add As StringDim i As Integer

Application.ScreenUpdating = False

MAX_row = 5 I SOAP Data s ta r ts on row 5Sheets (TXMN) .Visible = True

Sheets (TXMN) .SelectSheets (TXMN) .ActivateActiveSheet.Range ("A" & MAX_row) . SelectWhile (ActiveCell.Value <> " " )

MAX_row = MAX_row + 1

ActiveCell .Offset(l , 0) .Select

Wend

MAX_row

=MAX_row - 1

S h e e ~ s ( " t m p " ) .Visible True

Sheets ("tmp") .ActivateColumns(chart_index * 2 - 1) .SelectSelection.ClearContentsColumns(chart_index * 2) .SelectSelection.ClearContentsFo r i = 1 To MAX_row - 5

Sheets (TXMN) .ActivateActiveSheet.Range ("B" & 5 + ( i )) . Select I Hours columIlthe_hours = ActiveCell.ValueActiveSheet.Range("E" & 5 + (i)) .Select I Oil Added columno il add = ActiveCell.Value

Sheets ("tmp") .Activate

ActiveSheet.Range("A" & 1 + (i - 1) * 3) .Selec tAct iveCe ll .Of fse t(O , (cha rt_ index - 1) * 2) .SelectActiveCell.Value = the_hoursActiveCell .Offset(l , 0) the_hours

ActiveCell .Offset(2, 0) the_hours

ActiveCell.Offset(O, 1) -1

ActiveCell .Offset(l , 1) oil_addActiveCell .Offset(2, 1) -1

Next i

Sheets ("tmp") .Visible = FalseSheets (TXMN) .Visible = FalseCall add_oil-plot(MAX_row, chart_index)

End Sub

NOTES:Ta display the oil added data as a bar chart overiaid on the line graph of the SOAP

data, it must first be reformatted. This is done on a temporary sheet caned If t1l1p".

Once the data has been written to the temporary sheet, the function add_oil_plot

draws the plot onto the selected chart.

47

Page 53: A Replacement Database for the CH-47D Spectrometric Oil Analysis Program

8/4/2019 A Replacement Database for the CH-47D Spectrometric Oil Analysis Program

http://slidepdf.com/reader/full/a-replacement-database-for-the-ch-47d-spectrometric-oil-analysis-program 53/80

DSTO-TN-0412

Sub add_oil-plot(MAX_row As Integer, chart index As Integer)

Dim n_series As In teger

Dim C1 As StringDim C2

As String

App lic at io n. Sc re enUpda ti ng Fals e

Sheets ("tmp") .Activate

Range ("AI") .SelectActiveCell .Offset(O, (chart index - 1) * 2) .SelectC1 = ActiveCell.Address

ActiveCell .Offset(O, 1) .SelectC2 = ActiveCell.AddressRange(C1 & ":" & C2) .SelectRange (Selection, Selection.End(xlDown» .Select

Select ion. Copy

Sheets (cur-plot_sheet) .SelectActiveSheet.ChartObjects(chart_index) .Activate

n ser ies = ActiveChart .SeriesCollection.Count

I f (MAX_row> 5) Then ' ivlust be more than one datapoint?ActiveChart .SeriesCollection.Paste Rowcol:=xlColurnns,

... SeriesLabels: =False , CategoryLabels: =True, ...

_ Replace:=False, NewSeries:=True

ActiveChart .SeriesCollection(n_series + 1) .SelectActiveChart .SeriesCollection(n_series + 1) .AxisGroup 2Application.CutCopyMode = FalseWith Selection. Border

.Colorlndex = 57

.Weight = xlMedium

.LineStyle = xlContinuous

End WithWith Selection

.MarkerStyle = xlNone

.Smooth = False

End With

With ActiveChart

.Axes(xlValue, xlSecondary) .HasTitle = True

.Axes(xlValue, xlSecondary) .AxisTitle.Characters.Text... "Oil Added [Qts.]"

End With

ActiveChart .Axes(xlValue, xlSecondary) .AxisTit le .SelectWith Selection. Font

.Size = 16

End With

ActiveChart .Axes(xlValue, xlSecondary) .SelectWith Selection.TickLabels.Font

.Size = 14

End With

ActiveChart.Axes(xlValue, xlSecondary) .SelectWith ActiveChart .Axes(xlValue, xlSecondary)

.MinimumScale = 0

48

Page 54: A Replacement Database for the CH-47D Spectrometric Oil Analysis Program

8/4/2019 A Replacement Database for the CH-47D Spectrometric Oil Analysis Program

http://slidepdf.com/reader/full/a-replacement-database-for-the-ch-47d-spectrometric-oil-analysis-program 54/80

DSTD-TN-0412

End With

Selection.TickLabels.NumberFormat = "0.0"

Else

ActiveChart.SeriesCollection.NewSeriesActiveChart .SeriesCollection(n_series + 1) .SelectActiveChart.SeriesCollection (2) .SelectWith Selection. Border

.LineStyle = xlNone

End With

With Selection

.MarkerStyle = xlNone

End With

ActiveChart .SeriesCollection(n_series + 1) .AxisGroup 2With ActiveChart

.Axes(xlValue, xlSecondary) .HasTitle = True

.Axes (xlValue, x lSecondary) .AxisTitle.Characters.Text

'" "Oil Added [Qts.]"End With

End If

ActiveChart.DeselectActiveSheet.Select

End Sub

NOTES:

This function reads the formatted data off the temporary sheet, 1/ fmp", and adds it as

a new series to the plot referred to by charC.index. The oil-added data is plotted

against a secondary scale displayed on the right hand side of the chart .

Sub delete-plots(chart_index As Integer)Application.ScreenUpdating = FalseActiveSheet.ChartObjects(chart_index).Activate

While (ActiveChart.SeriesCollection.Count > 0)ActiveChart .PlotArea.SelectActiveChart. SeriesCollection (1) .SelectSelection. Delete

Wend

End Sub

NOTES:

This function erases any series that exist on a given chart.

49

Page 55: A Replacement Database for the CH-47D Spectrometric Oil Analysis Program

8/4/2019 A Replacement Database for the CH-47D Spectrometric Oil Analysis Program

http://slidepdf.com/reader/full/a-replacement-database-for-the-ch-47d-spectrometric-oil-analysis-program 55/80

DSTO-TN-0412

Sub fo rmaty lo t_ t i t l e s (plot_index As Integer, big As Integer, ...

... small As Integer)Application.ScreenUpdating = False

ActiveSheet.ChartObjects(plot_index) .ActivateActiveChart .ChartTit le .Select

Selection.AutoScaleFont = True

With Selection. Font

.Name = "Arial"

.Size = big

.Strikethrough = False

.Superscript = False

.Subscript = False

.OutlineFont = False

.Shadow = False

.Underline = xlUnderlineStyleNone

.Colo rln dex xlAutomatic

.Background=xlAutomaticEnd With

ActiveChart.Axes(xIValue) .AxisTit le .SelectSelection.AutoScaleFont = True

With Select ion. Font

.Name = "Arial"

.Size = big

.Strikethrough = False

.Superscr ip t = False

.Subscript = False

.OutlineFont = False

.Shadow = False

.Underline = xlUnderlineStyleNone

.Colorlndex xlAutomatic

.Background = xlAutomatic

End WithI f (OIL_flag) Then

ActiveChart.Axes(xIValue, xlSecondary) .AxisTit le .SelectSelection. AutoScaleFont True

With Selection. Font

.Name = "Arial"

.Size = big

.Strikethrough = False

.Superscript = False

.Subscript = False

.OutlineFont = False

.Shadow = False

.Underline = xlUnderlineStyleNone

.Colorln dex xlAutomatic

.Background = xlAutomaticEnd With

End I f

ActiveChart.Axes(xlValue) .SelectSelection.TickLabels.AutoScaleFont True

With Selection.TickLabels.Font.Name = "Arial"

50

Page 56: A Replacement Database for the CH-47D Spectrometric Oil Analysis Program

8/4/2019 A Replacement Database for the CH-47D Spectrometric Oil Analysis Program

http://slidepdf.com/reader/full/a-replacement-database-for-the-ch-47d-spectrometric-oil-analysis-program 56/80

.Size = small

.Strikethrough = False

.Superscript False

.Subscript = False

.OutlineFont = False

.Shadow = False

.Underline = xlUnderlineStyleNone

.Colorlndex xlAutomatic

.Background = xlAutomatic

End With

ActiveChart.Axes(xICategory) .SelectSelection.TickLabels.AutoScaleFont True

With Selection.TickLabels.Font.Name = "Arial"

.Size = small

.Strikethrough = False

.Superscript = False

.Subscript = False

.OutlineFont = False

.Shadow = False

.Underline = xlUnderlineStyleNone

.Colorlndex xlAutomatic

.Background = xlAutomatic

End With

I f (OIL_flag) Then

ActiveChart.Axes(xIValue, xlSecondary) .SelectSelection.TickLabels.AutoScaleFont = True

With Selection.TickLabels.Font.Name = "Arial".Size = small.Strikethrough = False

.Superscript = False

.Subscript = False

.OutlineFont = False

.Shadow = False

.Underline = xlUnderlineStyleNone

.ColorIndex xlAutomatic

.Background = xlAutomatic

End With

End IfActiveChart.Deselect

ActiveSheet.SelectEnd Sub

NOTES:

This function is used to set the font size and styles on the chart referred to by

ploCindex.

O5T0-TN-Q412

51

Page 57: A Replacement Database for the CH-47D Spectrometric Oil Analysis Program

8/4/2019 A Replacement Database for the CH-47D Spectrometric Oil Analysis Program

http://slidepdf.com/reader/full/a-replacement-database-for-the-ch-47d-spectrometric-oil-analysis-program 57/80

"Mar"

DSTO-TN-0412

Sub reformat_dates (MAX_row As Integer, date col As Integer)Dim i As IntegerDim col As String

Dimthe_date

AsDateDim tmp_day As String

Dim tmp_month As Str ing

Dim tmp_year As StringDim tmp_date As Str ing

Application.ScreenUpdating = False

ActiveSheet. Range ("A1") .SelectAct iveCel l .Offset(4, date_col - 1) .SelectFor i = 5 To MAX row

I f ActiveCell.Value <> Empty Thenthe_date = ActiveCell.Value

tmp_day = Day(the_date)

tmp_month=

Month(the_date)tmp_year = Year(the_date)

I Reformat to givE day-month-year

Select Case tmp_month

Case "1"

tmp_month "Jan"

Case "2"tmp_month "Feb"

Case "3"tmp_month

Case "4"

tmp_month "Apr"Case "5"

tmp_month "May"

Case "6"tmp_month "Jun"

Case "7"tmp_month "Jul"

Case "8"tmp_month "Aug"

Case "9 "

tmp_month "Sep"

Case "10"

tmp_month "Oct"

Case "11"

tmp_month "Nov"Case "12"

tmp_month "Dec"

End Selecttmp_date = tmp_day & "I" & tmp_month & "I" & tmp_year

ActiveCell.NurnberForrnat = "dd/mmm/yy"ActiveCell.ForrnulaR1C1 = tmp_date

End If

ActiveCell .Offset( l , 0) .SelectNext i

52

Page 58: A Replacement Database for the CH-47D Spectrometric Oil Analysis Program

8/4/2019 A Replacement Database for the CH-47D Spectrometric Oil Analysis Program

http://slidepdf.com/reader/full/a-replacement-database-for-the-ch-47d-spectrometric-oil-analysis-program 58/80

DST0-TN-D412

End Sub

NOTES:

Used to reformat the date entered, forcing it to stay in the Australian format:

(day jmonthjyear).

Sub add_warning(the_sheet As String, chart_index As Integer,... TX_type As Integer, ELtype As Integer)

Dim n_series As IntegerDim Xmin_scale As Double

Dim Xmax_scale As Double

Dim Ymin_scale As Double

Dim Ymax_scale As Double

Dim abnormal As Double

Dim marginal As Double

Application.ScreenUpdating False

I Get Levels . . .Sheets ("Levels") .Visible True

Sheets ("Levels") .SelectRange ("B3") . Select I Abnormal le ve l d ata s t a r t s on row 3ActiveCell.Offset(TX_type, ELtype) .Selectmarginal = ActiveCell .Value

Range ("B14") .Select ' Warning level data s t a r t s on row 14

ActiveCell .Offset (TX_type, ELtype) .Select

abnormal = ActiveCell .Value

I Act iv at e th e chartSheets (the_sheet) .SelectActiveSheet.ChartObjects(chart_index) .Activate

I Do

nothingi f

char t blank. . .

I f (ActiveChart.SeriesCollection.Count > 0) Then

, Get Automatic chart range . . .

ActiveChart.Axes(xlValue) .SelectWith ActiveChart.Axes(xlValue)

Ymin_scale .MinimumScale

Ymax_scale = .MaximumScaleEnd With

With ActiveChart.Axes(xlCategory)

Xmin_scale .MinimumScale

Xmax_scale = .MaximumScaleEnd With

n_series = ActiveChart.SeriesCollection.Count

I ABNORMlI.L

ActiveChart.SeriesCollection.NewSeriesActiveChart. SeriesCollection (n ser ies + 1) .XValues = ...

... "={" & Xmin-scale & "," & Xmax scale & "}"

ActiveChart .SeriesCollection(n-series + 1) .Values-=

... "={" & marginal & ", " & marginal & "} "

ActiveChart .SeriesCollection(n_series + 1) .SelectWith Selection.Border

53

Page 59: A Replacement Database for the CH-47D Spectrometric Oil Analysis Program

8/4/2019 A Replacement Database for the CH-47D Spectrometric Oil Analysis Program

http://slidepdf.com/reader/full/a-replacement-database-for-the-ch-47d-spectrometric-oil-analysis-program 59/80

DSTO-TN-0412

.ColorIndex = 45

.Weight = xlMedium

.LineStyle = xlDash

End With

With Select ion

.MarkerStyle xlNone

End With

, WARNING

ActiveChart.SeriesCollection.NewSeries

ActiveChart. SeriesCollection (n ser ies + 2 ) . XValues = ...... "={ II & xmin:=scale & " , II & Xmax_scale & " } II

ActiveChart .SeriesCollection(n ser ies + 2) .Values =.. . II = { " & a b n o ~ a l & " , II & abnormal & " } II

ActiveChart .SeriesCollection(n_series + 2) .SelectWith Select ion.Border

.ColorIndex = 3

.Weight = xlMedium

.LineStyle = xlDash

End With

With Selection

.MarkerStyle xlNone

End With

, Reset s ca l i ng to a u t o - s e l e c ~ e d values froffi before ...With ActiveChart.Axes(xlValue)

.MinimumScale Ymin scale

.MaximumScale = Ymax scaleEnd With

With ActiveChart.Axes(xlCategory)

.MinimumScale Xmin scale

.MaximumScale Xmax scaleEnd With

End I f

Sheets ("Levels") .VisibleEnd Sub

False

NOTES:

This function adds a vellow or red dashed hori7ontaJ line indicatilw the MARGINA1.0

and ABNORf\1AL levels respectively.

54

Page 60: A Replacement Database for the CH-47D Spectrometric Oil Analysis Program

8/4/2019 A Replacement Database for the CH-47D Spectrometric Oil Analysis Program

http://slidepdf.com/reader/full/a-replacement-database-for-the-ch-47d-spectrometric-oil-analysis-program 60/80

A.6. View not-fitted component form: fmNotFitted

3

4

Pr iva te Sub UserForm_QueryClose _

(cancel As Integer , CloseMode As In teger )

Prevents use of the Close but ton

I f CloseMode = vbFormControlMenu Then

cancel True

End IfEnd Sub

NOTES:

Disables the close button (1) in the top right corner of the form

Pr iva te Sub back_Click(}

Unload fmNotFit ted

fmTrends.Show

End Sub

NOTES:

Called by the Back button (4). Unloads the view not-fitted components form

(fmNotFitted) and returns to the view trends form (fmTrends).

DSTD-TN-D412

1

<11*-2

55

Page 61: A Replacement Database for the CH-47D Spectrometric Oil Analysis Program

8/4/2019 A Replacement Database for the CH-47D Spectrometric Oil Analysis Program

http://slidepdf.com/reader/full/a-replacement-database-for-the-ch-47d-spectrometric-oil-analysis-program 61/80

osrD-TN-0412

Private Sub aft-plot_Click{)

ge t -p lo t (aft_txmn.Value)

End Sub

Private Sub comb-plot_Click{)

ge t -p lo t (comb_txmn.Value)

End Sub

Private Sub eng-plot_Click{)

ge t -p lo t (eng.Value)

End Sub

Private Sub eng_tx-plot_Click{)

ge t -p lo t (eng_txmn.Value)

End Sub

Private Sub fwd-plot_Click{)

ge t -p lo t (fwd_txmn.Value)

End Sub

NOTES:

These five function.s are called by the Viet"" buttons (2) next to the lis ting of each of

the transmission types (2). It passes the current transmission serial number to the

gcCplot function.

Sub get-plot(TXMN As String)Dim the_offset As In tegerDim i As In teger

I f (TXMN <> Empty) Then

Application.ScreenUpdating = False

the_offset = SOA_element.Listlndex

Sheets ("Plot") .Visible = True

Sheets ("Plot") .Activate

fmTrends.delete-plots (1)fmTrends. set_cur -p lot_sheet ( "Plo t" )

Call fmTrends.get_single-plot{TXMN, II Fwd. Txmn. - SIN: II

the offset + 6, 4, 2)Call fmTrends.get_oil_data(TXMN, 1)

Call fmTrends.add_warning{IPlot", 1, 0, the_offset )

Cal l fmTrends. fo rmat -p lo t_ ti t les{ l, 18, 14)

Application.ScreenUpdating = True

Unload fmNotFitted

fmTrends.Hide

ActiveSheet.Select

End I fEnd Sub

NOTES:

Given the h'ansmission serial number, this function calls the plotting functions from

the formfJIITrends.

56

Page 62: A Replacement Database for the CH-47D Spectrometric Oil Analysis Program

8/4/2019 A Replacement Database for the CH-47D Spectrometric Oil Analysis Program

http://slidepdf.com/reader/full/a-replacement-database-for-the-ch-47d-spectrometric-oil-analysis-program 62/80

Sub In i t ia l i se ()Dim cur_txmn As StringDim index As Integer

Dim add_flag As BooleanDim tx_Ioc As String

Application.ScreenUpdating = False

SOA_element.AddItem "Iron (Fe)"

SOA_element.AddItem "Copper (Cu)"

SOA_element.AddItem "Magnesium (Mg)"SOA_element.AddItem "Chromium (Cr)"

SOA_element.AddItem "Aluminium (AI)"

SOA_element.AddItem "Si lver (Ag)"SOA_element.AddItem "Tin (Sn)"

SOA_element.AddItem "Nickel (Ni)"

SOA_element.AddItem "Titanium (Ti)"

SOA_element.AddItem "Sil icon (Si)"SOA_element.ListIndex = 0

Sheets ("Transmissions") .Vis ible True

Sheets ("Aircraft") .Visible = True

'F'i'ill TXMN

Sheets ("Transmissions") .ActivateActiveSheet.Range("A2") .SelectWhile (ActiveCell.Value <> " " )

Sheets ("Transmissions") .Activatecur_txmn = ActiveCell .Value

tx_loc = ActiveCell .Address

Sheets ( "Airc ra f t" ) .Ac tivate

ActiveSheet.Range("B2") .Selectadd flag = True

While (ActiveCell.Value <> " " )

If (ActiveCell.Value cur_txmn) Then

add_flag = FalseEnd IfActiveCel l .Offset ( l , 0) .Select

Wend

I f (add_flag = True) Then

fwd txmn.AddItem cur_txmn

End IfSheets ("Transmissions") .ActivateActiveSheet.Range(tx_Ioc) .SelectActiveCel l .Offset ( l , 0) .Select

Wend

'AFT TXMN

Sheets ("Transmissions") .ActivateActiveSheet.Range("B2") .SelectWhile (ActiveCell.Value <> ,",)

Sheets ("Transmissions") .Activate

DST()..TN..()412

57

Page 63: A Replacement Database for the CH-47D Spectrometric Oil Analysis Program

8/4/2019 A Replacement Database for the CH-47D Spectrometric Oil Analysis Program

http://slidepdf.com/reader/full/a-replacement-database-for-the-ch-47d-spectrometric-oil-analysis-program 63/80

DSTO-TN-0412

cur_txmn = ActiveCell .Value

tx_Ioc = ActiveCell .Address

Sheets (IIAircraft II) .Activate

ActiveSheet.Range("C2").Selectadd_flag = True

While (ActiveCell.Value <> 1111)

I f (ActiveCell.Value cur_txmn) Then

add_flag = False

End I f

ActiveCel l .Offset ( l , 0) .SelectWend

I f (add_flag = True) Thenaft_txmn.AddItem cur_txmn

End IfSheets ("Transmissions") .Activate

ActiveSheet.Range(tx_Ioc) .Select

ActiveCell .Offset(l , 0) .Select

Wend

I CQIliE Txr'1N

Sheets ("Transmissions") .ActivateActiveSheet.Range("C2") .SelectWhile (ActiveCell .Value <> II II)

Sheets ("Transmissions") .Activatecur_txmn = ActiveCell .Value

tx loc = ActiveCell .Address

Sheets ("Aircraf t II) .ActivateActiveSheet.Range("D2") .Selectadd_flag = True

While (ActiveCell.Value <> 1111)

I f (ActiveCell.Value cur_txmn) Then

add_flag = FalseEnd I f

ActiveCell .Offset(l , 0) .SelectWend

I f (add_flag = True) Then

cOmb_txmn.Addltem cur_txmn

End I f

Sheets ("Transmissions") .Activate

ActiveSheet.Range(tx_Ioc) .SelectActiveCell .Offset(l , 0) .Select

Wend

I ENG TXI'1N

Sheets (IITransmissions II) .Activate

ActiveSheet.Range("D2") .SelectActiveCell.Offset(O, 0) .SelectWhile (ActiveCell. Value <> II II)

Sheets ("Transmissions") .Activate

cur txmn = ActiveCell .Value

tx loc = ActiveCell .Address

Sheets ("Aircraft") .Activate

58

Page 64: A Replacement Database for the CH-47D Spectrometric Oil Analysis Program

8/4/2019 A Replacement Database for the CH-47D Spectrometric Oil Analysis Program

http://slidepdf.com/reader/full/a-replacement-database-for-the-ch-47d-spectrometric-oil-analysis-program 64/80

ActiveSheet.Range("E2") .Select

add_flag = True

While (ActiveCell.Value <> " " )

If (ActiveCell.Value cur_txmn) Thenadd_flag = False

End I fActiveCell .Offset(l , O).Select

WendActiveSheet.Range("F2").Select

While (ActiveCell.Value <> " " )

If (ActiveCell.Value cur_txmn) Then

add_flag = FalseEnd IfActiveCell .Offset(l , 0) .Select

WendI f (add_flag = True) Then

eng_txmn.AddItem cur txmnEnd IfSheets ("Transmissions") .Activate

ActiveSheet.Range(tx_loc) .SelectActiveCell.Offset(l , 0) .Select

Wend:

'ENG

Sheets ("Transmissions") .Activate

ActiveSheet.Range("E2") .SelectAct iveCel l.Off set (O , O) .Se lec tWhile (ActiveCell.Value <> " " )

Sheets("Transmissions").Activatecur_txmn = ActiveCell.Value

tx_loc = ActiveCell.Address

Sheets ("Aircraf t" ) .Activate

ActiveSheet.Range("G2") .Selectadd_flag = True

While (ActiveCell.Value <> ' " ')

I f (ActiveCell.Value cur_txmn) Then

add_flag = FalseEnd I fActiveCell.Offset(l , 0) .Select

Wend

ActiveSheet.Range("H2") .SelectWhile (ActiveCell.Value <> " " )

If (ActiveCell.Value cur_txmn) Then

add_flag = FalseEnd IfActiveCell.Offset(l , 0) .Select

Wend

If (add_flag = True) Theneng.Addltem cur_txmn

End IfSheets ("Transmissions") .ActivateActiveSheet.Range(tx_loc) .SelectActiveCell.Offset(l , 0) .Select

Wend

DSTO-TN-Q412

59

Page 65: A Replacement Database for the CH-47D Spectrometric Oil Analysis Program

8/4/2019 A Replacement Database for the CH-47D Spectrometric Oil Analysis Program

http://slidepdf.com/reader/full/a-replacement-database-for-the-ch-47d-spectrometric-oil-analysis-program 65/80

DST0-TN-0412

I f (fwd_txmn.ListCount > 0) Thenfwd_txmn.ListIndex 0

End IfI f (aft_txmn.ListCount > 0) Then

aft_txmn.ListIndex 0

End IfI f (comb_txmn.ListCount > 0) Then

comb_txmn.ListIndex 0

End IfI f (eng_txmn.ListCount > 0) Then

eng_txmn.Listlndex 0

End IfI f (eng.ListCount > 0) Then

eng. ListIndex 0

End I f

Sheets ("Transmissions") .Visible = FalseSheets ("Airc ra ft " ) .Visib le False

Application.ScreenUpdating = True

End Sub

NOTES:

For the five transmission types G component is added to the not-fitted list-box if it ison the master list of components on the Transmissions page but docs not appear in

the hst of in_stalled transmissions on the Aircraft slwct.

60

Page 66: A Replacement Database for the CH-47D Spectrometric Oil Analysis Program

8/4/2019 A Replacement Database for the CH-47D Spectrometric Oil Analysis Program

http://slidepdf.com/reader/full/a-replacement-database-for-the-ch-47d-spectrometric-oil-analysis-program 66/80

A.7. Change transmission component form: fmTransmission

DSTO-TN-Q412

3

4

5

6

',';C,:.'

"1Jt ;io

.:.lk::,Li\:::'?2,:ciF.,:q . ' ~ , , : ," N ;,::<\:<':;(;\/',,'1 ::.'''

' - ~ , ~ : ; , , : " ' : " " ':; 1"", ' ; : - ' ; ' : , ~ ~ ~ . i : · : ~ : ~ ~ ' . - ' · '

~ -

Const N_AC As In tege r = 6

Const N_TX As In tege r = 7

Const remove_st r As Str ing

, 6 Air c r a f t in f l e e t

I 7 Transmiss ions i n A ir cra ft

"REMOVED"

Dim TXarray(7, 2) As Integer

Dim AC_row As Integer

Dim fwd_txmn_index As In tege r

Dim a f t txmn index As Integer

Dim comb t index As In tege r

Dim eng txmnl- index As In tege r

Dim eng=txmn2=index As In tege rDim engl_index As Integer

Dim eng2_index As In teger

Option Compare T ex t ' That i s , "AM" i s equal to "aaa" .

NOTES:

Variables local to the form fmTransmission

Pr iva te Su b UserForm_QueryClose _

(cancel As In tege r , CloseMode As In teger )

Prevents use of the Close but ton

I f CloseMode = vbFormControlMenu Then

cancel True

End I fEnd Sub

NOTES:

Disables the close button (1) in the top right corner of the form

61

Page 67: A Replacement Database for the CH-47D Spectrometric Oil Analysis Program

8/4/2019 A Replacement Database for the CH-47D Spectrometric Oil Analysis Program

http://slidepdf.com/reader/full/a-replacement-database-for-the-ch-47d-spectrometric-oil-analysis-program 67/80

DSTO-TN-0412

Private Sub Cancel_Click()

fwd_txmn.ListIndex = TXarray(O, 1)

aft_txmn.ListIndex = TXarray(l, 1)

comb_ txmn .Lis tIndex TXarray (2 , 1)

eng_txmn1.ListIndex = TXarray(3, 1)

eng_txmn2.ListIndex = TXarray(4, 1)eng1.ListIndex TXarray(S, 1)

eng2.ListIndex = TXarray(6, 1)

Sheets ("Aircraft") .Visible = True

Sheets ("Aircraft") .Activate

ActiveSheet.Range("AircraftlB" & AC row) .SelectActiveCell.Value = fwd_txmn.Value

ActiveSheet.Range ("Aircraft I C" & AC_row) .SelectActiveCell.Value = a f t txmn.Value

ActiveSheet.Range("AircraftlD" & AC_row) .Select

ActiveCell.Value = comb txmn.Value

ActiveSheet.Range("AircraftlE" & AC_row) .SelectActiveCell.Value = eng_txmn1.Value

ActiveSheet.Range("AircraftlF" & AC row) .SelectActiveCell.Value = eng_txmn2.Value -ActiveSheet .Range ("Aircraft lG" & AC_row) .SelectActiveCell.Value = engl. Value

ActiveSheet.Range("AircraftlH" & AC_row) .SelectActiveCell.Value = eng2.Value

Sheets ("Aircraft") .VisibleUnload fmTransmission

fmAircraft.Show

End Sub

False

NOTES:

Called when the Cancel button (5) is pressed. Exits from the transmission change

page '<'I'ithout altering the currently installed transmissiDns in the selected aircraft.

This is accomplislwd by resturing the original state of thE' aircraft that is saved in

TXarray by the Initialize function when the form is lO2ldl'd. Returns to the main form

fmAircraft.

Sub In i t ia l ize ()Dim index As IntegerDim i As IntegerDim j As IntegerDim k As IntegerDim n_end As Integer

Dim txmn_object As Control

Application.ScreenUpdating = False

62

TXarray(O, 0)

TXarray(l, 0)TXarray(2, 0)

fwd txmn.TabIndex

aft_txmn.TabIndex

comb txmn.TabIndex

Page 68: A Replacement Database for the CH-47D Spectrometric Oil Analysis Program

8/4/2019 A Replacement Database for the CH-47D Spectrometric Oil Analysis Program

http://slidepdf.com/reader/full/a-replacement-database-for-the-ch-47d-spectrometric-oil-analysis-program 68/80

TXarray(3, 0)TXarray(4, 0)TXarray(S, 0)TXarray(6, 0)

eng_txmnl.TabIndex

eng_txmn2.TabIndex

engl.TabIndex

eng2.TabIndex

DST0-TN-D412

, AC data s t a r t s a t row 2

AC_row = fmAircraft .tai l_no.ListIndex + 2tail_no.ControlSource = "Aircraft lA" &AC_row

j = 0For Each txmn_object In Controls

I f (j < N_TX) Then

I f txmn_object.TabIndex = TXarray(j, 0) Then

, NOTE: Transmission data s t a r t s a t row 2 . . .Sheets ("Aircraft" ) .ActivateActiveSheet.Range("Aircraft lB" & AC_row) .Select

, Move to correct t ran smi ss ion typeActiveCell.Offset(O, j ) .Se lec t

, Build l i s t of available transmissions

Select Case jCase Is < 3 '0,1,2

k = jCase 3 To 4

k = 3

Case 5 To 6k = 4

End Select

I Builds menu using a l l transmissions . . .

Sheets ("Transmissions") .Activatetxmn object.AddItem remove s t r

Acti: ;eSheet.Range ("A2") .SelectActiveCell.Offset(O, k) .Select

txmn_object .ListIndex = 0While (ActiveCell.Value <> Empty)

txmn_object.AddItem ActiveCell .Value

ActiveCel l .Offset ( l , 0) .SelectWend

1 Remove from menu those components tha t a re a lre ad y f i t ted . . .

I Unless f i t ted to c urre nt AC in that location!Sheets ("Aircraft") .Activate

ActiveSheet.Range("Aircraft lB" & AC_row) . SelectActiveCell.Offset(O, j) .SelectWhile (ActiveCell.Value <> Empty)

n_end txmn_object.ListCount

Fo r i = 0 To n end - 1

63

Page 69: A Replacement Database for the CH-47D Spectrometric Oil Analysis Program

8/4/2019 A Replacement Database for the CH-47D Spectrometric Oil Analysis Program

http://slidepdf.com/reader/full/a-replacement-database-for-the-ch-47d-spectrometric-oil-analysis-program 69/80

DSTO-TN-D412

64

I f i < txmn_object.ListCount Then

txmn_object.ListIndex = iI f txmn_object.Value = ActiveCell.Value

... Then

If ActiveCell.Row <> AC row Then

txmn_object.RemoveItem i

End Ifn_end = txmn_object .ListCount

End IfEnd I f

Next i

ActiveCel l .Offset( l , 0) .SelectWend

I Case for engines and en g TX

I f (j = 3 Or j = 5) Then

ActiveSheet.Range("AircraftlB" & AC row) .Se lec t

ActiveCell.Offset(O, j + 1) .Se lec tWhile (ActiveCell .Value <> Empty)

n_end = txmn_object.ListCount

For i = 0 To n end - 1

I f i < txmn_object .ListCount Then

txmn_object.ListIndex = iIf txmn_object.Value = ...

... ActiveCell. Value Then

txmn_object.RemoveItem in_end = txmn_object .ListCount

End I fEnd I f

Next i

ActiveCel l .Offset( l , 0) .Se lec tWend

End If

I Case for engines and eng TX

I f (j = 4 Or j = 6) Then

ActiveSheet.Range("AircraftlB" & AC row) .Se lec tActiveCell .Offset(O, j - 1) .Se lec t

While (ActiveCell .Value <> Empty)

n_end = txmn_object .ListCount

Fo r i = 0 To n en d - 1

I f i < txmn_object .ListCount Then

txmn_object.Listlndex = iIf txmn_object.Value = ...

... ActiveCell. Value Then

txmn_object.Removeltem in_end = txmn_object.ListCount

End I fEnd If

Next i

Act iveCel l .Offse t ( l , 0) .Se lec tWend

End I fSheets ( "Airc ra ft" ) .Ac t ivate

ActiveSheet. Range ("B" & AC row) . Select

Page 70: A Replacement Database for the CH-47D Spectrometric Oil Analysis Program

8/4/2019 A Replacement Database for the CH-47D Spectrometric Oil Analysis Program

http://slidepdf.com/reader/full/a-replacement-database-for-the-ch-47d-spectrometric-oil-analysis-program 70/80

index

iActiveCel l .Value) Then

DST0-TN-Q412

Act iveCe l l .Of fse t ( j , 0) .Select

txmn_object.ListIndex = 0

n_end = txmn_object.ListCount

For i = 0 To n en d - 1

txmn_object.ListIndex

I f (txmn_object.Value

index = i

End IfNext itxmn_object.ListIndex

j = j + 1

End IfEnd I f ' j < N_TX

Next ' txmn_objec t

fwd_txmn.ControlSource = IAircraft!B" & AC_row

aft_txmn.ControlSource = IAircraft!C" & AC row

comb_txmn.ControlSource IAircraft!D" & AC_row

eng_txmn1.ControlSource = IAircraft!E" &AC_roweng_txmn2.ControlSource = IAircraft!F" & AC_row

eng1.ControlSource IAircraft!G" & AC_row

eng2.ControlSource = "Aircraft!H" & AC_row

fwd_txmn_index = fwd_txmn.ListIndex

aft_txmn_index = aft_txmn.ListIndex

comb txmn index comb txmn.ListIndex

eng_txmn1=index = eng_txmn1.ListIndex

eng_txmn2_index = eng_txmn2.ListIndex

eng1_index eng1.ListIndex

eng2_index = eng2.ListIndex

TXarray(O, 1)

TXarray(1, 1)TXarray(2, 1)

TXarray(3, 1)

TXarray(4, 1)

TXarray(S, 1)

TXarray(6, 1)

End Sub

fWd_txmn_index

aft_txmn_indexcomb txmn index- -eng_txmn1_index

eng_txmn2_index

eng1_index

eng2_index

NOTES:

This function populates the list boxes (2) with the available options for transmission

components that may be installed in the selected aircraft (3). The available options

include those components that are currently not fitted to any aircraft. Each list

initially shm,vs the serial number of the component that is currently fitted. Each list

box is bound to the aircraft data page ",'here the currently installed component serial

number is stored. Any changes made to the installed component are therefore

automatically updated here. An image of the original state of tl1e aircraft is kept in

TXarray - this information is used in the event that the operation is cancelled.

65

Page 71: A Replacement Database for the CH-47D Spectrometric Oil Analysis Program

8/4/2019 A Replacement Database for the CH-47D Spectrometric Oil Analysis Program

http://slidepdf.com/reader/full/a-replacement-database-for-the-ch-47d-spectrometric-oil-analysis-program 71/80

DST0-TN-0412

Private Sub Change_Button_Click()

Dim TXMN As Str ingDim AC As Str ing

Dim SOAP_row As IntegerDim tmp_index As IntegerDim txmn_object As Control

Dim i As Integer

Dim response As String

Dim tmp_day As String

Dim tmp_month As String

Dim tmp_year As String

Dim tmp_date As String

Dim change_tx As Boolean

Dim component_hours As Double

change_tx = False

I f (fwd_txmn_index <> fwd_txmn.Listlndex) Then

change_tx = TrueEnd I f

I f (aft_txmn_index <> aft_txmn.ListIndex) Then

change_tx = True

End I f

I f (comb_txmn_index <> comb_txmn.ListIndex) Then

change_tx = True

End I f

I f (eng_txmnl_index <> eng_txmnl.ListIndex) Then

change_tx = True

End I f

I f (eng_txmn2_index <> eng_txmn2.ListIndex) Then

change_tx = True

End I f

I f (engl_index <> engl .Lis tIndex) Then

change_tx = TrueEnd I f

I f (eng2_index <> eng2.ListIndex) Then

change_tx = True

End I f

I f (the_date. Value <> Empty) Then

tmp_day = Day(the_date.Value)

tmp_month = Month (the_date. Value)

tmp_year = Year(the_date.Value)

I Reformat to g ive d 5 ~ ' - m o E t ] ; - y e a rSe lec t Case tmp_month

Case "1"

66

tmp_month

Case "2"

tmp_month

Case "3"

tmp_month

Case "4"

"Jan"

"Feb"

"Mar"

Page 72: A Replacement Database for the CH-47D Spectrometric Oil Analysis Program

8/4/2019 A Replacement Database for the CH-47D Spectrometric Oil Analysis Program

http://slidepdf.com/reader/full/a-replacement-database-for-the-ch-47d-spectrometric-oil-analysis-program 72/80

"Apr"mp_monthCase "5"

tmp_month "May"Case "6"

tmp_month"Jun"

Case "7"

tmp_month "Jul"Case "8"

tmp_month "Aug"Case "9"

tmp_month "Sep"

Case "10"

tmp_month "Oct"

Case "11"

tmp_month "Nov"Case "12"

tmp_month "Dec"End Selecttmp_date = tmp_day & "I" & tmp_month & "I" & tmp_year

the_date. Value = tmp_date

I Get AC identi ty . . .

AC = fmAircraf t . ta i l_no.TextFo r Each txmn_object In Controls

i = 0While i < N TX

O5To-TN-0412

I f txmn_object.TabIndex = TXarray(i, 0) Then

Sheets ("Aircraf t") .Visible = True

Sheets ("Aircraf t") .ActivateI Get transmission ident i ty . . .

tmp_index = txmn_object.ListIndextxmn_object.ListIndex = TXarray(i, 1)

TXMN=

txmn_object.Valuetxmn_object.ListIndex = tmp_index

If (txmn_object.Listlndex <> TXarray(i , 1» ThenI f (TXarray(i, 1) <> 0) Then

I Remove exis t ing component

I SOAP Data s ta r ts on row 5 ._ .

SOAP_row = 5Sheets (TXMN) .ActivateActiveSheet.Range("A" & SOAP_row) .SelectWhile (ActiveCell.Value <> ",,)

SOAP row = SOAP row + 1- -ActiveCel l .Offset( l , 0) .Select

Wend

ActiveSheet.Range("A" & SOAP_row) .SelectActiveCell.Value = "Removed f rom" & AC

ActiveSheet.Range("D" & SOAP_row) .SelectActiveCell.Value = the date.Value

End IfI f (txmn_object.Listlndex <> 0) Then

I Add new component

TXMN = txmn_object.Value

67

Page 73: A Replacement Database for the CH-47D Spectrometric Oil Analysis Program

8/4/2019 A Replacement Database for the CH-47D Spectrometric Oil Analysis Program

http://slidepdf.com/reader/full/a-replacement-database-for-the-ch-47d-spectrometric-oil-analysis-program 73/80

DSTD-TN-0412

, SOP.P Data s t a r t s on ro,,' 5 ...SOAP row = 5Sheets (TXMN) .Activate

ActiveSheet.Range ("A" & SOAP_row) .SelectWhile (ActiveCell.Value <> " " )

SOAP row = SOAP row + 1- -ActiveCell .Offset{l , 0) .Select

Wend

ActiveSheet.Range{"A" & SOAP_row) .SelectActiveCell.Value = "Fit ted to " & AC

ActiveSheet.Range{"D" & SOAP_row) .SelectActiveCell.Value = the_date.Value

End I f

I f (SOAP_row > 5) Then, Copy component hours from pre7ious 7alue

ActiveSheet.Range{"B" & SOAP row -1 ) .... Selec t

component_hours = ActiveCell.Value

ActiveSheet.Range{"B" & SOAP_row) .SelectActiveCell .Value = component_hours

End I f

End I f

End If

i = i + 1

Wend

Next ' txmL_object

Unload fmTransmission

fmAircraft.Show

ElseIf (change_tx = True) Thenresponse = MsgBox{"Please enter a date for this act ion", _

... vbOKOnly + vbExclamation + vbApplicationModal)

ElseUnload fmTransmission

fmAircraft.Show

End I f

Sheets ("Aircraft") .VisibleEnd Sub

False

NOTES:

If a b'ansnussion has been changed. dnd a date few tht' change has been entered then

this function will update the databclSC' in three meas:

1. On the Aircraft page. the ne\\' installed cornponent serial numbers arc

updated.

2. On the Remo\lec! Components page. <; note is mack of Idwn and from which

aircraft it \-\'as remo,'cd.

3. On the Installed Components page, a note is milde of when and tc> which

aircraft it was installed.

68

Page 74: A Replacement Database for the CH-47D Spectrometric Oil Analysis Program

8/4/2019 A Replacement Database for the CH-47D Spectrometric Oil Analysis Program

http://slidepdf.com/reader/full/a-replacement-database-for-the-ch-47d-spectrometric-oil-analysis-program 74/80

A.B. Set alarm levels form: fmLevels

DSTD-TN-0412

3

4

5

Pr iva te Su b UserForm_QueryClose _

(Cancel As In teger , CloseMode As In teger)

Prevents use of the Close but ton

I f CloseMode = vbFormControlMenu Then

Cancel True

End IfEnd Sub

NOTES:

Disables the close button (1) in the top right corner of the form

Pr iva te Sub back_Click()

Unload fmLeve ls

fmAircraft.Show

End Sub

NOTES:

Called when Back button (5) is pressed. Closes the Alarm Levels form and returns to

the mall! page - any changes are kept.

Pr iva te Sub Component_Change()

get_ leve ls

End Sub

NOTES:

Called \-\Then the component type (3) is changed. Alarm level data is updated.

69

Page 75: A Replacement Database for the CH-47D Spectrometric Oil Analysis Program

8/4/2019 A Replacement Database for the CH-47D Spectrometric Oil Analysis Program

http://slidepdf.com/reader/full/a-replacement-database-for-the-ch-47d-spectrometric-oil-analysis-program 75/80

DSTO-TN-0412

Private Sub Level_Change()

get_levelsEnd Sub

NOTES:

Called when the component type (4) is changed. Alarm level data is updated.

Sub In i t i a l i ze ( )

Component .AddItem ("Forward TXMN")

Component .AddItem ("Aft TXMN")

Component .AddItem ("Combining TXMN")

Component .AddItem ("Engine TXMN")

Component .AddItem ("Engine")

Component.ListIndex = 0

Level.AddItem ("Marginal")

Level.AddItem ("Abnormal")

Level.ListIndex = 0

get levelsEnd Sub

NOTES:

Initialises the list boxes on thc form with coulponcnt names (3) and alarm lc\'els (4).

The alarm level values arc set by the function gct_Icl'rls.

Private Sub get_levels()Application.ScreenUpdating = False

Sheets ("Levels") .Visible = True

Sheets ("Levels") .Act ivate

I f (Level.ListIndex = 0) Then

Range("B3") .Select f Abnormal le 'Jel data s ta r t s on rm,' 3ElseIf (Level.ListIndex 1) Then

Range ("B14") .Select f Warning level data s ta r t s on rov,' 14End I f

ActiveCell.Offset(Component.ListIndex, 0) .Select

Fe.ControlSource = ActiveCell.Address

ActiveCell .Offset(O, 1) .SelectCu.ControlSource = ActiveCell.Address

ActiveCell .Offset(O, 1) .SelectMg.ControlSource = ActiveCell.Address

ActiveCell .Offset(O, 1) .SelectCr.ControlSource = ActiveCell.Address

ActiveCell .Offset(O, 1) .SelectAl.ControlSource = ActiveCell.AddressActiveCell .Offset(O, 1) .SelectAg.ControlSource = ActiveCell.AddressAct iveCel l .Offse t (0 ,4) .Selec t f S}:ip: Tin, Nickel, Titanium

Si.ControlSource = ActiveCell.Address

70

Page 76: A Replacement Database for the CH-47D Spectrometric Oil Analysis Program

8/4/2019 A Replacement Database for the CH-47D Spectrometric Oil Analysis Program

http://slidepdf.com/reader/full/a-replacement-database-for-the-ch-47d-spectrometric-oil-analysis-program 76/80

DSTO-TN..()412

Sheets("Levels").Visible = False

Application.ScreenUpdating = False

End Sub

NOTES:

Sets the alarm level values (2) for the indicated component and alarm level type. The

ControlSource call links the displayed text directly to the stored data on the sheet

Levels. There is no error checking - valid numbers must be entered.

71

Page 77: A Replacement Database for the CH-47D Spectrometric Oil Analysis Program

8/4/2019 A Replacement Database for the CH-47D Spectrometric Oil Analysis Program

http://slidepdf.com/reader/full/a-replacement-database-for-the-ch-47d-spectrometric-oil-analysis-program 77/80

DSTO-TN-D412

A.9. Help form: fmHelp

Help!

l--0_E_P_A_R_T_M_E_N_T_O_F_D_E_F_E_N_C_E-j 0SID8EFUCE SCIENCE & TECHNOLOCY ORClINlSATlOH

CH47 SOAP DatabaseDesigned by: Paul Marsden DSTO-AMRL

Version 1.0 - q (November 2001)

1

I

i If you have any commentE or questions about this database, pleaseIIi contact the Machine Dynamics Group, Aeronautical and Maritime

Ii Research Laboratory:

Ii Paul Marsden: Email: p a u l . m a r s d e n @ d s t o . d e f e n c e r : . ~ o : : : : v : : : : , a ~ u = = = ~II Ph: (03) 9626 7571Ii Fax: (03) 9626 7083 1-1-- 2Ii I.:Ii

Pr iva te Sub UserForm_QueryClose _

(Cancel As In tege r , CloseMode As Integer)

Prevents use of the Close but ton

I f CloseMode = vbFormContro lMenu Then

Cancel True

End I f

End Sub

NOTES:

Disables the close button (1) in the top right corner of the form

Private Sub OK_Button_Click()

Unload fmHelp

End Sub

NOTES:

Unloads the Help form (Returns the main form .UllAircmft tn vie\v).

72

Page 78: A Replacement Database for the CH-47D Spectrometric Oil Analysis Program

8/4/2019 A Replacement Database for the CH-47D Spectrometric Oil Analysis Program

http://slidepdf.com/reader/full/a-replacement-database-for-the-ch-47d-spectrometric-oil-analysis-program 78/80

DISTRffiUTIONLIST

A Replacement Database for the CH-47D SpectrometricOil Analysis Program

PaulMarsden and Andrew Becker

AUSTRALIA

DEFENCEORGANISATION

Task Sponsor

DGTA(RAAF)

S&TProgram

Chief Defence Scientist 1

FAS Science Policy 1hared copy

AS Science Corporate Management

Director General Science Policy Development

Counsellor DefenceScience, London (DocData Sheet only)

Counsellor Defence Science, Washington (DocData Sheet only)

Scientific Adviser to MROCThailand (DocData Sheet only)Scientific Adviser Joint

Navy Scientific Adviser

Scientific Adviser - Army

Air Force Scientific Adviser

Aeronautical and Maritime Research Laboratory

Director

Chief of Airframes & Engines Division

Research Leader Propulsion

Albert Wong (AED)

BrianRebbechi (AED)

Alan Power (AED)Author(s): PaulMarsden

Andrew Becker

DSTO Library and Archives

library Fishermans Bend, 1 copy

library Maribyrnong (DocData Sheet only)

library Edinburgh (DocData Sheet only)

Australian Archives

library, MOD, HMAS Stirling (DocData Sheet only)

library, MOD, Pyrmont (Doc Data sheet only)

US Defense Technical Information Center, 2 copies

UKDefence Research Information Centre, 2 copies

Canada Defence Scientific InformationService, 1 copy

. NZ Defence Information Centre, 1 copy

National library of Australia, 1 copy

Capability Systems Staff

Director General MaritimeDevelopment (Doc Data Sheet only)

Director General Land Development, 1 copy

Director General Aerospace Development, 1 copy

Page 79: A Replacement Database for the CH-47D Spectrometric Oil Analysis Program

8/4/2019 A Replacement Database for the CH-47D Spectrometric Oil Analysis Program

http://slidepdf.com/reader/full/a-replacement-database-for-the-ch-47d-spectrometric-oil-analysis-program 79/80

Knowledge Staff

Director General Command, Control, Communications and Computers (DGC4)

(Doc Data Sheetonly)

Navy

CENGRNAPO, HMASAlbatross, NSW 2540

Army

Commanding Officer, Army Aircraft Logistic Management Squadron, Oakey

Aviation Centre, OakeyQLD4401, (1 copy)

A15 LOGMNGR Army Aircraft Logistic Management Squadron, Oakey Aviation

Centre, Oakey QLD 4401, (2 copies)

Stuart Schnaars, ABCA Standardisation Officer, Tobruk Barracks, Puckapunyal,

3662 (4 copies)

SO (Science), Deployable Joint Force Headquarters (DJFHQ) (L), MILPO Gallipoli

Barracks, Enoggera QLD 4052 (1 copy)

Air Force

CENGR EMU, SRSPO, RAAF Amberley, QLD4306CENGR MPLMSQN, RAAF Edinburgh, SA 5111

CENGR ALSPO, RAAF Richmond, NSW 2755

CENGR TASPO, RAAF EastSale, VIC 3852

Corporate Support ProgramLibrary Manager, DLS-Canberra

MSSamDoran

Defence Library Service - SydneyWest

Building N157, Defence Establishment

The Northern Road

OrchardHills NSW 2748

UNIVERSITIES AND COLLEGES

Australian Defence Force Academy

Library

Head of Aerospace andMechanical Engineering

Hargrave Library, Monash University (Doc Data Sheet only)

OTHER ORGANISATIONS

Mr Alan Yarrow, Innisfail Scientific Services, PO Box 6 Miriwinni, QLD 4871

NASA (Canberra)

AusInfo

OUTSIDE AUSTRALIA

INFORMATIONEXCHANGE AGREEMENT PARTNERSAcquisitions Unit, Science Reference and Information Service, UK

Library - Exchange Desk, National Institute ofStandards and Technology, US

National Aerospace Laboratory, Japan

National Aerospace Laboratory, Netherlands

SPARES (5 copies)

Total number of copies: 55

Page 80: A Replacement Database for the CH-47D Spectrometric Oil Analysis Program

8/4/2019 A Replacement Database for the CH-47D Spectrometric Oil Analysis Program

http://slidepdf.com/reader/full/a-replacement-database-for-the-ch-47d-spectrometric-oil-analysis-program 80/80

UNCLASSIFIEDfi tiage c assl ca on:

DEFENCE SCIENCE AND TECHNOLOGY ORGANISATION

DOCUMENT CONTROL DATA 1. PRIVACYMARKING/CAVEAT (OF

DOCUMEN1)

2. TI11..E 3. SECURITYCLASSIFICATION (FORUNCLASSIFIED REPORTS

THAT ARE LIMITEDRELEASE USE (L) NEXT TO DOCUMENT

AReplacement Database for theCH-47DSpectrometricOil CLASSIFICATION)

Analysis ProgramDocument (U)

Title (U)

Abstract (U)

4. AUlHOR(S) 5. CORPORATE AUlHOR

Paul Marsden and Andrew Becker Aeronautical andMaritimeResearch Laboratory506 Lorimer St

FishermansBendVictoria 3207Australia

6a. OSTONUMBER 6b. ARNUMBER 6c. TYPEOF REPORT 7. DOCUMENT DATE

DSTO-TN-0412 AR-012-161 Technical Note March 2002

8. FILE NUMBER 9. TASK NUMBER 10. TASK SPONSOR 11. NO. OFPAGES 12. NO. OF

Ml/9/1037 NAVOO/l54 DGTA 71 REFERENCES

13. URLon th eWorld Wide 14. RELEASEAUlHORITY

http :/ /www.dsto.defence.gov.au/corporate/reports/DSTO-TN-0412.pdf Chief, Airframes and Engines Division

15.SECONDARYRELEASE STATEMENTOF TIllS DOCUMENT

Approved for public release

OVERSEAS ENQUIRIESOUTSIDE STATED LIMITATIONS SHOULD BE REFERRED lHROUGHDOCUMENTEXCHANGE, PO BOX 1500,SAIlSBURY, SA 5108

16. DELIDERATE ANNOUNCEMENT

No Limitations

17. CASUAL ANNOUNCEMENT Yes18. DEFTEST DESCRIPTORS

Oils; spectrochemical analysis; Wear;Military helicopters;Chinook helicopters; AustralianArmy; Data bases;

Computer programs; Failure (mechanics).

19. ABSTRACT

A Spectrometric Oil Analysis Program (SOAP) operates on selected Australian Defence Force platforms

to assist in the prediction of incipient machinery failure. Historically, the data from the Australian ArmyCH-47D helicopters has been stored on a simple Microsoft Excel spreadsheet. DSTO was tasked by the

Army Aircraft Logistic Management Squadron to assess the usefulness of this database. This reportcontains a detailed description of the replacementSOAP database designed by DSTO.