eTrice

This is a short tutorial on how to bring openSCADA and eTrice together.

The basics

First of all you will need to download etrice. The easiest way is to:

  • Download & Install Eclipse 4.2.2
    • In addition to the running Eclipse instance you will one version 3.8.2 located at "${system_property:user.home}/eclipse_build/eclipse382"
  • Install the "Marketplace Client" (Help -> Install New Software)
  • Drag the Marketplace Badge from the etrice homepage to your local and running Eclipse Window
  • Download and install OSTC from openscada.org

All openSCADA repositores can used from git.openscada.org or github and bitbucket. The example only lists the git.openscada.org URLs though.

Setup

openSCADA

First clone the "builder" repository of openSCADA ("git://git.openscada.org/org.openscada.builder"). Use the 1.1 branch and import at least the project "builder_global". Load the target platform from "openSCADABinaries.target". This is the step where you need the previously mentioned, separate Eclipse instance. You can also change the target platform and use "${eclipse_home}" instead.

Next clone the "contrib" repository of openSCADA ("git://git.openscada.org/org.openscada.contrib") and do use the 1.1 branch. Only import the following projects:

  • org.openscada.etrice
  • etrice.test1
  • org.eclipse.etrice.modellib.java
  • org.eclipse.etrice.runtime.java

The projects "org.eclipse.etrice.modellib.java" and "org.eclipse.etrice.runtime.java" are actually provided by the eTrice project. They need to be created in source form in the workbench and linked to directly using relative or absolute paths (no "platform:" URI or variables). Also the versions coming from openSCADA are OSGi bundles which the original versions are not (as of eTrice 0.2.0 – https://bugs.eclipse.org/bugs/show_bug.cgi?id=404989).

Code generation

Up to now there are several errors in the workspace. Running "ge_etrice.test1.launch" in the project "etrice.test1" should generate all the source and clear the errors.

Running

Run the run configuration named "etrice.test1.id". Check the console for output. If a dialog box named "Validation" pops up it can be ignored. Simply press "OK".

Start the OSTC (switch to DA perspective) and create a new connection for "da:ngp://localhost:2199". Connect using the context menu entry "Connect" and navigate to the items "item1" and "item2". Drag both to the realtime list view.

You should see two items counting up every second. It does up to 10, stops for 10 seconds and starts again at zero.

Now write to "item1" (context menu, "Write", not "Write attributes") and write any value to the item. The counter resets and starts again a zero immediately.