<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to i2c devices with codesys pi</title><link href="https://forge.codesys.com/forge/talk/Runtime/thread/b464d5b6f8/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/Runtime/thread/b464d5b6f8/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/Runtime/thread/b464d5b6f8/</id><updated>2020-02-27T17:23:53.748000Z</updated><subtitle>Recent posts to i2c devices with codesys pi</subtitle><entry><title>i2c devices with codesys pi</title><link href="https://forge.codesys.com/forge/talk/Runtime/thread/b464d5b6f8/?limit=25#b14f" rel="alternate"/><published>2020-02-27T17:23:53.748000Z</published><updated>2020-02-27T17:23:53.748000Z</updated><author><name>Ledrunner</name><uri>https://forge.codesys.com/u/ledrunner/</uri></author><id>https://forge.codesys.comc03479e22b1314c7ff4f8de342f052ac42270e8e</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Thank you Edwin I understand clock conception. I configured RTC under Linux, deleted fake software clock and  used DTUtility in Codesys to make calendar in web visualization. I used two MOS transistor for i2c bus matching levels 5v-3,3V.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>i2c devices with codesys pi</title><link href="https://forge.codesys.com/forge/talk/Runtime/thread/b464d5b6f8/?limit=25#d4c4" rel="alternate"/><published>2020-02-27T17:23:52.710000Z</published><updated>2020-02-27T17:23:52.710000Z</updated><author><name>eschwellinger</name><uri>https://forge.codesys.com/u/eschwellinger/</uri></author><id>https://forge.codesys.coma8690ea965c98d6c3cf083d279421cc975429548</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hi Osman,&lt;/p&gt;
&lt;p&gt;In general:&lt;br/&gt;
-HW Clock is only needed if you are not in an network, otherwise the pi synchronize the time by ntp protocoll (nothing to do for it - this is Default configuration i guess)&lt;br/&gt;
-if you have a mobile application without a network connection , hardware clock would be great to set the time on startup of the pi&lt;br/&gt;
-&amp;gt; to synchronize the clock once at startup (maybe you could add this to a Linux startscript - or in the startscript where the plc starts)&lt;br/&gt;
Nothing else is needed.&lt;br/&gt;
In CODESYS you use the time functions to have the Information in IEC, but this is independet from your hw clock and from my Point of view it&lt;br/&gt;
is not really needed to give the synchronize hw clock with Pi clock from IEC - if you do this on Startup of the Pi this would never be needed.&lt;/p&gt;
&lt;p&gt;Even timezone setting or automatic changeover between summertime and wintertime is everthing covered for example if you use the OSCAT library from store. (beside the functionblocks which are in SystimeRTC library)&lt;/p&gt;
&lt;p&gt;so for the your rtc you need:&lt;br/&gt;
1. load the kernelmodule rtc-ds1307&lt;br/&gt;
2. check the hwclock by echo ds1307 0x68 &amp;gt; /sys/class/i2c-adapter/i2c-1/new_device&lt;br/&gt;
3. hwclock -r&lt;br/&gt;
4. this is what you need to add either in /etc/rc.local or before the runtime starts&lt;br/&gt;
echo ds1307 0x68 &amp;gt; /sys/class/i2c-adapter/i2c-1/new_device&lt;br/&gt;
sudo hwclock -s&lt;/p&gt;
&lt;p&gt;BR&lt;br/&gt;
Edwin&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>i2c devices with codesys pi</title><link href="https://forge.codesys.com/forge/talk/Runtime/thread/b464d5b6f8/?limit=25#31e7" rel="alternate"/><published>2020-02-27T17:23:49.916000Z</published><updated>2020-02-27T17:23:49.916000Z</updated><author><name>Ledrunner</name><uri>https://forge.codesys.com/u/ledrunner/</uri></author><id>https://forge.codesys.com55c445dc52d49ce867aab0c54443db151cd8733e</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hello Edwin. I little didn't understand, I need the hardware real time clock. If I do all in Linux, Can I use this RTC which i set in Linux through the Codesys? Will it be possible to synchronize the time and get the time and data in Codesys project?&lt;/p&gt;
&lt;p&gt;BR,&lt;br/&gt;
Osman.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>i2c devices with codesys pi</title><link href="https://forge.codesys.com/forge/talk/Runtime/thread/b464d5b6f8/?limit=25#80b6" rel="alternate"/><published>2020-02-27T17:23:48.648000Z</published><updated>2020-02-27T17:23:48.648000Z</updated><author><name>eschwellinger</name><uri>https://forge.codesys.com/u/eschwellinger/</uri></author><id>https://forge.codesys.com6335794c53f0e489b526dda2d19e37ea6676fa6c</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hi Ledrunner,&lt;/p&gt;
&lt;p&gt;for me this link sounds that you could use it but this is more a Linux issue beside CODESYS.&lt;br/&gt;
Guess you Need nothing special in CODESYS using some Linux commands will manage this with loading a kernel modul etc&lt;/p&gt;
&lt;p&gt;&lt;a class="" href="http://www.forum-raspberrypi.de/Thread-tutorial-realtime-clock-rtc-ds1307-am-raspberry-pi-betreiben" rel="nofollow"&gt;http://www.forum-raspberrypi.de/Thread- ... -betreiben&lt;/a&gt;&lt;br/&gt;
Maybe you find a better description in englisch but for me this seems to work with that.&lt;/p&gt;
&lt;p&gt;BR&lt;br/&gt;
Edwin&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>i2c devices with codesys pi</title><link href="https://forge.codesys.com/forge/talk/Runtime/thread/b464d5b6f8/?limit=25#9fac" rel="alternate"/><published>2020-02-27T17:23:47.635000Z</published><updated>2020-02-27T17:23:47.635000Z</updated><author><name>Ledrunner</name><uri>https://forge.codesys.com/u/ledrunner/</uri></author><id>https://forge.codesys.comcf21a65bacdcc279ec08169528d4b174af11f311</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hello, can anyone help me? I changed the XML file using Raspi codesys instructions. More likely I need to rewrite data processing method in bus for DS1307?&lt;/p&gt;
&lt;p&gt;&lt;a class="" href="https://forum.codesys.com//download/file.php?id=1189" rel="nofollow"&gt;DS1307.xml &lt;span&gt;&lt;span&gt;[2.47 KiB]&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>i2c devices with codesys pi</title><link href="https://forge.codesys.com/forge/talk/Runtime/thread/b464d5b6f8/?limit=25#81f2" rel="alternate"/><published>2020-02-27T17:23:44.862000Z</published><updated>2020-02-27T17:23:44.862000Z</updated><author><name>Ledrunner</name><uri>https://forge.codesys.com/u/ledrunner/</uri></author><id>https://forge.codesys.coma141bd5bcd69c76cccf6a21da32c52cff5bd2efc</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Someone have a DS1307 I2C library and example?&lt;/p&gt;
&lt;p&gt;Best Regards.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>i2c devices with codesys pi</title><link href="https://forge.codesys.com/forge/talk/Runtime/thread/b464d5b6f8/?limit=25#36ee" rel="alternate"/><published>2020-02-27T17:23:43.863000Z</published><updated>2020-02-27T17:23:43.863000Z</updated><author><name>Ledrunner</name><uri>https://forge.codesys.com/u/ledrunner/</uri></author><id>https://forge.codesys.comdba12e2997a8134f8184da265cae6357a7030313</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hello everyone! Can I connect to the raspberry DS1307 real-time clock?&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>i2c devices with codesys pi</title><link href="https://forge.codesys.com/forge/talk/Runtime/thread/b464d5b6f8/?limit=25#7965" rel="alternate"/><published>2020-02-27T17:23:41.059000Z</published><updated>2020-02-27T17:23:41.059000Z</updated><author><name>Hodgy1993</name><uri>https://forge.codesys.com/u/hodgy1993/</uri></author><id>https://forge.codesys.com1da4536c5986c8dded90e815f777b365ed412bd7</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hi Edwin,&lt;/p&gt;
&lt;p&gt;For my project I'm using multiple Adafruit INA219 Current Sensors.&lt;br/&gt;
Do I have to install separate drivers or will the application detect their presence?&lt;/p&gt;
&lt;p&gt;Cheers,&lt;br/&gt;
Sean.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>i2c devices with codesys pi</title><link href="https://forge.codesys.com/forge/talk/Runtime/thread/b464d5b6f8/?limit=25#5b15" rel="alternate"/><published>2020-02-27T17:23:39.812000Z</published><updated>2020-02-27T17:23:39.812000Z</updated><author><name>eschwellinger</name><uri>https://forge.codesys.com/u/eschwellinger/</uri></author><id>https://forge.codesys.come3ea8dd3f865f5ecf4dea07f244b58835844a943</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hi,&lt;br/&gt;
if anyone want to use I2C devices please add in &lt;br/&gt;
/etc/modules&lt;/p&gt;
&lt;p&gt;i2c-dev&lt;/p&gt;
&lt;p&gt;then this should work.&lt;br/&gt;
Will be added to the next release.&lt;/p&gt;
&lt;p&gt;cu&lt;br/&gt;
E.Schwellinger&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>