Step 6 - Advanced Features
This page is part of a guide that gives a walk-through over the major 4diac IDE features.
- 4diac IDE Overview
- Use 4diac Locally (Blinking tutorial)
- Distribute 4diac Applications
- Deploy Applications Remotely
- Create Your own Function Block Types
- Other Basic Features
- Advanced Features (YOU ARE HERE!)
- Adapter Usage
- Subapplications (implemented since version 1.9)
Adapters group interface elements into reusable interface descriptions. They reduce the number of interface elements (event and data inputs and outputs) and by that the number of connections that have to be created between interacting function blocks. In 4diac IDE, adapters are listed in the type library and represented by this symbol: .
Create a new Adapter Type
These interface descriptions can be added to the interface of any Function Block Type. Currently, adapters can not contain other adapters. There are two types of adapters, which are mirrored interfaces:
- socket: added as input of a function block and represented by this symbol within the function block's interface.
- plug: added as output of a function block and represented by this symbol within the function block's interface.
When a new adapter is created, it should be a socket. The mirrored plug is derived automatically by 4diac IDE and is NOT created by the user. An adapter (socket) is created by File → New → New Type and selecting as Type. All adapter names should start with an A (naming convention).
Use Your new Adapter Type
After creating your desired adapter type (socket), it can be added to a function block's interface by drag and drop from the Palette, as illustrated in the following figure.
The function blocks used within the following application snippet are part of the TrafficLight example system. Two different adapter types have been used, ATimeOut in PedLightCtl_AT and E_TimeOut and ATrafficLight in PedLightCtl_AT.
The PedLightCtl_AT is a basic function block. Within basic function blocks adapters are accessed by FB_INTERFACE_NAME.ADAPTER_INTERFACE_NAME. The elements of the ATimeOut adapter are therefore accessed by timeOut.START, timeOut.STOP and timeOut.TimeOut.
The E_TimeOut is a composite function block. Within the network of a composite function block, any adapter added to its interface is represented by an adapter block which looks like a Function Block. The interface elements of this adapter block are connected like a function block.
Further examples for the usage of adapters can be found within the FestoMPS example system.
Where to go from here?
If you want to see some examples, behind the following link is an index of the available examples in the documentation:
If you have a specific platform that has input and outputs and is supported by 4diac FORTE, for example a Raspberry Pi or a PLC, and you want to use them, go to following page:
If you want to use a specific communication protocol supported by 4diac FORTE, for example MQTT, OPC UA, Modbus and so on, go this page:
If you want to go back to see again the basic features, here's a link:
If you want to go back to the Start Here page, we leave you here a fast access: