Operands at the Condition of en ECTransition

2 views
Skip to first unread message

christian

unread,
Mar 20, 2009, 4:42:39 AM3/20/09
to FBDK
Is there anything said inside the standard about the possible operands
at the Condition of an ECTransition?

If we want to perform e.g. an AND operation between 2 data inputs or
internal variables the following three options are available:

A and B - is translated to &
A & B - logical or bitwise AND depending at the datatype
A && B - logical AND and if A is false B is not evaluated

Which should be used?

Kind regards,
Christian

Jim Christensen

unread,
Mar 20, 2009, 3:35:13 PM3/20/09
to FBDK
Annex B.2.1 of IEC 61499-1 states that the syntax shall be

guard_condition ::= expression
<as defined in IEC 61131-3>
<Shall evaluate to a BOOL value>

So you have to go to the syntax in Annex B.4.1 of IEC 61131-3 to see
exactly what is allowed.

The FBDK just does a mapping from IEC 61131-3 operators to Java
operators and lets the Java compiler sort things out:

AND ==> &
OR ==> |
NOT ==> !
TRUE ==> true
= ==> ==
<> ==> !=

Variables, e.g., IN1, are mapped to their contained values, e.g.,
IN1.value.

Best regards,
Jim C
Reply all
Reply to author
Forward
0 new messages