Easy Data Exchange Via Festo Easyip: Festo Ag & Co - KG
Easy Data Exchange Via Festo Easyip: Festo Ag & Co - KG
KG
Contents
Requirements..........................................................................................................................................3
Overview................................................................................................................................................3
EasyIP.................................................................................................................................................3
Requirements
This description requires any Linux based Festo device (i. e. CPX-CEC, SBO..-Q) with CoDeSys
runtime system integrated (addressing mode = word aligned; see also PLCs with byte addressing
mode).
Overview
This documentation describes how to easily exchange data between a PC and a Festo device. It gives
detailed information on starting an EasyIP server in the CoDeSys runtime and how to connect to this
server with your PC running an EasyIP client program. To establish such a connection the program
"IPC TCP/IP Application" from Festo and the Festo_EasyIP.lib library are used.
EasyIP
EasyIP is a proprietary Ethernet protocol from Festo.
EasyIP is UDP based and uses port 995.
It allows a simple connection of different Festo controllers to form a network.
Switch to the "Exceptions" tab and click the "Add Port..." button.
Right-click in the upper left quarter of the window and select the option "Additional Library... ".
Choose the Festo_EasyIP.lib library and add it to your project by pressing the "open" button.
Right click to the white area in the left part of the window (while "Task configuration" is marked) and
then select the "Append Task" option.
Make sure that the choice box "cyclic" is selected in the "Type" field.
Now you have to append the "Easy_Server()" program to this task. Right click to white area again and
then select the option "Append Program Call".
In the area "Program Call:" you have to add the name of the server program of the Festo_EasyIP.lib
library: Easy_Server();
Because the Easy_Server() program is in the library it doesn't appear in the dialog box that opens
when clicking the "…" button (as all other programs do you created of your own).
When downloading the project to your Festo device and starting it the EasyIP server is reachable by
any EasyIP client.
Default IP
Device
address
CPX-
192.168.2.50
CEC
SBO..-Q-
192.168.2.10
…
Then open the "EasyIPDemo" window by clicking the "EasyIP" button. This client application
immediately connects to the server.
Search for the flagword you want to set (e.g. FW2000) and double-click the "Value" area to edit the
value. The fields left to the "Value" area represent the bits of this flagword.
In your CoDeSys server application you can directly refer to any of these flagwords.: e.g. with the
variable
PROGRAM PLC_PRG
VAR
udiAlive : UDINT := 0; (* counter to see if program is running *)
wValueFW AT %MW800 : WORD; (* "connection" to flagword 800 *)
udiCounter1 : UDINT := 0;
udiCounter2 : UDINT := 0;
END_VAR
2:
udiCounter2 := udiCounter2 + 1;
3: (* reset udiCounter1 *)
udiCounter1 := 0;
4: (* reset udiCounter2 *)
udiCounter2 := 0;
END_CASE;
ELSE
(* EasyIP Server is not running *)
;
END_IF;
Now you can download this small project to your PLC and start it. Of course the Easy_Server()
program must be added to this project to as stated in section "The CoDeSys project". Start the "Festo
IPC TCP/IP Application" and make all changes as described in section "Festo IPC TCP/IP
Application". When editing the FW800 flagword according to the list above "According to this value
…According to this value According to this value "According to this value According to this value
According to this value According to this value you can see the counters udiCounter1 and udiCounter2
changing their values in CoDeSys.
ADR(%MW2) =
CPX-CEC OFF
ADR(%MB4)
SBO...-Q- ADR(%MW2) =
OFF
… ADR(%MB4)
CECX-X- ADR(%MW2) =
ON
… ADR(%MB2)
Some easy example code to test the alignment during the runtime is
PROGRAM PLC_PRG
VAR
xByteAligned : BOOL; (* TRUE if "Byte adressing mode" is activated *)
END_VAR
Basically the Festo_EasyIP.lib up to version 1.4.2 has been developed for "word addressing mode"
devices, but it works also on "byte addressing mode" devices.
The only differences are the used offsets.
may be interpreted according to the addressing mode (assuming that the remote station has word
addressing mode):
SBO...-Q, CPX-CEC:
Receive 4 Bytes (= 2 words) from remote's offset %MW600 and write them starting with local offset
%MW800 (=%MB1600). As a result remote's %MW600 is on local %MW800 and remote's
%MW601 is at local %MW801. Status is available at offset %MW1000 (=%MB2000).
CECX-X-…:
Receive 4 Bytes (= 2 words) from remote's offset %MW600 and write them starting with local offset
%MW1600 (=%MB1600). As a result remote's %MW600 is on local %MW1600 and remote's
%MW601 is at local %MW1602. Status is available at offset %MW2000 (=%MB2000).