CoDeSys 2.3 allows to build visualizations controlling the PLC. While writing the main program one can direct bind variables with command coming from the visualization. It makes the work easier; creating the future control is intuitive.
The visualizations built with CoDeSys can be made available through the webserver of the PLC controller. To access it enter in the address bar of your browser the IP of your controller in the local network. It is also possible to use the CoDeSys HMI available in shareware version. It enforces an application closing after a few minutes of working but it does not limit the functionality. For house needs the program is run a few minutes at a time anyway…
(before you start to program take a look at the user’s guide available in the web, which describes all the visualization functions. At the beginning it is absolutely enough).
To create a simple visualization choose the Visulaiozation tab, right-click and choose ‘Add Object’. After the name is entered (for example “PLC_VISU”) and the OK button is pressed the new object is created.
Adding emelents to the visualization is as simple as drawing object in a graphical editor. The list o available shapes is long: rectangles, ellipses, triangles, lines, arches, pictures, buttons, embedded visus, tables, graphs, bars etc. You can read about the details in the User’s Guide.
For example – creating a button, which controls lights could look as follows:
1. Adding an rectangle element
2. Configuring the parameters (double click on the object)
In the programming part of PLC_PRG, in variable definition:
LIGHT1 : Fb_LatchingRelay; (*from Building_common.lib*) VIS_LIGHT1 : BOOL;
In the program itself:
LIGHT1(xSwitch:=IN1 OR VIS_LIGHT1); OUT1:=LIGHT_1.xActuator;
IN1 – Input connected to the wall-moutned swicth
OUT1 – Output connected to the light’s circuit
Pressing the button “1” will make the variable VIS_LIGHT1 change briefly from FALSE to TRUE, what will be understood as an impulse to change the status of the function block LIGHT1 and will turn the output OUT1 on or off. When OUT1 is on, the value of the LIGHT1.xActuator is TRUE, what causes the button to change the color.