<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to Codesys ST CASE statement</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/c3fad35ed1/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/Engineering/thread/c3fad35ed1/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/Engineering/thread/c3fad35ed1/</id><updated>2022-07-19T16:13:10.395000Z</updated><subtitle>Recent posts to Codesys ST CASE statement</subtitle><entry><title>Codesys ST CASE statement</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/c3fad35ed1/?limit=25#fafa" rel="alternate"/><published>2022-07-19T16:13:10.395000Z</published><updated>2022-07-19T16:13:10.395000Z</updated><author><name>timvh</name><uri>https://forge.codesys.com/u/timvh/</uri></author><id>https://forge.codesys.com12c99a529966207baaa8befe0c372b79306183ef</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;When timestamp_hist = 0&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Codesys ST CASE statement</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/c3fad35ed1/?limit=25#93b6" rel="alternate"/><published>2022-07-19T12:52:49.023000Z</published><updated>2022-07-19T12:52:49.023000Z</updated><author><name>damian177</name><uri>https://forge.codesys.com/u/damian177/</uri></author><id>https://forge.codesys.come0166da4edc57e3b66eb8feeea9e5c11c40e3fec</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Below I paste one of step CASE statement&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;    &lt;span class="nt"&gt;21&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;   &lt;span class="o"&gt;(*&lt;/span&gt;&lt;span class="nt"&gt;check&lt;/span&gt; &lt;span class="nt"&gt;number&lt;/span&gt; &lt;span class="nt"&gt;phone&lt;/span&gt; &lt;span class="nt"&gt;sender&lt;/span&gt;&lt;span class="s1"&gt;'a*)  (*check if sms is not too old*)&lt;/span&gt;
&lt;span class="s1"&gt;        timestamp_hist_hi := time_sys.udiLocal_DateAndTime + timestamp_hist;&lt;/span&gt;
&lt;span class="s1"&gt;        timestamp_hist_lo := time_sys.udiLocal_DateAndTime - timestamp_hist;&lt;/span&gt;

&lt;span class="s1"&gt;        IF  (smsrec.sNumber = '&lt;/span&gt;&lt;span class="nt"&gt;XXXXXXXXXXX&lt;/span&gt;&lt;span class="s1"&gt;' OR smsrec.sNumber = '&lt;/span&gt;&lt;span class="nt"&gt;XXXXXXXXXXX&lt;/span&gt;&lt;span class="err"&gt;'&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;  &lt;span class="nt"&gt;AND&lt;/span&gt;
            &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nt"&gt;DT_TO_UDINT&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nt"&gt;smsrec&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;dtSend&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="nt"&gt;timestamp_hist_lo&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;                    &lt;span class="nt"&gt;AND&lt;/span&gt;
            &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nt"&gt;DT_TO_UDINT&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nt"&gt;smsrec&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;dtSend&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="nt"&gt;timestamp_hist_hi&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;                    &lt;span class="nt"&gt;THEN&lt;/span&gt;
                &lt;span class="nt"&gt;iState&lt;/span&gt;&lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="nt"&gt;23&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
        &lt;span class="nt"&gt;ELSE&lt;/span&gt;
                &lt;span class="nt"&gt;iState&lt;/span&gt;&lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="nt"&gt;100&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
        &lt;span class="nt"&gt;END_IF&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;Teh variable &lt;strong&gt;timestamp_his&lt;/strong&gt;t equal 300sec.&lt;/p&gt;
&lt;p&gt;How it is possible that time to time the variables  &lt;strong&gt;timestamp_hist_hi&lt;/strong&gt; and &lt;strong&gt;timestamp_hist_lo&lt;/strong&gt; are the same ?&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>