i cannot modbus poll with enc28j60 ethernet module

hi guys. i have a question. i tried communicate to modbus with enc28j60 module but o can’t do it. i use the ModbusIP_ENC28J60.h library and simple examples. but i didn’t connect to modbus? please help.
#include <EtherCard.h>
#include <Modbus.h>
#include <ModbusIP_ENC28J60.h>
#include <Servo.h>

// Modbus Registers Offsets (0-9999)
const int SERVO_HREG = 100;
// Used Pins
const int servoPin = 9;

// ModbusIP object
ModbusIP mb;
// Servo object
Servo servo;

void setup() {
// The media access control (ethernet hardware) address for the shield
byte mac = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
// The IP address for the shield
byte ip = { 192, 168, 1, 120 };
// Config Modbus IP
mb.config(mac, ip);
// Attaches the servo pin to the servo object
servo.attach(servoPin);
// Add SERVO_HREG register - Use addHreg() for analog outpus or to store values in device
mb.addHreg(SERVO_HREG, 127);
}

void loop() {
//Call once inside loop() - all magic here
mb.task();

//Attach switchPin to SWITCH_ISTS register
servo.write(mb.Hreg(SERVO_HREG));
delay(15);
}

but i didn't connect to modbus?

What does that mean? You implemented a ModBus server, so the client has to connect to the server and not the other way around.

BTW: you forgot to use code tags! Always use code tags to post code!

I get the impression that you are making errors in the project architecture so it's time to go back and start at the basics. What are you trying to achieve? As it seems related to communication, what are your communication partners? Links to manuals?

i just communicate to modbus over tcp/ip protocol with enc28j60 ethernet module. what are you mean "what are your communication partners? " ???

What device is on the opposite end of the Modbus/network? As you’ve implemented a ModBus server there must be some kind of device that implements a ModBus client to connect to the server you implemented.

You cannot communicate to ModBus you can only communicate using the ModBus protocol.

i use arduino nano with nano ethernet shield v1.0. nano ethernet shield has enc28j60. so it's different wiznet 5100 but i find library and connect network and webserver but if i tried communicate with modbus protocol it connect to program (modbus poll) read once then give read error issue. it's not to much code and i get it but i did not how to figure read error issue. please help . thank you all.

hii guys i have one question.i searched that issue and i found that "library send one packet that is the reason modbus poll read once then connection lost" .how can i send multi packets to enc28j60. i use ModbusIP_ENC28J60.h library. or am i wrong ? please help. thank you all.

it's not to much code and i get it but i did not how to figure read error issue. please help .

Don't you think we need to know what error exactly you get?

i use arduino nano with nano ethernet shield v1.0. nano ethernet shield has enc28j60.

So we know one side of the communication. What's on the other side? Another Nano with Ethernet shield V1.0? In this case post the code of that Nano (and use code tags!, You should know in the meantime how to use them). Otherwise post a link to the device you connect or the software you use on the PC or whatever else you're using.

searched that issue and i found that "library send one packet that is the reason modbus poll read once then connection lost"

So you read that but you're unable to post a link to it? It's much easier to understand and check that "problem" if we know a little more detail about it.

In general: Post all information you have about the issue. We are not clairvoyant (at least most of us). It's not nice to let us ask for every tiny bit information.