|
Modbus TCP
Communications
ORMEC’s
MotionBASIC® Extensions for Modbus TCP Communications adds to the network
capability of the ORION® motion controller. Modbus TCP is an provides a
fast and low cost method to send and receive application data to any other
controller on an Ethernet network installed as a Quantum communication
node. The MBX also adds a full list of
MotionBASIC® statements to configure, control and monitor Quantum PLC
activity.
Features
and Benefits
Using Modbus TCP communications provides a
number of key advantages:
- A low cost physical interface to the
ORION® controller ... using standard Ethernet cards.
- Based on standard internet technologies
... TCP/IP protocol layered on a high speed 10base Ethernet network.
- Enhances the flexibility and performance
of message transfers by allowing peer-to-peer connections between
network nodes.
- Provides reliable connectivity to
popular HMI packages that use Modbus TCP to transfer of integers,
floating point and text string variables as object tags for operator
input and output.
- Based on open standards for effective
integration to other third party components.
Overview
Modbus TCP communications extends the MotionBASIC® operating system to
provide high speed connectivity between multiple ORION® controllers as
well as to third party PLCs and HMI packages that communicate with the
Modbus TCP protocol over an Ethernet network. An ORION® controller, with
an Ethernet link installed and configured with the MBX software
extensions, can open a Modbus TCP connection to send application data to
any Modbus TCP server node on the network. The ORION® also has the
ability to start a server node that will accept any connection from
another Modbus TCP node and receive application data.
Multi-protocol capability
Software development for a system with multiple ORION® controllers using
the full capabilities of Modbus TCP communications can now be performed
with one PC. Since Ethernet is a multi-protocol network, any PC connected
to the network can establish a TCP/IP connection, communicate to an ORION®
and run the MotionDesk for program development over the same wire at
basically the same time Modbus TCP communications are also going on.
.
Modbus TCP Architecture
ORION® Modbus TCP consists of a physical layer based on 10baseT, 10base2,
or 10base5 type Ethernet communication standards along with a
client/server transport protocol (TCP/IP stack) to provide reliable
peer-to-peer communications in the ORION® controller. At the application
level, the MBX uses the Modbus protocol developed for the PLC industry to
transfer register data as messages between controllers. All transfers
happen as a background task concurrent with the user’s main application
program.
User access at the application programming
interface level consists of MotionBASIC® extensions for making the
connection to the destination server and the specifying source and
destination registers for a read or a write multiple register transfer to
that connected server. Concurrent multiple connections can be made to
multiple servers on the network for a flexible and efficient arrangement
for updating application data between a variety of system components.
For constructing messages, the MBX provides
MotionBASIC® mapping capabilities to simplify data organization at the
PLC register level for the user.
ORION® Variable Mapping
The ability to map variables provides a way to map PLC register values
to any MotionBASIC® variable in the controller. Typically, PLC registers
are addressed numerically, but MotionBASIC® uses symbolic labels to
address its variables.
With mapping, the symbolic label of the
MotionBASIC® variable can be simultaneously defined as a PLC register
address value. Register mapping values can range from 0 to 32367. The main
purpose of this mapping feature is to allow the MBX to quickly assemble
the content of various variables such as integers, floats and strings that
reside in different areas of the controller’s memory, into an ordered
list of data and transferred over the network as one message.
The MBX also provides the
ability to monitor the changes in selected variables. Any change in the
data contained in the variable selected, can result in an event interrupt.
The event interrupt, if enabled, will in turn execute a user defined block
of code (subroutine) designed to respond to the changes in the data as a
result of receiving the message.
Modbus TCP MotionBASIC®
Extensions
MBX Statements
-
QE.OPEN
<device%>,"ip_adr,CLIENT | SERVER [,TM<timeout>] Open
a Server or a Client connection to a Server
-
QE.READ [qty of reg(s)]
FROM <starting src_register> TO <starting dest_register>
- QE.WRITE [qty of reg(s)] FROM
<starting src_register> TO <starting dest_register>
- QE.FC coil%, state% Force a
single coil to be on or off
- QE.CLOSE [<device%>] Close
one connection or all connections
MBX Control functions and access
variables
- QE@ = ON Set mapped register
access enabled
- QE.SOCKOPEN@(device%) Get status
of TCP/IP connection
- QE.DEST@ = device% Set
destination connection for next client command
- QE.MSG@(device%) Get client reply
received status
- QE.LED@ = <led value> Set
MBX to use the front panel MBX LED indicator.
- QE.CTR@(ctr%) Get 1 of 32 error
status counts of client and server connection activity during data
transfers.
- QE.STS@(device%) Get the response
code for the last exception that occurred.
Diagnostic Commands that display to the
Direct Mode window in MotionDesk.
- QE.TRACE@= ON Enable real-time
display of message transfer activity.
- QE.DUMP Display the current
settings and information for all current connections.
- PING <IP address> Check to
make sure that the destination IP address is available and listening
on the network.
MBX General MotionBASIC® Mapping
Statements
- MAP <regnum> TO
<variable> Relate a register number 0 to 32767 to a
MotionBASIC variable name.
- ON EVENT MAP@(regnum) GOSUB [label]
Call subroutine when value mapped to regnum changed.
TCP/IP Network Protocol Overview
TCP & IP are two separate protocols that along with others make
up what is known as the "Internet Protocol Suite". Because these
are the two best known protocols in the collection, people use TCP/IP to
refer to the entire collection.
TCP stands for Transfer Control Protocol.
It is responsible for breaking up data into packets, called datagrams, to
be sent, and then reconstructing the original data at the other end when
it is received. It also handles transmission errors, re-sending lost or
corrupt packets.
IP stands for Internet Protocol. TCP calls
on IP to route datagrams to their correct destinations. TCP supplies IP
with the destination address and IP handles all the details of how to get
the datagrams through routers, gateways, and other network links ensuring
the data will always arrive at the correct location.
Protocols below the IP layer manage the
physical media such as the Point-to-Point Protocol (PPP) dial-up service
for modem access or networks like Ethernet.
The TCP/IP protocols are "low
level" components of the Internet Protocol Suite. The other protocols
in the collection deal more with what is being sent and are referred to as
"application level" protocols.
The two application protocols that are used
by MotionDesk to communicate with the ORION® are FTP for file transfers
& TELNET to give specific commands. When an A-B Ethernet or Modbus TCP
MBX is installed on the ORION®, a new application protocol is added to
communicate with either A-B or Quantum controllers. Custom application
protocols may be programmed by the user using MotionBASIC® statements
that support TCP/IP sockets.
The ORION® controller uses TCP/IP and
manages all of these protocols simultaneously providing reliable
connections to a variety of different sources.
Modicon and Modbus are trademarks of
Schneider Electric
Click here to
view/print/download an Acrobat PDF of this document (920k).
|