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.

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.4.1.tar.gz (17.4 kB view details)

Uploaded Source

Built Distribution

mat_edge_generator-0.4.1-py3-none-any.whl (16.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: mat-edge-generator-0.4.1.tar.gz
  • Upload date:
  • Size: 17.4 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.4.1.tar.gz
Algorithm Hash digest
SHA256 3631c1dc7ac13cddc1becdf3df373783894631c1da7a06b9a69676c415b70527
MD5 afd2fcb1e58a1a532e7b075e9698e343
BLAKE2b-256 3537cd50d4d166bf62bfbf534a43c1b714c70e4366d5025e19086ada8cc0ec00

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mat_edge_generator-0.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 cf8961d041ca6a349da43571e07e61e0d9d8fbd6ab2ccb8c98430c5ee2625c2c
MD5 90ec3720d6c0b059edd9ba2c74f1ef7d
BLAKE2b-256 66c2308b32a11966225809280359c88db0094e466a4719f7e5d3d51f930c190b

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