# This header is for providing additional information to hugo for the website generation it ignored by asciidoctor

title: "Step 1 - Use 4diac Locally" url: doc/tutorials/use4diaclocally.html page_css_file: /4diac/css/4diac_doc.css sidebar: - sb-doc ---

# Step 1 - Use 4diac Locally

This page is part of a guide that gives a walk-through over the major 4diac IDE features.

0. 4diac IDE Overview

1. Use 4diac Locally (Blinking tutorial) (YOU ARE HERE!)

2. Distribute 4diac Applications

3. Deploy Applications Remotely

4. Create Your own Function Block Types

5. Other Basic Features

6. Advanced Features

7. Deploying new FBs with the Dynamic Type Loader

8. Deploying Applications with OPC UA

In this tutorial you create a simple Blinking application — the "Hello World" of automation programs. It teaches the key workflow of 4diac IDE. The application runs locally, so no external hardware or PLC is needed.

## Create a new IEC 61499 System

1. Open the System Perspective: Click the system icon in the top-right toolbar (see Step 0 for reference).

2. In the top menu bar, go to: File → New → 4diac IDE Project…​

3. In the wizard, name your project BlinkyTest and click Finish.

After creating the project, the System Explorer on the left shows the project BlinkyTest with the following items:

- BlinkyTest []— the system file; expand it to find BlinkyTestApp (your application) and System Configuration (where you define your hardware/devices)

- Type Library— the Function Block types available in this project

- External Libraries— shared type libraries

- Standard Libraries— standard IEC 61499 type libraries provided in 4diac IDE

- MANIFEST.MF— a 4diac IDE project manifest file

## Create the FB Network (Blink Application)

Double-click BlinkyTestApp in the System Explorer to open the Application Editor. Add the following three Function Blocks to the drawing area:

- `E_CYCLE`

- `E_SWITCH`

- `E_SR`

You can insert a Function Block using any of these methods:

- Quick Type: Double-click an empty space on the canvas and start typing the FB type name (auto-completion is available).

- Context Menu: Right-click the canvas → Insert FB and type the name.

- Drag and Drop: Drag directly from the type library or palette (e.g. the events folder).

The name in the middle of each block is its type; the name on top is the instance name. By default, a valid instance name is created from the type name — it is strongly recommended to change it to something representative for a better organised application. To inspect a block’s definition, right-click it and select Open Type in Editor. There you can see the interface and how it works. Try opening `E_SWITCH` and `E_SR` and go to the ECC tab to see how they behave.

### Connect the FBs

There are two types of connections, both created the same way: hover over a pin, click, and drag to the target pin.

- Event connections (green lines, top part of FBs) — control the execution flow between blocks.

- Data connections (varying color, e.g. grey for Booleans, lower part of FBs) — pass values between blocks.

Tip | Hover over any FB, Data, or Event connection end to see details about it.

Note | If you connect Data connections with incompatible types, the mouse pointer turns into a red sign and a tooltip appears explaining the problem.

### Set the Cycle Time (DT Input)

The `E_CYCLE` block needs a cycle time. Set DT to `T#1s` (1 second) using one of these methods:

- Double-click the DT pin on the left bottom of the `E_CYCLE` block

- Select DT and change the value in the Properties tab below

Note | DT must be set, otherwise `E_CYCLE` does not know how often to fire. `T#1s` means "every 1 second".

The blink works as follows: when a `START` event arrives at `E_CYCLE.START`, every second `E_CYCLE.EO` fires. `E_SWITCH` routes the event to `EO0` when `G=0`, or `EO1` when `G=1`. `E_SR` sets its output `Q` to `TRUE` on `S` and `FALSE` on `R`. `Q` feeds back to `G`, so `Q` toggles `TRUE`/`FALSE` every second — blink!

## Configure the Hardware (System Configuration)

Double-click System Configuration in the System Explorer to open the System Configuration Editor. Use drag-and-drop from the palette to add:

1. `FORTE_PC` (a Device) — represents your local computer

2. `Ethernet` (a Segment) — the communication medium

Then connect them by dragging from the Device to the Segment. Your mouse cursor has to turn into the shape of a `+` to create connections. The device comes with one `EMB_RES` resource already.

Rename the device to testee (double-click the name or use Properties below).

Device and Resource parameters can be set directly on the element or via the Properties View (visible when a Device or Resource is selected in the System Configuration Editor or System Manager View). The most important parameters are the IP address and port of the device management interface, as these are required for communication between 4diac IDE and the device — for example, to download an IEC 61499 application.

Check that `MGR_ID` is `localhost:61499` (or similar port). Check that the Profile is set to `HOLOBLOC` in the Properties tab.

### Device Profile Configuration

The device profile controls which download mechanism 4diac IDE uses to communicate with your device. 4diac IDE currently supports two profiles:

- `HOLOBLOC`— for devices conforming to the IEC 61499 Compliance Profile for Feasibility Demonstrations. This includes all `FORTE` devices and `FBDK` devices older than 2009.

- `FBDK2`— for FBDK devices version 2 or later.

Rename the `EMB_RES` resource to Blinky_RES (from the Properties). `EMB_RES` stands for Embedded Resource — it’s where your FBs will actually run.

## Map FBs to the Device/Resource

Go back to the Application Editor (BlinkyTestApp). Select all three FBs (click + drag or Ctrl+A), then:

right click → Map To…​ → testee → Blinky_RES

After mapping, the FBs change color to match the device color. To unmap, right-click a FB → Unmap.

## Configure the Resource (Add START)

Double-click Blinky_RES in the System Explorer (or in System Configuration) to open the Resource Editor. You’ll see:

- Your mapped FBs (`E_CYCLE`, `E_SWITCH`, `E_SR`)

- A white `START` block — the default starter FB of `EMB_RES`

The `START` block fires the following events:

- `COLD`— triggered when the PLC starts

- `WARM`— triggered when the PLC transitions from a stop state back to a run state

- `STOP`— triggered when the PLC is set to a stop state

Connect both `COLD` and `WARM` outputs of `START` to `E_CYCLE.START`.

## Deploy to 4diac FORTE

Before deploying, point 4diac IDE to the FORTE executable. Go to: 4diac IDE → Settings → FORTE Preferences

In FORTE Location, browse to your `forte` (or `forte.exe` on Windows) file. Click Apply and Close.

1. Start 4diac FORTE (run the executable locally)

2. In 4diac IDE, click the green Run/Deploy arrow in the toolbar

3. The Console should show:

       <!-- Connected to device: testee -->
       <!--  Disconnected from device: Testee -->

To redeploy, right-click the Blinky_RES in System Explorer → Delete Resource to wipe it clean, then deploy again.

## Monitor the Application

To observe the outputs of your Application you can use 4diac’s monitoring functionality. You can enable it in the Toolbar under the Toolbar icon: or doing the following:

1. Change to Debug Perspective using the button.

2. In the System Explorer, right click on the System → Monitor As → Monitor

A green circle will appear in the system icon indicating that monitoring is enabled for the system.

Once monitoring is active, you can watch variables in the Resource Editor in two ways:

- Right-click an FB → Watch All to watch all its variables at once.

- Right-click a variable or pin → Toggle Watch to watch a single value.

You can also use Force Value…​ from the same menu to manually override a value.

The watched values appear in the Watch panel on the right. You’ll see `Q` alternating between `true` and `false` every second — your light is blinking!

You can also trigger events manually by right-clicking on a pin and selecting Trigger Event.

## Quick Reference

Element | How to Create | Tutorial Name
--- | --- | ---
System | File → New → 4diac IDE Project | BlinkyTest
Application | Auto-generated | BlinkyTestApp
System Configuration | Auto-generated (one per system) | —
Device | Drag from palette (System Configuration Editor) | testee
Resource | System Configuration Editor | Blinky_RES

## Where to go from here?

- Now that you know how to do a centralized solution, let’s try and distribute things:
  Step 2 - Distribute 4diac Applications

- If you want to go back to see an overall overview of 4diac IDE:
  Step 0 - 4diac IDE Overview

- If you want to go back to the Start Here page:
  Where to Start

Go to top