# Building and Running 4DIAC-IDE

You have 2 options for building and running 4DIAC:

1. Building and Running 4DIAC-IDE from Source
2. Building a Binary 4DIAC-IDE Package from Source

## Building and Running 4DIAC-IDE from Source

Run through the following steps to build and execute the 4DIAC-IDE from source:

1. Get the development environment
2. Check out the 4DIAC-IDE repository
3. Import plug-ins into workspace
4. Get the 4DIAC-LIB
5. Run in development mode

### Get the Development Environment

Eclipse Neon (or later) use Eclipse Modeling Tools edition. In addition to the default Modeling Tool package you will need the following Eclipse Plug-ins. These can be installed via Help → Install Modeling Components.

- Xpand
- Xtext

### Check out the 4DIAC-IDE Repository

This section shows how to check out (clone) the 4DIAC-IDE repository. You will need Git to download it by using the clone command from Git to the repository https://git.eclipse.org/r/4diac/org.eclipse.4diac.ide. If you're using the terminal, do:

$ cd ~ $ git clone https://git.eclipse.org/r/4diac/org.eclipse.4diac.ide

The code will be copied to the new created folder ~/org.eclipse.4diac.ide.

### Import Plug-Ins into Workspace

1. File → Import → General → Existing Projects into Workspace
2. Under Select root directory select the source directory from the file system and mark all projects to be imported.
3. Wait till Eclipse finished building the project (look at the progress bar at the right bottom corner of the Eclipse main window)
4. Check problems view for errors. If you get API Baseline not set errors you need to perform the following steps:
   1. Open the Eclipse preferences: Window → Preferences
   2. Enter API in the top left search field. You should get three research results: 1. API Baselines, 2. API Errors/Warnings, and 3. API Use Scans
   3. You now have two options:
      1. Set an API Baseline for your developments:
         - Select: API Baseline
         - Click Add Baseline ...
         - Enter a name, e.g., MyEclipse
         - For the location select your Eclipse directory
         - Press Finish
         - Select your new baseline in the API Baselines window and press OK
      2. Set the API Baseline error to ignore:
         - Select: API Baseline
         - Set the option Missing API Baseline: which can be found in the bottom of the preferences window from Error to Ignore

### Set Target Platform

1. Open the Eclipse preferences within the product plugin:
2. Wait until the target platform is resolved or press Reload and wait until it is resolved
3. Press Set as Target Platform within the upper right corner and wait until the workspace is builded.

### Run in Development Mode

1. Open the 4DIAC-IDE.product from the org.fordiac.ide.product plug-in.
2. In the Testing Section of the Overview tab press Synchronize
3. To use 4DIAC-IDE directly under this (development) Eclipse you need a type library and templates
   - For the type library you need to put the typelibrary" folder into the directory with your eclipse.exe. How to get the default typelibrary is described here.
   - For the templates copy the templates directory from the 4DIAC download into the directory with your eclipse.exe
4. Press Launch an Eclipse Application in the Overview

### Get 4DIAC-LIB

Currently the 4DIAC-LIB includes:

- IEC 61499 specific function blocks
- All IEC 61131-3 functions and function blocks
- Some OSCAT functions and function blocks

To use the existing 4DIAC-LIB within the 4DIAC-IDE build from source perform the following step:

- Use tortoiseHG to clone the library from: http://hg.code.sf.net/p/fordiac/fordiac-lib into a typelibrary folder of your Eclipse installation (folder containing eclipse.exe).

To use the existing 4DIAC-LIB within the 4DIAC-IDE run through the following steps:

- Use tortoiseHG to clone the library from: http://hg.code.sf.net/p/fordiac/fordiac-lib
- Simply copy the contents of the library into your projects or into the Tool Library directory of your 4DIAC-IDE (folders of the Windows explorer can directly be copied into the Type Navigator View)
- OR Select all (for existing libraries in the project) and refresh

### Building your own IDE

A big drawback for running 4DIAC-IDE from source is that you need at least 2 Eclipse instances running. Especially on systems with little memory this can be an issue. If you still want to keep up with the developments performed in the Git repository it makes sense to build a binary package. See Building a binary 4DIAC-IDE package from source for details on how this can be achieved.

Go to top

## Building a Binary 4DIAC-IDE Package from Source

For building a binary 4DIAC-IDE package from the source code Eclipse provides a product export wizard. The necessary steps are:

1. Have the 4DIAC-IDE source code in an Eclipse workspace as described in Building and Running 4DIAC-IDE from Source
2. Press Eclipse Product Export Wizard in the Exporting Section of the product-file editor.
3. Specify Root Directory - e.g. 4DIAC-IDE
4. Specify Destination
5. After pressing Finish your product configuration is exported.
6. In the exported product, you need the typelibrary of an other 4DIAC-IDE and you have to copy or add the template directory of an other 4DIAC-IDE otherwise creating new FB types will not provide any template.

# Where to go from here?

Go back to Development index:

Development Index

If you want to go back to the Start Here page, we leave you here a fast access

Start Here page

Or Go to top