Modbus TCP with W5100

Hi, I need help with my modbus program, I use W5100 and a arduino uno for this setup.
I'm unable to get reading in the modbus doctor to read the 0 from my arduino.
The following is my code.

#include <ModbusIP.h>
#include <Modbus.h>
#include <Ethernet.h>
#include <SPI.h>

//IPAddress ip(192, 168, 250, 177);
//EthernetServer ethServer(502);
//ModbusTCPServer modbusTCPServer;
 const int SERVO_HREG_HR = 0;
 ModbusIP mb;

void setup() {
 byte mac[] = {0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED};
 byte ip[] = { 192, 168, 250, 177 }; 
 mb.config(mac, ip);


void loop() {
  SERVO_HREG = 123;

@j133n, your topic has been moved to a more suitable location on the forum. Installation and Troubleshooting is not for problems with your project :wink: See About the Installation & Troubleshooting category.

Can you please edit your opening post, select all code and click the </> button to apply code tags and next save your post. It makes it easier to read, easier to copy and prevents the forum software from incorrect interpretation of the code (e.g. [] instead of []).

Also, please spend a bit of time (again?) reading How to get the best out of this forum.

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.