I am trying to implement Compact M40 Modbus TCP support in our hardware using the sample code from appl_adimap_separate16.c as the base. Our modbus input registers and holding registers are simply declared as:
UINT16 iReg[65536];
UINT16 hReg[65536];
covering the maximum number of addressable registers by the Modbus protocol.
In appl_adimap_separate16.c, I changed the definition of APPL_asAdiEntryList to:
AD_AdiEntryType APPL_asAdiEntryList[] =
{
{ 10, “ABP_UINT16_SET”, ABP_UINT16, 32, APPL_READ_MAP_WRITE_ACCESS_DESC, { { hReg,NULL } }, NULL, SetAdi10Value },
{ 11, “ABP_UINT16_GET”, ABP_UINT16, 32, APPL_WRITE_MAP_READ_ACCESS_DESC, { { iReg,NULL } }, NULL, NULL },
};
The code works for the 32 registers declared in the list. Unfortunately, the bNumOfElements data type is UINT8, supporting only 255 registers.
How can I extend the code to support the full range of the Modbus TCP registers