<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to Fieldbus</title><link href="https://forge.codesys.com/forge/talk/Deutsch/thread/71ec7b207c/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/Deutsch/thread/71ec7b207c/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/Deutsch/thread/71ec7b207c/</id><updated>2020-02-28T01:19:23.065000Z</updated><subtitle>Recent posts to Fieldbus</subtitle><entry><title>Fieldbus</title><link href="https://forge.codesys.com/forge/talk/Deutsch/thread/71ec7b207c/?limit=25#78a4" rel="alternate"/><published>2020-02-28T01:19:23.065000Z</published><updated>2020-02-28T01:19:23.065000Z</updated><author><name>Moderator3S</name><uri>https://forge.codesys.com/u/moderator3s/</uri></author><id>https://forge.codesys.comd22fe05f7f19a09675ca63e16ad046dacc38638c</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;&lt;strong&gt;In a mixed application with Ethercat and Modbus masters, you see an influence on Modbus update to Ethercat task / sending frames- How could this be avoided? &lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;You need a proper seperation of the use of the modbus io's and ethercat io's according to the task which does the buscycle update:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Set Ethercat master in 'PLC Settings' as' Buscycle Task' - and Ethercat io's are only used in ethercat task context (in that case in PLC_PRG)&lt;/li&gt;
&lt;li&gt;specify on Modbus master the update task for Modbus - and Modbus io's are only used in Modbus task context ( in that case in ModbusPRG)&lt;/li&gt;
&lt;li&gt;Check if these rules are ok with 'task deployment' tap - Rule: Ethercat io's are only updated in the Ethercat task - Modbus io's are only updated on the Modbus task context - this you see with the red cross on each used io.&lt;br/&gt;
check online help for 'bus cycle'&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;a class="" href="http://forum.codesys.com/viewtopic.php?f=22&amp;amp;t=5640&amp;amp;x=10012&amp;amp;p=10010&amp;amp;lan=en" rel="nofollow"&gt;Back to FAQ overview&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;img alt="IMG: BuscycleTask.jpg" rel="nofollow" src="https://forum-de.codesys.com//download/file.php?id=564"/&gt;&lt;/p&gt;
&lt;p&gt;&lt;img alt="IMG: ModbusUpdateTask.jpg" rel="nofollow" src="https://forum-de.codesys.com//download/file.php?id=563"/&gt;&lt;/p&gt;
&lt;p&gt;&lt;img alt="IMG: Taskdeployment.jpg" rel="nofollow" src="https://forum-de.codesys.com//download/file.php?id=562"/&gt;&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Fieldbus</title><link href="https://forge.codesys.com/forge/talk/Deutsch/thread/71ec7b207c/?limit=25#bca6" rel="alternate"/><published>2020-02-28T01:19:18.081000Z</published><updated>2020-02-28T01:19:18.081000Z</updated><author><name>Moderator3S</name><uri>https://forge.codesys.com/u/moderator3s/</uri></author><id>https://forge.codesys.com42b5d16000d33cf21d2f82d52f0aaf573ee24fdc</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;&lt;strong&gt;Question:&lt;/strong&gt;&lt;br/&gt;
How to reset the Master in IEC:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Answer:&lt;/strong&gt;&lt;br/&gt;
    Do not use auto restart option and IEC code at the same time.&lt;br/&gt;
    Use a rising trigger to reset the Master with xReset.&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="err"&gt; &lt;/span&gt; &lt;span class="err"&gt;  &lt;/span&gt; &lt;span class="err"&gt; &lt;/span&gt;&lt;span class="n"&gt;Ethercat_Master&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;xRestart&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;xReset&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="err"&gt; &lt;/span&gt; &lt;span class="err"&gt;  &lt;/span&gt; &lt;span class="err"&gt; &lt;/span&gt;&lt;span class="n"&gt;Ethercat_Master&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;&lt;a class="" href="http://forum.codesys.com/viewtopic.php?f=22&amp;amp;t=5640&amp;amp;x=10012&amp;amp;p=10010&amp;amp;lan=en" rel="nofollow"&gt;Back to FAQ overview&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Fieldbus</title><link href="https://forge.codesys.com/forge/talk/Deutsch/thread/71ec7b207c/?limit=25#4858" rel="alternate"/><published>2020-02-28T01:19:15.981000Z</published><updated>2020-02-28T01:19:15.981000Z</updated><author><name>Moderator3S</name><uri>https://forge.codesys.com/u/moderator3s/</uri></author><id>https://forge.codesys.comb5342f0a348ae57f57c380c1a68fd87d9db80683</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;&lt;strong&gt;But we can’t locate the actual Boolean Trigger variable?&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;You can find the trigger var, if you change the Trigger to “Rising edge” :&lt;/p&gt;
&lt;p&gt;you can define any bool var and map the var like any other in/output within the IOMapping for this channel.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;What is the scope of the trigger boolean?&lt;/strong&gt; &lt;br/&gt;
Yes&lt;br/&gt;
&lt;strong&gt;Will it cause just one channel to be written?&lt;/strong&gt; &lt;br/&gt;
Yes&lt;/p&gt;
&lt;p&gt;&lt;a class="" href="http://forum.codesys.com/viewtopic.php?f=22&amp;amp;t=5640&amp;amp;x=10012&amp;amp;p=10010&amp;amp;lan=en" rel="nofollow"&gt;Back to FAQ overview&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;img alt="IMG: 1.png" rel="nofollow" src="https://forum-de.codesys.com//download/file.php?id=529"/&gt;&lt;/p&gt;
&lt;p&gt;&lt;img alt="IMG: 2.jpg" rel="nofollow" src="https://forum-de.codesys.com//download/file.php?id=528"/&gt;&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Fieldbus</title><link href="https://forge.codesys.com/forge/talk/Deutsch/thread/71ec7b207c/?limit=25#f9ed" rel="alternate"/><published>2020-02-28T01:19:10.807000Z</published><updated>2020-02-28T01:19:10.807000Z</updated><author><name>Moderator3S</name><uri>https://forge.codesys.com/u/moderator3s/</uri></author><id>https://forge.codesys.com350e18efd963916d3313619b712761e481e008fe</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;&lt;strong&gt;Question:&lt;/strong&gt;&lt;br/&gt;
    EtherCAT Error detection in IEC&lt;br/&gt;
&lt;strong&gt;Answer:&lt;/strong&gt; &lt;br/&gt;
        Master:&lt;br/&gt;
    Diagnostics Message can be read within the Master configuration tab.&lt;br/&gt;
    Same in EtherCAT_Master.m_sLastMesage&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="n"&gt;Slave&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;
&lt;span class="n"&gt;Slave&lt;/span&gt; &lt;span class="n"&gt;State&lt;/span&gt; &lt;span class="n"&gt;can&lt;/span&gt; &lt;span class="n"&gt;be&lt;/span&gt; &lt;span class="n"&gt;read&lt;/span&gt; &lt;span class="n"&gt;within&lt;/span&gt; &lt;span class="n"&gt;the&lt;/span&gt; &lt;span class="n"&gt;Slave&lt;/span&gt; &lt;span class="n"&gt;configuration&lt;/span&gt; &lt;span class="n"&gt;tab&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt; &lt;span class="n"&gt;Diagnostics&lt;/span&gt; &lt;span class="n"&gt;Current&lt;/span&gt; &lt;span class="n"&gt;State&lt;/span&gt;
&lt;span class="n"&gt;Same&lt;/span&gt; &lt;span class="k"&gt;with&lt;/span&gt;  &lt;span class="n"&gt;SlaveName&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;wState&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;call&lt;/span&gt; &lt;span class="n"&gt;of&lt;/span&gt; &lt;span class="n"&gt;the&lt;/span&gt; &lt;span class="n"&gt;slave&lt;/span&gt; &lt;span class="n"&gt;instance&lt;/span&gt; &lt;span class="k"&gt;is&lt;/span&gt; &lt;span class="n"&gt;required&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;Example&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;```&lt;/p&gt;
&lt;p&gt;EK1100(); // Name of the slave = "EK1100"&lt;br/&gt;
      EL1004();&lt;br/&gt;
      EL2008();&lt;br/&gt;
      IF NOT EK1100.wState = ETC_SLAVE_STATE.ETC_SLAVE_OPERATIONAL THEN&lt;br/&gt;
      // do something&lt;br/&gt;
      END_IF&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="o"&gt;**&lt;/span&gt;&lt;span class="n"&gt;Snippet&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="o"&gt;**&lt;/span&gt;&lt;span class="n"&gt;Snippet&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;


&lt;span class="n"&gt;A&lt;/span&gt; &lt;span class="n"&gt;very&lt;/span&gt; &lt;span class="n"&gt;good&lt;/span&gt; &lt;span class="n"&gt;example&lt;/span&gt; &lt;span class="k"&gt;is&lt;/span&gt; &lt;span class="n"&gt;the&lt;/span&gt; &lt;span class="n"&gt;ethercat&lt;/span&gt; &lt;span class="n"&gt;example&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="n"&gt;the&lt;/span&gt; &lt;span class="n"&gt;CODESYS&lt;/span&gt; &lt;span class="n"&gt;store&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;http&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="o"&gt;//&lt;/span&gt;&lt;span class="n"&gt;store&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;codesys&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;com&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;ethercat&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;example&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;html&lt;/span&gt;&lt;span class="o"&gt;#&lt;/span&gt;&lt;span class="n"&gt;Support&lt;/span&gt;&lt;span class="p"&gt;](&lt;/span&gt;&lt;span class="n"&gt;http&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="o"&gt;//&lt;/span&gt;&lt;span class="n"&gt;store&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;codesys&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;com&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;ethercat&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;example&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;html&lt;/span&gt;&lt;span class="o"&gt;#&lt;/span&gt;&lt;span class="n"&gt;Support&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;(&lt;em&gt; Get some information of the slaves and master. It is possible to go through all masters and slaves&lt;br/&gt;
   and get information about them. &lt;/em&gt;)&lt;br/&gt;
(&lt;em&gt; EtherCAT_Master is an instance of the IoDrvEtherCAT function block.&lt;/em&gt;)&lt;br/&gt;
(&lt;em&gt; The number of active slaves &lt;/em&gt;)&lt;br/&gt;
uiActiveSlaves := EtherCAT_Master.NumberActiveSlaves;&lt;br/&gt;
(&lt;em&gt; Get the ETCMaster &lt;/em&gt;)&lt;br/&gt;
pEtcMasterFB := EtherCAT_Master.Master;&lt;br/&gt;
(&lt;em&gt; The number of SDO's &lt;/em&gt;)&lt;br/&gt;
iSDOCnt := pEtcMasterFB^.GetNumberOfSDO;&lt;br/&gt;
(&lt;em&gt; Go through all Slaves &lt;/em&gt;)   &lt;br/&gt;
pSlave := Ethercat_Master.FirstSlave;&lt;br/&gt;
WHILE pSlave &amp;lt;&amp;gt; 0 DO &lt;br/&gt;
   (&lt;em&gt; get the address of the current slave. This can also be found under the  device in the "Slave" tab. &lt;/em&gt;)&lt;br/&gt;
   uiSlaveAddr := pSlave^.SlaveAddr;&lt;br/&gt;
&lt;br/&gt;
   pSlave^();&lt;br/&gt;
   (&lt;em&gt; Get the state of the slave &lt;/em&gt;)&lt;br/&gt;
   (&lt;em&gt; With pSlave^.SetOpMode(ETC_SLAVE_STATE), the state can be set.&lt;/em&gt;)&lt;br/&gt;
   IF pSlave^.wState = ETC_SLAVE_STATE.ETC_SLAVE_OPERATIONAL THEN &lt;br/&gt;
      ; &lt;br/&gt;
   END_IF &lt;br/&gt;
&lt;br/&gt;
   pSlave := pSlave^.NextInstance; &lt;br/&gt;
END_WHILE&lt;/p&gt;
&lt;p&gt;```&lt;/p&gt;
&lt;p&gt;&lt;a class="" href="http://forum.codesys.com/viewtopic.php?f=22&amp;amp;t=5640&amp;amp;x=10012&amp;amp;p=10010&amp;amp;lan=en" rel="nofollow"&gt;Back to FAQ overview&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Fieldbus</title><link href="https://forge.codesys.com/forge/talk/Deutsch/thread/71ec7b207c/?limit=25#6077" rel="alternate"/><published>2020-02-28T01:19:09.012000Z</published><updated>2020-02-28T01:19:09.012000Z</updated><author><name>Moderator3S</name><uri>https://forge.codesys.com/u/moderator3s/</uri></author><id>https://forge.codesys.com663648e54dfcb1a3a4b60879950ac88dbe49cbb1</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;&lt;strong&gt;EtherCat revocering from disconnection&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Question:&lt;/strong&gt;&lt;br/&gt;
Which steps are needed to recover from disconnected slaves&lt;/p&gt;
&lt;p&gt;&lt;strong&gt; Answer: &lt;/strong&gt;&lt;br/&gt;
         There are two use cases:&lt;br/&gt;
          1. IEC application  should care on restart / error handling&lt;br/&gt;
               xRestart on Master is needed&lt;br/&gt;
          2. restart of slaves is done automatically:   &lt;br/&gt;
    The EtherCAT Master provides an option to restart the fieldbus:&lt;br/&gt;
    Master Configuration, Master: Checkbox: Auto restart slaves&lt;br/&gt;
          3. Optional Slaves are possible (this is a tag 'Optional') in the slave config&lt;/p&gt;
&lt;p&gt;&lt;img alt="IMG: Ethercat_RestartSlaves.jpg" rel="nofollow" src="https://forum-de.codesys.com//download/file.php?id=558"/&gt;&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Fieldbus</title><link href="https://forge.codesys.com/forge/talk/Deutsch/thread/71ec7b207c/?limit=25#45ed" rel="alternate"/><published>2020-02-28T01:19:03.958000Z</published><updated>2020-02-28T01:19:03.958000Z</updated><author><name>Moderator3S</name><uri>https://forge.codesys.com/u/moderator3s/</uri></author><id>https://forge.codesys.com5d83d551e1b56ad53985008103526f97d22e0824</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;&lt;strong&gt;Fieldbus related: &lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;a class="" href="http://forum.codesys.com/viewtopic.php?f=22&amp;amp;t=5640&amp;amp;x=10011&amp;amp;p=10011&amp;amp;lan=en" rel="nofollow"&gt;EtherCat recovering from disconnection&lt;/a&gt;&lt;br/&gt;
&lt;a class="" href="http://forum.codesys.com/viewtopic.php?f=22&amp;amp;t=5640&amp;amp;x=10014&amp;amp;p=10014&amp;amp;lan=en" rel="nofollow"&gt;EtherCat, How to reset the Master in IEC?&lt;/a&gt;&lt;br/&gt;
&lt;a class="" href="http://forum.codesys.com/viewtopic.php?f=22&amp;amp;t=5640&amp;amp;x=10012&amp;amp;p=10012&amp;amp;lan=en" rel="nofollow"&gt;EtherCat, Error detection in IEC&lt;/a&gt;&lt;br/&gt;
&lt;a class="" href="http://forum.codesys.com/viewtopic.php?f=22&amp;amp;t=5640&amp;amp;x=10084&amp;amp;p=10084&amp;amp;lan=en" rel="nofollow"&gt;EtherCat project contains additional Modbus TCP Master: update of Ethercat frames seems to be influenced by modbus update - how could this be avoided?&lt;/a&gt;&lt;br/&gt;
&lt;a class="" href="http://forum.codesys.com/viewtopic.php?f=22&amp;amp;t=5640&amp;amp;x=10013&amp;amp;p=10013&amp;amp;lan=en" rel="nofollow"&gt;Modbus, Trigger variable&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>