Accelerated Life Testing Analysis in Microsoft Excel - Explanation: Difference between revisions

From ReliaWiki
Jump to navigation Jump to search
No edit summary
(Redirected page to API Tutorials)
 
(4 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{Template:APIClass|Repository Class| }}
#REDIRECT [[API_Tutorials]]
This article explains some of the API calls in the [http://www.reliasoft.com/synthesis/api/examples/ALTAExample.xlsm Accelerated Life Testing Analysis in Microsoft Excel] example file. For more examples, please see the [[Synthesis_API_Reference#Application_Examples|Example section]] of the API Reference.
 
The functions in this example are very similar to the [[Life Data Analysis in Microsoft Excel - Explanation|Weibull++ example]]. After reviewing the structure of the Weibull++ example, note the following differences.
 
*Inside the CalculateALTA function, a "Use Stress" value is specified before running calculations. This is done by calling the ALTADataSet object's AddStressDefinition and passing a name of the stress and the value.  Note that we are checking that the stress value is greater than 0 to provide a useful error message if it is not.
 
<div style="margin-right: 150px;">
{{APIComment|'Set the Use Stress value}}
  Dim useStress As Double
  useStress = ActiveSheet.Range("F3")
  If useStress <= 0 Then
    {{APIComment|'If the use stress value is invalid, then don't continue calculating}}
      MsgBox "Enter a use stress. The use stress value must be greater than 0.", vbInformation
      Call ClearResults
      Exit Sub
  End If
  Call mALTADataSet.AddStressDefinition(ActiveSheet.Range("C2"), , useStress)
</div>
 
*When loading the failure data from the spreadsheet, the ALTADataSet object’s AddFailure subroutine includes a third parameter to pass the stress values for the failure.  Note that although our sheet has only one stress column, you could add additional stress columns which is why the stress value is passed inside an array.
 
{{APIComment|'Read the Grouped Time to Failures data into the ALTADataSet}}
  Dim i As Integer
  Dim StressArray(0) As Variant
  For i = 3 To ActiveSheet.Cells(ActiveSheet.Rows.count, 1).End(xlUp).Row - 1
    StressArray(0) = ActiveSheet.Cells(i, 3).Value
    Call mALTADataSet.AddFailure(Val(ActiveSheet.Cells(i, 1).Value), _
                              CLng(ActiveSheet.Cells(i, 2).Value), StressArray)
    Next

Latest revision as of 21:17, 4 May 2016

Redirect to: