Modbus data 32 bit
I am communicating AC500 PLC with Gas flow meter. While checking on modbus tester I found following response.
Query: [01][03][07][D0][00][01][84][87]
Response: [01][03][04][3F][73][74][BC][21][4D]
It means Slave is sending data as 2 words (4 Bytes) with request of 1 (2 Bytes) as a default. When I make request of 2 words, I am getting back data of 4 words.
While testing on AC500, I am getting following error
8215: Invalid length COM_MOD_MAST: Invalid data length received
Is there any method to eliminate above error?
I have tried defining one word as a request and DINT address at DATA at modbus block. Still it is not working out.
Answers
Hi,
here is my working example for read of 2 consequence words.
You have to use ADR block at DATA input and variable of type DWORD (DINT will not work) at ADR block !
May be have to try with FCT=3 or 4:

FCT_READ: BYTE := 3;
START_ADDRESS_ANSW: WORD := 1001;
NUMBER_REG_READ: WORD := 2;
VF1_FREQ_W:DWORD;
here is my working example for read of 2 consequence words.
You have to use ADR block at DATA input and variable of type DWORD (DINT will not work) at ADR block !
May be have to try with FCT=3 or 4:
FCT_READ: BYTE := 3;
START_ADDRESS_ANSW: WORD := 1001;
NUMBER_REG_READ: WORD := 2;
VF1_FREQ_W:DWORD;
Add new comment