Skip to main content

This library is used for creating a MAT edge starting from a simple configuration file

Project description

MAT Edge Generator

Introduction

matEdgeGenerator is a tool designed for automatically generating Edge configurations suitable for the MAT software.

Running the software

To run the software you need to import from matEdgeGenerator.generator the function generateConfiguration. This function accepts two arguments:

  • config_path: Path of the folder containing the input configurations.
  • output_path: Path of the folder in which the output configuration will be generated.

The folder in config_path must contains the following files:

  • profiles: Folder containing the factoryedge profiles used for the current configuration. Supported profiles are S7, OPC-UA and MODBUS. Each profile is a file .json.
  • cloudConfig.json: json file used to indicate the cloud configuration
  • utils.json: json file containining the utils function used in the BSW (if any)
  • configBsw.json: metaconfiguration used to create the BSW configuration file

Getting an Example Configuration

To obtain an example configuration, you can execute the following script:

from matEdgeGenerator.example import getExampleConfig

getExampleConfig('your_target_folder')

this will generate an example input configuration that can be used as a starting point.

configBsw

This configuration file is a dictionary containing the a KEY-VALUE pair for each sub-machine in the asset configuration. If only a machine is present, only the KEY line must be used. Below are the keys that make up the configuration for eache sub-machine (i.e. the sub-machine dictionary value). Note that whenever the term "variable" is mentioned, it refers to a BSW input. If this input does not come directly from the PLC (so is not present in one of the profile present in the profile folder) but needs to be calculated, the variable must be indicated as utils.-variable name-. All utils variables will be set up in a dedicated aspect that needs to be filled out manually.

To specify a global influxdb password, is possible to add the influxdbPassword key in the configuration. This will force the value of the influxdb password in the project

The configuration is done for each sub-machine (including the line) and for each machine; it presents the following keys:

  • cycle (Optional): Dictionary containing the following keys:

    • id: String variable used to understand cycle changes.
    • aux_var: List of auxiliary variables to include in the cycle history.
  • phase (Optional): Dictionary of phases - possible only if the cycle dictionary exists:

    • id: String variable used to understand phase changes.
    • aux_var: List of auxiliary variables to include in the phase history.
  • state: Dictionary containing the following keys:

    • var: String variable used for the state.
    • faulty: List of integers representing fault states.
    • productive: List of integers representing productive states.
    • external: List of integers representing external stop states.
    • possible_vals: List of all possible state integers.
  • mainCounter (Optional): Dictionary containing:

    • id: String variable used for the incremental production counter.
    • scale: Number indicating possible data scaling.
  • badCounter (Optional): Dictionary containing:

    • id: String variable used for the incremental waste counter.
    • scale: Number indicating possible data scaling.
  • scrapReasons (Optional): List of dictionaries, each containing:

    • id: String variable used for the nth scrap reason counter.
    • scale: Number indicating possible data scaling.
  • goodCounter (Optional): Dictionary containing:

    • id: String variable used for the incremental good pieces counter.
    • scale: Number indicating possible data scaling.
  • idealSpeed (Optional): Dictionary containing:

    • id: String variable used to determine ideal speed.
    • scale: Number indicating possible data scaling.
  • aggr: List of machine aggregates.

  • counters (Optional): List of dictionaries, each containing:

    • id: String variable used for the nth generic counter.
    • scale: Number indicating possible data scaling.
  • consIntegral (Optional): List of dictionaries, each containing:

    • id: String variable used for the consumable to integrate over time.
    • scale: Number indicating possible data scaling.
  • consSum (Optional): List of dictionaries, each containing:

    • id: String variable used for the consumable to sum.
    • scale: Number indicating possible data scaling.
  • raws (Optional): List of dictionaries, each containing:

    • sampling: Integer indicating the sampling time in milliseconds.
    • sendToMqtt: Boolean; if True, the raw aspect will be made available as an MQTT channel output.
    • vars:
      • List of variables to acquire without modifications.
      • Dictionary with keys corresponding to the variables to be recorded and values equal to their data types (e.g., "var_01": "float").
  • warnings (Optional): List of strings, containing variables used for warnings (boolean type data).

  • alarms (Optional): List of strings, containing variables used for alarms (boolean type data).

  • breakdowns (Optional): Dictionary containing:

    • mode: String indicating the breakdown search mode. Possible values are:
      • 'pre': Only alarms started before the breakdown can be the cause.
      • 'post': Only alarms started after the breakdown can be the cause.
      • 'prepost': Alarms started both before and after the breakdown can be the cause.
    • params: List of parameters to acquire at the beginning and end of breakdown.
  • buttons (Optional): List of strings, containing variables used for buttons (boolean type data).

  • snapshot: Boolean; if True, BSW output snapshots will be created for all RAW aspects.

  • recipe (Optional):

    • Option 1:
      • List of strings, containing variables used as recipe parameters.
    • Option 2:
      • Dictionary with keys corresponding to the variables to be recorded and values equal to their data types (e.g., "var_01": "float").

cloudConfig

This configuration file is dedicated to the cloud configuration, contains the following keys:

  • active: Boolean that says if the cloud configuration must be configured

  • platform: Cloud platform used, possible values are 'azure' or 'mindsphere'

  • name: Identifier of the asset in the edge configuration, up to the user.

utils

utils.json contains the function used in the BSW in the utils aspect. Object configured in this file will be automatically substituted inside the aspect when the BSW is configured

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mat-edge-generator-0.5.4.tar.gz (17.6 kB view details)

Uploaded Source

Built Distribution

mat_edge_generator-0.5.4-py3-none-any.whl (16.6 kB view details)

Uploaded Python 3

File details

Details for the file mat-edge-generator-0.5.4.tar.gz.

File metadata

  • Download URL: mat-edge-generator-0.5.4.tar.gz
  • Upload date:
  • Size: 17.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.12

File hashes

Hashes for mat-edge-generator-0.5.4.tar.gz
Algorithm Hash digest
SHA256 14315452da500fa152a2dd0d233db6739829c50a67220bfc851cef823ac903ca
MD5 75ea61c2309eadf34f64af663ea1da0f
BLAKE2b-256 1ea54ee3707a68fcca56c79af475f1c2bcbfd384b4c7576f08f9f192c4873ff6

See more details on using hashes here.

File details

Details for the file mat_edge_generator-0.5.4-py3-none-any.whl.

File metadata

File hashes

Hashes for mat_edge_generator-0.5.4-py3-none-any.whl
Algorithm Hash digest
SHA256 6b04c7ad5e895791e316fc639c1e052bd0a8a9c79b513d252eabaa96af3b3d75
MD5 183b00051e98dff4e4e031892d46d63b
BLAKE2b-256 ab478f342d37ed2c957f85d6e31daf754bed345da3395cd610d421befe1deb63

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page