OpenCommissioning / OC_Assistant

Open Commissioning Assistant
BSD 3-Clause "New" or "Revised" License
15 stars 3 forks source link
digital-twin opencommissioning

Open Commissioning Assistant

The Open Commissioning Assistant is an application designed to facilitate engineering processes based on the Open Commissioning Framework. It specializes in implementing various plugins for virtual commissioning and optimizing TwinCAT project workflows.

The goal of this application is to keep it as simple as possible with a clean design and let it only do what it needs to do. It is currently optimized for a connection to a TwinCAT3 Shell. Supported Versions:

Target framework

Used packages:

Installation

Download the OC.Assistant.exe from the Release page and start it. .NET 8.0 is required to run the application.

Core Functionality

The application's primary functions are:

  1. Generating and updating connected TwinCAT projects
  2. Connecting external systems via plugins and make this data available to the TwinCAT project.

Handling TwinCAT Solutions

The File menu contains functions regarding TwinCAT Solutions:

FileMenu.png

Updating Projects

The Project menu contains functions to update the connected TwinCAT Solution. Note that this menu is only active when the Assistant is connected to a TwinCAT solution and this solution is in Config Mode.

ProjectMenu.png

DeviceGeneration.gif

TaskGeneration.gif

ProjetctSettings.png

Profinet

The Profinet menu provides the function to automatically scan for Profinet devices on a selected network interface and create corresponding Profinet device nodes in the connected TwinCAT solution. Note: When using it for the first time, the dsian.TcPnScanner tool has to be installed. This can be done via the Assistant application itself by clicking on Install dsian.TcPnScanner in the Profinet menu. After successful installation, the function Scan Profinet function becomes available.

ProfinetMenu.png

To scan for Profinet devices:

  1. Click "Scan Profinet"
  2. Enter a name for the Profinet Node in TwinCAT
  3. Select the network adapter for scanning (must have TwinCAT Real-Time driver installed)
  4. Optionally, specify a .hwml file
  5. Click "Start" to begin the scan

The scan will create Profinet nodes in the connected TwinCAT solution for each detected device.

ScanProfinet.png

Plugin System

Plugins enable the Assistant to connect to external systems such as PLCs, robot controllers, and other control data sources, making this data available to the TwinCAT solution via Global Variable Lists (GVLs).

OS_System OS_System

There will be plugins for:

[!NOTE] There are no plugins released for the public yet.

Installation

  1. Move the plugin folder into the directory of the OC.Assistant.exe.
  2. Start the OC.Assistant.exe application.
  3. The Assistant will automatically search through all subdirectories for *.plugin files and load any compatible plugin assemblies.
  4. Once loaded, the plugin will be available for use within the Assistant.

Usage

  1. Create a new instance of a plugin using the + button
  2. Configure the plugin instance with required data
  3. Upon successful loading, the assistant generates a GVL for the plugin's interface
  4. The generated variables become available for use in TwinCAT

PluginUsage.gif

Configuration File

The OC.Assistant.xml file in the project folder of the TwinCAT solution serves as the base for generating objects in the TwinCAT solution. It gets created the first time the Assistant connects to the solution. This configuration includes all plugin connections and devices of the project for which behavior models should be generated

The plugin connection section is populated by adding plugins via the Assistant application itself. The device section is populated by using the "Update TwinCAT Project" function of the Client component in the Unity package.

This is an example configuration file containing a Plugin configuration and Devices:

<?xml version="1.0" encoding="utf-8"?>
<Config>
  <TaskAutoUpdate />
  <Plugins>
    <Plugin Name="PLC1" Type="PlcSimAdvanced" IoType="Address">
      <Parameter>
        <AutoStart>true</AutoStart>
        <PlcName>PLC_1</PlcName>
        <Identifier>1</Identifier>
        <CycleTime>10</CycleTime>
        <InputAddress>0-1023</InputAddress>
        <OutputAddress>0-1023</OutputAddress>
      </Parameter>
      <InputStructure />
      <OutputStructure />
    </Plugin>
  </Plugins>
  <Project>
    <Hil />
    <Main>
      <Group Name="Devices">
        <Group Name="Cylinders">
          <Device Name="Cylinder_1" Type="FB_Cylinder" />
          <Device Name="Cylinder_2" Type="FB_Cylinder" />
          <Device Name="Cylinder_3" Type="FB_Cylinder" />
          <Device Name="Cylinder_4" Type="FB_Cylinder" />
        </Group>
        <Group Name="Drives">
          <Device Name="Drive_Position" Type="FB_Drive" />
          <Device Name="Drive_Simple" Type="FB_Drive" />
          <Device Name="Drive_Speed" Type="FB_Drive" />
        </Group>
        <Group Name="Interactions">
          <Device Name="Button" Type="FB_Button" />
          <Device Name="Lamp" Type="FB_Lamp" />
          <Device Name="Lock" Type="FB_Lock" />
          <Device Name="Panel_1" Type="FB_Panel" />
          <Device Name="Toggle" Type="FB_Button" />
        </Group>
        <Group Name="SensorsAnalog">
          <Device Name="SensorAnalog_1" Type="FB_SensorAnalog" />
          <Device Name="SensorAnalog_2" Type="FB_SensorAnalog" />
          <Device Name="SensorAnalog_3" Type="FB_SensorAnalog" />
        </Group>
        <Group Name="SensorsBinary">
          <Device Name="SensorBinary_1" Type="FB_SensorBinary" />
          <Device Name="SensorBinary_2" Type="FB_SensorBinary" />
          <Device Name="SensorBinary_3" Type="FB_SensorBinary" />
        </Group>
      </Group>
    </Main>
  </Project>
</Config>

Contributing

We welcome contributions from everyone and appreciate your effort to improve this project. We have some basic rules and guidelines that make the contributing process easier for everyone involved.

Submitting Pull Requests

  1. For non-trivial changes, please open an issue first to discuss your proposed changes.
  2. Fork the repo and create your feature branch.
  3. Follow the code style conventions and guidelines throughout working on your contribution.
  4. Create a pull request with a clear title and description.

After your pull request is reviewed and merged.

[!NOTE] All contributions will be licensed under the project's license.

Code Style Convention

Please follow these naming conventions in your code:

Type Rule
Private field _lowerCamelCase
Public field UpperCamelCase
Protected field UpperCamelCase
Internal field UpperCamelCase
Property UpperCamelCase
Method UpperCamelCase
Class UpperCamelCase
Interface IUpperCamelCase
Local variable lowerCamelCase
Parameter lowerCamelCase
Constant UPPER_SNAKE_CASE

Guidelines for Contributions

We appreciate your contributions and look forward to collaborating with you to improve this project!