I'm having problems writing outputs over Modbus TCP. I will describe my setup first.
Codesys V3.5 SP16
Raspberry Pi running Licensed Codesys 32-bit run-time
Phoenix Contact Modbus TCP Bus Coupler 2703981 (IL ETH BK DI8 DO4 2TX-PAC)
The Phoenix Contact Bus Coupler has one output card with 4 channels, and two output cards each with 4 channels.
I have been able to write a Modbus Slave Channel to read the Inputs correctly and use them in a POU. I cannot figure out how to write to the output card by Modbus TCP.
I contacted tech support at Phoenix Contact today to confirm what the correct register offsets are. They said for this basic hardware setup, inputs are 8000 and outputs are 8001. Again, inputs are working correctly. With register offset for outputs set to 8001, I get the following error: "Slave Device Failure - Unrecoverable error while performing the request". I have attached a screenshot of the modbus channel setting for the write.
I have tried changing the Function Code because Phoenix Contact supposedly supports FC6, FC16, and FC23 but get the same error. I have also tried changing the register offset, but any other offset will give the following error: "Illegal Data Address - Slave does not support this register offset".
I actually just figured it out. I found a forum post elsewhere where a user had the same problem. There is a feature called "plug and play" in the Phoenix Contact I/O that must be turned off before writing outputs can occur.
Hi,
I'm having problems writing outputs over Modbus TCP. I will describe my setup first.
Codesys V3.5 SP16
Raspberry Pi running Licensed Codesys 32-bit run-time
Phoenix Contact Modbus TCP Bus Coupler 2703981 (IL ETH BK DI8 DO4 2TX-PAC)
The Phoenix Contact Bus Coupler has one output card with 4 channels, and two output cards each with 4 channels.
I have been able to write a Modbus Slave Channel to read the Inputs correctly and use them in a POU. I cannot figure out how to write to the output card by Modbus TCP.
I contacted tech support at Phoenix Contact today to confirm what the correct register offsets are. They said for this basic hardware setup, inputs are 8000 and outputs are 8001. Again, inputs are working correctly. With register offset for outputs set to 8001, I get the following error: "Slave Device Failure - Unrecoverable error while performing the request". I have attached a screenshot of the modbus channel setting for the write.
I have tried changing the Function Code because Phoenix Contact supposedly supports FC6, FC16, and FC23 but get the same error. I have also tried changing the register offset, but any other offset will give the following error: "Illegal Data Address - Slave does not support this register offset".
Any ideas?
Thanks.
Hi again,
I actually just figured it out. I found a forum post elsewhere where a user had the same problem. There is a feature called "plug and play" in the Phoenix Contact I/O that must be turned off before writing outputs can occur.
https://forums.ni.com/t5/LabVIEW/Modbus-Exception-Code-communication-with-an-Inline-bus-coupler/td-p/728227?profile.language=en