Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Last revision Both sides next revision
modbus [2011/11/07 16:39]
jap
modbus [2011/11/07 16:40]
jap
Line 41: Line 41:
 Source code of mbtest.c: Source code of mbtest.c:
  
-<code>+<file>
 #include <​stdio.h>​ #include <​stdio.h>​
 #include <​modbus.h>​ #include <​modbus.h>​
Line 78: Line 78:
     return -1;     return -1;
   }   }
-  /* +
-  if ( modbus_rtu_set_serial_mode(ctx,​ MODBUS_RTU_RS485) ) +
-    { +
-      fprintf(stderr,​ +
-       "​Failed to set modbus mode\n"​);​ +
-      errno = -1; +
-      //      goto fail; +
-    } +
-  */+
   if ( modbus_set_slave(ctx,​ MB_SLAVE_ADDRESS) )   if ( modbus_set_slave(ctx,​ MB_SLAVE_ADDRESS) )
     {     {
Line 127: Line 119:
   return errno;   return errno;
 } }
-</code>+</file>
  
modbus.txt · Last modified: 2011/11/07 16:41 by jap
Recent changes RSS feed CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki