ReliaSoft API Reference: Difference between revisions

From ReliaWiki
Jump to navigation Jump to search
(updated the list of files to reference in .NET projects)
m (moved Synthesis API Reference to ReliaSoft API Reference: Remove reference to "Synthesis")
(21 intermediate revisions by 4 users not shown)
Line 7: Line 7:
</div>
</div>


The Synthesis Platform’s ''Application Programming Interface'' (API) enables you to programmatically read and write data to Synthesis repositories, as well as analyze and plot data sets from external sources. It is provided for Visual Basic for Applications (VBA) and .NET applications, allowing you to create automated solutions using popular Microsoft Office applications, such as Excel and PowerPoint, or create custom applications for your organization.  
The ReliaSoft ''Application Programming Interface'' (API) enables you to programmatically read and write data to ReliaSoft repositories, as well as analyze and plot data sets from external sources. It is provided for Visual Basic for Applications (VBA) and .NET applications, allowing you to create automated solutions using popular Microsoft Office applications, such as Excel and PowerPoint, or create custom applications for your organization.  


Implementing the Synthesis API allows you to connect data in Synthesis repositories with the systems and tools used within your organization. It provides the functionality to:
Implementing the ReliaSoft API allows you to connect data in repositories with the systems and tools used within your organization. It provides the functionality to:


*'''Transfer and synchronize data via XML'''
*'''Transfer and synchronize data via XML'''
:Use XML files to manage structured data (such as system hierarchies/BOMs, incidents and work orders) between ReliaSoft’s [http://xfracas.reliasoft.com/ XFRACAS] and a variety of different PLMs, ERPs, CMMS and other external systems. You can also use XML files to create reliability block diagrams (RBDs) in [http://blocksim.reliasoft.com/ BlockSim].  
:Use XML files to manage structured data (such as system hierarchies/BOMs, incidents and work orders) between ReliaSoft’s [https://www.reliasoft.com/products/reliability-management/xfracas/ XFRACAS] and a variety of different PLMs, ERPs, CMMS and other external systems. You can also use XML files to create reliability block diagrams (RBDs) in [http://www.reliasoft.com/products/reliability-analysis/blocksim BlockSim].  
*'''Read/write specific data elements'''
*'''Read/write specific data elements'''
:Read or write data to Synthesis resources (models, actions, URDs, etc.), system hierarchy items and FMEA records (causes, effects, failures, etc.). 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).  
:Read or write data to resources (models, actions, URDs, etc.), system hierarchy items and FMEA records (causes, effects, failures, etc.). Initiate batch data processing and create custom solutions for importing/exporting data from ReliaSoft repositories, as well as load data into the Synthesis Data Warehouse (SDW).  
*'''Obtain calculated results'''
*'''Obtain calculated results'''
:Read data from published Synthesis models and obtain calculated results such as reliability, probability of failure, BX% life, failure rate and mean time.  
:Read data from published models and obtain calculated results such as reliability, probability of failure, BX% life, failure rate and mean time.  
*'''Analyze data'''
*'''Analyze data'''
:Use [http://weibull.reliasoft.com/ Weibull++'s] or [http://alta.reliasoft.com/ ALTA’s] analysis and plotting engines to analyze data from third-party sources, and incorporate the functionality into your own custom applications. (Requires a Synthesis API license.)
:Use [http://www.reliasoft.com/products/reliability-analysis/weibull Weibull++'s] or [http://www.reliasoft.com/products/reliability-analysis/alta ALTA’s] analysis and plotting engines to analyze data from third-party sources, and incorporate the functionality into your own custom applications. (Requires a ReliaSoft API license.)
 


==Prerequisites==
==Prerequisites==
*'''Getting the latest version'''
*'''Getting the latest version'''
:The Synthesis API consists of a library file that contains the classes, methods and events that provide access to Synthesis applications. The file is located in the folder where the Synthesis application is installed. By default, this folder is at "C:\Program Files\ReliaSoft\Synthesis 11." For VBA, you will use the '''SynthesisAPI.tlb''' file; for .NET applications, you will use the '''SynthesisAPI.dll''' file.
:The ReliaSoft API consists of a library file that contains the classes, methods and events that provide access to ReliaSoft applications. The file is located in the folder where the ReliaSoft desktop applications are installed. By default, this folder is at "C:\Program Files\ReliaSoft\ReliaSoft 2019." As of Version 2019, the library names are now version dependent. For VBA, you will use the '''ReliaSoftAPI19.tlb''' file; for .NET applications, you will use the '''ReliaSoftAPI19.dll''' file. Prior to Version 2019, the files to use were SynthesisAPI.tlb (VBA) and SynthesisAPI.dll (.NET).


:To obtain the latest version of the library file and the Synthesis application, choose '''File > Help > Check for Updates''' or download the latest version at http://www.ReliaSoft.com/synthesis/downloads.htm.
:To obtain the latest version of the library file and the ReliaSoft applications, choose '''File > Help > Check for Updates''' or download the latest version from the [https://support.hbmprenscia.com HBM Prenscia Support Portal].
 
*'''Build environment'''
:For Visual Studio projects using Version 10 or 11, at minimum you will need Visual Studio 2010 and the .NET Framework 4.0 runtime. Version 2018 and later require Visual Studio 2015 and the .NET Framework 4.6.1 developer pack and runtime.


*'''32- vs. 64-bit'''
*'''32- vs. 64-bit'''
:For VBA, the bit version 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].)  
:For VBA, the bit version of the ReliaSoft applications 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.)  


:For Visual Studio projects targeting the .NET Framework 4.5 and compiled to run an any platform (Any CPU), turn off the '''Prefer 32-bit''' property of the build configuration if you want to run a 64-bit application as a 64-bit application; otherwise, the application will run as a 32-bit application on both 32- and 64-bit versions of Windows.
:For Visual Studio projects targeting the .NET Framework 4.5 (or later) and compiled to run an any platform (Any CPU), turn off the '''Prefer 32-bit''' property of the build configuration if you want instances of your application to run as a 64-bit process; otherwise, the application will run as a 32-bit process on both 32- and 64-bit versions of Windows. Note that when using [https://www.reliasoft.com/locally-hosted-licensing locally hosted licensing], it is necessary to ensure your application bitness matches the bitness of the ReliaSoft desktop applications installed wherever your application is run due to dependencies on platform-specific libraries.


*'''Running API applications on a server  
*'''Running API applications on a server  
:If you plan to run API applications on a Windows server, you’ll need to run the Synthesis API Ante Service to allow clients to access the application (the service is not required when running API applications locally). The API Service may be installed on the server or on a different machine. For instructions on how to install and configure the service, see http://www.synthesisplatform.net/synthesis_api_ante_service.htm.  
:If you plan to run the API on a Windows server, you must use [https://www.reliasoft.com/locally-hosted-licensing locally hosted licensing] and you’ll need to install the ReliaSoft API Ante Service to scale the implementation (the service is not required when running the API on a Windows desktop environment). For instructions on how to install and configure the service, see https://www.reliasoft.com/reliasoft-api-ante-service.  


*'''Access to calculations functionality
*'''Access to calculations functionality
:Access to Weibull++'s and ALTA’s analysis and plotting engines require a Synthesis API license. To obtain a license, please [http://www.reliasoft.com/contact.htm contact ReliaSoft].
:Access to Weibull++'s and ALTA’s analysis and plotting engines require a ReliaSoft API license. To obtain a license, please see [http://www.reliasoft.com/contact.htm contact ReliaSoft].
 


==Getting Started==
==Getting Started==


====Referencing the Synthesis API Library File====
====Referencing the ReliaSoft API Library File====
To use the Synthesis API in your code, you must reference the Synthesis API library in your VBA or .NET projects. The file is located in the folder where the Synthesis application is installed. By default, this folder is at "C:\Program Files\ReliaSoft\Synthesis 11." For VBA, you will use the '''SynthesisAPI.tlb''' file; for .NET applications, you will use the '''SynthesisAPI.dll''' file.
<!-- This "onlyinclude" section is transcluded into the API Tutorials page -->
<onlyinclude>To use the ReliaSoft API in your code, you must reference the ReliaSoft API library in your VBA or .NET projects. The file is located in the folder where the ReliaSoft desktop applications are installed. By default for Version 2019, this folder is at "C:\Program Files\ReliaSoft\ReliaSoft 2019." For VBA, you will use the '''ReliaSoftAPI19.tlb''' file; for .NET applications, you will use the '''ReliaSoftAPI19.dll''' file.


'''To reference the library in VBA''':
'''To reference the library in VBA''':
:#Enter the VBA environment by clicking the '''Visual Basic''' command on the Developer tab (If the Developer tab is not visible, see [https://msdn.microsoft.com/en-us/library/bb608625.aspx this Microsoft article]).  
:#Enter the VBA environment by clicking the '''Visual Basic''' command on the Developer tab (If the Developer tab is not visible, see [https://msdn.microsoft.com/en-us/library/bb608625.aspx this Microsoft article]).  
:#In the VBA environment, choose '''Tools > References'''.
:#In the VBA environment, choose '''Tools > References'''.
:#Click '''Browse''' and find the SynthesisAPI.tlb file on your computer. Click '''OK'''.  
:#Click '''Browse''' and find the ReliaSoftAPI19.tlb file on your computer. Click '''OK'''.  


'''To reference the library in Visual Studio:'''
'''To reference the library in Visual Studio:'''
:#In the Solution Explorer, right-click the '''References''' node and choose '''Add References'''.  
:#In the Solution Explorer, right-click the '''References''' node and choose '''Add References'''.  
:#In the Reference Manager window, click the '''Browse''' tab and find the SynthesisAPI.dll file on your computer. Click '''OK'''.  
:#In the Reference Manager window, click the '''Browse''' tab and find the ReliaSoftAPI19.dll file on your computer. Click '''OK'''.  
:#Copy the following files from the Synthesis installation folder to your target folder (e.g., bin/Debug or bin/Release Folder).  
:#Copy the following files from the ReliaSoft installation folder to your target folder (e.g., bin/Debug or bin/Release Folder).  
:::*licncr.dll
:::*licncr.dll
:::*licncr.dll.nsign
:::*licncr.dll.nsign
:::*licshr.dll
:::*licshr.dll
:::*licshr.dll.nsign
:::*licshr.dll.nsign
:::*libcrypto-1_1.dll
:::*msvcp110.dll
:::*msvcp110.dll
:::*msvcr110.dll
:::*msvcr110.dll
Line 63: Line 64:
:::*RSLM8nCodeDotNetWrapper.dll
:::*RSLM8nCodeDotNetWrapper.dll
:::*utlibr.dll
:::*utlibr.dll
 
</onlyinclude>
====Examples====
====Examples====
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\Examples11\API. (For Version 10, see C:\Users\Public\Public Documents\ReliaSoft\Examples10\API.)
Sample applications that you can test and tweak yourself are included with the ReliaSoft installation. The files are stored on your computer at C:\Users\Public\Public Documents\ReliaSoft\Examples19\API.
   
   
The sample applications are available for Excel VBA and VB.NET projects. (To run the Excel examples, macros must be enabled. See [http://office.microsoft.com/en-us/excel-help/enable-or-disable-macros-in-office-documents-HA010031071.aspx this Microsoft article].)  
The sample applications are available for Excel VBA and VB.NET projects. (To run the Excel examples, macros must be enabled. See [http://office.microsoft.com/en-us/excel-help/enable-or-disable-macros-in-office-documents-HA010031071.aspx this Microsoft article].)  


====Tutorials====
====Tutorials====
[[API Tutorials|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.
[[API Tutorials|Tutorials]] are available to help you learn the core objects of the ReliaSoft API and start coding right away. The tutorials include code samples for both VBA and VB.NET.
 


==Object Library ==
==Object Library ==
Below is a summary of the core objects in the Synthesis API library. For an alphabetical listing of all objects in the latest version, see [[API Reference Documentation]]. (Click [[API Reference Documentation 10| here]] for the list of objects in Version 10.)
Below is a summary of the core objects in the ReliaSoft API library. For an alphabetical listing of all objects in the latest version, see [[API Reference Documentation]].


*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.  
*The <code>'''[[Repository Class|Repository]]'''</code> object represents the ReliaSoft 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 represent the Synthesis resources. Instances of each class can be used to store data for an existing or new resource.   
*The following objects represent the ReliaSoft resources. Instances of each class can be used to store data for an existing or new resource.   
**<code>'''[[CAction Class|cAction]]'''</code>
**<code>'''[[CAction Class|cAction]]'''</code>
**<code>'''[[CCorrectiveTask Class|cCorrectiveTask]]'''</code>
**<code>'''[[CCorrectiveTask Class|cCorrectiveTask]]'''</code>

Revision as of 16:56, 14 March 2019

APIWiki.png



The ReliaSoft Application Programming Interface (API) enables you to programmatically read and write data to ReliaSoft repositories, as well as analyze and plot data sets from external sources. It is provided for Visual Basic for Applications (VBA) and .NET applications, allowing you to create automated solutions using popular Microsoft Office applications, such as Excel and PowerPoint, or create custom applications for your organization.

Implementing the ReliaSoft API allows you to connect data in repositories with the systems and tools used within your organization. It provides the functionality to:

  • Transfer and synchronize data via XML
Use XML files to manage structured data (such as system hierarchies/BOMs, incidents and work orders) between ReliaSoft’s XFRACAS and a variety of different PLMs, ERPs, CMMS and other external systems. You can also use XML files to create reliability block diagrams (RBDs) in BlockSim.
  • Read/write specific data elements
Read or write data to resources (models, actions, URDs, etc.), system hierarchy items and FMEA records (causes, effects, failures, etc.). Initiate batch data processing and create custom solutions for importing/exporting data from ReliaSoft repositories, as well as load data into the Synthesis Data Warehouse (SDW).
  • Obtain calculated results
Read data from published models and obtain calculated results such as reliability, probability of failure, BX% life, failure rate and mean time.
  • Analyze data
Use Weibull++'s or ALTA’s analysis and plotting engines to analyze data from third-party sources, and incorporate the functionality into your own custom applications. (Requires a ReliaSoft API license.)

Prerequisites

  • Getting the latest version
The ReliaSoft API consists of a library file that contains the classes, methods and events that provide access to ReliaSoft applications. The file is located in the folder where the ReliaSoft desktop applications are installed. By default, this folder is at "C:\Program Files\ReliaSoft\ReliaSoft 2019." As of Version 2019, the library names are now version dependent. For VBA, you will use the ReliaSoftAPI19.tlb file; for .NET applications, you will use the ReliaSoftAPI19.dll file. Prior to Version 2019, the files to use were SynthesisAPI.tlb (VBA) and SynthesisAPI.dll (.NET).
To obtain the latest version of the library file and the ReliaSoft applications, choose File > Help > Check for Updates or download the latest version from the HBM Prenscia Support Portal.
  • Build environment
For Visual Studio projects using Version 10 or 11, at minimum you will need Visual Studio 2010 and the .NET Framework 4.0 runtime. Version 2018 and later require Visual Studio 2015 and the .NET Framework 4.6.1 developer pack and runtime.
  • 32- vs. 64-bit
For VBA, the bit version of the ReliaSoft applications 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.)
For Visual Studio projects targeting the .NET Framework 4.5 (or later) and compiled to run an any platform (Any CPU), turn off the Prefer 32-bit property of the build configuration if you want instances of your application to run as a 64-bit process; otherwise, the application will run as a 32-bit process on both 32- and 64-bit versions of Windows. Note that when using locally hosted licensing, it is necessary to ensure your application bitness matches the bitness of the ReliaSoft desktop applications installed wherever your application is run due to dependencies on platform-specific libraries.
  • Running API applications on a server
If you plan to run the API on a Windows server, you must use locally hosted licensing and you’ll need to install the ReliaSoft API Ante Service to scale the implementation (the service is not required when running the API on a Windows desktop environment). For instructions on how to install and configure the service, see https://www.reliasoft.com/reliasoft-api-ante-service.
  • Access to calculations functionality
Access to Weibull++'s and ALTA’s analysis and plotting engines require a ReliaSoft API license. To obtain a license, please see contact ReliaSoft.

Getting Started

Referencing the ReliaSoft API Library File

To use the ReliaSoft API in your code, you must reference the ReliaSoft API library in your VBA or .NET projects. The file is located in the folder where the ReliaSoft desktop applications are installed. By default for Version 2019, this folder is at "C:\Program Files\ReliaSoft\ReliaSoft 2019." For VBA, you will use the ReliaSoftAPI19.tlb file; for .NET applications, you will use the ReliaSoftAPI19.dll file.

To reference the library in VBA:

  1. Enter the VBA environment by clicking the Visual Basic command on the Developer tab (If the Developer tab is not visible, see this Microsoft article).
  2. In the VBA environment, choose Tools > References.
  3. Click Browse and find the ReliaSoftAPI19.tlb file on your computer. Click OK.

To reference the library in Visual Studio:

  1. In the Solution Explorer, right-click the References node and choose Add References.
  2. In the Reference Manager window, click the Browse tab and find the ReliaSoftAPI19.dll file on your computer. Click OK.
  3. Copy the following files from the ReliaSoft installation folder to your target folder (e.g., bin/Debug or bin/Release Folder).
  • licncr.dll
  • licncr.dll.nsign
  • licshr.dll
  • licshr.dll.nsign
  • msvcp110.dll
  • msvcr110.dll
  • RSDB.dll
  • RSLM8nCodeDotNetWrapper.dll
  • utlibr.dll

Examples

Sample applications that you can test and tweak yourself are included with the ReliaSoft installation. The files are stored on your computer at C:\Users\Public\Public Documents\ReliaSoft\Examples19\API.

The sample applications are available for Excel VBA and VB.NET projects. (To run the Excel examples, macros must be enabled. See this Microsoft article.)

Tutorials

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

Object Library

Below is a summary of the core objects in the ReliaSoft API library. For an alphabetical listing of all objects in the latest version, see API Reference Documentation.

  • The Repository object represents the ReliaSoft 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 sets for the Synthesis Data Warehouse (SDW).
    • RawData represents a single data point.
    • RawDataSet serves as the data container for 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.
  • The WeibullDataSet object represents a Weibull++ data sheet for life data analysis. Instances of this class are used to define a data set and fit a statistical distribution to the data.
  • The ALTADataSet object represents an ALTA data sheet for accelerated life testing data analysis. Instances of this class are used to define a data set, and fit a distribution and life-stress relationship to the data.
  • The WAPlots object represents a plot based on a cModel, WeibullDataSet or ALTADataSet object. Instances of this class are used to display a plot of the analysis results.