Skip to main content

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.

Jump to: navigation, search

BaSyx RAW AAS/Submodel provider

Revision as of 21:02, 11 January 2019 by Unnamed Poltroon (Talk) (Created page with "== Static configuration == The Raw AAS/sub model provider provides the values described in its configuration file as virtual automation bus object. Through this configuratio...")

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Static configuration

The Raw AAS/sub model provider provides the values described in its configuration file as virtual automation bus object. Through this configuration file, the complete structure of the exported object may be configured, which includes its meta data. This way, an Asset Administration Shell, a sub model, or any other object may be exported. The raw AAS/sub model provider is implemented by servlet class org.eclipse.basyx.components.servlets.RawCFGSubModelProviderServlet. It accepts the following configuration parameter:


  • config: Path to configuration file


The following snippet illustrates an Apache Tomcat configuration for the sub model provider Example_RawProvider. It configures the location of the configuration file inside the WEB-INF folder and configures the URL pattern that is used to access the sub model to /Testsuite/components/BaSys/1.0/provider/rawcfgsm/*.


  <servlet>
    <servlet-name>Example_RawProvider</servlet-name>
    <servlet-class> org.eclipse.basyx.components.servlets.RAWCFGSubModelProviderServlet </servlet-class>
 
    <init-param>
        <param-name>config</param-name>
        <param-value>/WEB-INF/config/rawprovider/samplecfg.properties</param-value>
    </init-param>
 
    <load-on-startup>5</load-on-startup>
  </servlet>
  <servlet-mapping>
    <servlet-name>Example_RawProvider</servlet-name>
    <url-pattern>/Testsuite/components/BaSys/1.0/provider/rawsm/*</url-pattern>
  </servlet-mapping>


The main configuration file of the Raw AAS/sub model provider contains the sub model ID and all sub model properties and meta data properties that are exported by the RAW AAS/sub model provider. For a more in depth description, please refer to <<<PDF>>>.


  • basyx.submodelID ID of sub model


Meta data of sub models needs to be exported as properties. The property definition

administration/version = 1.0

defines the value of meta data administration/version to value 1.0. Property values are exported as strings by default. Changing a type is supported via the $ftype extension. Therefore, adding the line

administration/version$ftype = int

defines that the administration/version property should be exported as integer value.


The following illustrates an example configuration file for the RAW AAS/sub modelfile provider:

# ##############################################################
# Configuration sub model provider configuration file
# ##############################################################
 
 
# ##############################################################
# Sub model provider configuration
 
# Name of provided sub model
basyx.submodelID       = rawSampleCFG
 
 
# ##############################################################
# Sub model meta data
 
# Sub model version
administration/version           = 1.0
 
 
 
# ##############################################################
# Exported configuration
 
 
# Export property "cfgProperty1" and its meta data
properties/cfgProperty1/value        = exampleStringValueRaw
properties/cfgProperty1/description  = Configuration property description
 
# Export property "cfgProperty2" and its meta data
properties/cfgProperty2/value        = 12
properties/cfgProperty2/value$ftype  = int
properties/cfgProperty2/description  = Configuration property description \
                                       on multiple lines
 
# Export property "cfgProperty3" and its meta data
properties/cfgProperty3/value        = 45.8
 
# Export property "cfgProperty4" and its meta data
cfgProperty4/value        = 44.8
cfgProperty4/description  = Another configuration property description
cfgProperty4/newMetaData  = 8


Exporting a conforming sub model with the raw AAS/sub model provider requires the configuration file to define all required meta data properties for a sub model, as defined in <<<PDF>>>. The following configuration file excerpt defines a RAW AAS/sub model provider configuration file that describes meta data for a sub model:


# ##############################################################
# Sub model meta data
 
# Sub model version
administration/version           = 1.0


Dynamic model deployment

In addition to the aforementioned static configuration through configuration file properties, the raw AAS/sub model provider also enables the dynamic deployment of VAB objects, e.g. sub models and asset administration shells. Dynamic sub model deployments require the sub model to be deployed as JSON serialized object that conform to the serialization format of the platform Industrie 4.0 (cf. <<<>>>). The standard provider REST calls (see here) may be used to put new VAB elements, AAS and sub models on the server, to query VAB elements, or to modify and add properties. In the following example, the BaSyx SDK is used to serialize a new Asset Administration Shell as JSON and to deploy it on a raw CFG sub model provider.


// Server connections
// - Connect to AAS server
VABElementProxy connSubModel = this.connManager.connectToVABElement("AASServer");
 
// AAS repository server URL
String aasSrvURL = "http://localhost:8080/basys.examples/Testsuite/components/BaSys/1.0/aasserver";
 
// Create device AAS
// - Product ID (urn:<legalEntity>:<subUnit>:<subModel>:<version>:<revision>:<elementID>#<elementInstance>)
ModelUrn deviceAASID = new ModelUrn("de.FHG", "devices.es.iese", "aas", "1.0", "3", "x-509", "001");
 
// - Create device AAS
AssetAdministrationShell_ aas = new AssetAdministrationShell_();
aas.put("idShort", "DeviceIDShort");
// - Transfer device AAS to server
connSubModel.createElement("/aas/submodels/aasRepository/"+deviceAASID.getEncodedURN(), aas);


BaSyx project links: Project BaSyx main wiki page | What is BaSyx? | BaSyx Developer Documentation

Back to the top