Modbus Host Object (FAh) Command Error

Hi,

I’m using the Anybus CompactCom starter kit
( STM3240G-EVAL board with a CompactCom M40 Module - Modbus TCP) to try
and communicate with a simulated modbus master on my laptop (using Mdbus by Calta).
I have enabled the modbus host object, with the following:


#define MOD_IA_ADI_INDEXING_BITS_ENABLE        TRUE 
#define MOD_IA_ADI_INDEXING_BITS_VALUE         0x00  
#define MOD_IA_MESSAGE_FORWARDING_ENABLE       TRUE
#define MOD_IA_MESSAGE_FORWARDING_VALUE        TRUE
#define MOD_IA_RW_OFFSET_ENABLE                FALSE
#define MOD_IA_RW_OFFSET_READ_VALUE            0x0000
#define MOD_IA_RW_OFFSET_WRITE_VALUE           0x0000

In the ABCC set up sequence, the attributes of the modbus are read
and match my settings.

In Mdbus, I set my IP to match the dev board. In this case ‘10.200.1.1’.

Once I enable the Mdbus master on my laptop, the ABCC receives a Process-modbus-message command:

Msg received:
[ MsgBuf:0x2000095c Size:0x0006 SrcId  :0x00 DestObj:0xfa
  Inst  :0x0000     Cmd :0x50   CmdExt0:0x00 CmdExt1:0x00 ]
[ 0x01 0x03 0x00 0x00 0x00 0x04 ]

The ABCC then replies with a ‘The target object does not support the specified command’ error:

Msg sent:
[ MsgBuf:0x2000095c Size:0x0001 SrcId  :0x00 DestObj:0xfa
  Inst  :0x0000     Cmd :0x90   CmdExt0:0x00 CmdExt1:0x00 ]
[ 0x05 ]

The connection fails after Mdbus does not receive a reply.

What could be going wrong?

Kind regards,

Daniel

To add to this, I’ve uncovered a case that I can’t seem to find an explanation for in the documentation
(I’ve been using the Software Design Guide and the Modbus Network Guide). Is there a document that I’ve missed?

In the case:

  #define MOD_IA_MESSAGE_FORWARDING_ENABLE        TRUE
   #define MOD_IA_MESSAGE_FORWARDING_VALUE         FALSE

and

   #define MOD_IA_MESSAGE_FORWARDING_ENABLE        FALSE 
   #define MOD_IA_MESSAGE_FORWARDING_VALUE         TRUE

and


   #define MOD_IA_MESSAGE_FORWARDING_ENABLE        FALSE 
   #define MOD_IA_MESSAGE_FORWARDING_VALUE         FALSE

The Modbus object does not seem to get used ( why is this? ) but
I can read ADI data (I’m using appl_adimap_simple16 as my ADI data to read).
For example, requesting the first Modbus register of ADI 1, I read the correct value back:

TX 01 03 10 10 00 01 
RX 01 03 02 00 01

(From the Mdbus monitor)

However, when writing to the ADI Modbus registers, the value of the ADI does not change despite what seems to be the correct Modbus command:

TX 01 06 10 10 00 01 
RX 01 06 10 10 00 01

In the case:

   #define MOD_IA_MESSAGE_FORWARDING_ENABLE        TRUE
   #define MOD_IA_MESSAGE_FORWARDING_VALUE         TRUE

No Modbus replies are received, but the incoming message reaches the Modbus object.
The ABCC seems to be interpreting the ‘Instance’ command ‘0x10’ as an ‘Object’ command,
returning the error code ‘0x05’ - unsupported command.

Mdbus monitor:

TX 01 03 10 10 00 01 
RX - NONE

ABCC debug terminal:


Mem: Buffer allocated: 0x20000844

Msg received:
[ MsgBuf:0x20000844 Size:0x0006 SrcId  :0x00 DestObj:0xfa
  Inst  :0x0000     Cmd :0x50   CmdExt0:0x00 CmdExt1:0x00 ]
[ 0x01 0x03 0x10 0x10 0x00 0x01 ]


Msg sent:
[ MsgBuf:0x20000844 Size:0x0001 SrcId  :0x00 DestObj:0xfa
  Inst  :0x0000     Cmd :0x90   CmdExt0:0x00 CmdExt1:0x00 ]
[ 0x05 ]

Mem: Buffer returned:  0x20000844

Do you have any insight into what is going wrong?
I can’t seem to find anything in the documentation that helps with either scenario

Hi @DAZU,

I would recommend creating a case at https://support.hms-networks.com for this issue as this message board is monitored by our Americas team and currently our ABCC support folks are out of the office. Creating a case will put you in touch with your local team in the EU.