<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to Modbus Master read/write over Ethernet UDP/TCP libraries</title><link href="https://forge.codesys.com/forge/talk/CODESYS-V2/thread/3c728b7455/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/CODESYS-V2/thread/3c728b7455/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/CODESYS-V2/thread/3c728b7455/</id><updated>2020-02-27T21:43:41.968000Z</updated><subtitle>Recent posts to Modbus Master read/write over Ethernet UDP/TCP libraries</subtitle><entry><title>Modbus Master read/write over Ethernet UDP/TCP libraries</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/3c728b7455/?limit=25#3a2c" rel="alternate"/><published>2020-02-27T21:43:41.968000Z</published><updated>2020-02-27T21:43:41.968000Z</updated><author><name>nathangreco</name><uri>https://forge.codesys.com/u/nathangreco/</uri></author><id>https://forge.codesys.com20bc62be2091796cd4162f1ead8a021bddfbecbc</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Update for those interested:&lt;/p&gt;
&lt;p&gt;&lt;a class="" href="http://www.oscat.de/community/index.php?topic=1827.0" rel="nofollow"&gt;http://www.oscat.de/community/index.php?topic=1827.0&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I was never successful with the ETHERNET_MODBUSMASTER_TCP function, which I'm not sure I understand why.  No matter what the result was error 150, "server not available".  Additionally, I was only only successful with one device.  Another device I have (Cognex Dataman 60SX 2D barcode scanner) would only timeout.  I'm still a bit stuck on this one and am going to post another thread on that topic, as with this device I have other options.  I suspect maybe it doesn't support MODBUS UDP and for whatever reason the Modbus TCP function block doesn't work.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Modbus Master read/write over Ethernet UDP/TCP libraries</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/3c728b7455/?limit=25#7e45" rel="alternate"/><published>2020-02-27T21:43:40.493000Z</published><updated>2020-02-27T21:43:40.493000Z</updated><author><name>nathangreco</name><uri>https://forge.codesys.com/u/nathangreco/</uri></author><id>https://forge.codesys.comac2fc58351b569392f5a2884c1d0099f514c33b5</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Actually, is there any way functions that can simply ping from the SysSocket libraries?  It would be good to confirm network access first.&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Modbus Master read/write over Ethernet UDP/TCP libraries</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/3c728b7455/?limit=25#0147" rel="alternate"/><published>2020-02-27T21:43:36.328000Z</published><updated>2020-02-27T21:43:36.328000Z</updated><author><name>nathangreco</name><uri>https://forge.codesys.com/u/nathangreco/</uri></author><id>https://forge.codesys.com225ebabeb8ca3a20dec8be804fe21b234775a08e</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hey Guys,&lt;/p&gt;
&lt;p&gt;Finally got my hands on a Win 7 / 32-bit system to actually make some tests with a project loaded into CoDeSyS RTE v2.3.  I haven't tried the Oscat libraries yet, but I've been messing around with the "WAGOLibModbus_IP_01.lib" libraries and it seems as if there's no network access at all to my Modbus device.  The Ethernet_Modbusmaster_UDP Function block gives me an error code "153", which is a timeout error, and Ethernet_Modbus_TCP gives me an error code "150", which is Server not available.&lt;/p&gt;
&lt;p&gt;Is there anything I have to do with the CoDeSyS RTE configuration to give the PLC service access through Windows to my LAN?  I recall during installation there was a firewall permission granted for something, (OPC, maybe?), possibly another port needs reserved for the PLC?  From within windows I can definitely ping the device.&lt;/p&gt;
&lt;p&gt;If the RTE PLC has access to my LAN by default (is there an easy way to check this?) then I'll try some of the other modbus libraries.&lt;/p&gt;
&lt;p&gt;Thanks guys.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Modbus Master read/write over Ethernet UDP/TCP libraries</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/3c728b7455/?limit=25#1992" rel="alternate"/><published>2020-02-27T21:43:34.854000Z</published><updated>2020-02-27T21:43:34.854000Z</updated><author><name>nathangreco</name><uri>https://forge.codesys.com/u/nathangreco/</uri></author><id>https://forge.codesys.com4464553f468487f81bdf208cc785edbbbf93fded</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hello jzhvymetal,&lt;/p&gt;
&lt;p&gt;I have found my compile issues were due to my version of CoDeSys being very old, although I still haven't successfully tested the library yet.  Now I have 3 options, I think one will work   Thanks for the help!  I will provide feedback once I've got a device available to make some tests.&lt;/p&gt;
&lt;p&gt;-Nate&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Modbus Master read/write over Ethernet UDP/TCP libraries</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/3c728b7455/?limit=25#ca98" rel="alternate"/><published>2020-02-27T21:43:33.373000Z</published><updated>2020-02-27T21:43:33.373000Z</updated><author><name>jzhvymetal</name><uri>https://forge.codesys.com/u/jzhvymetal/</uri></author><id>https://forge.codesys.combb518f5dde4a6d460de4f3de9a5b637a190a9e67</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;This can be done with OsCat Libraries.  You will need both the basic and network.&lt;/p&gt;
&lt;p&gt;&lt;a class="" href="http://www.oscat.de/index.php?option=com_jdownloads" rel="nofollow"&gt;http://www.oscat.de/index.php?option=com_jdownloads&lt;/a&gt; m &lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Modbus Master read/write over Ethernet UDP/TCP libraries</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/3c728b7455/?limit=25#5f84" rel="alternate"/><published>2020-02-27T21:43:29.201000Z</published><updated>2020-02-27T21:43:29.201000Z</updated><author><name>nathangreco</name><uri>https://forge.codesys.com/u/nathangreco/</uri></author><id>https://forge.codesys.com1f024b5042cb0039b9b0539c592f4c00be5308bf</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hello Everyone,&lt;/p&gt;
&lt;p&gt;I have need to read/write coils to a Modbus slave device from a CoDeSys PLC.  I am testing it on my PC with CoDeSys RTE, but haven't gotten as far as getting a program to compile .  I thought this should be a fairly common task with an obvious solution, but it seems this isn't the case or I'm a little slow this week...&lt;/p&gt;
&lt;p&gt;It seems there's a few different options, two of which seem to come from WAGO libraries.  I have found this youtube video:&lt;/p&gt;
&lt;p&gt;&lt;a class="" href="https://www.youtube.com/watch?v=mCI19PJ2A5I" rel="nofollow"&gt;https://www.youtube.com/watch?v=mCI19PJ2A5I&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;But as you can see in my comments, I had to track down 2 dependent libraries (only 1 was indicated in the documentation).  I used the following Libraries:&lt;br/&gt;
ModbusEthernet_04.lib &amp;lt;- Contains the ETHERNET_MODBUSMASTER_UDP function block used in the demo&lt;br/&gt;
Ethernet.lib &amp;lt;- Indicated as a dependent library&lt;br/&gt;
Mod_com.lib &amp;lt;- Library I found also dependent, as it declares the 'CRC16' data type used in one of the above libraries&lt;/p&gt;
&lt;p&gt;As you can see by my comment, I could not compile the program without receiving the compile error  #3821, "ETH_is16Bit (7): At least one input required for functions".&lt;/p&gt;
&lt;p&gt;Next option is a WAGOLibModbus_IP_01.lib, which in the comment is suggested in this video (its the same video by the original poster),&lt;/p&gt;
&lt;p&gt;&lt;a class="" href="https://www.youtube.com/watch?v=l4xkaKFTZB0" rel="nofollow"&gt;https://www.youtube.com/watch?v=l4xkaKFTZB0&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Which appears the exact same, but when I try to compile this program (it is correct, SysLibSocket.lib is the only dependent library), I get the error #3820, ModbusRequest(36): 'VAR_OUTPUT' and 'VAR_IN_OUT' not allowed in functions.&lt;/p&gt;
&lt;p&gt;This seems to be basic error of the library.&lt;/p&gt;
&lt;p&gt;Additionally, I have searched this forum and found some threads regarding this topic, but most seem related to setting up a modbus device as an actual IO module in the PLC configuration, but I just want to send a request.  Also, it seems some are clever enough to write their own functions and use only the SysLibSocket.lib, but I am not yet that clever.  Anybody out there have a solution that's in use, robust, and clean?  Or know what I'm doing wrong here?  Thanks.&lt;/p&gt;
&lt;p&gt;Also, my CoDeSys version is 2.3.01.&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>