Events and the "Events" page
In this chapter you will work on changing the boiler temperature. Obviously in a real application the boiler temperature is detected by some sensor. In our simple example we will use script value emulation of the temperature instead. The emulation will be performed so that the temperature will be increased by a constant value every second.
The simplest way to achieve that some script is executed repeatedly every second is to use the PmTimer
(Timer) PROMOTIC object :
In the application editor, in the "Boiler1" object create a new basic object of the PmTimer
type. Name it "Emul"
. On the Timer
page of this object do the following setup:
By this configuration you have achieved that the object will tick every second, i.e. the onTick
event will be triggered every second.
page is divided into 3 parts:
- In the upper left part
of the page you can see a list of all (three) events of the PmTimer
.. the event says that the object has been created. Every PROMOTIC object holds this event and for each object it fires only once after starting the application
.. the event says that the object has been removed. Every PROMOTIC object holds this event and for each object it fires only once during stopping the application
.. the event says that the object has "ticked"
. Only the PmTimer
object holds this event and in our configuration this event fires every second.
- In the lower left part
of the page there is a list of parameters of the selected event. Every event of the PROMOTIC object holds two parameters pMe
. Their meanings will be explained later on.
- In the right part of the page there is an area where you can write script that refers to the selected event.