ReliaSoft API Reference: Difference between revisions

From ReliaWiki
Jump to navigation Jump to search
No edit summary
(v10.1 update)
Line 1: Line 1:
{{Template:API}}
{{Template:API}}


The  ReliaSoft Synthesis API enables you to programmatically read and write data in Synthesis desktop applications. The API has been developed for Visual Basic for Applications (VBA) and Visual Basic.NET. This gives you the ability to create automated solutions using popular Microsoft Office applications, such as Excel and PowerPoint, as well as create custom applications for your organization.
<div style="border:1px solid #D0CDE8; background:#EEEDF7; border-radius:10px; width:auto; margin:0 0 1em 1em; padding:1em; float:right;">
*'''[[API Changelog]]'''
*'''[[Full Synthesis API|Documentation]]
</div>


== Requirements  ==
The Synthesis Platform’s ''Application Programming Interface (API)'' enables you to programmatically connect your Synthesis applications and data with other systems and tools used within your organization. The API is written for Visual Basic for Applications (VBA) and Visual Basic.NET. This gives you the ability to create automated solutions using popular Microsoft Office applications, such as Excel and PowerPoint, as well as create custom applications for your organization.
Before using the Synthesis API, note the following requirements:


*You must reference the required Synthesis API library in your .NET project or VBA file ([[Referencing_an_Object_Library|show me how]]). The library is located in the folder where the Synthesis applications are installed. By default, this folder is at C:\Program Files\ReliaSoft\Synthesis 10" (for Version 9, it is "C:\Program Files\ReliaSoft\Synthesis 9").
'''Transfer and synchronize data via XML'''


:*For VBA developers, use the SynthesisAPI.tlb library
For structured data (such as system hierarchies/BOMs, incidents and work orders) you can use XML files and the API to manage data transfer and synchronization between XFRACAS and variety of different PLMs, ERPs, CMMS and other external systems. You can also use XML files to create reliability block diagrams (RBDs) in BlockSim.
:*For .NET developers, use the SynthesisAPI.dll library


*The version of the Synthesis Platform that you've installed (32- vs. 64-bit) must match your installed version of Microsoft Office. If they do not match, you may see an error related to ActiveX controls. (See [http://www.reliasoft.com/support/rs20024.htm ReliaSoft KB article RS20024].)
'''Input/output specific data elements and analyses'''


==Examples==
With the Synthesis API, you can read from or write data to Synthesis resources (models, actions, URDs, etc.), system hierarchy items and FMEA records (causes, effects, failures, etc.). You can initiate batch data processing and create custom solutions for importing/exporting data from Synthesis repositories, as well as load data into the Synthesis Data Warehouse (SDW).  
Sample applications that you can test and tweak yourself are shipped by default with every Synthesis desktop application. They are available for Excel, PowerPoint and Visual Basic projects. The files are stored on your computer at C:\Users\Public\Public Documents\ReliaSoft\Examples10\API. (For Version 9, see C:\Users\Public\Public Documents\ReliaSoft\Examples\API.)


To run the Excel and PowerPoint examples, macros must be enabled. (To learn how, see this [http://office.microsoft.com/en-us/excel-help/enable-or-disable-macros-in-office-documents-HA010031071.aspx Microsoft article].)
'''Obtain calculated results'''


You must also recompile the example before first use. In Excel or PowerPoint, choose '''Developer > Visual Basic'''. In the Microsoft Visual Basic for Applications window, choose '''Debug > Compile VBAProject'''.
You can use the Synthesis API to read data from published Synthesis models and obtain calculated results such as the reliability, probability of failure, BX% life, failure rate and mean time.


==API Reference Documentation==
==Getting Started==
This documentation is organized by object type. For an alphabetical listing of all classes and enumerations, see [[Full Synthesis API]].
===Examples===
Tutorials are available to help you learn the core objects of the Synthesis API and start coding right away. The tutorials include code samples for both VBA and VB.NET. See [[API Tutorials]].


*The [[Repository_Class|Repository]] object represents a connection to a Synthesis repository. You will need to establish a connection to a Synthesis repository before you can read and/or write data to it. Once you have a connection, you can use the methods in the Repository class to update Synthesis resources, import or export data from XML files, or transfer data to the Synthesis Data Warehouse (SDW).
In addition, sample applications that you can test and tweak yourself are included with the Synthesis Platform installation. The files are stored on your computer at C:\Users\Public\Public Documents\ReliaSoft\Examples10\API. (For Version 9, see C:\Users\Public\Public Documents\ReliaSoft\Examples\API.) The sample applications are available for Excel VBA and VB.NET projects. (To run the Excel examples, macros must be enabled. To learn how, see this [http://office.microsoft.com/en-us/excel-help/enable-or-disable-macros-in-office-documents-HA010031071.aspx Microsoft article].)


*The following objects represent a type of Synthesis resource.
===Prerequisites===
**[[cModel Class|cModel]]
**[[cAction Class|cAction]]
**[[cURD Class|cURD]]
**[[cVariable Class|cVariable]]
**[[cCrew Class|cCrew]]
**[[cPool Class|cPool]]
**[[cCorrectiveTask Class|cCorrectiveTask]]
**[[cScheduledTask Class|cScheduledTask]]
**[[cXfmeaControl Class|cXfmeaControl]]


To specify the displayed language for the Synthesis API library, use the [[Common_Class|SynthesisAPI.SetLanguage]] common class method.
* Install the latest version of the Synthesis application. Choose '''File > Help > Check for Updates''' or download the latest version at http://www.ReliaSoft.com/synthesis/downloads.htm.


<!--
:Note that for VBA, the bit version (32- vs. 64-bit) of the Synthesis Platform that you've installed must match your installed version of Microsoft Office. If they do not match, you may see an error related to ActiveX controls. (See [http://www.reliasoft.com/support/rs20024.htm ReliaSoft KB article RS20024].)
*The following objects represent a type of analysis or folio. You would use these objects to perform analyses on external data sources; hence, a connection to a Synthesis repository is not required.
**WeibullDataSet
**ALTADataSet
**WAPlots


* Reference the Synthesis API object library. The object library is located in the folder where the Synthesis application is installed. By default, this folder is at "C:\Program Files\ReliaSoft\Synthesis 10". (For Version 9, it is "C:\Program Files\ReliaSoft\Synthesis 9".)


-->
:For VBA applications, use the SynthesisAPI.tlb library file. For VB.NET applications, use SynthesisAPI.dll.


:For help with referencing the library, see this simple [[Referencing_an_Object_Library|How-To Guide]].


<!--
==Object Library==
The Synthesis API can be used to accomplish many of the same tasks as within Synthesis applications, and it also enables seamless integration of the Synthesis Platform with other systems within your organization—all through a programmer's own custom-developed code. This allows you to create customizable and automated solutions to reliability engineering problems by integrating Synthesis functionality into other applications.  
Below are the core objects in the Synthesis API library. For an alphabetical listing of all classes and enumerations in the object library, see [[Full Synthesis API]].


This reference describes all of the programming elements in the API. The sample code and documentation have been prepared for .NET, VB6 and VBA development environments, and it is assumed that the reader is familiar with them.  
*The <code>'''[[Repository Class|Repository]]'''</code> object represents the Synthesis repository. All other objects use the functions in this class to read or write data to the repository. This class also contains the functions for importing/exporting XML files.  


== Requirements  ==
*The following objects represent the Synthesis resources. Instances of each class can be used to store data for an existing or new resource. Note that the <code>cModel</code> class provides the methods for obtaining calculated results from a model, such as reliability, probability of failure, etc.
**<code>'''[[CAction Class|cAction]]'''</code>
**<code>'''[[CCorrectiveTask Class|cCorrectiveTask]]'''</code>
**<code>'''[[CScheduledTask Class|cScheduledTask]]'''</code>
**<code>'''[[CCrew Class|cCrew]]'''</code>
**<code>'''[[CModel Class|cModel]]'''</code>
**<code>'''[[CPool Class|cPool]]'''</code>
**<code>'''[[CURD Class|cURD]]'''</code>
**<code>'''[[CVariable Class|cVariable]]'''</code>
**<code>'''[[CXfmeaControl Class|cXfmeaControl]]'''</code>


Before using the Synthesis API, note the following requirements:
*The following objects build data collections for the SDW: <code>'''[[RawData Class|RawData]]'''</code> represents a single data point, while <code>'''[[RawDataSet Class|RawDataSet]]'''</code> serves as the data container for the RawData objects.


*Your code must include a reference to the ReliaSoft Synthesis API Library. The library is located in the folder where ReliaSoft Synthesis is installed. By default, this folder is "C:\Program Files\ReliaSoft\Synthesis 10" (for version 9 users it is&nbsp;"C:\Program Files\ReliaSoft\Synthesis 9").
*The <code>'''[[XfmeaItem Class|XfmeaItem]]'''</code> object represents a system hierarchy item. Instances of this class can be used to store data for a system or assembly, as well as build a multi-level system configuration.  
**.NET developers – use the SynthesisAPI.dll library
**VB6 / VBA developers – use the SynthesisAPI.tlb library


*The version of the Synthesis Platform that you've installed (32- vs. 64-bit) must match your installed version of Microsoft Office. If they do not match, you may see an [http://www.reliasoft.com/support/rs20024.htm error] related to ActiveX controls.
*The following objects represent the FMEA records. Instances of each class can be used to store data for an existing or new FMEA analysis.  
 
**<code>'''[[XfmeaFunction Class|XfmeaFunction]]'''</code>
== API Elements  ==
**<code>'''[[XfmeaCause Class|XfmeaCause]]'''</code>
 
**<code>'''[[XfmeaEffect Class|XfmeaEffect]]'''</code>
The Synthesis API includes a rich set of programming elements that allow you to work with any of the following components of the Synthesis Platform:
**<code>'''[[XfmeaFailure Class|XfmeaFailure]]'''</code>
 
*'''[[Repository Class|Repositories]]''': Allows you to connect to a standard or enterprise Synthesis repository to access/edit repository-level information. This includes accessing/adding/modifying resources, exporting/importing BlockSim and XFRACAS XML files and exporting data to the Synthesis Data Warehouse (SDW).
*'''[[WeibullDataSet Class|Weibull++ Data Sets]]''': {{Template:WeibullDataSet Class.Cmt}}
*'''[[ALTADataSet_Class|ALTA Data Sets]]''': {{Template:ALTADataSet Class.Cmt}}
*'''[[WAPlots Class|Weibull++/ALTA Plots]]''': {{Template:WAPlots Class.Cmt}}
*'''[[Resource Classes|Resources]]''': {{Template:Resource Classes.Cmt}}
*'''[[Common Class|Displayed Language]]''': {{Template:Common Class.Cmt}}
 
A complete list of all the classes and enumerations in the Synthesis API is available [[Full Synthesis API|here]].
 
== Application Examples  ==
 
'''Excel VBA Samples'''
 
Use the following links to download macro-enabled Excel files (*.xlsm) that utilize the Synthesis API. Note that to run/view the underlying code, the [http://msdn.microsoft.com/en-us/library/bb608625.aspx Developer tab must be enabled] in Excel so you can enter the Visual Basic for Applications (VBA) environment by choosing '''Developer &gt; View Code'''. Also, you must have [http://office.microsoft.com/en-us/excel-help/enable-or-disable-macros-in-office-documents-HA010031071.aspx macros enabled] to run the example files. If Excel displays a warning regarding macros in these files, select to enable them.
 
*Use Synthesis analysis engines in Excel
**[http://www.reliasoft.com/synthesis/api/examples/WeibullExample.xlsm Life Data Analysis in Excel (243 KB)] ([[Life Data Analysis in Microsoft Excel - Explanation|Code explanation]])
**[http://www.reliasoft.com/synthesis/api/examples/ALTAExample.xlsm Accelerated Life Testing Analysis (ALTA) in Excel (224 KB)] ([[Accelerated Life Testing Analysis in Microsoft Excel - Explanation|Code explanation]])
*Transfer data from Excel to the Synthesis Reliability Data Warehouse (RDW)
**[http://www.reliasoft.com/synthesis/api/examples/SDW_Example_Standard.xlsm Excel to Standard Repository (2.64 MB)]
**[http://www.reliasoft.com/synthesis/api/examples/SDW_Example_Enterprise.xlsm Excel to Enterprise SQL Repository (2.64 MB)] ''Requires code modification to reference a SQL repository.''
*Use Excel to update Universal Reliability Definitions (URDs) used in BlockSim, etc.
**[http://www.reliasoft.com/synthesis/api/examples/URDExample_V10.xlsm Update URDs with Excel (108 KB)]
-->

Revision as of 00:33, 1 March 2016

APIWiki.png



The Synthesis Platform’s Application Programming Interface (API) enables you to programmatically connect your Synthesis applications and data with other systems and tools used within your organization. The API is written for Visual Basic for Applications (VBA) and Visual Basic.NET. This gives you the ability to create automated solutions using popular Microsoft Office applications, such as Excel and PowerPoint, as well as create custom applications for your organization.

Transfer and synchronize data via XML

For structured data (such as system hierarchies/BOMs, incidents and work orders) you can use XML files and the API to manage data transfer and synchronization between XFRACAS and variety of different PLMs, ERPs, CMMS and other external systems. You can also use XML files to create reliability block diagrams (RBDs) in BlockSim.

Input/output specific data elements and analyses

With the Synthesis API, you can read from or write data to Synthesis resources (models, actions, URDs, etc.), system hierarchy items and FMEA records (causes, effects, failures, etc.). You can initiate batch data processing and create custom solutions for importing/exporting data from Synthesis repositories, as well as load data into the Synthesis Data Warehouse (SDW).

Obtain calculated results

You can use the Synthesis API to read data from published Synthesis models and obtain calculated results such as the reliability, probability of failure, BX% life, failure rate and mean time.

Getting Started

Examples

Tutorials are available to help you learn the core objects of the Synthesis API and start coding right away. The tutorials include code samples for both VBA and VB.NET. See API Tutorials.

In addition, sample applications that you can test and tweak yourself are included with the Synthesis Platform installation. The files are stored on your computer at C:\Users\Public\Public Documents\ReliaSoft\Examples10\API. (For Version 9, see C:\Users\Public\Public Documents\ReliaSoft\Examples\API.) The sample applications are available for Excel VBA and VB.NET projects. (To run the Excel examples, macros must be enabled. To learn how, see this Microsoft article.)

Prerequisites

Note that for VBA, the bit version (32- vs. 64-bit) of the Synthesis Platform that you've installed must match your installed version of Microsoft Office. If they do not match, you may see an error related to ActiveX controls. (See ReliaSoft KB article RS20024.)
  • Reference the Synthesis API object library. The object library is located in the folder where the Synthesis application is installed. By default, this folder is at "C:\Program Files\ReliaSoft\Synthesis 10". (For Version 9, it is "C:\Program Files\ReliaSoft\Synthesis 9".)
For VBA applications, use the SynthesisAPI.tlb library file. For VB.NET applications, use SynthesisAPI.dll.
For help with referencing the library, see this simple How-To Guide.

Object Library

Below are the core objects in the Synthesis API library. For an alphabetical listing of all classes and enumerations in the object library, see Full Synthesis API.

  • The Repository object represents the Synthesis repository. All other objects use the functions in this class to read or write data to the repository. This class also contains the functions for importing/exporting XML files.
  • The following objects build data collections for the SDW: RawData represents a single data point, while RawDataSet serves as the data container for the RawData objects.
  • The XfmeaItem object represents a system hierarchy item. Instances of this class can be used to store data for a system or assembly, as well as build a multi-level system configuration.