Getting Error Code 0x01 While Doing Transmission

B

Thread Starter

BPatel

Hi,

I am trying to implement Modbus TCP over LwIP. I have created a C code for Modbus TCP/IP communication. (Modbus packet as follow on Texas Instrument board)

Following is the query I am creating <pre>
<b>test1.TransactionIdentifier=1;
test1.ProtocolIdentifier=0;
test1.Length=5;
test1.UnitIdentifier=2;
test1.FunctionCode=5;
test1.Bytecount=2;
test1.Data1=0x000A;</b></pre>
I have installed mod_RSsim in Windows 8 machine and looking at communication in console.
Following is the console logs:<pre>
<b> [560] connection accepted.
TX:10 00 00 00 05 00 02 00 05 00 02 00 0A 00 00 00 F8
Modbus message in error x01
RX:01 00 00 00 00 03 02 80 01</b></pre>

I tried with function code as 1, 4, 6 but all are giving same error. can anybody help me what is wrong with this Or is there any other way to test Modbus TCP/IP? Communication is over 502 port. Both board and PC are connected in Local Network.

Thanks,
B Patel
 
Top