User manual
IEC61131 User and Reference Manual
April 22, 2008
320
Code
Description
14
disconnecting from slave IP address is in progress.
15
connection to slave IP address is disconnected.
16
invalid connection ID.
17
invalid protocol type.
18
invalid slave IP address.
19
last message is still being processed.
20
Master connection has been released.
21
error while connecting to slave IP address.
22
no more connections are available.
24
exception response: invalid function code
25
exception response: invalid address
26
exception response: invalid value
27
protocol is invalid or serial port queue is full
28
slave and master stations are equal; they must be different
29
exception response: slave device failure
30
exception response: slave device busy
Sending a Message
1. Set the enable input to TRUE to enable use of the masterip FB. This input may be set to
TRUE at the same time as the sendCmd input in the next step.
If the maximum number of connections has been reached, an “enable error” occurs: The
error output becomes TRUE and the value of the statusMasterCmd output indicates the
maximum number of connections has been reached. Disable another masterip FB to
correct the error, and repeat step 1.
2. Send one command message by toggling the sendCmd input from FALSE to TRUE.
3. The statusMasterCmd output reads 0 indicating that the message was sent.
4. Sending is complete when either the done output or error output is TRUE. The done
output is TRUE if the response is received successfully. The error output is TRUE if
there was a command error, timeout, or connection failure. The statusMasterCmd
output reads 1 for success or another value for error conditions.
5. Repeat steps 2 to 4 to send additional command messages.
Notes
For UDP protocols, which are connectionless, connection refers to the unique socket used
by each masterip FB to send messages.
The timeOut input determines how long to wait for a response before closing the connection
and reporting an error. The connection is re-connected when the next message is sent.
Note that holding the enable input of the masterip FB to TRUE ensures a connection is held
allocated to this FB.
There are a fixed number of connections available for both server and client (e.g. masterip
FB) connections. Connections are pooled together for both servers and clients to allocate;
however, at least one connection is fixed for server use, and another for client use only. This
ensures, for example, that at least one masterip FB can be enabled.
The connection is said to be “idle” if the enable input is held TRUE, but a message has not
been sent for some configurable amount of time (see the setmbip FB). When the connection
becomes idle, a timeout will close the connection. The connection will automatically be re-
connected when the next message is sent. This timeout conserves server resources at the