4DIAC-IDE vs. Other IEC 61499 Tools: A Practical Comparison

How to Build IEC 61499 Applications in 4DIAC-IDE: Step-by-StepThis article walks you through building IEC 61499 applications using 4DIAC-IDE (Eclipse-based engineering environment for FORTE and other runtime systems). It covers installation, project setup, developing function blocks and applications, linking devices and resources, deploying to run-time, debugging, and best practices. Examples use a simple temperature-monitoring and alarm application to demonstrate common workflows.


What you need before you start

  • A computer with Windows, Linux, or macOS.
  • Java Runtime Environment (recommended JRE 11 or later) for running Eclipse/4DIAC-IDE.
  • 4DIAC-IDE — download the latest stable release from the 4DIAC project site and extract or install it.
  • FORTE (4DIAC runtime) or another IEC 61499 runtime if you plan to deploy to hardware/VM. FORTE often ships as part of 4DIAC or is available separately.
  • Basic familiarity with IEC 61499 concepts: function blocks (FBs), events/variables, resources, devices, and distribution.
  • Optional: hardware or virtual devices for deployment and testing (Raspberry Pi, embedded controller, or desktop VM).

1. Install and launch 4DIAC-IDE

  1. Install the required JRE/JDK (11+).
  2. Download 4DIAC-IDE for your platform from the Eclipse project page or the 4DIAC website.
  3. Unpack the archive and run the executable (4diac-ide or 4diac-ide.exe). On first launch, choose or create a workspace directory.
  4. Familiarize yourself with the main perspectives:
    • Project Explorer — manage projects, devices, and resources.
    • System Editor — place devices and connections.
    • Application Editor — design application’s network of FB instances.
    • Device Editor — configure resources and mappings.
    • Library — access standard and custom FB types.

2. Create a new IEC 61499 project

  1. File → New → Project → 4DIAC Project.
  2. Name the project (e.g., TempMonitor). Click Finish.
  3. The project structure typically includes:
    • Applications folder — for .applib/.application files.
    • Devices folder — device definitions (.device).
    • Libraries — function block type definitions (.fbtype), sub-apps, and composites.

3. Understand the sample application: temperature monitor

We’ll build a simple application that reads a temperature sensor, compares the value to a threshold, and raises an alarm event when the temperature exceeds the threshold. Components:

  • AnalogSensor FB (reads temperature) — input variable: Temperature (REAL).
  • Comparator FB (compares Temperature to Threshold) — outputs boolean OverLimit.
  • Alarm FB (generates alarm event/LED) — receives OverLimit and triggers Alarm event.
  • Timer or periodic trigger to sample sensor.

You can use built-in FBs (e.g., RISING_EDGE, E_SR, CONNECTIONS) or create custom FBs.


4. Create or reuse Function Block Types (FB Types)

Option A — Use built-in FBs:

  • Browse the Library view for existing FBs like Comparator, E_CYCLE, or AnalogInput. Drag them into your application.

Option B — Create custom FB Type:

  1. Right-click project → New → Function Block Type.
  2. Choose Basic, Composite, or Service interface FB type:
    • Basic FB: implement algorithmic behavior with ECC (Execution Control Chart) and algorithms in ST, C, or structured textual pseudo-code.
    • Composite FB: compose other FB instances and interconnections.
  3. Define interface: Events (e.g., REQ, CNF, ALARM) and Data Inputs/Outputs (e.g., Temperature: REAL; Threshold: REAL; OverLimit: BOOL).
  4. For Basic FB: define ECC states and transitions; attach algorithms to transitions or states. Implement algorithms using ST (Structured Text) or C++ depending on runtime support. Example algorithm in ST for comparison: “`pascal VAR_INPUT Temperature : REAL; Threshold : REAL; END_VAR VAR_OUTPUT OverLimit : BOOL; END_VAR

OverLimit := Temperature > Threshold;

5. Save the FB type; it appears in the project library. --- ## 5. Build the application network 1. Create a new Application: Right-click Applications → New → Application. Name it TempMonitorApp.   2. Open the Application Editor. Drag FB types or instances from the Library into the network canvas:    - E_CYCLE (periodic event) — emits a REQ event every 1000 ms.      - AnalogSensor instance — receives REQ, outputs Temperature.      - Comparator instance — inputs Temperature and Threshold, outputs OverLimit event.      - Alarm instance — receives OverLimit and sets Alarm output. 3. Connect event and data ports:    - Events: connect E_CYCLE.REQ → AnalogSensor.REQ → Comparator.REQ → Alarm.REQ (or as appropriate per FB interfaces).      - Data: connect AnalogSensor.Temperature → Comparator.Temperature; set Comparator.Threshold to a constant (double-click to set initial value or use a VAR_IN with constant source). 4. Configure parameters: set Threshold value, sampling period on E_CYCLE, and any Alarm behavior. --- ## 6. Map application to device and resources 1. Create a Device: Right-click Devices → New → Device. Choose a device type (e.g., FORTE-based device) or generic device.   2. Inside the Device Editor, create a Resource (e.g., R0). Resources host applications and correspond to runtime execution contexts.   3. Drag your TempMonitorApp into the Resource to map it. The Device Editor shows application-to-resource mapping.   4. Configure communication settings if deploying to remote FORTE instances (TCP/IP, ports). Set resource names to match runtime names. --- ## 7. Deploy to runtime (FORTE) Local deployment: 1. If FORTE is installed locally, ensure the FORTE runtime is running and reachable.   2. Right-click Device → Deploy Device (or use the deployment toolbar). 4DIAC-IDE will transfer application and types to the FORTE instance.   3. Start the application from the runtime monitor or via 4DIAC-IDE controls. Remote deployment: 1. Ensure network connectivity and matching runtime configuration.   2. Set the device’s IP/port and resource names. Use Deploy Device to send the configuration. Troubleshooting tips: - If deployment fails, ensure runtime versions and FB type libraries match.   - Check firewall and port settings for remote machines.   - Use the runtime console to view errors. --- ## 8. Test and debug 1. Use the IDE’s runtime monitor to view events, variables, and resource state.   2. Insert logging within FB algorithms (if supported) or use outputs to toggle indicators.   3. For Basic FBs, step through ECC transitions by sending events manually (IDE provides event injection in the Application Editor).   4. Monitor communication using network tools or runtime logs. --- ## 9. Example: implement a Basic FB Alarm with ECC 1. Create Basic FB Alarm:    - Events: REQ (input), ALARM (output).      - Data: Trigger: BOOL (input). 2. ECC states:    - S0 (Idle) — on REQ if Trigger = FALSE → stay Idle. On REQ if Trigger = TRUE → transition to AlarmState and execute SetAlarm algorithm.      - AlarmState — on REQ if Trigger = FALSE → transition to Idle and execute ClearAlarm algorithm. 3. Algorithms (ST): ```pascal (* SetAlarm *) AlarmOutput := TRUE; (* ClearAlarm *) AlarmOutput := FALSE; 
  1. Hook ALARM event to external LED FB or logging FB.

10. Best practices

  • Reuse standard FB types when possible; build custom FBs only for unique logic.
  • Keep FB interfaces small and focused (single responsibility).
  • Version-control your 4DIAC project files (they are text-based XML).
  • Use composite FBs to encapsulate repeated sub-networks.
  • Test FB types independently before composing them into applications.
  • Document resource mappings and deployment configurations.

11. Common issues and fixes

  • Mismatched FB type versions between IDE and runtime: ensure both use the same library files.
  • Deployment connectivity errors: verify IP, ports, and firewall rules.
  • Unexpected timing: check E_CYCLE periods and resource scheduling.
  • Data type mismatches: ensure connected data ports use compatible types.

12. Further learning and resources

  • 4DIAC project website for downloads and documentation.
  • IEC 61499 standard texts and tutorials.
  • FORTE runtime documentation for platform-specific deployment.
  • Community forums and mailing lists for examples and troubleshooting.

This guide gives a practical, step-by-step path from installing 4DIAC-IDE to building, deploying, and debugging a simple IEC 61499 application. Adjust the example to your hardware and runtime needs as you gain familiarity.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *