没有合适的资源?快使用搜索试试~ 我知道了~
首页AB PLC 与 PC 通过 socket 通讯文档
资源详情
资源评论
资源推荐

EtherNet/IP Socket Interface
Application Technique

Important User Information
Read this document and the documents listed in the additional resources section about installation, configuration, and
operation of this equipment before you install, configure, operate, or maintain this product. Users are required to
familiarize themselves with installation and wiring instructions in addition to requirements of all applicable codes, laws,
and standards.
Activities including installation, adjustments, putting into service, use, assembly, disassembly, and maintenance are required
to be carried out by suitably trained personnel in accordance with applicable code of practice.
If this equipment is used in a manner not specified by the manufacturer, the protection provided by the equipment may be
impaired.
In no event will Rockwell Automation, Inc. be responsible or liable for indirect or consequential damages resulting from the
use or application of this equipment.
The examples and diagrams in this manual are included solely for illustrative purposes. Because of the many variables and
requirements associated with any particular installation, Rockwell Automation, Inc. cannot assume responsibility or
liability for actual use based on the examples and diagrams.
No patent liability is assumed by Rockwell Automation, Inc. with respect to use of information, circuits, equipment, or
software described in this manual.
Reproduction of the contents of this manual, in whole or in part, without written permission of Rockwell Automation,
Inc., is prohibited.
Throughout this manual, when necessary, we use notes to make you aware of safety considerations.
Labels may also be on or inside the equipment to provide specific precautions.
Allen-Bradley, Rockwell Software, Rockwell Automation, CompactLogix, ControlLogix, Logix5000, MicroLogix, RSLogix 5000, and TechConnect are trademarks of Rockwell Automation, Inc.
Trademarks not belonging to Rockwell Automation are property of their respective companies.
WARNING: Identifies information about practices or circumstances that can cause an explosion in a hazardous environment,
which may lead to personal injury or death, property damage, or economic loss.
ATTENTION: Identifies information about practices or circumstances that can lead to personal injury or death, property
damage, or economic loss. Attentions help you identify a hazard, avoid a hazard, and recognize the consequence.
IMPORTANT
Identifies information that is critical for successful application and understanding of the product.
SHOCK HAZARD: Labels may be on or inside the equipment, for example, a drive or motor, to alert people that dangerous
voltage may be present.
BURN HAZARD: Labels may be on or inside the equipment, for example, a drive or motor, to alert people that surfaces may
reach dangerous temperatures.
ARC FLASH HAZARD: Labels may be on or inside the equipment, for example, a motor control center, to alert people to
potential Arc Flash. Arc Flash will cause severe injury or death. Wear proper Personal Protective Equipment (PPE). Follow ALL
Regulatory requirements for safe work practices and for Personal Protective Equipment (PPE).

Rockwell Automation Publication ENET-AT002C-EN-P - September 2014 3
Summary of Changes
This manual contains new and updated information. Changes throughout this
revision are marked by change bars, as shown to the right of this paragraph.
New and Updated
Information
This table contains the changes made to this revision.
Topic Page
Updated the Additional Resources. 7
Updated the list of supported modules. 9
Added Important message to the Socket Interface Architecture section. 16
Updated instance creation in ReadSocket. 32
Updated instance creation in WriteSocket. 34
Updated the list of Error Codes for Socket Services. 49

4 Rockwell Automation Publication ENET-AT002C-EN-P - September 2014
Summary of Changes
Notes:

Rockwell Automation Publication ENET-AT002C-EN-P - September 2014 5
Table of Contents
Important User Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
Summary of Changes
New and Updated Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
Preface
Additional Resources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
Chapter 1
Socket Interface Architecture
Socket Interface Architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
Number and Type of Sockets. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
Typical Sequence of Transactions for a TCP Client . . . . . . . . . . . . . 12
Typical Sequence of Transactions for a TCP Server . . . . . . . . . . . . . 12
Typical Sequence of Transactions for UDP
without OpenConnection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
Typical Sequence of Transactions for UDP
with OpenConnection. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
Communicate with the Socket Object via a MSG Instruction . . . . . . . . 16
Service Timeouts. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
MSG Instruction Timeouts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
Socket Instance Timeouts. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
Programming Considerations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
TCP Connection Loss . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
ControlLogix Enhanced Redundancy . . . . . . . . . . . . . . . . . . . . . . . . . . 20
EtherNet/IP Module Reset. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
Change Controller Mode between Run and Program. . . . . . . . . . . . 21
Application Messages and TCP. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
Application Messages and Uninhibited Modules . . . . . . . . . . . . . . . . 21
Partial Reads . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
Partial Writes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
Performance Considerations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
Chapter 2
Socket Object Services
Socket Create. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
MSG Source Element. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
MSG Source Length . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
MSG Destination Element . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
Considerations. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
OpenConnection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
MSG Source Element. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
MSG Source Length . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
MSG Destination Element . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
Considerations. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
AcceptConnection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
MSG Source Element. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
MSG Source Length . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
MSG Destination Element . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
Considerations. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
剩余55页未读,继续阅读
















安全验证
文档复制为VIP权益,开通VIP直接复制

评论5