CODESYS V3, Installation and Start: User Documentation
CODESYS V3, Installation and Start: User Documentation
User Documentation
Version: 15.0
Template: templ_tecdoc_en_V1.0.docx
File name: CODESYS Installation and Start.docx
1 Welcome
2 System Requirements
Recommended:
Operating system: Windows XP/7/8 (32/64 Bit)
RAM: 4 GB
Hard disk: 2 GB
CPU: Dualcore
3 Installation
Perform the Setup_CODESYSV<Version>.exe to start the installation assistant which will guide you.
In order to minimize the risk of data security breaches we recommend the following organizational and technical
measurements for the system running your applications:
Avoid as far as possible to expose PLCs and PLC networks to public networks and internet. For protection use
additional security layers like a VPN for remote access and install firewall mechanisms. Restrict access on
authorized persons, if available change default passwords at start-up and modify them frequently. If you
nevertheless want to publish your Web Visualization, then it is highly recommended to give it at least a simple
password protection to prevent that anybody can access the functionality of your PLC over internet (for an
example see the project "SimpleWebvisuLogin.project" provided with the standard setup of the programming
system).
Use the latest versions of Gateway Server and Web Server. For web servers and gateway servers up to V3.4
SP4 Patch 2 a security vulnerability (US ICS CERT: ICS-ALERT-12-097-02) was detected. This is fixed as from
V3.5.
5 Start
Start CODESYS from the Start menu: Per default the path is Programs – 3S CODESYS – CODESYS –
CODESYS V<version>.
Alternatively use the CODESYS icon which is available on the desktop after installation.
6 Help
Online help is provided via the ‘Help’ menu. There you find the commands to open a Contents view of the help,
the Index view for searching by keywords or the Search view for full-text search.
See in the following a description of how to create a simple project containing a PLC program, further how to
load this program via a Gateway Server to the PLC (target device) and to get it run and monitored. The PLC
runtime system used for this example project per default is provided with the CODESYS setup.
The sample program will be written in Structured Text language and consist of a program PLC_PRG and a
function block FB1. PLC_PRG will contain a counter variable ivar and call function block FB1; FB1 will get input
"in" from PLC_PRG, will add "2" on this input and will write the result to an output out; out will be read by
PLC_PRG.
(Regard that the following descriptions refer on the default configuration of the user interface provided with the
currently installed version of the programming system.)
Alternatively you can start via the CODESYS Icon that will be available on the desktop after
installation.
The programming system will be automatically started with a predefined profile. So currently you do not to have
select a profile.
In the New Project dialog select Standard project in the ‘Templates’ field and enter a Name and a Location
path for the project file. Press OK to confirm.
Choose device CODESYS Control Win V3 and programming language Structured Text for PLC_PRG. Press
OK to open the new project.
The project name now will appear in the title bar of the CODESYS user interface and as a symbolic root node in
the POUs and the Devices view windows.
In the declaration part of the editor put the cursor behind VAR and press the Return-key. A new empty line will
be displayed where you enter the declaration of variables ivar and erg which are of type INTEGER and fbinst of
type FB1:
PROGRAM PLC_PRG
VAR
ivar: INT;
fbinst: FB1;
erg: INT;
END_VAR
Instead of this you could directly type a line in the implementation part of the editor (body) and use the
Autodeclare function, see (4).
The variables name and scope as well as the current POU (Object) will be filled in automatically. Enter the
desired type and initialization value according to the declaration described in (3). Regard that comments if you
define them here in the autodeclaration dialog, will not be inserted indicated by”//” like shown above, but as an
xml-description in the declaration part and will later be usable for documentation purposes.
Confirm the dialog with OK. This will enter the declaration of erg in the declaration part of the POU with the
comments ahead:
7.3 Define the Resource objects for running and controlling the program on the PLC
(6) Start Gateway Server and PLC
Start Gateway Server:
The Gateway Server is started automatically at system start as a service. Make sure that there is an icon in
the system tray, indicating that the gateway is running. If the icon is looking like , the gateway currently is
stopped.
(This icon is part of the GatewaySysTray program which is available for controlling and monitoring the Gateway
service. It provides a menu with a start and a stop command, thus allowing the user to stop or restart the service
manually. The menu also includes the command Exit Gateway Control, which just terminates the
GatewaySysTray program, not however the Gateway service. The GatewaySysTray program is started
automatically when Windows is started, however it also can be started manually via the Programs menu.)
Start PLC:
The PLC (CODESYS Control Win V3) is available as a service at system start. It is represented by an icon in
the system tray: for status 'stopped', for status 'running'. For security reasons (Protection against
unauthorized access) as from V3.5 SP2 the PLC service will not any longer be started automatically at the
system start. It must be started manually by command 'Start PLC' from the menu which you open by a mouse-
click on the icon.
CAUTION: This icon is part of the CODESYSControlSysTray program which is available for
controlling and monitoring the CODESYS Control Win V3 service. It provides a menu
with a start and a stop command, thus allowing the user to stop or restart the service
manually. The menu also includes the command Exit PLC Control, which just
terminates the CODESYSControlSysTray program, not however the ControlService.
The CODESYSControlSysTray program is started automatically when Windows is
started, however it also can be started manually via the Programs menu.
Enter a symbolic Name for the Gateway, define the Driver type "TCP/IP" and enter IP-address "localhost"
(Perform a double-click on the column field to open an edit frame). Leave the setting for the Port. Confirm with
OK.
The gateway will be entered in the field on the left part of the Communication Settings dialog and the name of
the Gateway will be added to the selection list under 'Select the network path to the controller'. When the
gateway is properly running, a green bullet is displayed before the entry, otherwise a red one:
Now define a channel to the target device which should be connected via the set gateway:
Use button Scan network to search for available devices in your local network.
You should at least find the PLC installed with the CODESYS setup: It will be displayed indented below the
gateway: instead of "WST06 [003C]" shown in the picture below you should find the name and address of your
computer.
Now select the PLC (device) entry and use button Set active path.
This will set this communication channel as the active one, which means that all actions concerning
communication will exactly refer to this channel. Regard this later when you may have set up several
communication channels in your project.
The settings will be applied automatically, you can leave the Communication dialog now.
Do the same for the further variables. The watch list shown in the next picture just contains expressions of
PLC_PRG, but of course you might create a set of any variables of your project. Regard that for instance
variables, e.g. for the FB1-instances, it is sufficient to enter the expression "
PLCWinNT.Application.PLC_PRG.fbinst". The particular variables will be entered automatically and the
corresponding lines can be opened via the plus-symbol: The current value of a variable is displayed in the
'Value' column:
If not yet done, now perform command 'Start Application' from the Online menu. The application will be started
on the PLC and the current value will be displayed in column Value:
To disconnect from the PLC perform command 'Logout' from the Online menu.
Now you can step further by using <F8>, which represents command Step Into from the Debug menu and
therefore will step also into the function block instance. To skip the steps of the function block use <F10> which
equals the command Step Over. Each variable value currently read from the PLC will be displayed.
You might also have a look at the Breakpoints dialog to be opened via command Breakpoints from the View
menu. Here, the breakpoints currently set can be viewed and edited and new breakpoints might be entered.
Regard also that the breakpoint positions will be remembered when you log out. They will be indicated by faded
red bullets.
Now you have built and run your first project with CODESYS V3. For further use of the programming
system please see the online help.
We wish you successful programming. We appreciate each feedback.
Deinstallation
Normally you can install new versions of CODESYS without having to de-install the current version from your
system. In case you want to de-install also execute Setup_CODESYSV<version>.exe. In the start dialog of the
installation wizard activate option ‘Remove all installed features’ and use button ‘Next’. Alternatively use the
common deinstallation procedure via the System Control dialogs of your system.
Modify
If you want to modify the installation parameters, e.g. the selection of installed components, execute
Setup_CODESYSV<version>.exe and choose option ‘Modify’ in the installation wizard start dialog. Use button
‘Next’ to run through the installation dialogs and modify the settings, having made during the previous
installation, as desired.
Repair
If for any reasons the installation is not proper, you might try to “repair” it. For this purpose execute
Setup_CODESYSV<version>.exe and choose option ‘Repair’ in the installation wizard start dialog. The
installation will be done once more as configured during the previous run.
Change History
3.0 Release after adaptations in chap.6.3 (default device) and 6.4 26.03.2007
(monitoring possibilities)