Sunteți pe pagina 1din 3

Object Oriented Programming (Extended)

General information
Order number: 000016
Version: 1.0.0.0
Short description
This example demonstrates how object
orientation is used to realize a building which
has different rooms with different
functionalities. The included visualization
illustrates the implementation.

Supplier information
3S-Smart Software Solutions GmbH
Memminger Strae 151
87439 Kempten
Germany
Support:
Phone: +49 831 54031 -66
support@codesys.com

Requirements and restrictions


Programming system

CODESYS Development System


Version 3.5.0.0 or higher

Target system

CODESYS Control Version 3.5.0.0

Supported Platforms/ Devices

All

Additional requirements

Restrictions

3S-Smart Software Solutions GmbH


Product Data Sheet: Object Oriented Programming (Extended)

Page 1 of 3

Price
This example is for free.

Product description
This example demonstrates an object oriented programming approach. Therefore a building
with different rooms and functionalities was implemented. At daytime, all the light bulbs are
switched off and the air condition is set to 21. At nighttime, all light bulbs are switched on and
the temperature is set to 15. With the manual mode, the light can be switched on and off
separately. The cellar room has one light but no service is provided. The cheap room also
has one light, but additionally a service which changes the light bulb when the end of its
lifetime is reached is provided. The better room has a duo light with the doubled lifetime of
a normal room and the climate better room has additionally an air conditioner, where the
filter has to be changed after a certain amount of temperature changes.

Technical description
Main: Creates all the four rooms and calls the necessary functions, depending on the mode
(daytime, nighttime, manual).
clsRoom: Base function block for a room. The necessary functions which are needed for
every room are provided here. All four rooms inherit from this function block.
clsCellarRoom: Extends the base room and has an instance of the clsLight function
block to implement the light bulb.
clsCheapRoom: Extends the base room and includes an instance of the clsLight1min,
which implements a light bulb with a lifetime of one minute. It also includes the service
function.
clsBetterRoom: Extends the base room and includes an instance of clsDuoLight1min,
which has the doubled lifetime and it also includes the service function.
clsClimateBetterRoom: Extends the clsBetterRoom and additionally adds an air
condition.
FB_AirCondition: The temperature for the day- and nighttime is regulated with the help of
this function block.
clsLight: Base function block, which recognizes, when the light is switched on or off.
clsLight1min: Extends the clsLight and implements the IService interface. With this
function the lifetime of the light bulb is monitored.
3S-Smart Software Solutions GmbH
Product Data Sheet: Object Oriented Programming (Extended)

Page 2 of 3

clsDuoLight1min: Extends the clsLight1min with a second timer to double its lifetime.
FB_LifeTimer: Counts down the lifetime of a switched on light bulb.
Visualization: The main visualization includes different rooms. Each consists of a light
bulb, a service message, a service display that shows whether a service is needed and two
buttons, one to toggle the light on or off and one to reset the service. The topmost room
additionally shows the temperature. With the OpMode slider the mode can be set to daytime
with light, night time without light or manual to switch the lights separately on and off.

Screenshots

3S-Smart Software Solutions GmbH


Product Data Sheet: Object Oriented Programming (Extended)

Page 3 of 3

S-ar putea să vă placă și