NEX
Dear all

I'm a beginner with openplc I write a simply prg and assign %Q100.0 to my led . I use a TCP standard modbus device .
The monitor execute rights  the program , all work fine but my led is off.

My device receive the packet rights but not respomding I got this error 

"Modbus Write Coils failed on MB device Mioslave: Connection timed out"

I tested my device before with Modbustool app and work fine .

am I wrong something?

Regards NEX
Reply 0 0
thiagoralves
What device is this? What does your slave device configuration looks like?
Reply 0 0
NEX
My device is a modbus I/O coneccted by LAN address nr 1 with 8 relè output 0x02 read coils . Below the modbuspool communication.

modbus.jpg
Reply 0 0
NEX
I did other tests, I tested serial communication in OpenPlc but nothing.

I tried my device with ScadaBR and it works perfectly.

My device responds but OpenPLC ignores the response why?

I attach below the communication using modbuspool using  ReadCoil 0x01 and set it at 1 with 0x05 WriteCoil.

My Device use a standard modbus protocol write in C18 on 18F4520 and work fine with other software.
https://github.com/whchoi/Modbus-Slave-for-PIC18F/blob/master/modbus.c

I would like to understand.

Thanks a lot for your help , best regards

modbus.jpg
Reply 0 0
thiagoralves
I see from the logs you are using FC 05 (force single coil) and FC 06 (set single register) to write to your device. OpenPLC uses FC 15 and FC 16 to write, which are analogous to FC 05 and FC 06, but do the writing in batch - multiple writings at the same time. This is way more efficient in terms of IO remapping, which is the case of slave devices on OpenPLC. It could be possible that your device does not support FC 15 and FC16. If that's the case, you can't use this device with OpenPLC.
Reply 0 0
NEX
Thanks a lot for your replay

Ok I can modify my device firmware , it is open , I'll do more tests and let you know.

Thanks in advance

Nex
Reply 0 0
Reply