From the example program for ModbusTCP
// Configure the MODBUS TCP client
client(aIPaddr:=server.aIPaddr, udiLogOptions:=(ModbusFB.LoggingOptions.ClientConnectDisconnect OR ModbusFB.LoggingOptions.ClientReceivedValidReplies));
// Try to connect the client
After configuring and connecting the MBTCP client instance as shown, wouldn't a line like the following re-initialize the client object and terminate the connection? ...because it has just been stripped of the server's IP address and xConnect goes back to its default FALSE value.
// Call the client to do request processing (handling state changes in ClientRequest's)
I say this because that's exactly what happened (as expected) in a code I've been working on.
Could you please provide some clarification?
Talk Topic about project #codesys-example/modbus
I'm having this problem with my Modbus TCP master program: a successful connection is made to the server, to be used to read a number of input registers in sequence by using the ModbusFB.ClientRequestReadInputRegisters function block.
But although the xExecute input is being controlled by a clock signal which turns it ON and OFF cyclically, no ModbusTCP request has ever been sent onto the physical ethernet medium. At the same time, I get no Error or Exception messages from any ModbusTCP function block. However, the ClientTCP.udiNumReqNotProcessed keeps rising, hinting at something called request starvation (at least according to the official documentation). Is there some extra action that I need to take to make the ModbusFB.ClientRequestReadInputRegisters FB send these requests out apart from setting appropriate values at its inputs and outputs?
Log in to post a comment.