Commands and functions
P.
172 of 349
Comparison operators
Hysteresis-comparison
To create Comparison-Links the following instructions are provided
Definition
●
A
>
B
greater
●
A
<
B
less
●
A
==
B equal
●
A
>=
B greater than or equal
●
A
=<
B less than or equal
●
A
!=
B
not equal
Arguments
●
2 arguments (
A, B
) are of the same data type.
●
Data types: u
XX
,s
XX
,f
XX
, with
XX
arbitrary bit lengths defined on page 154.
Effect
●
The variable
A
is compared with the variables
B
– depending on the operator:
The result of the operation
>
is 1b01, if the variable A is greater than variable B.
The result of the operation
<
is 1b01, if the variable A is less than variable B.
The result of the operation
==
is 1b01, if the variable A has the same value as the variable
B.
The result of the operation
>=
is 1b01, if the variable A is greater than or equal to the
variable B.
The result of the operation
=<
is 1b01, if the variable A is less than or equal to the variable
B.
The result of the operation
!=
is 1b01, if the variable A does not have the same value as
the variable B.
In all other cases the result is 0b01.
Data type result (Return)
●
Data type b01
Definition
●
Function
hysteresis
(
Var
,
LowerLimit
,
UpperLimit
)
Arguments
●
3 arguments (
Var
,
LowerLimit
,
UpperLimit
) of the same data type.
●
Data types: u
XX
,s
XX
,f
XX
, with
XX
arbitrary bit lengths, defined on page 154.
Effect
●
The argument
Var
is compared with the
LowerLimit
and
UpperLimit
of a hysteresis
function.
●
If the last comparison led to a result 0b01 and (
Var
≥
UpperLimit
) is true, the function
assumes the value 1b01.
●
If the last comparison led to a result 1b01 and (
Var
≥
LowerLimit
) is true, the function
assumes the value 0b01.
Data type Result (Return)
●
Data type b01
Example: Temperature-controlled shading
If a temperature actuator (Group address 1/3/4, data type f16) reports a temperature warmer
than 25°C, the shading on the group address 4/5/77 should go to ON.
Only if the temperature falls below 23°C again, the shading is to boot again.
Implementation in the user program:
if hysteresis('1/3/4'f16,23f16,25f16) then write('4/5/77'b01,ON) \\
else write('4/5/77'b01,OFF) endif
HandbuchEibPC_USA-30.odt, 2017-05-11
Enertex
®
Bayern GmbH - Erlachstraße 13 - 91301 Forchheim - [email protected]