ModbusRTU extension

For the moment you have to write a program in the PLC (device) that copy a value in a holding register to a coil. Then use 0x06, write single holding register to write the data that shall be transferred to the coil.

Hello everyone
I want to read data running on plc with mit app
I looked at the examples on the forum but I couldn't succeed. The connection is established, but when I want to read data, I see the value -2.
Can you help with this ?

From your mail:

word type
D0 plc adres
1000 hexadecimal adress
44097 modbus adress

44097 mean read input register 4097 using function code 4 (16bit word).
The test program does not accept this format. Use address 4097 and FC4 instead.

D0 implies that it is a Modbus serial subnet bridged from this TCP unit. Normally it is 0 for direct Modbus/TCP addressing. The test program just send what is entered.

The test program uses decimal notation.

Note: Some PLC:s number the registers from 0 and some from 1. I guess that you should use dec 4096 in this example (Hex 1000)

1 Like

Hello
Thank you very much for your reply. I will try again tomorrow and get back to you.

Hello again
Data reading was successful.
Thank you very much for sharing this valuable information with us.

Hi everyone, I'm looking for modbus extension that have code for 0x0 , 0x1, 0x3 and 0x4 code, I looked at other extension all of them just have 0x3 And 0x4 code.
Does anyone can help?

Not possible for the moment, and I don't have a device to test it.
'If you have a device with a single memory area (see Modbus specification) then you can read coil and discrete inputs as part of that area.
If it is separate areas then you have to make a program in the PLC that copy the input bits and coils to the holding register area so you can read it.

1 Like

It's easy to test the program with modbus slave, If you have one send it to me and I will test it , and also I have plc for more testing