<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to Getting crazy with SysRtcGetTime</title><link href="https://forge.codesys.com/forge/talk/CODESYS-V2/thread/d92d7707a0/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/CODESYS-V2/thread/d92d7707a0/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/CODESYS-V2/thread/d92d7707a0/</id><updated>2020-02-27T20:59:15.639000Z</updated><subtitle>Recent posts to Getting crazy with SysRtcGetTime</subtitle><entry><title>Getting crazy with SysRtcGetTime</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/d92d7707a0/?limit=25#846c" rel="alternate"/><published>2020-02-27T20:59:15.639000Z</published><updated>2020-02-27T20:59:15.639000Z</updated><author><name>Anonymous</name><uri>https://forge.codesys.com/u/*anonymous/</uri></author><id>https://forge.codesys.combb0a62d6b4963d1ecbe187f78296401edd1d029c</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;&lt;em&gt;Originally created by:&lt;/em&gt; crthomas1234&lt;/p&gt;
&lt;p&gt;The RTC libraries can access the RTC on your PC.&lt;/p&gt;
&lt;p&gt;I like to use the internal function: SysTimeGetDate found in the SysTime.lib.&lt;/p&gt;
&lt;p&gt;This function returns a structure of type SYSTIMEDATE.  Inside this structure, all of the sub-elements such as year, day, hour, minute, second, etc are already broken out for you to access so you do not have to parse the time string that is returned by some of the other blocks.&lt;/p&gt;
&lt;p&gt;The SysRtcGetTime() returns a time that is referenced from an initial input time setting.  The default value for this initial time is the 1970-01-01-00:00.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Getting crazy with SysRtcGetTime</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/d92d7707a0/?limit=25#c371" rel="alternate"/><published>2020-02-27T20:59:14.223000Z</published><updated>2020-02-27T20:59:14.223000Z</updated><author><name>GUERILLON</name><uri>https://forge.codesys.com/u/guerillon/</uri></author><id>https://forge.codesys.com40a34ea67d20cebe2b0e59ea0912b86492a1fdec</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Thanks a lot for your help  &lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Getting crazy with SysRtcGetTime</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/d92d7707a0/?limit=25#7291" rel="alternate"/><published>2020-02-27T20:59:10.242000Z</published><updated>2020-02-27T20:59:10.242000Z</updated><author><name>Nitrozin</name><uri>https://forge.codesys.com/u/nitrozin/</uri></author><id>https://forge.codesys.com932ec45ba72ef143f1146aa7fcc9d5aa552a1ee7</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;hi again,&lt;/p&gt;
&lt;p&gt;you can use the external librarys only with the target system.&lt;/p&gt;
&lt;p&gt;for testing the date &amp;amp; time functions use the RTC FB from the standard.lib&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="nt"&gt;VAR&lt;/span&gt;
&lt;span class="nt"&gt;My_DT&lt;/span&gt;&lt;span class="err"&gt; &lt;/span&gt; &lt;span class="err"&gt; &lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="nt"&gt;DT&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;&lt;span class="err"&gt; &lt;/span&gt; &lt;span class="err"&gt; &lt;/span&gt;&lt;span class="o"&gt;(*&lt;/span&gt; &lt;span class="nt"&gt;testvar&lt;/span&gt; &lt;span class="o"&gt;*)&lt;/span&gt;
&lt;span class="nt"&gt;MyRtcSim&lt;/span&gt;&lt;span class="err"&gt; &lt;/span&gt; &lt;span class="err"&gt; &lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="nt"&gt;RTC&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt; &lt;span class="o"&gt;(*&lt;/span&gt; &lt;span class="nt"&gt;instance&lt;/span&gt; &lt;span class="o"&gt;*)&lt;/span&gt;
&lt;span class="nt"&gt;END_VAR&lt;/span&gt;
&lt;span class="nt"&gt;MyRtcSim&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nt"&gt;EN&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="nt"&gt;TRUE&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="nt"&gt;PDT&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="nt"&gt;DT&lt;/span&gt;&lt;span class="p"&gt;#&lt;/span&gt;&lt;span class="nn"&gt;2010-01-15-07&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="nd"&gt;10&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
&lt;span class="nt"&gt;My_DT&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="nt"&gt;MyRtcSim&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;CDT&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;this should work&lt;/p&gt;
&lt;p&gt;greets Volker&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Getting crazy with SysRtcGetTime</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/d92d7707a0/?limit=25#879d" rel="alternate"/><published>2020-02-27T20:59:08.825000Z</published><updated>2020-02-27T20:59:08.825000Z</updated><author><name>GUERILLON</name><uri>https://forge.codesys.com/u/guerillon/</uri></author><id>https://forge.codesys.com7c649efabdeef579998ee755e5b757e5518eca66</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Thanks again for your answer but the idea is to have the current time and to see it change. Is there a simple solution in simulation mode or is there a solution to test without having the material (use my computer as a platform)&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Getting crazy with SysRtcGetTime</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/d92d7707a0/?limit=25#3ae3" rel="alternate"/><published>2020-02-27T20:59:04.828000Z</published><updated>2020-02-27T20:59:04.828000Z</updated><author><name>Nitrozin</name><uri>https://forge.codesys.com/u/nitrozin/</uri></author><id>https://forge.codesys.com62e5214800728b61c23311488bd27d28b9f8abe7</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;hi,&lt;/p&gt;
&lt;p&gt;it's really easy.&lt;/p&gt;
&lt;p&gt;first create a variable with DT format.&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="n"&gt;VAR&lt;/span&gt;
&lt;span class="n"&gt;MY_DT&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;DT&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;testvariable&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;END_VAR&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;use this variable instead of the GetSysRtc-output for testing the input of your FB. &lt;/p&gt;
&lt;p&gt;run your program and make a doubleclick on the variable you want to change (My_DT).&lt;/p&gt;
&lt;p&gt;you get a window for changing the value.&lt;/p&gt;
&lt;p&gt;greets Volker&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Getting crazy with SysRtcGetTime</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/d92d7707a0/?limit=25#48e5" rel="alternate"/><published>2020-02-27T20:59:03.420000Z</published><updated>2020-02-27T20:59:03.420000Z</updated><author><name>GUERILLON</name><uri>https://forge.codesys.com/u/guerillon/</uri></author><id>https://forge.codesys.com25eef52144c22b8adec639e87c28e9cfed19eb8a</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Thanks NITROZIN,&lt;/p&gt;
&lt;p&gt;The new question is How can I have the current date and time in simulation mode ? I need it to make the test of my FB.&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Getting crazy with SysRtcGetTime</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/d92d7707a0/?limit=25#a5b9" rel="alternate"/><published>2020-02-27T20:58:59.452000Z</published><updated>2020-02-27T20:58:59.452000Z</updated><author><name>Nitrozin</name><uri>https://forge.codesys.com/u/nitrozin/</uri></author><id>https://forge.codesys.comf4d71f008d4e7ce83160ef18755477c54e6ee857</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;the value is correct. what you see is the default value.&lt;/p&gt;
&lt;p&gt;the SysRtcGetTime function won't work in simulaton mode,&lt;/p&gt;
&lt;p&gt;because you have no access to the controllers realtime-clock.&lt;/p&gt;
&lt;p&gt;greets Volker&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Getting crazy with SysRtcGetTime</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/d92d7707a0/?limit=25#e9d0" rel="alternate"/><published>2020-02-27T20:58:58.021000Z</published><updated>2020-02-27T20:58:58.021000Z</updated><author><name>GUERILLON</name><uri>https://forge.codesys.com/u/guerillon/</uri></author><id>https://forge.codesys.com8669a8ea0bae2967bd65c9eeee4371eca5959a16</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hi all,&lt;/p&gt;
&lt;p&gt;I'm a new user of CoDeSys and I try it on my PC before to use it on "real" on a PMA system (KS128).'m in simulation mode.&lt;/p&gt;
&lt;p&gt;I'm trying to get the current date and time and it's not realy succesful&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="nt"&gt;dummy&lt;/span&gt;&lt;span class="o"&gt;:=&lt;/span&gt;&lt;span class="nt"&gt;FALSE&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="nt"&gt;test&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="nt"&gt;SysRtcGetTime&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nt"&gt;dummy&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;;&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;and I get for test the value &lt;strong&gt;DT#1970-01-01-00:00&lt;/strong&gt; in spy mode  &lt;/p&gt;
&lt;p&gt;Please help&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>