Arduino Modbus

Hello Guys,

Thanks for your comments and you are right, i need to share more details in order you have more information to evaluate better the options.

So, the Kepware is the master and the arduino is the slave.
There is the code that i'm using to some tests:

#include <SPI.h>
#include <Ethernet.h>
#include "Mudbus.h"

//uncomment if you want to see debug info
//#define DEBUG

Mudbus Mb;
//Function codes 1(read coils), 3(read registers), 5(write coil), 6(write register)
//signed int Mb.R[0 to 125] and bool Mb.C[0 to 128] MB_N_R MB_N_C
char myString[] = "ABCDEFGHIJ";
void setup()
{
uint8_t mac[] = { 0x90, 0xA2, 0xDA, 0x00, 0x51, 0x06 };
uint8_t ip[] = { 192, 168, 1, 10 };
uint8_t gateway[] = { 192, 168, 1, 1 };
uint8_t subnet[] = { 255, 255, 255, 0 };
Ethernet.begin(mac, ip, gateway, subnet);
//Avoid pins 4,10,11,12,13 when using ethernet shield
}

void loop()
{
//modbus TCP update
Mb.Run();
Mb.R[0] = 0x42;
Mb.R[1] = 0x43;
Mb.R[2] = 0x44;
Mb.R[3] = 0x45;
Mb.R[4] = 0x46;
Mb.R[5] = 0x47;
Mb.R[6] = 0x48;
Mb.R[7] = 0x49;
Mb.R[8] = 0x50;
Mb.R[9] = 0x51;

Mb.R[25] = analogRead(1);
Mb.R[26] = analogRead(2);
delay(20);

}

The Link to the Kepware is: https://www.kepware.com/en-us/products/kepserverex/

My goal is share one string of 10 char like "ABCDEFGHIJ" with the Kepware.
As you are saying, if i use one register i can share one char, but nothing more... it works good if i share 1 int.

My test is to load in Hex one char in each register Mb.R[0...9] and then in the Kepware i say to read from 400001.10 (1 to 10) and i just read the first register... i already change many different ways on the Kepware and on the arduino and i didn't find one way to do this...

attached is one picture if it help...

If someone have new ideas or need need more information, i can provide it!

Thanks