Commands and functions
P.
194 of 349
After
Definition
●
Function
after
(
Signal
,
Time
)
Arguments
●
Argument
Signal
is of data type b01
●
Argument
Time
is of data type u64
Effect
●
The function starts a timer at the transition of the variable
signal
from OFF to ON and sets
the return value of the function for one after to ON, if the time delay is reached.
●
During the dead time interval the function is blocked, i.e. new incoming pulses are ignored.
Data type result (Return)
●
Data type b01
Note:
●
If the
after
(using an
if
statement and a
write
) writes a telegram, there can arise an
additional delay time of a few ms - depending on the bus load and the bus speed.
Example: On- and Off-delay
The variable light sensors (data type b01) is to follow the variable LightButton (data type b01)
after 1000 ms.
Implementation in the user program:
LightActuator = after(LightButton,1000u64)
Example: On-delay
If LightButton (data type b01) is
ON
, the variable LightActuator (data type b01) is to be set to
ON
after 1300 ms.
Implementation in the user program:
if (after(LightButton,1300u64)==1b01) then LightActuator=1b01 endif
Alternative 1
if after(LightButton==1b01,1300u64) then LightActuator=1b01 endif
Alternative 2
if after(LightButton,1300u64) then LightActuator=1b01 endif
Note that "LightActuator" is only set to 1b01 (ON), but not re-set to 0b01 (OFF). See also the
following example.
Example: Off-delay
If the LightButton is (data type b01) is
OFF
, the variable LightActuator is to be set after 4000
ms.
Then, the implementation in the user program is :
if (after(LightButton==OFF,4000u64)) then LightActuator=0b01 endif
HandbuchEibPC_USA-30.odt, 2017-05-11
Enertex
®
Bayern GmbH - Erlachstraße 13 - 91301 Forchheim - [email protected]