Step 2 - Distribute 4DIAC applications

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

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

This guide extends the blinking application of Step 1. We want to count how many times the light has turned on. You will learn how to distribute a IEC 61499 Application to several devices and set up the communication between them. The example continues to run on the local computer. The Application will run on 2 devices. The blinking part of the application will run on a 4diac FORTE and the count on another 4diac FORTE, see the architecture below. The two different programs running on the local machine emulate two PLCs.
architecture for the current step

Extend the Application

To count the blinking, we need to add 2 new Function Blocks (FBs) to the existing Application in the BlinkTestApp Application Editor.

  1. Drag and Drop the following FBs from the folder events of the Palette.
  2. Create the connections between them the FBs.

Remember, Event and Data connections can not be mixed.

architecture for the current step

Add Another Device

Change to the BlinkTest System Configuration Editor an add a second device from the Palette. The counter will run on the new device

  1. Drag and Drop a FORTE_PC device next to the existing one.
  2. Rename the device to Counter.
  3. Set the localhost to 61500. The devices need to have different localhosts, they can not have the same.
  4. Rename the resource to Counter_RES.
Add another device to the system

Change back to the BlinkTestApp Application Editor and map the two new FBs to the Resource Counter_RES. You can see the dashed connections between the two devices.

Mapping of Function Block Instances within the Application Editor

Set up the Communication Between Both Devices

Change to the Testee.Blinky_RES or Counter.Counter_RES Resource Editor. There you can see 2 incomplete FBs at the E_SR FB or E_PERMIT. It symbolizes the broken connections between the two devices. Currently they have no opportunity to communicate with each other. We fix it by adding special Communications FBs. You can find more information about broken connections here on our Homepage.

incomplete FBs show die broken connection beween two devices

Set up the Blinking Part of the Application

Change to the Testee.Blinky_RES Resource Editor.

Drag and Drop a PUBLISH_1 FB from the folder net of the Palette and set up the connections. The PUBLISH FB must be initialized, so it is best to connect its INIT event directly to the START.

Blinky_RES completely connected

Set up the Counting Part of the Application

Change to the Counter.Counter_RES Resource Editor.

Drag and Drop a SUBSCRIBE_1 FB from the folder net of the Palette and set up the connections. The SUBSCRIBE FB must also be initialized.

Counter_RES completely connected

Start both devices

Change to the Deployment Perspective.

  1. Set the Port to 61499 (the same define before, remember localhost:61499 in the System Configuration Editor?)
  2. Launch Local FORTE
  3. You should see the the location of your 4diac FORTE and the Terminate button enabled in the Console.
  4. Set the Port to 61500 (the same define before, remember localhost:61500 in the System Configuration?)
  5. Launch Local FORTE
  6. You should see the the location of your 4diac FORTE and the Terminate button enabled in the Console.
  7. Select the elements to deploy. For this tutorial select our devices Counter and Testee.
  8. Click the Deploy button
  9. Check that the Deployment Console shows some output, and that no red warning appears on the right nor left of it. If you get something red, something went wrong.
deploying of the application

Test it!

monitoring of the application

Where to go from here?

In the next step you will see how FORTE runs in another machine.

Step 3 - Deploy remotely

If you want to go back to the original Blinking application without buttons, here's a link

Step 1 - Use 4DIAC-IDE locally

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

Start Here page

Go to top