<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to Simple question about case's</title><link href="https://forge.codesys.com/forge/talk/CODESYS-V2/thread/4210ae6234/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/CODESYS-V2/thread/4210ae6234/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/CODESYS-V2/thread/4210ae6234/</id><updated>2020-02-27T23:14:04.080000Z</updated><subtitle>Recent posts to Simple question about case's</subtitle><entry><title>Simple question about case's</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/4210ae6234/?limit=25#e3dc" rel="alternate"/><published>2020-02-27T23:14:04.080000Z</published><updated>2020-02-27T23:14:04.080000Z</updated><author><name>stu1980</name><uri>https://forge.codesys.com/u/stu1980/</uri></author><id>https://forge.codesys.come952fb61dfe3790bc55dc4604f9bfc3874a0e3e4</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Thanks  &lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Simple question about case's</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/4210ae6234/?limit=25#a1a1" rel="alternate"/><published>2020-02-27T23:14:02.436000Z</published><updated>2020-02-27T23:14:02.436000Z</updated><author><name>shooter</name><uri>https://forge.codesys.com/u/shooter/</uri></author><id>https://forge.codesys.comce3f44640667ad09bd9d0e5e17ca6558db219906</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;yes that why example is declared in the VAR list&lt;br/&gt;
VAR&lt;br/&gt;
example:INT;&lt;br/&gt;
END_VAR&lt;/p&gt;
&lt;p&gt;but this will be done automatic when you type in the program.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Simple question about case's</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/4210ae6234/?limit=25#8263" rel="alternate"/><published>2020-02-27T23:13:57.888000Z</published><updated>2020-02-27T23:13:57.888000Z</updated><author><name>stu1980</name><uri>https://forge.codesys.com/u/stu1980/</uri></author><id>https://forge.codesys.comdda4d20fa1176635d40756daaa62afadead6eeb2</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Thanks Shooter  &lt;/p&gt;
&lt;p&gt;One thing, how do you determin which case is used. How can you choose case 1. or 2. or 3. I presume if you declare your variable "example" as an interger you can feed values in that variable, then choose each case you want.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Simple question about case's</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/4210ae6234/?limit=25#0d0b" rel="alternate"/><published>2020-02-27T23:13:55.713000Z</published><updated>2020-02-27T23:13:55.713000Z</updated><author><name>shooter</name><uri>https://forge.codesys.com/u/shooter/</uri></author><id>https://forge.codesys.com7c658177008108ee3ff8a09eef69b17e7a54831c</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;If example is 1 case1 will be executed&lt;br/&gt;
It will not even test if example is 2 but will move to the end_case instruction just because the example is not correct for any other.&lt;br/&gt;
This is also not allowed so&lt;br/&gt;
1:&lt;br/&gt;
and 1..3: is not allowed.&lt;br/&gt;
btw it must be a colon and not a comma.&lt;br/&gt;
see example i gave you &lt;br/&gt;
CASE INT1 OF&lt;br/&gt;
1, 5: BOOL1 := TRUE;&lt;br/&gt;
 BOOL3 := FALSE;&lt;br/&gt;
2: BOOL2 := FALSE;&lt;br/&gt;
 BOOL3 := TRUE;&lt;br/&gt;
10..20: BOOL1 := TRUE;&lt;br/&gt;
 BOOL3:= TRUE;&lt;br/&gt;
ELSE&lt;br/&gt;
 BOOL1 := NOT BOOL1;&lt;br/&gt;
 BOOL2 := BOOL1 OR BOOL2;&lt;br/&gt;
END_CASE;&lt;/p&gt;
&lt;p&gt;if int1 is not 1,2,5,10,11,12,13,14,15,16,17,18,19,20 else will be done&lt;br/&gt;
otherwise &lt;br/&gt;
when it is 1 or 5 bool1 will be true &lt;br/&gt;
when int1 is 2 bool2 will be false&lt;br/&gt;
if int1 is from 10 to 20 bool3 will be true&lt;br/&gt;
etc.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Simple question about case's</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/4210ae6234/?limit=25#1407" rel="alternate"/><published>2020-02-27T23:13:50.279000Z</published><updated>2020-02-27T23:13:50.279000Z</updated><author><name>stu1980</name><uri>https://forge.codesys.com/u/stu1980/</uri></author><id>https://forge.codesys.comb2a826c96e1be39e5dc8718a63623c79a7bb3c1e</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Will this be the case with multiple cases? e.g.&lt;br/&gt;
CASE  Example OF&lt;br/&gt;
1.case1();&lt;br/&gt;
2.case2();&lt;br/&gt;
3.case3();&lt;/p&gt;
&lt;p&gt;END_CASE;&lt;/p&gt;
&lt;p&gt;Say if case1 executes its code, will it automatically jump to the next or as you said jump to end case.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Simple question about case's</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/4210ae6234/?limit=25#4984" rel="alternate"/><published>2020-02-27T23:13:48.639000Z</published><updated>2020-02-27T23:13:48.639000Z</updated><author><name>shooter</name><uri>https://forge.codesys.com/u/shooter/</uri></author><id>https://forge.codesys.com657f38eff89318f61ecb99ddc6e703ab10f35943</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;When the CASE is done the program jumps to END_CASE&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Simple question about case's</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/4210ae6234/?limit=25#9172" rel="alternate"/><published>2020-02-27T23:13:46.799000Z</published><updated>2020-02-27T23:13:46.799000Z</updated><author><name>stu1980</name><uri>https://forge.codesys.com/u/stu1980/</uri></author><id>https://forge.codesys.comdeff9646615a32da0feb786a09811521b1eb85e2</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hi, very simple question. if i have code in a case and no jump address. Will the code keep executing over and over again?&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>