<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to Funktion für Frostperiode ?</title><link href="https://forge.codesys.com/forge/talk/Deutsch/thread/ae06c88219/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/Deutsch/thread/ae06c88219/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/Deutsch/thread/ae06c88219/</id><updated>2020-02-28T05:57:53.667000Z</updated><subtitle>Recent posts to Funktion für Frostperiode ?</subtitle><entry><title>Funktion für Frostperiode ?</title><link href="https://forge.codesys.com/forge/talk/Deutsch/thread/ae06c88219/?limit=25#e9fa" rel="alternate"/><published>2020-02-28T05:57:53.667000Z</published><updated>2020-02-28T05:57:53.667000Z</updated><author><name>Oberchefe</name><uri>https://forge.codesys.com/u/oberchefe/</uri></author><id>https://forge.codesys.com39b8ceeb7bee98676085fe77d129ae81c054505a</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Schaltjahr:```&lt;/p&gt;
&lt;p&gt;Jahr:=STRING_TO_INT((MID(DT_TO_STRING(DatumUhrzeit), 4, 4)));&lt;br/&gt;
Schaltjahraktiv:=NOT Jahr.1 AND NOT Jahr.0 ;&lt;/p&gt;
&lt;p&gt;```&lt;/p&gt;
&lt;p&gt;Paßt von 1904 bis 2096, 2100 ist bekanntlich eine Ausnahme, falls Du damit rechnest daß das Teil bis dahin noch laufen muß kannst Du ja entsprechende Ausnahmen von Hand rein setzen (1700, 1800, 1900, 2100, 2200, 2300, 2500, 2600....)&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Funktion für Frostperiode ?</title><link href="https://forge.codesys.com/forge/talk/Deutsch/thread/ae06c88219/?limit=25#c6da" rel="alternate"/><published>2020-02-28T05:57:51.391000Z</published><updated>2020-02-28T05:57:51.391000Z</updated><author><name>dietere</name><uri>https://forge.codesys.com/u/dietere/</uri></author><id>https://forge.codesys.com88bdb0332278deb540817ecccdb332d6d19d7b26</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;wow, ich bin fassungslos&lt;/p&gt;
&lt;p&gt;was ist das denn für ein Service - klasse&lt;/p&gt;
&lt;p&gt;ich bedanke mich&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Funktion für Frostperiode ?</title><link href="https://forge.codesys.com/forge/talk/Deutsch/thread/ae06c88219/?limit=25#586e" rel="alternate"/><published>2020-02-28T05:57:45.140000Z</published><updated>2020-02-28T05:57:45.140000Z</updated><author><name>hugo</name><uri>https://forge.codesys.com/u/hugo/</uri></author><id>https://forge.codesys.com4eebabf1a952d39301f0e6a56e37f653d554d12b</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;hallo dieter leider hast du recht.&lt;/p&gt;
&lt;p&gt;in einem schaltjahr schaltet die funktion einen tag zu früh falls das datum nach dem 28. feb liegt.&lt;/p&gt;
&lt;p&gt;wir werden das in der nächsten release verbessern.&lt;/p&gt;
&lt;p&gt;es wird ein prüfung auf schaltjahr mit eingebaut.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Funktion für Frostperiode ?</title><link href="https://forge.codesys.com/forge/talk/Deutsch/thread/ae06c88219/?limit=25#eea6" rel="alternate"/><published>2020-02-28T05:57:42.979000Z</published><updated>2020-02-28T05:57:42.979000Z</updated><author><name>hugo</name><uri>https://forge.codesys.com/u/hugo/</uri></author><id>https://forge.codesys.com58c0f4bbdbc766b893ca676bc2de0dd3af27108b</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;ja das isr richtig.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Funktion für Frostperiode ?</title><link href="https://forge.codesys.com/forge/talk/Deutsch/thread/ae06c88219/?limit=25#730f" rel="alternate"/><published>2020-02-28T05:57:37.039000Z</published><updated>2020-02-28T05:57:37.039000Z</updated><author><name>dietere</name><uri>https://forge.codesys.com/u/dietere/</uri></author><id>https://forge.codesys.com2791c6707f66a341c7c2cc6ee5d1c7b9e536bace</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;hallo hugo,&lt;/p&gt;
&lt;p&gt;wie sieht das bei einem schaltjahr aus ?&lt;/p&gt;
&lt;p&gt;d1 und d2 haben ja immer die gleiche Jahreszahl, z.B. 2007.&lt;/p&gt;
&lt;p&gt;dx wird aber irgendwann mal ein Schaltjahr, dann ist day_of_year dann doch ein Tag daneben, oder ?&lt;/p&gt;
&lt;p&gt;Grüsse,&lt;/p&gt;
&lt;p&gt;Dieter&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Funktion für Frostperiode ?</title><link href="https://forge.codesys.com/forge/talk/Deutsch/thread/ae06c88219/?limit=25#f826" rel="alternate"/><published>2020-02-28T05:57:34.900000Z</published><updated>2020-02-28T05:57:34.900000Z</updated><author><name>hugo</name><uri>https://forge.codesys.com/u/hugo/</uri></author><id>https://forge.codesys.com5e8d80b5385a40a760d752362a7098803ccfb0c4</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;ja sie wird in der 2.0 drin sein, sie wird heute nacht online gestellt&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Funktion für Frostperiode ?</title><link href="https://forge.codesys.com/forge/talk/Deutsch/thread/ae06c88219/?limit=25#19cf" rel="alternate"/><published>2020-02-28T05:57:28.964000Z</published><updated>2020-02-28T05:57:28.964000Z</updated><author><name>dietere</name><uri>https://forge.codesys.com/u/dietere/</uri></author><id>https://forge.codesys.com9c60486949ecc3278d5d9cf6b8adedacbd11f2f9</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;ja super, danke hugo&lt;/p&gt;
&lt;p&gt;das hilft mir erstmal weiter, vor allem weil jahresunabhängig&lt;/p&gt;
&lt;p&gt;Ist diese Funktion auch in der neuen oscat.lib drin ?&lt;/p&gt;
&lt;p&gt;Grüsse,&lt;/p&gt;
&lt;p&gt;Dieter&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Funktion für Frostperiode ?</title><link href="https://forge.codesys.com/forge/talk/Deutsch/thread/ae06c88219/?limit=25#9980" rel="alternate"/><published>2020-02-28T05:57:26.795000Z</published><updated>2020-02-28T05:57:26.795000Z</updated><author><name>hugo</name><uri>https://forge.codesys.com/u/hugo/</uri></author><id>https://forge.codesys.com4e5262e44a5aaba7a24043a0ac8cc4328710f011</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;sorry das war etwas zu schnell gescossen&lt;/p&gt;
&lt;p&gt;es muss natürlich noch berücksichtigt werden das die periode über den 1.1 verläuft.&lt;/p&gt;
&lt;p&gt;hier der code der funktioniert:&lt;/p&gt;
&lt;p&gt;FUNCTION period : BOOL&lt;/p&gt;
&lt;p&gt;VAR_INPUT&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="n"&gt;d1&lt;/span&gt; &lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="n"&gt;DATE&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

&lt;span class="n"&gt;dx&lt;/span&gt; &lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="n"&gt;DATE&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

&lt;span class="n"&gt;d2&lt;/span&gt; &lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="n"&gt;DATE&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;END_VAR&lt;/p&gt;
&lt;p&gt;VAR&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="n"&gt;p1&lt;/span&gt; &lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="n"&gt;INT&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

&lt;span class="n"&gt;px&lt;/span&gt; &lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="n"&gt;INT&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

&lt;span class="n"&gt;p2&lt;/span&gt; &lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="n"&gt;INT&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;END_VAR&lt;/p&gt;
&lt;p&gt;(*&lt;/p&gt;
&lt;p&gt;version 1.0 19 sep 2007&lt;/p&gt;
&lt;p&gt;programmer  hugo&lt;/p&gt;
&lt;p&gt;tested by       tobias&lt;/p&gt;
&lt;p&gt;PERIOD checks if a given date is between two dates (d1 and d2) d1 is the starting date and d2 the last date for the period.&lt;/p&gt;
&lt;p&gt;the years of the dates are ignored, so the function period cheks for a time period within a year independet of the year.&lt;/p&gt;
&lt;p&gt;*)&lt;/p&gt;
&lt;p&gt;p1 := day_of_year(D1);&lt;/p&gt;
&lt;p&gt;p2 := day_of_year(D2);&lt;/p&gt;
&lt;p&gt;px := day_of_year(DX);&lt;/p&gt;
&lt;p&gt;IF p2 &amp;gt;= p1 THEN&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="n"&gt;period&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;px&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;p2&lt;/span&gt; &lt;span class="k"&gt;AND&lt;/span&gt; &lt;span class="n"&gt;px&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="n"&gt;p1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;ELSE&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="n"&gt;period&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;px&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;p2&lt;/span&gt; &lt;span class="k"&gt;OR&lt;/span&gt; &lt;span class="n"&gt;px&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="n"&gt;p1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;END_IF;&lt;/p&gt;
&lt;p&gt;(* revision history&lt;/p&gt;
&lt;p&gt;hm      19. sep 2007&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="n"&gt;original&lt;/span&gt; &lt;span class="k"&gt;version&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;*)&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Funktion für Frostperiode ?</title><link href="https://forge.codesys.com/forge/talk/Deutsch/thread/ae06c88219/?limit=25#718a" rel="alternate"/><published>2020-02-28T05:57:20.884000Z</published><updated>2020-02-28T05:57:20.884000Z</updated><author><name>hugo</name><uri>https://forge.codesys.com/u/hugo/</uri></author><id>https://forge.codesys.comc57fe44980fa0097f45739e064a4bc1adf30b81e</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;in der 2.0 wird hierfür eine funktion angeboten&lt;/p&gt;
&lt;p&gt;folgender source code&lt;/p&gt;
&lt;p&gt;FUNCTION period : BOOL&lt;/p&gt;
&lt;p&gt;VAR_INPUT&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="n"&gt;d1&lt;/span&gt; &lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="n"&gt;DATE&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

&lt;span class="n"&gt;dx&lt;/span&gt; &lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="n"&gt;DATE&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

&lt;span class="n"&gt;d2&lt;/span&gt; &lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="n"&gt;DATE&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;END_VAR&lt;/p&gt;
&lt;p&gt;VAR&lt;/p&gt;
&lt;p&gt;END_VAR&lt;/p&gt;
&lt;p&gt;period := (date_add(d1,0,0,0,year(dx)-year(d1)) &amp;lt;= dx) AND (date_add(d2,0,0,0,year(dx)-year(d2)) &amp;gt;= dx);&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Funktion für Frostperiode ?</title><link href="https://forge.codesys.com/forge/talk/Deutsch/thread/ae06c88219/?limit=25#d89c" rel="alternate"/><published>2020-02-28T05:57:18.769000Z</published><updated>2020-02-28T05:57:18.769000Z</updated><author><name>hugo</name><uri>https://forge.codesys.com/u/hugo/</uri></author><id>https://forge.codesys.com64d51c1b0ab97e2610aa8acc2937989b98ae412b</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;die funktion temp_ext in der oscat lib hat diesen periodenvergleich auch mit drin, macht aber vieles mehr. schau dir mal dort den source code an&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>