I am trying read modbus 3xxxx registers via 04 function.
But response data are incorrect
Code: Select all
%MW10 := 16#0004; (* corresponds to the read function of n input words (byte 0 = 16#04, byte 1 = 16#00) *)
%MW11 := 16#0296; (* corresponds to the identification of the Modbus function *)
%MW12 := 0; (* reserved *)
%MW13 := 16#0100; (* address of the first word to read (1) *)
%MW14 := 16#1400; (* number of words to read (20) *)
%MW103 :=10; (* length of the data to be transmitted in bytes *)
SEND_REQ(ADDR('0.0.1.x'),16#9F,%MW10:10,%MW100:4,%MW50:30);