MTCP NJ Client E
MTCP NJ Client E
Read/write
Fn
File MTCP_NJ.zip
Function Block MTCP_NJ_Client Modbus TCP Client for NJ Controller
Conditions of The FB Modbus TCP Client provides some read/write features in accordance with
use the specifications defined by the Modbus organization.
The Modbus TCP Client function block is offered 'as is' and may serve as a basis
for development.
Users should previously test its adequacy to the final application.
Omron could not be held responsible in case of malfunction.
Principe The function block MTCP_NJ_Connect establish the connection with a remote
Modbus TCP server when Connect input is activated.
Connected output could allow execution of read/write FB via the Enable input.
Input Variables
Name type range Description
Enable Bool OFF, ON FB Activation
IPaddress STRING n.n.n.n IP Address of the server
Connect Bool OFF, ON Request to connect to the server
Output Variables
Name type Range Description
Connected Bool OFF, ON ON : Connected to the server
Error Bool OFF, ON Error flag
ErrorID UINT 0 - FFFF Error Code returned by the socket or Modbus
TCP server (see error code list below).
TCP_Socket _sSocket Structure DstAdr, Handle and SrcAdr
Socket_Status _eCONNECTION_STATE
Code Description
0001 ILLEGAL FUNCTION
Modbus
0002 ILLEGAL DATA ADDRESS
Exception
0003 ILLEGAL DATA VALUE
2000 Local IP Address Setting Error
2001 TCP/UDP Port Already in Use
2002 Address Resolution Failed
2003 Socket Status Error
2004 error Local IP Address Not Set
2006 Socket Timeout
2007 Socket Handle Out of Range
2008 Socket Communications Resource Overflow