<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.cpr-robots.com/index.php?action=history&amp;feed=atom&amp;title=Conditions</id>
	<title>Conditions - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.cpr-robots.com/index.php?action=history&amp;feed=atom&amp;title=Conditions"/>
	<link rel="alternate" type="text/html" href="https://wiki.cpr-robots.com/index.php?title=Conditions&amp;action=history"/>
	<updated>2026-06-07T22:55:38Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.44.0</generator>
	<entry>
		<id>https://wiki.cpr-robots.com/index.php?title=Conditions&amp;diff=1030&amp;oldid=prev</id>
		<title>OLT: Created page with &quot;Conditions can be used in if-then-else instructions, loops, and as termination conditions in motion instructions. The conditions can be combinations of digital inputs, global signals, boolean operations and comparisons. Capitalization and spaces between symbols are ignored.  == Digital Inputs &amp; Global Signals ==  In the simplest case, for example, a condition can check whether a signal is present at digital input 21: :DIn21  More complex conditions can be constructed usi...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.cpr-robots.com/index.php?title=Conditions&amp;diff=1030&amp;oldid=prev"/>
		<updated>2026-05-21T07:17:17Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;Conditions can be used in if-then-else instructions, loops, and as termination conditions in motion instructions. The conditions can be combinations of digital inputs, global signals, boolean operations and comparisons. Capitalization and spaces between symbols are ignored.  == Digital Inputs &amp;amp; Global Signals ==  In the simplest case, for example, a condition can check whether a signal is present at digital input 21: :DIn21  More complex conditions can be constructed usi...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Conditions can be used in if-then-else instructions, loops, and as termination conditions in motion&lt;br /&gt;
instructions. The conditions can be combinations of digital inputs, global signals, boolean operations&lt;br /&gt;
and comparisons. Capitalization and spaces between symbols are ignored.&lt;br /&gt;
&lt;br /&gt;
== Digital Inputs &amp;amp; Global Signals ==&lt;br /&gt;
&lt;br /&gt;
In the simplest case, for example, a condition can check whether a signal is present at digital input&lt;br /&gt;
21:&lt;br /&gt;
:DIn21&lt;br /&gt;
&lt;br /&gt;
More complex conditions can be constructed using the AND and OR keywords and parentheses. The&lt;br /&gt;
following condition is met if a signal is present at either input 21 or inputs 22 and 23:&lt;br /&gt;
:DIn21 OR (DIn22 AND DIn23)&lt;br /&gt;
&lt;br /&gt;
To negate an expression put an exclamation mark (!) in front of it. This is also possible before paren-&lt;br /&gt;
thesized expressions. The following condition is met if either there is no signal at input 21 or if there&lt;br /&gt;
is no signal at inputs 22 and 23 together:&lt;br /&gt;
:!DIn21 OR !(DIn22 AND DIn23)&lt;br /&gt;
&lt;br /&gt;
Likewise, the state of [[Global_Signals | global signals]] can be queried. Global signals are internal&lt;br /&gt;
flags which can also be used for communication between robot and logic program and external ap-&lt;br /&gt;
plications or PLC:&lt;br /&gt;
:GSig1 AND !DIn21&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt; The states of the &amp;#039;&amp;#039;&amp;#039;digital outputs cannot be queried&amp;#039;&amp;#039;&amp;#039; in conditions. If necessary, a global&lt;br /&gt;
signal representing the output can be set after setting the output. &amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Variables ==&lt;br /&gt;
&lt;br /&gt;
In addition, the values of number and position variables can also be checked. Number variables&lt;br /&gt;
represent a single number while position variables contain several number components. For position&lt;br /&gt;
variables, it is therefore always necessary to specify which component is to be compared.&lt;br /&gt;
&lt;br /&gt;
:mynumbervariable = 5&lt;br /&gt;
:mynumbervariable &amp;lt; 10&lt;br /&gt;
:mypositionvariable &amp;gt;= 42&lt;br /&gt;
:mypositionvariable.X = 123&lt;br /&gt;
:mypositionsvariable.B &amp;gt;= 90&lt;br /&gt;
:mypositionvariable.A3 &amp;gt; 300&lt;br /&gt;
:mypositionvariable.E1 &amp;lt; 500&lt;br /&gt;
&lt;br /&gt;
Numeric values can also be compared to each other:&lt;br /&gt;
:mypositionvariable.X &amp;gt; mynumbervariable&lt;br /&gt;
:mypositionvariable.A1 &amp;lt;= otherpositionvariable.A1&lt;br /&gt;
&lt;br /&gt;
The following position components can be used to compare positions:&lt;br /&gt;
* cartesian&lt;br /&gt;
** X, Y, Z: position in millimeters&lt;br /&gt;
** A, B, C: orientation in degrees&lt;br /&gt;
* axis positions&lt;br /&gt;
** A1 to A6: robot axes in degrees or millimeters&lt;br /&gt;
** E1 to E3: additional axes in degrees, millimeters or self-defined unit&lt;br /&gt;
&lt;br /&gt;
== Syntax Rules ==&lt;br /&gt;
In summary, the condition syntax can be described by the following EBNF definition:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Expression&lt;br /&gt;
| &amp;lt;nowiki&amp;gt; [&amp;quot;!&amp;quot;] &amp;lt;Boolean&amp;gt; &amp;lt;BooleanOperator&amp;gt; &amp;lt;Boolean&amp;gt; ... &amp;lt;/nowiki&amp;gt; &lt;br /&gt;
|-&lt;br /&gt;
| Boolean&lt;br /&gt;
| &amp;lt;nowiki&amp;gt; &amp;lt;BooleanConstant&amp;gt; | &amp;lt;Expression&amp;gt; | &amp;quot;(&amp;quot; &amp;lt;Expression&amp;gt; &amp;quot;)&amp;quot; | CompExpression | &amp;quot;(&amp;quot; &amp;lt;CompExpression&amp;gt; &amp;quot;)&amp;quot; | &amp;lt;DigitalInputs&amp;gt; | &amp;quot;(&amp;quot; &amp;lt;DigitalInputs&amp;gt; &amp;quot;)&amp;quot; &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| BooleanOperator&lt;br /&gt;
| &amp;lt;nowiki&amp;gt; &amp;quot;And&amp;quot; | &amp;quot;Or&amp;quot; &amp;lt;/nowiki&amp;gt; &lt;br /&gt;
|-&lt;br /&gt;
| BooleanConstant&lt;br /&gt;
| &amp;lt;nowiki&amp;gt; &amp;quot;True&amp;quot; | &amp;quot;False&amp;quot; &amp;lt;/nowiki&amp;gt; &lt;br /&gt;
|-&lt;br /&gt;
| Digital Inputs&lt;br /&gt;
| &amp;lt;nowiki&amp;gt; &amp;lt;ChannelType&amp;gt; &amp;lt;ChannelId&amp;gt; &amp;lt;/nowiki&amp;gt; &lt;br /&gt;
|-&lt;br /&gt;
| ChannelType&lt;br /&gt;
| &amp;lt;nowiki&amp;gt; &amp;quot;Din&amp;quot; | &amp;quot;GSig&amp;quot; &amp;lt;/nowiki&amp;gt; &lt;br /&gt;
|-&lt;br /&gt;
| ChannelId&lt;br /&gt;
| &amp;lt;nowiki&amp;gt; Integer value &amp;lt;/nowiki&amp;gt; &lt;br /&gt;
|-&lt;br /&gt;
| CompExpression&lt;br /&gt;
| &amp;lt;nowiki&amp;gt; &amp;lt;CompValue&amp;gt; &amp;lt;CompOperator&amp;gt; &amp;lt;CompValue&amp;gt; &amp;lt;/nowiki&amp;gt; &lt;br /&gt;
|-&lt;br /&gt;
| CompValue&lt;br /&gt;
| &amp;lt;nowiki&amp;gt; &amp;lt;Variable&amp;gt; | &amp;lt;Number&amp;gt; &amp;lt;/nowiki&amp;gt; &lt;br /&gt;
|-&lt;br /&gt;
| Variable&lt;br /&gt;
| &amp;lt;nowiki&amp;gt; &amp;lt;Numbervariable&amp;gt; | &amp;lt; PositionComponent&amp;gt; &amp;lt;/nowiki&amp;gt; &lt;br /&gt;
|-&lt;br /&gt;
| Numbervariable&lt;br /&gt;
| &amp;lt;nowiki&amp;gt; Name of a number variable &amp;lt;/nowiki&amp;gt; &lt;br /&gt;
|-&lt;br /&gt;
| Positions component&lt;br /&gt;
| &amp;lt;nowiki&amp;gt; &amp;lt;Position variable&amp;gt; &amp;quot;.&amp;quot; &amp;lt;Component&amp;gt; &amp;lt;/nowiki&amp;gt; &lt;br /&gt;
|-&lt;br /&gt;
| PositionVariable&lt;br /&gt;
| &amp;lt;nowiki&amp;gt; Name of a position variable &amp;lt;/nowiki&amp;gt; &lt;br /&gt;
|-&lt;br /&gt;
| Component&lt;br /&gt;
| &amp;lt;nowiki&amp;gt; &amp;quot;x&amp;quot; | &amp;quot;y&amp;quot; | &amp;quot;z&amp;quot; | &amp;quot;A&amp;quot; | &amp;quot;B&amp;quot; | &amp;quot;C&amp;quot; | &amp;quot;A1&amp;quot; | &amp;quot;A2&amp;quot; | &amp;quot;A3&amp;quot; | &amp;quot;A4&amp;quot; | &amp;quot;A5&amp;quot; | &amp;quot;A6&amp;quot; | &amp;quot;E1&amp;quot; | &amp;quot;E2&amp;quot; | &amp;quot;E3&amp;quot; &amp;lt;/nowiki&amp;gt; &lt;br /&gt;
|-&lt;br /&gt;
| Number&lt;br /&gt;
| &amp;lt;nowiki&amp;gt; Integer or floating point number &amp;lt;/nowiki&amp;gt; &lt;br /&gt;
|-&lt;br /&gt;
| CompOperator&lt;br /&gt;
| &amp;lt;nowiki&amp;gt; &amp;quot;=&amp;quot; | &amp;quot;&amp;gt;&amp;quot; | &amp;quot;&amp;lt;&amp;quot; | &amp;quot;&amp;gt;=&amp;quot; | &amp;quot;&amp;lt;=&amp;quot; &amp;lt;/nowiki&amp;gt; &lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>OLT</name></author>
	</entry>
</feed>