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.

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 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.

    Create a new IEC 61499 System

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

System Explorer showing project structure

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).

Function Blocks in the Application Editor

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.

Open type in editor view

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.

Connected Function 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

Setting the DT value on E_CYCLE

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.

System Configuration with device renamed and properties configured

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

Mapping FBs to the resource

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

Resource Editor showing the START block and mapped FBs

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.

Selecting the FORTE executable

  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 ExplorerDelete Resource to wipe it clean, then deploy again.

Delete Resource option in the context menu

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: Monitoring or doing the following:

  1. Change to Debug Perspective using the Debug Perspective Button button.

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

    Resource completely connected

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 FBWatch All to watch all its variables at once.

  • Right-click a variable or pinToggle Watch to watch a single value.

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

Right-click context menu showing Toggle Watch and Force Value options

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!

Light Blinking

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

Right-click context menu showing Toggle Watch and Trigger Event options

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?