Step 1 - Use 4DIAC-IDE locally (Blinking tutorial)

This page is part of a guide that gives a walkthrough over the major 4DIAC features.

  1. Overview
  2. Use 4DIAC locally (YOU ARE HERE!)
  3. Create a distributed application
  4. Deploy remotely
  5. Create your own Function Blocks
  6. Other basic features
  7. Advanced Features [optional]

In this guide, it will be shown a simple Blinking application. It's the "Hello World" of automation programs, so it will be enough to understand the key aspects and workflow of 4DIAC. The application will run locally, so no connection to any PLC or external hardware is needed. The architecture is shown below.

architecture for the current step

Create a new IEC 61499 System

  1. Select the System Perspective using the System Perspective Button button create a new IEC 61499 System, by selecting either
  2. Follow the instructions in the creation wizard. In the following wizard, the project name has to be specified.
    Create a new IEC 61499 System

The system appears in the System Explorer on the left. There you can see two things now:

You will see here also later the applications you develop.

New systems per default contain a copy the types in the Type Library. If different types are need, for example from another project or another IEC 61499 engineering tool, these type files can be easily added by copying them into the project directory at the desired place. Furthermore the Type Navigator allows to drag and drop types between projects as well as within a project to a different folder.

Configuration of the Automation Hardware

First, let's define the devices that are present in out system. The automation hardware can be modelled with the System Configuration Editor. It can be opened by double clicking on the System Configuration tree node in the System Explorer on the left. By using Drag and Drop, Device, Resource and Segment types can be added from the palette. On an IEC 61499 Device several IEC 61499 Resources can be configured. Resources can be directly added to Devices.

Drag and Drop a FORTE_PC Device and a Ethernet Segment from the Palette. Connect them clicking on one of them and dragging to the other. One EMB_RES resource is already present in the device. The MGR_ID localhost:61499 specifies the IP:PORT where the device will run. In this case it'll run locally and will listen at the port 61499.

System Configuration Editor

Device and Resource parameters can either be specified directly at each Device/Resource or via the Properties View. The Properties View shows the parameters of a IEC 61499 Device/Resource (if it is selected either in the System Configuration Editor or in the System Manager View). The most important parameters are the IP address and the port of the device management interface as they are required for the communication between the engineering tool and the Devices (e.g. Download of IEC 61499 Applications).

Check that the Profile in the Properties tab is set to HOLOBLOC.

Configuration of the Device's Configuration Profile

In order to support different device vendors' download mechanism you need to specify the device profile to be used for your device. currently 4DIAC-IDE supports the following two device profiles:

Create a new IEC 61499 Application

  1. Create a new IEC 61499 Application, by selecting either
  2. Follow the instruction in the creation wizard. In the following page of the wizard, the name of the Application and the corresponding parent System have to be specified. The number of applications that can be created is not limited.
    Create a new IEC 61499 Application Select target system

Create a network of FBs for the Blink application

A double-click on an Application in the System Explorer tab on the left opens the Application Editor for this specific application in the editor area.

  1. Drag and Drop the following Function Blocks (FBs) to the Editor. Use the Palette on the right or the Type Libary in the System Explorer (the three are in the event folder): Function Blocks for the blink example

    The name in the middle of the FB is the type of it. If you CTRL + click on it, you can access the definition of the type of the FB. There you can see the interface and how it works. Check E_SWITCH and E_SR and go to the ECC tab to see how it behaves.

    The name on top of the FB is the instace name. Two FBs cannot have the same instance name. You can double click on it to change it for a better organized application.

  2. Create the connections between the FBs

    Event (red, on top part of FBs) and Data (blue, on lower part of FBs) connections can be generated by connecting the Event-/Data in- and outputs. Position the mouse pointer over an Event-/Data in- or output, click and drag to the other end of the connection to create one. Remember, Event and Data connections cannot be mixed. Events connections allow fan-in and fan-out. Data connections allow fan-out but not fan-in.

    Function Blocks for the blink example

    Here are some tips about editing the application:

  3. Set a literal as an input data connection. The DT input data connection of E_CYCLE must be set to a value in order for it to work. You can do it by either:

    Set the value to T#1s, meaning 1 second.

    Function Blocks for the blink example

Now the application is done. You should try to understand how the application works. Something missing is the starting event. This would be done later when the hardware is configured. For now, imagine an event arrives to E_CYCLE.START. Every 1 second, and event output will be triggered in E_CYCLE.EO. The E_SWITCH will trigger an event output EO0 when G is zero, and EO1 when G is one. The value Q of E_SR will be 1 when an event at S arrive and 0 when an event at R arrive. Try to follow the flow of events and understand why this application makes Q toogle, considering it starts at 0.

Mapping of Function Block Networks to Devices/Resources

Mapping FBs means specifing in which Hardware will each FBs run. All mapped FBs are changing their fill color to the Device's color during the mapping process.

Go to the Application created before, select the FBs you want to map (in this case all of them), right click → Map to ... → FORTE_PC → EMB_RES

Mapping of Function Block Instances within the Application Editor

To unmap a Function Block instance from a Resource, use the context menu entry Unmap of a Function Block in the corresponding Application.

Configure the Resource

You can ope the Resource Configuration by double clicking the Resource in the System Configuration, or in the tree in the System Explorer on the left.

There you can find a START function block in white. This is the default starter fuction block of the EMB_RES. This will trigger a COLD event when starting. The STOP is triggered when the PLC is set to a STOP state, and the WARM when the PLC changes from a STOP state back to a RUN state. Connect both COLD and WARM to E_CYCLE.START.

Resource completely connected

You also see the FBs that were previosly mapped. You can add more FBs directly here and they will be already mapped to the resource, or you can unmap the FBs.

Deploying application to FORTE

In this step, the Blink application will be deployed to FORTE running locally.

  1. Go to Windows → Preferences → 4DIAC → FORTE Preferences, and in FORTE Location look for FORTE inside your 4DIAC folder in runtime/FORTE/1.8RC3/[YOUR_OS]/forte[.exe] and then click OK.
  2. Change to the Deployment Persperctive using the Deployment Perspective Button button.
  3. Set the port to 61499 (the same define before, remember localhost:61499 in the System Configuration?)
  4. Launch Local FORTE
  5. You should see the the location of your FORTE and the STOP button enable in the Console.
  6. Select the elements to deploy. In case you have many devices with many resources, you can select the devices to deploy and even which resources to deploy.
  7. Click the Download button
  8. Check that the deployment console shows some output, and that no red warning appears on the right nor left of it. If you get somthing red, something went wrong.
Resource completely connected

Note: With the runtime launcher you can only start run-time environments in your local development computer. It is not possible to start run-time environments on remote computers or control devices. In order to perform this task device specific means to start the run-time environment have to be performed.

The Deployment Console is automatically cleared before each download. Furthermore, with the icon Clear Deployment Console in the upper right corner of the Deployment Console the deployment messages can be cleared.

By selecting a Device or Resource the corresponding IEC 61499 element can be cleaned. This means that the Device or Resource configuration are cleaned and reset to the default configuration without any Function Block Network.

Delete All Resources leaves the Device empty, and Kill Device stops FORTE. You can deploy again after cleaning the Device

Clean Device

Delete Resource deletes just the selected resource:

Clean Resource

Monitoring 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 System
    Resource completely connected

A green sign shows that the monitoring is enabled for the system. To watch variables, you can:

The Data and Events are monitored. The Data shows the current value and the Events show the times it was triggered. You can watch on the directly on the Element or in the Watches view.

Resource completely connected

You can force values to data inputs and trigger events by right clickin on it and selecting the corresponding command.

Force value Trigger Event

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 the back to see an overall overview of 4DIAC, here's a link

Step 0 - 4DIAC-IDE - General View

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

Start Here page

Go to top