Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.
Difference between revisions of "BaSyx / Examples"
Line 3: | Line 3: | ||
== Code snippets == | == Code snippets == | ||
− | Code snippets are simple, isolated use-cases that illustrate the use of Eclipse BaSyx. They provide focused recipes that document the intended use of the BaSyx SDK and our reference implementations of Industrie 4.0 middleware components. To keep functional examples simple, code snippets only address selected aspects of Industrie 4.0 implementations. Selected snippets provide a page with documentation. For all snippets, links to executable source code files in the git repository are provided. The | + | Code snippets are simple, isolated use-cases that illustrate the use of Eclipse BaSyx. They provide focused recipes that document the intended use of the BaSyx SDK and our reference implementations of Industrie 4.0 middleware components. To keep functional examples simple, code snippets only address selected aspects of Industrie 4.0 implementations. Selected snippets provide a page with documentation. For all snippets, links to executable source code files in the git repository are provided. The snippets itself only contain the code necessary to fulfil their function. Examples on how to use the snippets can be found in the [https://git.eclipse.org/r/plugins/gitiles/basyx/basyx/+/master/examples/basys.examples/src/test/java/org/eclipse/basyx/examples/snippets tests] for the snippets. |
Please keep in mind that not all features are available with all language versions of Eclipse BaSyx. Snippets therefore may only be available for selected languages. | Please keep in mind that not all features are available with all language versions of Eclipse BaSyx. Snippets therefore may only be available for selected languages. | ||
Line 15: | Line 15: | ||
=== Virtual Automation Bus (VAB)=== | === Virtual Automation Bus (VAB)=== | ||
− | The Virtual Automation Bus provides end-to-end connection capabilities. The VAB uses gateways to connect network technologies into one virtual, and fully connected network. The network consists of objects, e.g. Asset Administration Shells and | + | The Virtual Automation Bus provides end-to-end connection capabilities. The VAB uses gateways to connect network technologies into one virtual, and fully connected network. The network consists of objects, e.g. Asset Administration Shells and Submodels that are accessible through unqiue IDs. The following code snippets illustrate VAB operations and the use of the Virtual Automation Bus. |
{| | {| | ||
Line 46: | Line 46: | ||
− | ===Asset Administration Shell | + | ===Asset Administration Shell deployment=== |
These code snippets illustrate Asset Administration Shells in context of HTTP servers. It is common to deploy an Asset Administration Shell to the IT to ensure its presence when a device fails. HTTP servers are available hosts for Asset Administration Shells. The following code snippets illustrate the dynamic creation of an Asset Administratuion Shell, its transfer, and its use from Industrie 4.0 applications. | These code snippets illustrate Asset Administration Shells in context of HTTP servers. It is common to deploy an Asset Administration Shell to the IT to ensure its presence when a device fails. HTTP servers are available hosts for Asset Administration Shells. The following code snippets illustrate the dynamic creation of an Asset Administratuion Shell, its transfer, and its use from Industrie 4.0 applications. | ||
Line 53: | Line 53: | ||
| style="width:20em" | ''Snippet'' || style="width:20em" | ''Additional Documentation'' ||style="width:45em" | ''Description'' || style="width:20em" | ''Source'' | | style="width:20em" | ''Snippet'' || style="width:20em" | ''Additional Documentation'' ||style="width:45em" | ''Description'' || style="width:20em" | ''Source'' | ||
|- | |- | ||
− | | | + | | Deploy AAS || || Illustrates the creation of an Asset Administration Shell on a remote server || [https://git.eclipse.org/r/plugins/gitiles/basyx/basyx/+/master/examples/basys.examples/src/main/java/org/eclipse/basyx/examples/snippets/manager/PushAASToServer.java Java] |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
|- | |- | ||
− | | | + | | Connect to AAS || [[BaSyx.Examples.Snippets.AASConnection.Java | (Java)]] || Illustrates the connection to an Asset Administration Shell || [https://git.eclipse.org/r/plugins/gitiles/basyx/basyx/+/master/examples/basys.examples/src/main/java/org/eclipse/basyx/examples/snippets/manager/RetrieveAAS.java Java] |
− | [https://git.eclipse.org/r/plugins/gitiles/basyx/basyx/+/master/examples/basys.examples/src/main/java/org/eclipse/basyx/examples/snippets/manager/ | + | |
|- | |- | ||
− | | | + | | Delete AAS || || Illustrates the deletion of an Asset Administration Shell from a remote server || [https://git.eclipse.org/r/plugins/gitiles/basyx/basyx/+/master/examples/basys.examples/src/main/java/org/eclipse/basyx/examples/snippets/manager/RetrieveAAS.java Java] |
|} | |} | ||
− | ===AAS | + | ===AAS Submodels=== |
− | Asset Administration Shell | + | Asset Administration Shell Submodels may be distributed through the network. While an AAS resides on the IT and remains accessible in case of device failures, Submodels may be distributed. Submodels containing static data or information about devices that needs to remain available in case of device failure may be hosted on the IT as well; Submodels containing live data may be hosted on devices, and possibly on products. The following code snippets illustrate the creation, transfer, hosting, and use of AAS Submodels. |
{| | {| | ||
| style="width:20em" | ''Snippet'' || style="width:20em" | ''Additional Documentation'' ||style="width:45em" | ''Description'' || style="width:20em" | ''Source'' | | style="width:20em" | ''Snippet'' || style="width:20em" | ''Additional Documentation'' ||style="width:45em" | ''Description'' || style="width:20em" | ''Source'' | ||
|- | |- | ||
− | | | + | | Deploy Submodel || [[BaSyx.Examples.Snippets.AASSMCreation.Java | (Java)]] || Illustrates the creation of an AAS Submodel on a remote server || [https://git.eclipse.org/r/plugins/gitiles/basyx/basyx/+/master/examples/basys.examples/src/main/java/org/eclipse/basyx/examples/snippets/manager/AddSubmodelToAAS.java Java] |
|- | |- | ||
− | | | + | | Connect to Submodel || [[BaSyx.Examples.Snippets.AASSMConnection.Java | (Java)]] || Illustrates the connection to an AAS Submodel || [https://git.eclipse.org/r/plugins/gitiles/basyx/basyx/+/master/examples/basys.examples/src/main/java/org/eclipse/basyx/examples/snippets/manager/RetrieveSubmodelFromAAS.java Java] |
− | [https://git.eclipse.org/r/plugins/gitiles/basyx/basyx/+/master/examples/basys.examples/src/main/java/org/eclipse/basyx/examples/snippets/manager/ | + | |
|- | |- | ||
− | | | + | | Delete Submodel || || Illustrates the deletion of an AAS Submodel from a remote server || [https://git.eclipse.org/r/plugins/gitiles/basyx/basyx/+/master/examples/basys.examples/src/main/java/org/eclipse/basyx/examples/snippets/manager/DeleteSubmodelFromAAS.java Java] |
|- | |- | ||
− | | Invoke | + | | Create Submodel element || || Illustrates the creation of a Submodel element || [https://git.eclipse.org/r/plugins/gitiles/basyx/basyx/+/master/examples/basys.examples/src/main/java/org/eclipse/basyx/examples/snippets/submodel/AddSubmodelElement.java Java] |
− | [https://git.eclipse.org/r/plugins/gitiles/basyx/basyx/+/master/examples/basys.examples/src/main/java/org/eclipse/basyx/examples/snippets/submodel/ExecuteOperation.java Java] | + | |- |
+ | | Retrieve Submodel element|| || Illustrates the retrieval of a Submodel element || [https://git.eclipse.org/r/plugins/gitiles/basyx/basyx/+/master/examples/basys.examples/src/main/java/org/eclipse/basyx/examples/snippets/submodel/RetrieveSubmodelElement.java Java] | ||
+ | |- | ||
+ | | Delete Submodel element || || Illustrates the deletion of a Submodel element || [https://git.eclipse.org/r/plugins/gitiles/basyx/basyx/+/master/examples/basys.examples/src/main/java/org/eclipse/basyx/examples/snippets/submodel/DeleteSubmodelElement.java Java] | ||
+ | |- | ||
+ | | Invoke Submodel operation || || Illustrates the invokation of an Operation from a remote Submodel || [https://git.eclipse.org/r/plugins/gitiles/basyx/basyx/+/master/examples/basys.examples/src/main/java/org/eclipse/basyx/examples/snippets/submodel/ExecuteOperation.java Java] | ||
|} | |} | ||
− | ===AAS | + | ===AAS Submodel providers=== |
− | Eclipse BaSyx provides pre-created AAS | + | Eclipse BaSyx provides pre-created AAS Submodel providers. These servlets connect existing data sources, such as textual configuration files and SQL data bases into Industrie 4.0 environments as AAS Submodels. BaSyx Submodel providers are configured with a configuration API and do not require programming knowledge to integrate data sources into Industrie 4.0 environments as AAS Submodels. |
− | ===AAS | + | ===AAS Submodels (Dynamic)=== |
− | Asset Administration Shell | + | Asset Administration Shell Submodels may contain dynamic properties and operations. Dynamic properties are properties whose values are generated dynamically at runtime. This may happen for example periodically, or whenever a specific information is requested. Dynamic operations are operations that may be updated at runtime. The following code snippets illustrate dynamic Submodel properties and operations. |
{| | {| | ||
| style="width:20em" | ''Snippet'' || style="width:20em" | ''Additional Documentation'' ||style="width:45em" | ''Description'' || style="width:20em" | ''Source'' | | style="width:20em" | ''Snippet'' || style="width:20em" | ''Additional Documentation'' ||style="width:45em" | ''Description'' || style="width:20em" | ''Source'' | ||
|- | |- | ||
− | | Dynamic property (Lambda) || || Illustrate dynamic | + | | Dynamic property (Lambda) || || Illustrate dynamic Submodel properties (Lambda expression) || N/A |
|- | |- | ||
− | | Dynamic property (Class) || || Illustrate the dynamic | + | | Dynamic property (Class) || || Illustrate the dynamic Submodel properties (Class) || N/A |
|} | |} | ||
Line 111: | Line 106: | ||
===Registry=== | ===Registry=== | ||
− | The Asset Administration Shell registry enables registration of AAS and | + | The Asset Administration Shell registry enables registration of AAS and Submodels, as well as retrieving previously registered AAS and Submodels by their IDs. |
{| | {| | ||
Line 119: | Line 114: | ||
|- | |- | ||
| Lookup AAS || || Retrieve AAS descriptors from registry || [https://git.eclipse.org/r/plugins/gitiles/basyx/basyx/+/master/examples/basys.examples/src/main/java/org/eclipse/basyx/examples/snippets/registry/LookupAAS.java Java] | | Lookup AAS || || Retrieve AAS descriptors from registry || [https://git.eclipse.org/r/plugins/gitiles/basyx/basyx/+/master/examples/basys.examples/src/main/java/org/eclipse/basyx/examples/snippets/registry/LookupAAS.java Java] | ||
+ | |- | ||
+ | | Deregister AAS || || Removes AAS descriptors from registry || [https://git.eclipse.org/r/plugins/gitiles/basyx/basyx/+/master/examples/basys.examples/src/main/java/org/eclipse/basyx/examples/snippets/registry/DeregisterAAS.java Java] | ||
|- | |- | ||
| Register Submodel || || Register a Submodel to an existing AAS descriptor || [https://git.eclipse.org/r/plugins/gitiles/basyx/basyx/+/master/examples/basys.examples/src/main/java/org/eclipse/basyx/examples/snippets/registry/RegisterSubmodel.java Java] | | Register Submodel || || Register a Submodel to an existing AAS descriptor || [https://git.eclipse.org/r/plugins/gitiles/basyx/basyx/+/master/examples/basys.examples/src/main/java/org/eclipse/basyx/examples/snippets/registry/RegisterSubmodel.java Java] | ||
|- | |- | ||
− | | Lookup Submodel || || | + | | Lookup Submodel || || Retrieve a Submodel from a registry || [https://git.eclipse.org/r/plugins/gitiles/basyx/basyx/+/master/examples/basys.examples/src/main/java/org/eclipse/basyx/examples/snippets/registry/RegisterSubmodel.java Java] |
+ | |- | ||
+ | | Deregister Submodel || || Removes a Submodel from a registry || [https://git.eclipse.org/r/plugins/gitiles/basyx/basyx/+/master/examples/basys.examples/src/main/java/org/eclipse/basyx/examples/snippets/registry/DeregisterSubmodel.java Java] | ||
|} | |} | ||
Line 134: | Line 133: | ||
| style="width:20em" | ''Snippet'' || style="width:20em" | ''Additional Documentation'' ||style="width:45em" | ''Description'' || style="width:20em" | ''Source'' | | style="width:20em" | ''Snippet'' || style="width:20em" | ''Additional Documentation'' ||style="width:45em" | ''Description'' || style="width:20em" | ''Source'' | ||
|- | |- | ||
− | | Construct URNs || || Create URNs for AAS and globally idenfied | + | | Construct URNs || || Create URNs for AAS and globally idenfied Submodels || [https://git.eclipse.org/r/plugins/gitiles/basyx/basyx/+/master/examples/basys.examples/src/test/java/org/eclipse/basyx/examples/snippets/urn/ConstructURNs.java Java] |
|} | |} | ||
Revision as of 08:31, 24 November 2020
Contents
Examples
Code snippets
Code snippets are simple, isolated use-cases that illustrate the use of Eclipse BaSyx. They provide focused recipes that document the intended use of the BaSyx SDK and our reference implementations of Industrie 4.0 middleware components. To keep functional examples simple, code snippets only address selected aspects of Industrie 4.0 implementations. Selected snippets provide a page with documentation. For all snippets, links to executable source code files in the git repository are provided. The snippets itself only contain the code necessary to fulfil their function. Examples on how to use the snippets can be found in the tests for the snippets.
Please keep in mind that not all features are available with all language versions of Eclipse BaSyx. Snippets therefore may only be available for selected languages.
The code for the snippets is available via the Eclipse BaSyx GIT repository:
- For Java, the code is located in the basyx.example project in package org.eclipse.basyx.examples.snippets
Virtual Automation Bus (VAB)
The Virtual Automation Bus provides end-to-end connection capabilities. The VAB uses gateways to connect network technologies into one virtual, and fully connected network. The network consists of objects, e.g. Asset Administration Shells and Submodels that are accessible through unqiue IDs. The following code snippets illustrate VAB operations and the use of the Virtual Automation Bus.
Snippet | Additional Documentation | Description | Source |
CRUD operations | Illustrate creation of VAB object and use of create/update/retrieve/delete operations to manipulate it. | Java | |
Manual HTTP calls | Illustrate manual HTTP operations to access VAB objects via HTTP REST interface | Java | |
Dynamic property (Lambda) | Illustrate dynamic properties (Lambda expression) in VAB objects. | Java | |
Dynamic property (Class) | Illustrate the dynamic properties (Class) in VAB objects. |
Asset Administration Shell (AAS)
The Asset Administration Shell snippets illustrate the creation of Asset Administration Shells using tools of the BaSyx SDKs.
Snippet | Additional Documentation | Description | Source |
Create AAS | (Java) | Creation of Asset Administration Shell by extending SDK class | N/A |
Create AAS on the fly | Creation of Asset Administration Shell by setting properties of predefined AAS class | N/A |
Asset Administration Shell deployment
These code snippets illustrate Asset Administration Shells in context of HTTP servers. It is common to deploy an Asset Administration Shell to the IT to ensure its presence when a device fails. HTTP servers are available hosts for Asset Administration Shells. The following code snippets illustrate the dynamic creation of an Asset Administratuion Shell, its transfer, and its use from Industrie 4.0 applications.
Snippet | Additional Documentation | Description | Source |
Deploy AAS | Illustrates the creation of an Asset Administration Shell on a remote server | Java | |
Connect to AAS | (Java) | Illustrates the connection to an Asset Administration Shell | Java |
Delete AAS | Illustrates the deletion of an Asset Administration Shell from a remote server | Java |
AAS Submodels
Asset Administration Shell Submodels may be distributed through the network. While an AAS resides on the IT and remains accessible in case of device failures, Submodels may be distributed. Submodels containing static data or information about devices that needs to remain available in case of device failure may be hosted on the IT as well; Submodels containing live data may be hosted on devices, and possibly on products. The following code snippets illustrate the creation, transfer, hosting, and use of AAS Submodels.
Snippet | Additional Documentation | Description | Source |
Deploy Submodel | (Java) | Illustrates the creation of an AAS Submodel on a remote server | Java |
Connect to Submodel | (Java) | Illustrates the connection to an AAS Submodel | Java |
Delete Submodel | Illustrates the deletion of an AAS Submodel from a remote server | Java | |
Create Submodel element | Illustrates the creation of a Submodel element | Java | |
Retrieve Submodel element | Illustrates the retrieval of a Submodel element | Java | |
Delete Submodel element | Illustrates the deletion of a Submodel element | Java | |
Invoke Submodel operation | Illustrates the invokation of an Operation from a remote Submodel | Java |
AAS Submodel providers
Eclipse BaSyx provides pre-created AAS Submodel providers. These servlets connect existing data sources, such as textual configuration files and SQL data bases into Industrie 4.0 environments as AAS Submodels. BaSyx Submodel providers are configured with a configuration API and do not require programming knowledge to integrate data sources into Industrie 4.0 environments as AAS Submodels.
AAS Submodels (Dynamic)
Asset Administration Shell Submodels may contain dynamic properties and operations. Dynamic properties are properties whose values are generated dynamically at runtime. This may happen for example periodically, or whenever a specific information is requested. Dynamic operations are operations that may be updated at runtime. The following code snippets illustrate dynamic Submodel properties and operations.
Snippet | Additional Documentation | Description | Source |
Dynamic property (Lambda) | Illustrate dynamic Submodel properties (Lambda expression) | N/A | |
Dynamic property (Class) | Illustrate the dynamic Submodel properties (Class) | N/A |
Registry
The Asset Administration Shell registry enables registration of AAS and Submodels, as well as retrieving previously registered AAS and Submodels by their IDs.
Snippet | Additional Documentation | Description | Source |
Register AAS | Register AAS descriptors in registry | Java | |
Lookup AAS | Retrieve AAS descriptors from registry | Java | |
Deregister AAS | Removes AAS descriptors from registry | Java | |
Register Submodel | Register a Submodel to an existing AAS descriptor | Java | |
Lookup Submodel | Retrieve a Submodel from a registry | Java | |
Deregister Submodel | Removes a Submodel from a registry | Java |
URN
Eclipse BaSyx advocates the use of URNs as unique identifiers for AAS. Code snippets illustrate the creation and use of URNs.
Snippet | Additional Documentation | Description | Source |
Construct URNs | Create URNs for AAS and globally idenfied Submodels | Java |
Deployment with Docker
The deployment of the different SDKs and components with docker is explained in its own page.
Monitoring Applications (AAS Dashboards)
The integration with third-party applications & tools enable the possibility to monitor Asset Administration Shell and visualize its data through Dashboards. The integration and its use is explained in here [page].