>/etc/init.d/runtime stop
Wago PFC200
Wago PFC200 series is a PLC designed to work in small and medium enterprises for small-scale automation and runs on an ARM cortex A8, 600 Mhz controller with real-time Linux 3.6 (RT preemption patch).
Currently supported Wago modules
-
WagoMaster: Wago core module PFC 200
-
Wago1405_6: 16 digital inputs, Wago module 750-1405 and 750-1406
-
Wago1504_5: 16 digital outputs, Wago module 750-1504 (positive switching) and 750-1505 (negative switching)
-
Wago1506: 8 digital IOs, Wago module 750-1506
-
Wago459: 4 Analog inputs, Wago module 750-459
-
Wago636: DC-Drive-Controller 24V 5A, Wago module 750-636
Setup your hardware
Put the several modules together by the rails on each Wago module and as last module the end module 750-600 otherwise the KBus cannot be initialized correctly. The core module provides the power supply for all modules connect all 0V and 24V of your core module with your 24V power supply. In case you use an analog input module 750-459 consider that each analog input has a corresponding 0V connection that also has to be connected. When you use the Wago core module for the first time, it will startup with CODESYS. According to the Wago GitHub How To:
Important
|
"The ADI/DAL could only be used by one master, it could be the CODESYS-Runtime or your own application, but not both". This means you have to stop the CODESYS-Runtime when you want to use 4diac FORTE. Login to your PFC200 to stop the CODESYS-Runtime with one of the following methods: For temporary stop: for permanent stop: #//Delete symbolic link >rm /etc/rc.d/S98_runtime #Recover symbolic link >ln -s /etc/init.d/runtime /etc/rc.d/S98_runtime |
A general explanation about how the process image of Wago modules is created, can be found within the PDF ADI/DAL PFC Firmware provided by Wago. This document is useful especially when integrating new Wago modules or other modules that use the KBus. This document states the following important information:
Important
|
"Every I/O-Module offers some fixed sized process data values and configuration information. Process data size varies from 2 bit up to 24 bytes. Process data values also have a direction, named “input process data” or “output process data”. Also IO-Modules are classified as “digital” or “complex”. Configuration of IO-Modules is stored inside “registers”, accessible via “register-communication” or “parameter-channel”. Every WAGO Output-Module monitors elapsed time since the last kbus-cycle. If the elapsed time exceeds 50ms, Output-Modules shut down their outputs to a failsafe state." "With adi→OpenDevice the device driver identifies all connected IO-Modules and constructs two process images: Process-Image-of-Inputs (PII) and Process-Image-of-Outputs (PIO)" |
Consider that each Wago module has its own manual, which describes the bits of its process image in detail.
Compile 4diac for PFC200
To compile 4diac FORTE for Wago PFC200 best use 4diac FORTE’s build environment. Since Wago PFC200 has dependencies you have to add a new recipe containing information for these dependencies. Under fordiac-fbe/dependencies/recipes/ create a folder called wago and add the following files and file contents:
-
the file build.cmake with the following content:
project(wago C) CMAKE_MINIMUM_REQUIRED(VERSION 3.5) install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/. DESTINATION include) install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/OsLinux/. DESTINATION include) install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/lib/. DESTINATION lib)
-
the file wago.7z with your dependencies, which you might find in the sdk-builder container created according to pfc-firmware-sdk-G2:
wago/include/ldkc_kbus_information.h wago/include/ldkc_kbus_register_communication.h wago/include/dal/adi_application_interface.h wago/include/dal/canopen_types.h wago/include/dal/dal_caps.h wago/include/dal/dal_limits.h wago/include/dal/dal_types.h wago/include/dal/libcanopen.h wago/include/dal/sdi_stack_interface.h wago/include/dal/events/events.h wago/include/OsLinux/OsCommon.h wago/lib/libdal.a wago/lib/libdbus-1.so wago/lib/libdbus-1.so.3 wago/lib/libdbus-1.so.3.19.9 wago/lib/libdbus-glib-1.so wago/lib/libdbus-glib-1.so.2 wago/lib/libdbus-glib-1.so.2.3.2 wago/lib/libdbuskbuscommon.so wago/lib/libdbuskbuscommon.so.0 wago/lib/libdbuskbuscommon.so.0.0.0 wago/lib/libffi.so wago/lib/libffi.so.6 wago/lib/libffi.so.6.0.4 wago/lib/libgio-2.0.so wago/lib/libgio-2.0.so.0 wago/lib/libgio-2.0.so.0.5701.0 wago/lib/libglib-2.0.so wago/lib/libglib-2.0.so.0 wago/lib/libglib-2.0.so.0.5701.0 wago/lib/libgmodule-2.0.so wago/lib/libgmodule-2.0.so.0 wago/lib/libgmodule-2.0.so.0.5701.0 wago/lib/libgobject-2.0.so wago/lib/libgobject-2.0.so.0 wago/lib/libgobject-2.0.so.0.5701.0 wago/lib/liblibloader.so wago/lib/liblibloader.so.0 wago/lib/liblibloader.so.0.0.0 wago/lib/liboslinux.so wago/lib/liboslinux.so.0 wago/lib/liboslinux.so.0.0.0 wago/lib/libpcre.so wago/lib/libpcre.so.1 wago/lib/libpcre.so.1.2.8 wago/lib/libtypelabel.so wago/lib/libwago_dbus.so wago/lib/libz.so wago/lib/libz.so.1 wago/lib/libz.so.1.2.11
-
the file package.txt with the following content. You should determine the ssh256 for your wago.7z file and add it instead of the example shown here:
wago.7z -H sha256:75bd3904f6b68ba937dbf1d59de44fd07ded7892c9c8c4e8bf86a439ab180613 -X build.cmake
After this preparation follow the instructions of 4diac FORTE’s build environment to install and setup a configuration. Your configuration file for Wago PFC200 for this build environment could be like the following:
ARCH=arm-linux-gnueabihf DEPS=tinyxml DEPS=wago COM=ETH,FBDK,LOCAL,HTTP MODULE=CONVERT,IEC61131,UTILS,UTILS_ADDON,CUSTOM_FBS MODULE=WagoKbus // address sanitizer doesn't work with static linking TOOLCHAIN_EXTRA_C_FLAGS=-fno-sanitize=address -fno-lto TOOLCHAIN_EXTRA_LINKER_FLAGS=-fno-sanitize=address -fno-lto FORTE_IO=ON // no local additions #FORTE_EXTERNAL_MODULES_DIRECTORY=/nonexistant
After successful compilation the runtime can be found within the folder build/yourConfigurationFileName/output/bin of 4diac FORTE’s build environment. Copy the whole content to your Wago PFC200 core module by e.g. WinSCP, possibly within a folder /home/forte. You should set execution rights for for all copied files to run it. Login to your Wago PFC200 core module by e.g. Putty, navigate to the folder where you put your executable and run it by ./forte. Now you can deploy the desired IEC 61499 resources on your Wago PFC200.
Configure your hardware in 4diac
Within 4diac IDE create a new IEC 61499 device with one IEC 61499 resource. Maybe call it IO_CONFIG_RES. This IO_CONFIG_RES contains your hardware setup in terms of function blocks. In case you have one Wago PFC200 core module, two DI, two DO, and one AIO module, it could be like in the following image.
Within your IEC 61499 application you might have a function block like shown within the following image. Take it’s IEC 61499 application name and it’s instance name separated by a dot and add it as input for the desired input of the corresponding IO_CONFIG function block.
When all I/Os are wired and named within your IO_CONFIG function block network correspondingly, your IEC 61499 application is ready to be deployed and to access the hardware.
Where to go from here?
You can see the supported protocols:
You can see the examples:
If you want to go back to the Where to Start page, we leave you here a fast access
Or Go to top