<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to get actual time</title><link href="https://forge.codesys.com/forge/talk/CODESYS-V2/thread/bd2692dac2/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/CODESYS-V2/thread/bd2692dac2/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/CODESYS-V2/thread/bd2692dac2/</id><updated>2020-02-27T23:24:28.080000Z</updated><subtitle>Recent posts to get actual time</subtitle><entry><title>get actual time</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/bd2692dac2/?limit=25#fe5f" rel="alternate"/><published>2020-02-27T23:24:28.080000Z</published><updated>2020-02-27T23:24:28.080000Z</updated><author><name>gbutori</name><uri>https://forge.codesys.com/u/gbutori/</uri></author><id>https://forge.codesys.com45f1ad9502f96a31beb86ddabae004d3d0d30dce</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hello, &lt;/p&gt;
&lt;p&gt;I've used CurTimeEx (not to set time and date, but only to read it) and it works well.&lt;/p&gt;
&lt;p&gt;In the declarations:&lt;/p&gt;
&lt;p&gt;VAR&lt;br/&gt;
    ActualTime:SysTime64;&lt;br/&gt;
    ActualTimeEx:SystemTimeDate;&lt;br/&gt;
    RdCurTimeEx: CurTimeEx;&lt;br/&gt;
END_VAR&lt;/p&gt;
&lt;p&gt;In the program part:&lt;br/&gt;
    RdCurTimeEx(SystemTime:=ActualTime , TimeDate:= ActualTimeEx);&lt;/p&gt;
&lt;p&gt;ActualTimeEx has now the time and date values.&lt;/p&gt;
&lt;p&gt;I use Lenze HMI(WCE) and IPC(WCE) and this works on both.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>get actual time</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/bd2692dac2/?limit=25#f81e" rel="alternate"/><published>2020-02-27T23:24:25.783000Z</published><updated>2020-02-27T23:24:25.783000Z</updated><author><name>CME</name><uri>https://forge.codesys.com/u/cme/</uri></author><id>https://forge.codesys.comcbb57c318472302f988b3d2771c771b2339c07c4</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;I have the same problem. The example "MyDateTime := SysRtcGetTime(TRUE);" gives  " DT#1970-01-01-00:00 ". &lt;br/&gt;
I'm using a 750-841 controller and the time in the wago is correct.&lt;/p&gt;
&lt;p&gt;Anyone already a solution.&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;CME&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>get actual time</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/bd2692dac2/?limit=25#297e" rel="alternate"/><published>2020-02-27T23:24:19.443000Z</published><updated>2020-02-27T23:24:19.443000Z</updated><author><name>asifdip</name><uri>https://forge.codesys.com/u/asifdip/</uri></author><id>https://forge.codesys.com9c013279e9ce2c9300b541946d44a162b5c50b0d</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hello everyone,&lt;br/&gt;
I am using Codesys 2.3 with target SP RTE. I have already found "SysLibTime" and "SysLibRtc".&lt;br/&gt;
I have also need to use Real system time in my ST editor.  I have run the above small program as described above but I have this old time.&lt;br/&gt;
VAR&lt;br/&gt;
    MyDateTime:DT;&lt;br/&gt;
END_VAR&lt;/p&gt;
&lt;p&gt;MyDateTime := SysRtcGetTime(TRUE);&lt;/p&gt;
&lt;p&gt;Then result: DT#1970-01-01-00:00 It is not currect date &amp;amp; time system time.&lt;/p&gt;
&lt;p&gt;If I  add and use "SysLibTime" library in my project then I have just write in Visualisation &lt;strong&gt;%t%a %b %d.%m.%y %H:%M:%S&lt;/strong&gt;  then i have the real system time in Visualisation.It is very nice.But I can only see not use it ST editor.how can i use this? or any idea?&lt;br/&gt;
As I want to get the system time and then i want to use it again. how can i get this time in "Main "or " PLC_PRG"  Program editor in ST language?&lt;/p&gt;
&lt;p&gt;I am waititng for ur reply.&lt;/p&gt;
&lt;p&gt;Thanks&lt;br/&gt;
asif&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>get actual time</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/bd2692dac2/?limit=25#26a0" rel="alternate"/><published>2020-02-27T23:24:17.803000Z</published><updated>2020-02-27T23:24:17.803000Z</updated><author><name>Nitrozin</name><uri>https://forge.codesys.com/u/nitrozin/</uri></author><id>https://forge.codesys.com6397e314c235f19d5065b328263c7f780acf4eb6</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hi,&lt;br/&gt;
you can find a lot of informations on the WAGO Website&lt;br/&gt;
Service &amp;gt;&amp;gt; Downloads &amp;gt;&amp;gt; Automation&lt;br/&gt;
also you can visit &lt;a class="" href="http://www.oscat.de/" rel="nofollow"&gt;http://www.oscat.de/&lt;/a&gt;, a free library (open Source)&lt;/p&gt;
&lt;p&gt;Nitro&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>get actual time</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/bd2692dac2/?limit=25#5269" rel="alternate"/><published>2020-02-27T23:24:13.187000Z</published><updated>2020-02-27T23:24:13.187000Z</updated><author><name>Anonymous</name><uri>https://forge.codesys.com/u/*anonymous/</uri></author><id>https://forge.codesys.com480302c495ea6005a414af554fd1a2a1b098f8a8</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;&lt;em&gt;Originally created by:&lt;/em&gt; Arjan&lt;/p&gt;
&lt;p&gt;Hello Nitro,&lt;/p&gt;
&lt;p&gt;Thanks that was what I was looking for.&lt;br/&gt;
Maybe the clock of the 750-841 is not to accurate, but that is no problem for my application.&lt;/p&gt;
&lt;p&gt;Do you know of any documentation (pdf´s or websites) where these standard functions are explained some more and maybe easy to browse by categories etc.?&lt;/p&gt;
&lt;p&gt;Greetz,&lt;br/&gt;
Arjan&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>get actual time</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/bd2692dac2/?limit=25#b6bf" rel="alternate"/><published>2020-02-27T23:24:11.529000Z</published><updated>2020-02-27T23:24:11.529000Z</updated><author><name>Nitrozin</name><uri>https://forge.codesys.com/u/nitrozin/</uri></author><id>https://forge.codesys.comf33dcb5f06c9ecf20d84f2987fb273ae82533a68</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;the 750-841 has a battery buffered RTC.&lt;br/&gt;
You can get the actual time with the 'SysRtcGetTime' function from the SysLibRtc.lib.&lt;/p&gt;
&lt;p&gt;VAR&lt;br/&gt;
MyDateTime: DT;&lt;br/&gt;
END_VAR&lt;/p&gt;
&lt;p&gt;MyDateTime := SysRtcGetTime(TRUE);&lt;/p&gt;
&lt;p&gt;Nitro&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>get actual time</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/bd2692dac2/?limit=25#41a6" rel="alternate"/><published>2020-02-27T23:24:09.879000Z</published><updated>2020-02-27T23:24:09.879000Z</updated><author><name>shooter</name><uri>https://forge.codesys.com/u/shooter/</uri></author><id>https://forge.codesys.com95f477699c2d77af7a5e0bb8a3d02b49865a43f8</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;inside 750-841 is no RTC present so you can not ask for it.&lt;br/&gt;
you can give a time when startup and then the time will be running (not very good on time though but you can make calcs with it.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>get actual time</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/bd2692dac2/?limit=25#7b84" rel="alternate"/><published>2020-02-27T23:24:05.262000Z</published><updated>2020-02-27T23:24:05.262000Z</updated><author><name>Anonymous</name><uri>https://forge.codesys.com/u/*anonymous/</uri></author><id>https://forge.codesys.com4bc8aa5de92837f998189bdb5adb727b1293e335</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;&lt;em&gt;Originally created by:&lt;/em&gt; Arjan&lt;/p&gt;
&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;I am an obvious newbie to CoDeSys so this is probably a dumb beginners question, but I´ve Googled around and could not find any satisfiable answer.&lt;/p&gt;
&lt;p&gt;How can a get the current time from my controller (a Wago 750-841)&lt;/p&gt;
&lt;p&gt;I want to start with a simple time clock which sets an output on or off according to the time of the day. Found the OSCAT library which contains a function for this purpose (TIMECHECK) this function needs an input in TOD type. The OSCAT libraries also contain functions to convert from different types to TOD, but my problem is I don´t know how to get the time in any format from the system.&lt;/p&gt;
&lt;p&gt;I´ve tried the CurTime and CurTimeEx functions but the seem to need inputs. I don´t want to set the time just read it.&lt;br/&gt;
Can anyone give a hint on how to accomplish this probably simple task.&lt;/p&gt;
&lt;p&gt;thanks in advance,&lt;br/&gt;
Arjan&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>