MBP - MSTR - Modbus Plus Master 12
MBP - MSTR - Modbus Plus Master 12
MBP_MSTR
33002527 07/2011
12
Introduction
This chapter describes the MBP_MSTR block.
33002527 07/2011 95
MBP_MSTR
Topic Page
TCP/IP Ethernet Network Statistics 135
Modbus Plus, SY/MAX, and Ethernet TCP/IP Error Codes 138
SY/MAX-Specific Error Codes 142
TCP/IP Ethernet Error Codes 144
CTE Error Codes for SY/MAX and TCP/IP Ethernet 148
Mail Service Error Codes 149
96 33002527 07/2011
MBP_MSTR
Block Description
Function Description
You can select one of 14 available network communication operations
(see page 100) using the MBP_MSTR function block.
EN and ENO can be configured as additional parameters.
NOTE: You must be familiar with the routing procedures of your network when
programming an MBP_MSTR function block. Modbus Plus routing path structures are
described in detail in the Modbus Plus Network Planning and Installation Guide. If
TCP/IP or SY/MAX Ethernet routing is implemented, standard Ethernet IP router
products must be used. A full description of the TCP/IP routing is provided in the
Quantum with Unity Pro TCP/IP Configuration User Guide.
CREAD_REG, CWRITE_REG, READ_REG, WRITE_REG and MBP_MSTR function
blocks use 1 data transaction path and require multiple cycles to complete an
operation. Number of transaction path available is dependent on the communication
port used:
Modbus Plus embedded port or NOM modules support up to 4 blocks at the same
time
Modbus Plus embedded port or NOM modules support up to 4 blocks at the same
time
Modbus Plus embedded port or NOM modules support up to 4 blocks at the same
time
More communication function blocks may be programmed on the same
communication port. However communication block exceeding the maximun
number on that port will not be serviced until one of the transaction paths is freed up.
When the transaction path resources become free the next block on the same port
will become active and begin using freed path.
NOTE: In FBD and LD sections, this function block can be used on the program level
and with derived function blocks (DFBs). When using DFBs, the parameters
CONTROL and DATABUF must be directly connected to the I/O pins of the DFB.
NOTE: A TCP/IP communication between a Quantum PLC and a Momentum PLC
is possible only when only one read or write job is carried out in every cycle. If
several jobs are sent per PLC cycle, the communication stops without generating an
error message in the status register of the function block.
33002527 07/2011 97
MBP_MSTR
Example:
you can send MBP_MSTR.Enable:=(HSBY_NOEPLCMSTR_ON) AND
(%SW61.1) AND NOT (%SW61.0)
or
you can create a boolean variable, primary_state:=(%SW61.1) AND NOT
(%SW61.0), and insert it for executing the section
NOTE: To prevent the former standby CPU, which has switched its state for RUN
offline from executing communication functions, you must add a condition on the
status bits to disable the function, if the CPU is offline.
NOTE: Several copies of this function block can be used in the program. However,
multiple instancing of these copies is not possible.
Representation in FBD
Representation in LD
98 33002527 07/2011
MBP_MSTR
Input Parameters
Output Parameters
Runtime Error
In the event of an error occurring during an MBP_MSTR operation, a hexadecimal
error code is displayed in the CONTROL[2] register of the control block for one
cycle.
Function error codes are network-specific:
Modbus Plus and SY/MAX Ethernet error codes (see page 138)
SY/MAX specific error codes (see page 142)
TCP/IP Ethernet error codes (see page 144)
CTE Error Codes for SY/MAX and TCP/IP Ethernet (see page 148)
Send e-mail error codes (see page 149)
NOTE: For a list of all block error codes and values, refer to the tables of error codes
for the communication library.
33002527 07/2011 99
MBP_MSTR
where:
X indicates Yes
- indicates No
Summary
The structure of the MBP_MSTR control block varies according to the type of network
you are using. Structures for Modbus Plus, TCP/IP Ethernet, and SyMax Ethernet
are described below.
Register Contents
CONTROL[1] Indicates an operation that is valid for Modbus Plus
CONTROL[2] Indicates the error status
CONTROL[3] Indicates the length, i.e., the number of data units transferred (max. 100)
CONTROL[4] Indicates MSTR operation-dependent information
CONTROL[5] Routing register 1: used to specify a destination node during network
transfer (routing path addresses one of five)
Most significant byte: source node address, i.e., the slot for the Modbus Plus
Network Options Module (NOM)
When using the Modbus Plus Port on the CPU, this byte must be set to 0
(regardless of the CPU slot).
Least significant byte: destination node address, i.e., a value that represents
a direct or a bridge address. If there is no bridge, this value contains the
destination node address. If there is a bridge, this value contains the address
of the bridge.
If the NOM is inserted in slot 7 on the module rack, the most significant byte
of routing register 1 looks as follows (value 0x0706):
Register Contents
CONTROL[1] Indicates an operation that is valid for TCP/IP
CONTROL[2] Indicates the error status
CONTROL[3] Indicates the length, i.e., the number of data units transferred (max. 100)
CONTROL[4] Indicates MSTR operation-dependent information
CONTROL[5] Routing register: used to specify a destination node during network transfer
Most significant byte: source node address, i.e., the NOE slot for the NOE
module
When using an integrated Ethernet on the CPU, this byte must be set to 254
(FE hex) regardless of the CPU slot.
Least significant byte: destination node address, i.e, a value that represents
a direct or bridge address. If there is no bridge the value in the least
significant byte is set to 0. If there is a bridge, this value contains the MBP
for the Ethernet mapping index (MET).
If the NOE is inserted in slot 7 on the module rack and the Ethernet mapping
index (MET) is 6, the routing register looks as follows (value 0x0706):
Register Contents
CONTROL[1] Indicates an operation that is valid for SY/MAX
CONTROL[2] Indicates the error status
CONTROL[3] Indicates the length, i.e., the number of registers transferred (max. 100)
Register Contents
CONTROL[4] Indicates MSTR operation-dependent information
CONTROL[5] Routing register: used to specify a destination node during network transfer
Most significant byte: source node address, ie.e, the slot for the NOE module
Least significant byte: destination node address, i.e, a value that represents
a direct or bridge address. If there is no bridge the value in the least
significant byte is set to 0. If there is a bridge, this value contains the MBP for
the Ethernet mapping index (MET).
If NOM is inserted in slot 7 on the module rack and the Ethernet mapping
index (MET) is 6, the routing register looks as follows (value 0x0706):
Read Data
Description
A read operation transfers data from a specified slave source device to a master
destination device on the network. It uses a master transaction path and may require
several cycles to complete. To program an MBP_MSTR block to perform a write
operation, use function code 2 (see page 100).
NOTE: Do not attempt to program an MBP_MSTR to read to its own station address.
This action causes the function block to generate an error in the CONTROL[2]
register of the control block (see page 101).
You can perform a read operation on a nonexistent slave register. The slave detects
the status and logs it. This can last for several cycles.
Network Implementation
The read operation can be performed on Modbus Plus, TCP/IP Ethernet, and
SY/MAX Ethernet networks.
Register Meaning
CONTROL[1] 2 = Read data
CONTROL[2] Indicates the error status.
Register Meaning
CONTROL[3] Number of registers to be read from the slave
CONTROL[4] Determines the %MW starting register in the slave from which the data is
read, e.g., 1 = %MW1, 49 = %MW49).
CONTROL[5] Routing register 1 is used to specify the address (routing path address 1 of
... 5) of the node during a network transfer.
CONTROL[9] The last byte in the routing path that is not 0 is the destination node.
Register Meaning
CONTROL[1] 2 = read data
CONTROL[2] Indicates the error status.
CONTROL[3] Number of addresses to be read from the slave
CONTROL[4] Determines the %MW starting register in the slave from which the data is
read, e.g., 1 = %MW1, 49 = %MW49)
CONTROL[5] Routing register:
Most significant byte: network adapter module slot
Least significant byte: MBP on Ethernet Transporter (MET) mapping index
CONTROL[6] Each address contains 1 byte of the 32-bit IP address, where the MSB is
... in CONTROL[6] and the LSB is in CONTROL[9].
CONTROL[9]
Register Meaning
CONTROL[1] 2 = Read data
CONTROL[2] Indicates the error status.
CONTROL[3] Number of addresses to be read from the slave
CONTROL[4] Determines the %MW starting register in the slave to which the data is
written, e.g., 1 = %MW1, 49 = %MW49).
CONTROL[5] Routing register
Most significant byte: network adapter module slot
Least significant byte: destination drop number
CONTROL[6] Terminator: FF hex
...
CONTROL[9]
Write Data
Description
A write operation transfers data from a master source device to a specified slave
destination device on the network. It uses a master transaction path and may require
several cycles to complete. To program an MBP_MSTR block to perform a write
operation, use function code 1 (see page 100).
NOTE: Do not attempt to program an MBP_MSTR to write to its own drop address.
This action causes the function block to generate an error in the CONTROL[2]
register of the control block (see page 101).
You can perform a write operation to a nonexistent slave register. The slave detects
the status and logs it. This can last for several cycles.
Network Implementation
The write operation can be performed on Modbus Plus, TCP/IP Ethernet, and
SY/MAX Ethernet networks.
Register Meaning
CONTROL[1] 1 = write data
CONTROL[2] Indicates the error status
CONTROL[3] Number of addresses sent to the slave
CONTROL[4] Determines the %MW starting register in the slave to which the data is
written, e.g. 1 = %MW1, 49 = %MW49
CONTROL[5] Routing register 1 is used to specify the address (routing path address 1 of
... 5) of the node during a network transfer.
CONTROL[9] The last byte in the routing path that is not 0 is the destination node.
Register Meaning
CONTROL[1] 1 = write data
CONTROL[2] Indicates the error status
CONTROL[3] Number of addresses sent to the slave
CONTROL[4] Determines the CONTROL[ ] start address of the slave to which the data is
written
CONTROL[5] Routing register
Most significant byte: network adapter module slot
Least significant byte: MBP on Ethernet transporter (MET) mapping index
Register Meaning
CONTROL[6] Each address contains 1 byte of the 32-bit IP address.
...
CONTROL[9]
Register Meaning
CONTROL[1] 1 = Write data
CONTROL[2] Indicates the error status
CONTROL[3] Number of addresses sent to the slave
CONTROL[4] Determines the %MW starting register in the slave to which the data is
written, e.g., 1 = %MW1, 49 = %MW49)
CONTROL[5] Routing register
Most significant byte: network adapter module slot
Least significant byte: destination drop number
CONTROL[6] Terminator: FF hex
...
CONTROL[9]
Description
A Get Local Statistics operation reads the data from the local node in one
cycle and does not require a master transaction path.To program an MBP_MSTR
block to Get Local Statistics, use function code 3 (see page 100).
Network Implementation
A Get Local Statistics operation can be performed on Modbus Plus and
TCP/IP Ethernet networks (see page 135).
Register Meaning
CONTROL[1] 3 = get local statistics
CONTROL[2] Indicates the error status
CONTROL[3] Number of addresses to be read from local statistics (0...37)
Note: The size of databuf must be at least the size of this entry.
CONTROL[4] First address from which the statistics table must be read (Reg1=0)
CONTROL[5] Routing register 1 is used to specify the address (routing path address 1 of
5) of the node during a network transfer.
The last byte in the routing path that is not 0 is the destination mode.
Register Meaning
CONTROL[1] 3 = get local statistics
CONTROL[2] Indicates the error status
CONTROL[3] Number of addresses to be read from local statistics (0...37)
Note: The size of databuf must be the size of this entry.
CONTROL[4] First address from which the statistics table must be read (Reg1=0)
CONTROL[5] Routing register
Most significant byte: Network adapter module slot
CONTROL[6] Not used
...
CONTROL[9]
Description
A clear local statistics operation clears the values from words 13 ... 22 in the
statistics table of the local node. The operation is carried out in one cycle and does
not require a master transaction path. To program an MBP_MSTR block to clear local
statistics, use function code 4 (see page 100).
Network Implementation
A clear local statistics operation can be performed on Modbus Plus and TCP/IP
Ethernet networks (see page 135).
Register Meaning
CONTROL[1] 4 = clear local statistics
CONTROL[2] Indicates the error status
CONTROL[3] Reserved
CONTROL[4] Reserved
CONTROL[5] Routing register 1 is used to specify the address (routing path address 1 of
5) of the node during a network transfer.
The last byte in the routing path that is not 0 is the destination mode.
Register Meaning
CONTROL[1] 4 = clear local statistics
CONTROL[2] Indicates the error status
CONTROL[3] Reserved
CONTROL[4] Reserved
CONTROL[5] Routing register
Most significant byte: network adapter module slot
CONTROL[6] Reserved
...
CONTROL[9]
Description
A write global data operation transfers data to the communication processor of the
current node; the data can be transmitted on the network as soon as the node
receives the token and then read by all nodes connected to the local network
(see page 110) .
A write global data operation is carried out in one cycle and does not require a
master transaction path. To program an MBP_MSTR block to write global data, use
function code 5 (see page 100).
Network Implementation
A write global data operation can be performed only on Modbus Plus networks. The
read and write global data operations comprise a Modbus Plus capability known as
Peer Cop.
Register Meaning
CONTROL[1] 5 = write global data
CONTROL[2] Indicates the error status
CONTROL[3] Number of addresses to be written from state RAM into global data
memory (comm processor) (1...32)
CONTROL[4] Reserved
CONTROL[5] If global data is sent via a NOM, enter the NOM module slot in the most
significant byte of this register.
Description
A read global data operation reads data from the communications processor of a
node on the network that has written global data (see page 109). A master
transaction path is not required.
A read global data operation can take several cycles if the global data is not currently
available with the nodes called. If global data is available, the operation is executed
in one cycle. To program an MBP_MSTR block to write global data, use function code
6 (see page 100).
Network Implementation
A read global data operation can be performed only on Modbus Plus networks. The
read and write global data operations comprise a Modbus Plus capability known as
Peer Cop.
Register Meaning
CONTROL[1] 6 = read global data
CONTROL[2] Indicates the error status
CONTROL[3] Number of addresses to be sent from global data memory (comm
processor) (1...32)
CONTROL[4] Displays the addresses available in the scanned node. (This register Is
automatically updated.)
CONTROL[5] The least significant byte contains the address of the node whose global
data is to be read. It can be a value in the range 1 ... 64.
If global data is received via a NOM, enter the NOM module slot in the most
significant byte of this address.
Description
A get remote statistics operation can be used to read data from remote nodes on the
network. With each query, the remote communications processor supplies a
complete table of statistics even if the query does not refer to the entire table. It then
copies only the words that you queried into identified $MW addresses.
An operation can take several cycles to complete; it does not require a master data
transaction path. To program an MBP_MSTR block to get remote statistics, use
function code 7 (see page 100).
Network Implementation
A get remote statistics operation can be performed on Modbus Plus and TCP/IP
Ethernet networks.
Register Meaning
CONTROL[1] 7 = get remote statistics
CONTROL[2] Indicates the error status
CONTROL[3] Number of addresses to be read from the statistics data field (0 ... 38).
Note: The size of databuf must be at least the size of this entry.
CONTROL[4] First address from which the node statistics must be read. The number of
available statistics registers cannot be exceeded.
CONTROL[5] Routing address 1 ... 5 of the node.
... The last byte in the routing path that is not 0 is the destination node.
CONTROL[9]
Register Meaning
CONTROL[1] 7 = get remote statistics
CONTROL[2] Indicates the error status
CONTROL[3] Number of addresses to be read from the statistics data field (0 ... 38).
Note: The size of databuf must be at least the size of this entry.
CONTROL[4] First address from which the node statistics must be read. The number of
available statistics registers cannot be exceeded.
CONTROL[5] Routing register
Most significant byte: network adapter module slot
Register Meaning
CONTROL[6] Each address contains 1 byte of the 32-bit IP address, where the value in
... CONTROL[6] is the MSB and the value in CONTROL[9] is the LSB.
CONTROL[9]
Description
A clear remote statistics operation clears remote-node values from words 13 ... 22
in the statistics table of the local node. It uses a master transaction path and may
require several cycles to complete. To program an MBP_MSTR block to perform a
clear remote statistics operation, use function code 8 (see page 100).
Network Implementation
A clear remote statistics operation can be performed on Modbus Plus and TCP/IP
Ethernet networks (see page 135).
Register Meaning
CONTROL[1] 8 = clear remote statistics
CONTROL[2] Indicates the error status
CONTROL[3] Reserved
CONTROL[4] Reserved
CONTROL[5] Routing register 1 is used to specify the address (routing path address 1 of
... 5) of the destination node during a network transfer.
CONTROL[9] The last byte in the routing path that is not 0 is the destination mode.
Register Meaning
CONTROL[1] 8 = clear remote statistics
CONTROL[2] Indicates the error status
CONTROL[3] Reserved
CONTROL[4] Reserved
CONTROL[5] Routing Register
Most significant byte: network adapter module slot
CONTROL[6] Each address contains one byte of the 32-bit IP address, where the MSB
... is in CONTROL[6] and the LSB is in CONTROL[9].
CONTROL[9]
Description
A peer cop health operation reads selected data from the peer cop communications
health table and downloads the data to the specified %MW addresses in state RAM.
To program an MBP_MSTR block to perform a clear remote statistics operation, use
function code 9 (see page 100).
NOTE: Peer cop health is operational only when a peer cop-based I/O scanner has
been configured.
The peer cop communications health table is 12 words long; MBP_MSTR indexes
these words with the numbers 0 ... 11.
Network Implementation
A peer cop health operation can be performed only on Modbus Plus networks.
Register Meaning
CONTROL[1] 9 = peer cop health
CONTROL[2] indicates the error status.
CONTROL[3] Number of words wanted by the peer cop table (1...12)
CONTROL[4] First word to be read from the peer cop table, where 0 = the first word and
11 = the last word)
CONTROL[5] Routing address 1
If this is the second of two local nodes, set the value in the high byte to 1.
Description
A reset optional module operation causes a Quantum NOE Ethernet
communications module or the Ethernet port on a 140CPU65150/60 CPU module
to enter a cycle that resets its working environment. To program an MBP_MSTR
block to perform a reset option module operation, use function code 10
(see page 100).
Network Implementation
A reset optional module operation can be performed on TCP/IP Ethernet
(see page 135) and SY/MAX Ethernet networks.
Register Meaning
CONTROL[1] 10 = reset optional module
CONTROL[2] Indicates the error status
CONTROL[3] No significance
CONTROL[4] No significance
CONTROL[5] Routing register
The value shown in the high byte in area 1 through 16 indicates the slot in
the Quantum backplane where the NOE module is located.
CONTROL[6] No significance
...
CONTROL[9]
Register Meaning
CONTROL[1] 10 = reset optional module
CONTROL[2] Indicates the error status
CONTROL[3] No significance
CONTROL[4] No significance
CONTROL[5] Routing register
MSB: network adapter module slot
CONTROL[6] No significance
...
CONTROL[9]
Read CTE
Description
A read CTE operation reads a specified number of bytes from the Ethernet
configuration extension table in the specified buffer of PLC memory. The bytes to be
read start with a byte offset at the start of the CTE table. The contents of the CTE
table are displayed in the DATABUF output parameter. (see page 99)To program an
MBP_MSTR block to perform a clear remote statistics operation, use function code
11 (see page 100).
Network Implementation
A read CTE operation can be performed on TCP/IP Ethernet and SY/MAX Ethernet
networks.
Register Meaning
CONTROL[1] 11 = read CTE
CONTROL[2] Indicates the error status
CONTROL[3] The length setting: a value from 12 to 37
CONTROL[4] No significance
CONTROL[5] Routing register
Least significant byte = mapping index
Either a value displayed in the byte of the register or is not used.
or
Most significant byte = network adapter module slot
CONTROL[6] No significance
...
CONTROL[9]
Register Meaning
CONTROL[1] 11 = read CTE
CONTROL[2] Indicates the error status
CONTROL[3] Number of words transferred
CONTROL[4] Byte offset in the PLC register structure, specifying from where the CTE
bytes are read
Register Meaning
CONTROL[5] Routing register
MSB: slot of the NOE module
CONTROL[6] Terminator: FF hex
...
CONTROL[9]
Write CTE
Description
A write CTE operation writes the CTE configuration table from the specified data
(DATABUF) to a specified Ethernet configuration extension table or to a specific slot.
To program an MBP_MSTR block to perform a write CTE operation, use function
code 12 (see page 100).
Network Implementation
A write CTE operation can be performed on TCP/IP Ethernet (see page 135) and
SY/MAX Ethernet networks.
Register Meaning
CONTROL[1] 12 = write CTE
CONTROL[2] Indicates the error status
CONTROL[3] The length setting: a value from 12 to 37.
CONTROL[4] No significance
CONTROL[5] Routing register
Least significant byte = mapping index
Either a value displayed in the byte of the address or is not used.
or
Most significant byte = network adapter module slot
CONTROL[6] No significance
...
CONTROL[9]
Register Meaning
CONTROL[1] 12 = Write CTE (Config extension table)
CONTROL[2] Indicates the error status
CONTROL[3] Number of words transferred
CONTROL[4] Byte offset in the PLC address structure specifying where the CTE bytes
are written
CONTROL[5] Routing register
Most significant byte = NOE module slot
Least significant byte = Destination drop number
Register Meaning
CONTROL[6] Terminator: FF hex
CONTROL[7] No significance
...
CONTROL[9]
Send Email
Description
The electronic mail notification service allows controller-based projects to report
alarms or events. The controller monitors the system and dynamically creates an
electronic mail message, which alerts local or remote users.
A user-defined event or condition triggers the MSTR block to create a message.
Each message uses one of three user-defined headers. Each message sent from
the controller can contain text and variable information (with a maximum of 238
bytes).
The project selects the appropriate header. Each header contains:
sender name
list of recipients
subject
To program an MBP_MSTR block to send email, use function code 13
(see page 100).
Network Implementation
A send email operation can be performed on a TCP/IP Ethernet network.
Register Meaning
CONTROL[1] 13 = send Email
CONTROL[2] Indicates the email-specific error codes (see page 149)
CONTROL[3] Number of words transferred
CONTROL[4] Not used
CONTROL[5] High byte: slot address of the NOE module or 0xFE for the 140 CPU 651 60
Low byte: always 0
CONTROL[6] Not used
...
CONTROL[9]
Register Contents
DATABUF 1 The mail header is the least significant byte with a value of 1, 2, or 3.
The most significant byte contains the number (n) of characters in the
subject, a value between 0 and 238.
DATABUF 2 The data (in ASCII format) that will be copied into the Email message.
... The first n characters are added to the configured Email subject. The
DATABUF 119 remaining characters (2 * N -2 - n) are part of the message body, where N
is the number of words transferred.
At a Glance
Use MSTR operation 15 to send generic Modbus requests on the network.
NOTE: This operation is not available on Modbus Plus ports (embedded port on
CPU or NOM modules) and the embedded Ethernet port on a CPU.
Block Operation
The MBP_MSTR block can send requests and receive responses up to 253 bytes
long.
For the operation, refer to Block Operation (see page 97):
When the ENABLE input pin is turned ON, operation 15 begins.
If the ABORT input pin is turned ON or if the ENABLE input pin is turned OFF, the
operation ends.
The ACTIVE output pin is ON during the operation.
The ERROR output pin turns ON if the operation aborts without success.
The SUCCESS output pin turns ON if the operation completes with success.
The CONTROL and DATABUF output pins define the operation (refer to the
Control Block (see page 122) and Data Buffer (see page 123)).
EN and ENO can be configured as additional parameters.
Control Block
The format of the Control block is described in the following table:
Word Description
CONTROL[1] 15 = Send Modbus Request
CONTROL[2] Indicates detected error status
CONTROL[3] DATABUF length (WORDs)
CONTROL[4] Offset for the beginning of the response in the DATABUF (WORDs).
NOTE: To avoid overwriting the request, the Response Offset value
multiplied by 2 must be greater than the Request Length (CONTROL[10]).
CONTROL[5] Routing register:
High byte = Ethernet communication module slot
Low byte = MBP on Ethernet transporter (MET) mapping index (also known
as Unit ID)
CONTROL[6] Byte 4 of the IP address (MSB)
CONTROL[7] Byte 3 of the IP address
CONTROL[8 Byte 2 of the IP address
CONTROL[9] Byte 1 of the IP address (LSB)
CONTROL[10] Length of the DATABUF Request data (bytes)
Word Description
CONTROL[11] Length of the DATABUF Response received (bytes)
NOTE: This is read only, it is set by option module after operation
completion.
Data Buffer
The MODBUS protocol defines a simple protocol data unit (PDU) independent of the
underlying communication layers.
The data buffer (DATABUF) consists of contiguous registers that include both the
Modbus Request PDU and the Modbus Response PDU:
CAUTION
LOSS OF DATA
Verify that the Response Offset is greater than the Data Request Length.
Failure to follow these instructions can result in injury or equipment damage.
NOTE: Both the Request and Response must be structured in little endian order.
Each word of 2 bytes of data in little endian format, where the least significant byte
is stored in the smallest memory address.
Modbus Request
The Modbus Request PDU format is:
Modbus Response
The Modbus Response PDU format is:
Modbus Specification
The standard Modbus function codes are defined in the MODBUS Application
Protocol Specification, V1.1b, which can be downloaded from www.modbus-ida.org.
At a Glance
Use MBP_MSTR operation 16 to close a Modbus TCP/IP connection on the network.
NOTE: This operation is not available on Modbus Plus ports (embedded port on
CPU or NOM modules).
Block Operation
The MBP_MSTR block can send requests and receive responses up to 253 bytes
long. For block operation, refer to the block description (see page 97):
When the ENABLE input pin is turned ON, operation 15 begins.
If the ABORT input pin is turned ON or if the ENABLE input pin is turned OFF, the
operation ends.
The ACTIVE output pin is ON during the operation.
The ERROR output pin turns ON if the operation aborts without success.
The SUCCESS output pin turns ON if the operation completes with success.
The CONTROL and DATABUF output pins (see page 99) define the operation.
EN and ENO can be configured as additional parameters.
Control Block
The format of the CONTROL block is described below:
Read/Write Data
Introduction
In a single transaction, the MSTR read and write operations can transfer data from
a master source device to a specified slave destination device, then transfer data
from this specified slave source to the master. It uses a master transaction path and
may require several cycles to complete. To program an MBP_MSTR block to perform
a combined read/write operation, use function code 23 (see page 100).
The combined read/write operation can be used only with these two Quantum
models:
NOE 771 01 (version 3.0 or later)
NOE 771 11 (version 3.0 or later)
Register Content
CONTROL[1] 23 = read/write data.
CONTROL[2] Indicates the error status.
CONTROL[3] Number of registers to be sent to the slave.
CONTROL[4] Specifies the %MW starting register in the slave to which the data will be
written, e.g. 1 = %MW1, 49 = %MW49.
CONTROL[5] Routing register:
Most significant byte: network adapter module slot.
Least significant byte: MBP on Ethernet Transporter (MET) mapping index.
CONTROL[6] Each address contains 1 byte of the 32-bit IP address, where the MSB is
... in CONTROL[6] and the LSB is in CONTROL[9].
CONTROL[9]
CONTROL[10] Number of registers to be read from slave.
CONTROL[11] Specifies the %MW starting register in the slave from which the data is
read, e.g. 1 = %MW1, 49 = %MW49.
NOTE:
When configuring the MBP_MSTR block for a read/write data operation, note that
The DATABUF output parameter is used to store, in the following sequence, both:
1 the data to be written
2 the data to be read
The size of the DATABUF output parameter must equal the combined size of the
data to be written and the data to be read; if the size is smaller, data will be
overwritten and may be lost.
Both the CONTROL and DATABUF parameters must be stored at located
addresses, for example %MW addresses.
Network Implementation
A Peer Cop communications health status operation can be performed only on
Modbus Plus networks.
Send direct 4
10
11
Word Meaning
00 to 02 MAC address Word Contents
e.g. MAC address 00 00 54 00 12 34 is 00 00 00
displayed as follows: 01 54 00
02 12 34
03 Board status (refer to the following table)
04 and 05 Number of receiver interrupts
06 and 07 Number of transfer interrupts
08 and 09 Transfer timeout error count
10 and 11 Collision detection error count
12 and 13 Omitted packets
14 and 15 Memory error count
16 and 17 Number of restarts performed by the driver
18 and 19 Receive framing error count
20 and 21 Overflow error count receiver
22 and 23 Receive CRC error counter
24 and 25 Receive buffer error counter
26 and 27 Transfer buffer error counter
28 and 29 Transfer bin underflow counter
30 and 31 Late collision counter
32 and 33 Lost carrier counter
34 and 35 Number of retries
36 and 37 IP address Word Contents
e.g. the IP address 198.202.137.113 (or 36 89 71
C6 CA 89 71) is represented as follows: 37 C6 CA
Bit # Definition
15 0 = Link LED off 1 = Link LED on
14 0 = Appl LED off 1 = Appl LED on
13 0 = twisted pair 1 = fiber
12 0 = 10 Mbit 1 = 100 Mbit
11 ... 8 (Reserved)
7 ... 4 Module type (see table, below)
3 (Reserved)
2 0 = half duplex 1 = full duplex
1 0 = not configured 1 = configured
0 0 = not running 1 = running
NOTE: Bits are numbered from right to left, starting with bit 0 (low bit). For example,
PLC running = 0000 0000 0000 0001 and LED connection = 1000 0000 0000
0000.
The following table describes the word bit definitions for board status for the:
140 NOE 771 x1, version 3.5
140 NOE 771 x0, versions 1.02 and 2.0
140 CPU 651 x0
Bit # Definition
15 ... 12 Module type (see table below)
11 (Reserved)
10 0 = half duplex 1 = full duplex
9 0 = not configured 1 = configured
8 0 = PLC not running 1 = PLC/NOE running
7 0 = Link LED off 1 = Link LED on
6 0 = Appl LED off 1 = Appl LED on
5 0 = twisted pair 1 = fiber
NOTE: Bits are counted from right to left, starting with bit 0 (low bit). For example,
PLC running = 0x0100, Application LED = 0x0040, and LED Connection =
0x0080.
NOTE:
Error code 5055 can occur before a 503C error.
No remote device takes precedence over a timeout.
Hex. Description
Error
Code
7101 Invalid opcode found by the SY/MAX remote device
7103 Invalid address found by the SY/MAX remote device
7109 Attempt to write to a write protected register found by the SY/MAX remote device
F710 Receiver overflow found by the SY/MAX remote device
7110 Invalid length found by the SY/MAX remote device
7111 Remote device not active, no connection (occurs when retry attempts and time-out
have been used up), found by the SY/MAX remote device
7113 Invalid parameter in a read operation found by the SY/MAX remote device
711D Invalid route found by the SY/MAX remote device
7149 Invalid parameter in a write operation found by the SY/MAX remote device
714B Invalid drop number found by the SY/MAX remote device
7101 Invalid opcode found by the SY/MAX server
7203 Invalid address found by the SY/MAX server
7209 Attempt to write to a write protected register found by the SY/MAX server
F720 Receiver overflow found by the SY/MAX server
7210 Invalid length found by the SY/MAX server
7211 Remote device not active, no connection (occurs when retry attempts and time-out
have been used up), found by the SY/MAX server
7213 Invalid parameter in a read operation found by the SY/MAX server
721D Invalid route found by the SY/MAX server
7249 Invalid parameter in a write operation found by the SY/MAX server
724B Invalid drop number found by the SY/MAX server
Hex. Description
Error
Code
7301 Invalid opcode in an MSTR block request from the Quantum translator
7303 Read/Write QSE module status (200 route address out of range)
7309 Attempt to write to a write protected register when a status write is carried out (200
route)
731D Invalid route found by the Quantum translator.
Valid routes:
dest_drop, 0xFF
200, dest_drop, 0xFF
100+drop, dest_drop, 0xFF
All other routing values produce an error
734B One of the following errors occurred:
No CTE (configuration extension table) has been configured
No CTE table entry has been made for the QSE model slot number
No valid drop has been specified
The QSE module has not been reset after the creation of the CTE.
Note: After writing and configuring the CTE and downloading to the QSE
module, the QSE module must be reset for the modifications to become
effective.
When using an MSTR instruction no valid slot or drop has been specified
Hex. Meaning
Error
Code
1001 Abort by user
2001 An operation type that is not supported has been specified in the control block
2002 One or more control block parameters were modified while the MSTR element was
active (this only applies to operations which require several cycles for completion).
Control block parameters my only be modified in inactive MSTR components.
2003 Invalid value in the length field of the control block
2004 Invalid value in the offset field of the control block
2005 Invalid value in the length and offset fields of the control block
2006 Unauthorized data field on slave
2008 Unauthorized network routing path on slave
200E The control block is not assigned, or parts of the control block are located outside
of the %MW (4x) range.
3000 Generic Modbus failure code
30ss Exceptional response by Modbus slave (see page 144)
4001 Inconsistent response by Modbus slave
ss hex. Meaning
Value
01 Slave does not support requested operation
02 Non-existing slave registers were requested
ss hex. Meaning
Value
03 An unauthorized data value was requested
05 Slave has accepted a lengthy program command
06 Function cannot currently be carried out: lengthy command running
07 Slave has rejected lengthy program command
Hex. Meaning
Error
Code
5004 Interrupted system invocation
5005 I/O error
5006 No such address
5009 The socket descriptor is not valid
500C Not enough storage space
500D Authorization denied
5011 Entry exists
5016 An argument is not valid
5017 An internal table has no more space
5020 There is interference on the connection
5023 This operation was blocked and the socket is non-blocking
5024 The socket is non-blocking and the connection cannot be closed down
5025 The socket is non-blocking and a previous connection attempt has not been
concluded
5026 Socket operation on a non-socket
5027 The destination address is not valid
5028 Message too long
5029 Wrong type of protocol for the socket
502A Protocol not available
502B Protocol not supported
502C Socket type not supported
502D Operation not supported at socket
Hex. Meaning
Error
Code
502E Protocol family not supported
F502 Address family not supported
5030 Address is already in use
5031 Address not available
5032 Network is out of order
5033 Network cannot be reached
5034 Network shut down the connection during reset
5035 The connection was terminated by the peer
5036 The connection was reset by the peer
5037 An internal buffer is required, but cannot be assigned
5038 The socket is already connected
5039 The socket is not connected
503A Cannot transmit after the socket has been shut off
503B Too many references; cannot splice
503C Connection timed out
503D The connection attempt was denied
5040 Host is out of order
5041 The destination host could not be reached from this node
5042 Directory not empty
5046 NI_INIT returned -1
5047 The MTU is not valid
5048 The hardware length is not valid
5049 The route specified cannot be found
504A Collision when invoking Select; these conditions have already been selected by
another job
504B The job ID is not valid
5050 No Network Resource
5051 Length Error
5052 Addressing Error
5053 Application Error
5054 Client cannot process request
5055 No Network Resource
5056 Non-Operational TCP connection
Hex. Meaning
Error
Code
5057 Incoherent configuration
6003 FIN or RST not expected
F001 In reset mode
F002 Component not fully initialized
Error Codes
The electronic mail notification service supports the following error codes: