<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
  <channel>
    <title>'compilation problem for modbus tcp/ip' Thread RSS Feed</title>
    <link>http://www.programmersheaven.com/</link>
    <description>Contains the latest posts from the thread 'compilation problem for modbus tcp/ip' posted on the 'C/C++ on Linux/Unix' forum at Programmer's Heaven.</description>
    <language>en</language>
    <copyright>Copyright 2013 Programmers Heaven</copyright>
    <pubDate>Sat, 18 May 2013 19:08:30 -0700</pubDate>
    <lastBuildDate>Sat, 18 May 2013 19:08:30 -0700</lastBuildDate>
    <generator>Argotic Syndication Framework 2007.3.0.1, http://www.codeplex.com/Argotic</generator>
    <docs>http://www.rssboard.org/rss-specification</docs>
    <ttl>360</ttl>
    <image>
      <url>http://www.programmersheaven.com/images/ph.gif</url>
      <title>Programmers Heaven</title>
      <link>http://www.programmersheaven.com/</link>
      <width>88</width>
      <height>31</height>
    </image>
    <item>
      <title>compilation problem for modbus tcp/ip</title>
      <link>http://www.programmersheaven.com/mb/ConLunix/430968/430968/compilation-problem-for-modbus-tcpip/</link>
      <description>hi guys......;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
i written c program for modbus tcpàip for reading and writing registers ubuntu. there is a compilation problem. please help. it showing no input files i included the library files of modbus . even then there is error. see the code below.&lt;br /&gt;
&lt;br /&gt;
	&lt;br /&gt;
#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
#include &amp;lt;unistd.h&amp;gt;&lt;br /&gt;
#include &amp;lt;string.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
#include &amp;lt;errno.h&amp;gt;&lt;br /&gt;
#include &amp;lt;modbus.h&amp;gt;&lt;br /&gt;
/* compiling : gcc master-program.c -o master-program.c -lmodbus */&lt;br /&gt;
main ()&lt;br /&gt;
modbus_t=modbus_connect;	&lt;br /&gt;
stuct timeval old respose_timeout;&lt;br /&gt;
stuct timeval response_time out;&lt;br /&gt;
modbus*ctx;&lt;br /&gt;
set_slave;&lt;br /&gt;
rc;&lt;br /&gt;
wr;&lt;br /&gt;
int i;&lt;br /&gt;
uint16_t*tab_reg;&lt;br /&gt;
const uint16_t*ut_reg&lt;br /&gt;
modbus_error_recoverymode* error recovery_link&lt;br /&gt;
modbus_connect("128.2.2.1",302);&lt;br /&gt;
void modbus_set_socket("128.2.2.1",302);&lt;br /&gt;
server_socket=modbus_tcp_listen(ctx;nb_connection)
;&lt;br /&gt;
int modbus_set_slave(ctx,0*FF);&lt;br /&gt;
modbus_set_response_timeout(ctx,timeout);&lt;br /&gt;
/* Save original timeout */&lt;br /&gt;
modbus_get_response_timeout(ctx, &amp;amp;old_response_timeout);&lt;br /&gt;
&lt;br /&gt;
/* Define a new and too short timeout! */&lt;br /&gt;
response_timeout.tv_sec = 0;&lt;br /&gt;
response_timeout.tv_usec = 0;&lt;br /&gt;
modbus_set_error_recovery(ctx,modbus_error_recover
_link);&lt;br /&gt;
if (rc!== -1) {&lt;br /&gt;
printf("sterror recovery_failed%s/n"modbus_set_error recovery)(error);&lt;br /&gt;
rc_waiting for reply=0;&lt;br /&gt;
  }&lt;br /&gt;
modbus_read_registers(ctx,ut_reg_adress,ut_reg_nb,
tab_reg);&lt;br /&gt;
rc=ut_reg_nb;&lt;br /&gt;
if(rc=-1) {&lt;br /&gt;
fprintf(stderr,"%s/n");&lt;br /&gt;
modbus_sterror(errno);&lt;br /&gt;
return -1&lt;br /&gt;
  }&lt;br /&gt;
for(i=0 i&amp;lt;rc;i++) {&lt;br /&gt;
printf("reg[%d]=%d (0x%X)\n", i, tab_reg[i], tab_reg[i]);&lt;br /&gt;
    }&lt;br /&gt;
 modbus_write_registers(ctx,ut_reg_adress,ut_reg_nb
,ut_reg);&lt;br /&gt;
 wr=modbus_write_registers;&lt;br /&gt;
    if (wr=1) {&lt;br /&gt;
printf("modebus_write succesful%s/n");&lt;br /&gt;
("src[%d]=%d (0x%X)\n");&lt;br /&gt;
    }&lt;br /&gt;
 void modbus_close(ctx);&lt;br /&gt;
 &lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/ConLunix/430968/430968/compilation-problem-for-modbus-tcpip/</guid>
      <pubDate>Fri, 18 Jan 2013 01:58:54 -0700</pubDate>
      <category>C/C++ on Linux/Unix</category>
    </item>
  </channel>
</rss>