<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to Case Function - Multiple Conditions, Is it possible?</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/e2d58a40f2/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/Engineering/thread/e2d58a40f2/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/Engineering/thread/e2d58a40f2/</id><updated>2024-11-05T17:15:38.292000Z</updated><subtitle>Recent posts to Case Function - Multiple Conditions, Is it possible?</subtitle><entry><title>Case Function - Multiple Conditions, Is it possible?</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/e2d58a40f2/?limit=25#39c3" rel="alternate"/><published>2024-11-05T17:15:38.292000Z</published><updated>2024-11-05T17:15:38.292000Z</updated><author><name>pistola</name><uri>https://forge.codesys.com/u/pistola/</uri></author><id>https://forge.codesys.com40f16e6f5c3399a889413e25320db2ec14437622</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Thanks for the information, I ended up just making a long if else statement as each variable had 3 possible options, I figured at least this way it would still work. &lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Case Function - Multiple Conditions, Is it possible?</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/e2d58a40f2/?limit=25#761f" rel="alternate"/><published>2024-11-05T13:47:13.236000Z</published><updated>2024-11-05T13:47:13.236000Z</updated><author><name>TimvH</name><uri>https://forge.codesys.com/u/timvh/</uri></author><id>https://forge.codesys.coma918fe97bcf8410a89a03002d8d48985434ded57</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;This is not possible.&lt;br/&gt;
Possible solution could be:&lt;br/&gt;
CASE var1 OF&lt;br/&gt;
    10:&lt;br/&gt;
        CASE var2 OF&lt;br/&gt;
            10:;&lt;br/&gt;
            20:;&lt;br/&gt;
        END_CASE&lt;br/&gt;
    20:&lt;br/&gt;
        CASE var2 OF&lt;br/&gt;
            10:;&lt;br/&gt;
            20:;&lt;br/&gt;
        END_CASE&lt;br/&gt;
ELSE      &lt;br/&gt;
    ;&lt;br/&gt;
END_CASE&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Case Function - Multiple Conditions, Is it possible?</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/e2d58a40f2/?limit=25#4040" rel="alternate"/><published>2024-11-03T04:51:39.161000Z</published><updated>2024-11-03T04:51:39.161000Z</updated><author><name>pistola</name><uri>https://forge.codesys.com/u/pistola/</uri></author><id>https://forge.codesys.com5e0fc4ee0f2138854892a9ea6de2e8f98a2002fa</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Looking at the help (https://content.helpme-codesys.com/en/CODESYS%20Development%20System/_cds_st_instruction_case.html).&lt;/p&gt;
&lt;p&gt;I don't think it is possible but I figured I'd ask. &lt;/p&gt;
&lt;p&gt;I'm looking at have a case that evaluates two variables, instead of having multiple If Else statements I was hoping I could just use a case. &lt;/p&gt;
&lt;p&gt;Example&lt;/p&gt;
&lt;blockquote&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;*
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Case Var1 &amp;amp; Var 2 of&lt;br/&gt;
    10 &amp;amp; 10:&lt;br/&gt;
        Instruction Code&lt;br/&gt;
    10 &amp;amp; 20:&lt;br/&gt;
        Instruction Code&lt;br/&gt;
    20 &amp;amp; 20:&lt;br/&gt;
        Instruction Code&lt;br/&gt;
End_Case&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Obviously I tried typing as noted above and Codesys threw an error. But I was wondering if there was a different way of programming to make something like this work? &lt;/p&gt;
&lt;p&gt;If not I'll just use a bunch of If Else Statements, Thanks. &lt;/p&gt;&lt;/div&gt;</summary></entry></feed>