<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to Display RTC</title><link href="https://forge.codesys.com/forge/talk/CODESYS-V2/thread/147e6f98b3/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/CODESYS-V2/thread/147e6f98b3/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/CODESYS-V2/thread/147e6f98b3/</id><updated>2020-02-27T19:10:03.427000Z</updated><subtitle>Recent posts to Display RTC</subtitle><entry><title>Display RTC</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/147e6f98b3/?limit=25#43d6" rel="alternate"/><published>2020-02-27T19:10:03.427000Z</published><updated>2020-02-27T19:10:03.427000Z</updated><author><name>MusashiAharon</name><uri>https://forge.codesys.com/u/musashiaharon/</uri></author><id>https://forge.codesys.combc2ae708493affad632f987a12c361da083d0287</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;I tried using SysLibTime, but had issues (the time stayed at Jan 1, 1970, 12:00 AM). &lt;/p&gt;
&lt;p&gt;So, I decided to use the time string format. Just make a rectangle in your visualization, and set the text string to something like mine:&lt;/p&gt;
&lt;p&gt;Time:&lt;br/&gt;
%t%I:%M:%S %p&lt;/p&gt;
&lt;p&gt;Date:&lt;br/&gt;
%t%m/%d/%Y&lt;/p&gt;
&lt;p&gt;Unfortunately, %I in the time string gives a leading zero for the hour, but I couldn't figure out how to remove it. For more info about the time string, you can click the ? button next to the Text field.&lt;/p&gt;
&lt;p&gt;Edit: Found out that SysLibTime doesn't work in Simulation. It did work on my Wago, but only when the program was running. %t strings, however, will always work, even when the program isn't running.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Display RTC</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/147e6f98b3/?limit=25#758f" rel="alternate"/><published>2020-02-27T19:10:02.223000Z</published><updated>2020-02-27T19:10:02.223000Z</updated><author><name>shooter</name><uri>https://forge.codesys.com/u/shooter/</uri></author><id>https://forge.codesys.com353d0d94811ddd45ad6a07afab3bc2383f24b350</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;for nice clocks have a look at  w &lt;a class="" href="http://www.oscat.de" rel="nofollow"&gt;www.oscat.de&lt;/a&gt; w&lt;br/&gt;
lots of functions&lt;br/&gt;
example:&lt;br/&gt;
(*&lt;br/&gt;
version 1.2 8. mar. 2009&lt;br/&gt;
programmer  hugo&lt;br/&gt;
tested by       oscat&lt;/p&gt;
&lt;p&gt;DT_SIMU simulates a real time clock and can be adjusted to different speeds&lt;br/&gt;
it can also be used in simulation to simulate a real time clock.&lt;br/&gt;
the peed of the clock can be increased or decreased to debug timers.&lt;br/&gt;
with the input start a start date-time can be specified.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;)&lt;br/&gt;
(&lt;/em&gt; @END_DECLARATION := '0' &lt;em&gt;)&lt;br/&gt;
(&lt;/em&gt; read system timer *)&lt;br/&gt;
tx := T_PLC_MS();&lt;br/&gt;
tc := REAL_TO_DWORD(DWORD_TO_REAL(tx - last) * speed);&lt;/p&gt;
&lt;p&gt;IF NOT init THEN&lt;br/&gt;
    init := TRUE;&lt;br/&gt;
    DTS := Start;&lt;br/&gt;
    tc := 0;&lt;br/&gt;
    last := tx;&lt;br/&gt;
ELSIF SPEED = 0.0 THEN&lt;br/&gt;
    DTS := DWORD_TO_DT(DT_TO_DWORD(DTS) + 1);&lt;br/&gt;
ELSIF tc &amp;gt;= 1000 THEN&lt;br/&gt;
    td := (tc / 1000) * 1000;&lt;br/&gt;
    DTS := DTS + DWORD_TO_TIME(td);&lt;br/&gt;
    last := last + REAL_TO_DWORD(DWORD_TO_REAL(td) / speed);&lt;br/&gt;
END_IF;&lt;/p&gt;
&lt;p&gt;(* revision history&lt;br/&gt;
hm  11. sep. 2008   rev 1.0&lt;br/&gt;
    original version&lt;/p&gt;
&lt;p&gt;hm  16. nov 2008    rev 1.1&lt;br/&gt;
    added type conversions for compatibility reasons&lt;/p&gt;
&lt;p&gt;hm  8.  mar. 2009   rev 1.2&lt;br/&gt;
    added increment by cycle mode&lt;/p&gt;
&lt;p&gt;*)&lt;/p&gt;
&lt;p&gt;END_FUNCTION_BLOCK&lt;br/&gt;
just one for you to get the idea the rest is at oscat&lt;/p&gt;
&lt;p&gt;you can have it displayed with lines or with numbers.&lt;br/&gt;
if needed more help just ask.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Display RTC</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/147e6f98b3/?limit=25#b148" rel="alternate"/><published>2020-02-27T19:10:01.024000Z</published><updated>2020-02-27T19:10:01.024000Z</updated><author><name>JAPIB</name><uri>https://forge.codesys.com/u/japib/</uri></author><id>https://forge.codesys.comd45fba163debe29dd175e59bac7b1a290c4caeed</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;With CoDeSys there are libraries SysLibRtc.lib or SysLibTime.lib to get the real time clock.&lt;br/&gt;
I think with your controller you must have the same libraries.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Display RTC</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/147e6f98b3/?limit=25#df65" rel="alternate"/><published>2020-02-27T19:09:57.669000Z</published><updated>2020-02-27T19:09:57.669000Z</updated><author><name>Phil</name><uri>https://forge.codesys.com/u/phil/</uri></author><id>https://forge.codesys.comc8db1692d129ab829f12ba7121950401be5f2267</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Is it possible to display the real time clock of my 750-849?&lt;/p&gt;
&lt;p&gt;thanks&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>