Hi,
Yes, the conversions from ASCII and HEX are as you are saying.
There is the code:
#include <SPI.h>
#include <Ethernet.h>
#include "Mudbus.h"//uncomment if you want to see debug info
//#define DEBUGMudbus 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] = 0x41;
Mb.R[1] = 0x42;
Mb.R[2] = 0x43;
Mb.R[3] = 0x44;
Mb.R[4] = 0x45;
Mb.R[5] = 0x46;
Mb.R[6] = 0x47;
Mb.R[7] = 0x48;
Mb.R[8] = 0x49;
Mb.R[9] = 0x50;Mb.R[25] = analogRead(1);
Mb.R[26] = analogRead(2);
delay(20);}
I think that the problem could be with the Kepware too... Because the Kepware can't be read all registers as i'm thinking...
Maybe i'm doing something wrong and declaring one char in each register, and i'm creating the tag on Kepware as HR 400001.20L and thinking that Kepware will read from 400001 to 400020 on the low byte (first byte of the resgister) and it is just read the Register 400001.(1...20) and in fact it is just the register 400001 from 1 to 20 bytes and they are empty because in fact it have jus two bytes, the rest should stay empty.
Maybe it could work if i found one way to create one register with more them 2 bytes.... i'ts impossible i think...
the other solution could be find other way to create one tag on the Kepware that can really allow to ready the array from the 400001 to 400010 and allow concatenate all in one array....
i'm trying but without success....
