copyright © 2012 kendall electric, inc. all rights reserved. socket services lunch & learn...

22
2012 Kendall Electric, Inc. All rights reserved. Socket Services Lunch & Learn Presented by: Eric Paquette Automation Specialist Kendall Electric

Upload: gregory-howard

Post on 19-Jan-2016

221 views

Category:

Documents


6 download

TRANSCRIPT

Page 1: Copyright © 2012 Kendall Electric, Inc. All rights reserved. Socket Services Lunch & Learn Presented by: Eric Paquette Automation Specialist Kendall Electric

Copyright © 2012 Kendall Electric, Inc. All rights reserved.

Socket Services Lunch & Learn

Presented by:Eric PaquetteAutomation SpecialistKendall Electric

Page 2: Copyright © 2012 Kendall Electric, Inc. All rights reserved. Socket Services Lunch & Learn Presented by: Eric Paquette Automation Specialist Kendall Electric

Agenda

• What Is It?• Understanding Basic Socket Services• How is it Different from Standard Ethernet Communications• Explanation of New Hardware Capable of Socket Comms• Socket Services Hints• Setting it Up• Review of Error Codes – Common and Others• Some Examples• Reference Tools • Setting Up and Using Logging with the EWEB

Copyright © 2012 Kendall Electric, Inc. All rights reserved.

Page 3: Copyright © 2012 Kendall Electric, Inc. All rights reserved. Socket Services Lunch & Learn Presented by: Eric Paquette Automation Specialist Kendall Electric

What is a socket?

• A socket is one of the most fundamental technologies of computer networking.

• Sockets allow applications to communicate using standard mechanisms built into network hardware and operating systems.

• Although socket technology may seem to be a relatively new topic, socket technology actually has been around for roughly two decades.

• Sockets are bidirectional, meaning that either side of the connection is capable of both sending (writing) and receiving (reading) data.

• The application that initiates communication is termed the “client” and the other application the “server”.

• Sockets are created using an IP address and a port number.

Copyright © 2012 Kendall Electric, Inc. All rights reserved.

Page 4: Copyright © 2012 Kendall Electric, Inc. All rights reserved. Socket Services Lunch & Learn Presented by: Eric Paquette Automation Specialist Kendall Electric

Who uses socket interfaces?

• Almost all networked hardware and software.

• Historically sockets have been of interest mainly to computer programmers.

• Most, if not all, programming languages use libraries that implement application programming interfaces (API’s) to access socket communications. Microsoft uses Windows Sockets (Winsock).

• Since the widespread growth of Ethernet in factory floor automation, a need was created to make a more generic socket interface. Not all products speak EtherNet/IP.

Copyright © 2012 Kendall Electric, Inc. All rights reserved.

Page 5: Copyright © 2012 Kendall Electric, Inc. All rights reserved. Socket Services Lunch & Learn Presented by: Eric Paquette Automation Specialist Kendall Electric

Types of sockets

• Sockets are divided into three categories: Stream, Datagram and Raw

• Stream– TCP/IP– Connection Oriented– Most Common– Requires two devices to establish a connection in advance

• Datagram– UDP– Connectionless– Implicit– More efficient data transfer

• Raw– Custom low-level programming– Not common

Copyright © 2012 Kendall Electric, Inc. All rights reserved.

Page 6: Copyright © 2012 Kendall Electric, Inc. All rights reserved. Socket Services Lunch & Learn Presented by: Eric Paquette Automation Specialist Kendall Electric

EtherNet/IP vs. Open-Socket Interface

• EtherNet/IP is a protocol and does in fact use sockets to communicate between devices.

• EtherNet/IP products from Rockwell set up the socket connections automatically. No user programming is needed

Copyright © 2012 Kendall Electric, Inc. All rights reserved.

EtherNet/IP Open-Socket Interface

Uses Sockets to communicate between devices

Uses standard Ethernet technology

Application Layer Protocol

Requires Complex Programming to configure

TCP/IP packet capability

UDP packet capability

Used by Rockwell I/O

Used by Third Party Devices

Page 7: Copyright © 2012 Kendall Electric, Inc. All rights reserved. Socket Services Lunch & Learn Presented by: Eric Paquette Automation Specialist Kendall Electric

What can I use Sockets for?

Copyright © 2012 Kendall Electric, Inc. All rights reserved.

• Control data can be easily consumed by an external application using the XML data markup (Data Views)

• Standard XML data presentation provides a platform neutral environment (works on all Operating Systems)

w/ EWEB support

RFID Readers

Printers

Sockets Connection (using the MSG Instruction)

XML Data (via Data Views)

Any Standard Ethernet Devices (ie: Robots)

Non-Windows Based Workstations

• The EWEB modules support both TCP and UDP socket types. Up to 20 Socket connections per module.

• The MSG instruction in RSLogix 5000 is used to setup and pass data thru Socket connections to other devices

Page 8: Copyright © 2012 Kendall Electric, Inc. All rights reserved. Socket Services Lunch & Learn Presented by: Eric Paquette Automation Specialist Kendall Electric

Which Rockwell Products Support an Open-Socket Services?

• 1756-EWEB

• 1768-EWEB

• 1756-EN2xx

• 1769-L30ER, 1769-L30ERM, 1769-L30ER-NSE, 1769-L33ER, 1769-L33ERM, and 1769-L36ERM CompactLogix controllers

• 1769-L24ER-QB1B, 1769-L24ER-QBFC1B, 1769-L27ERM-QBFC1B CompactLogix controllers

• 1769-L16ER, 1769-L18ER, 1769-L18ERM CompactLogix controllers

Copyright © 2012 Kendall Electric, Inc. All rights reserved.

Page 9: Copyright © 2012 Kendall Electric, Inc. All rights reserved. Socket Services Lunch & Learn Presented by: Eric Paquette Automation Specialist Kendall Electric

How is it implemented?

• Rockwell Products that support open-socket services contain a socket object that is available for creating connection instances.

• Socket Instances are created in the EWEB using Message (MSG) Instructions in the PAC.

• The MSG instructions use a CIP Generic messages manage the Socket Instances. This is similar to the socket API function calls in most programming languages.

• Each MSG Instruction is configured to perform one of the many different Socket Services. (Create, Open, Read, Write, Delete, etc.)

• To communicate with another device you must understand the other devices application protocol. For example: the Socket Write must send the data in the proper format for the end device to understand it.

Copyright © 2012 Kendall Electric, Inc. All rights reserved.

Page 10: Copyright © 2012 Kendall Electric, Inc. All rights reserved. Socket Services Lunch & Learn Presented by: Eric Paquette Automation Specialist Kendall Electric

Socket Object Services

• Create Socket• Delete Socket• Delete All Sockets• Open Connection (Client)• Accept Connection (Listen)• Read Data• Write Data• Clear Log• Join Multicast Address• Drop Multicast Address

Copyright © 2012 Kendall Electric, Inc. All rights reserved.

Page 11: Copyright © 2012 Kendall Electric, Inc. All rights reserved. Socket Services Lunch & Learn Presented by: Eric Paquette Automation Specialist Kendall Electric

Typical TCP Client

Copyright © 2012 Kendall Electric, Inc. All rights reserved.

Page 12: Copyright © 2012 Kendall Electric, Inc. All rights reserved. Socket Services Lunch & Learn Presented by: Eric Paquette Automation Specialist Kendall Electric

Typical TCP Server

Copyright © 2012 Kendall Electric, Inc. All rights reserved.

Page 13: Copyright © 2012 Kendall Electric, Inc. All rights reserved. Socket Services Lunch & Learn Presented by: Eric Paquette Automation Specialist Kendall Electric

Using MSG Instructions

Copyright © 2012 Kendall Electric, Inc. All rights reserved.

Page 14: Copyright © 2012 Kendall Electric, Inc. All rights reserved. Socket Services Lunch & Learn Presented by: Eric Paquette Automation Specialist Kendall Electric

Socket Attributes

• Socket Attributes can also be obtained using message instructions.

• These are divided into two catergories:– Class Attributes (apply to the Socket Object)– Instance Attributes (apply to each Socket Instance)

Copyright © 2012 Kendall Electric, Inc. All rights reserved.

Page 15: Copyright © 2012 Kendall Electric, Inc. All rights reserved. Socket Services Lunch & Learn Presented by: Eric Paquette Automation Specialist Kendall Electric

Timeouts! Timeouts! Timeouts!

• There are three types of timeouts to be concerned with:– Service Timeouts

• Should be less than the MSG timeout• Set in the Source Tag of the MSG

– MSG Instruction Timeouts• 30 Sec is Default, can be up to 35 minutes• Set in the MSG Configuration Tab

– Socket Instance Timeouts• 5 minutes is default• Set by accessing the Socket Instance Attributes

Copyright © 2012 Kendall Electric, Inc. All rights reserved.

Page 16: Copyright © 2012 Kendall Electric, Inc. All rights reserved. Socket Services Lunch & Learn Presented by: Eric Paquette Automation Specialist Kendall Electric

Socket Object Logging

• The EWEB cards are capable of logging activity and errors and are stored in RAM of the module

• Logging is viewed on the Web Pages of EWEB module

• Items logged can be selectively chosen

• The log can be enabled, disabled, or cleared from within the controller using a Socket Class Attribute MSG

Copyright © 2012 Kendall Electric, Inc. All rights reserved.

Page 17: Copyright © 2012 Kendall Electric, Inc. All rights reserved. Socket Services Lunch & Learn Presented by: Eric Paquette Automation Specialist Kendall Electric

Socket Object Logging (cont’d)

• Logging can be enabled for the following:– Socket Create Requests– Open Connection Requests– Accept Connection Requests– Read Requests– Write Requests– Delete Socket and Delete All Socket Requests– Get / Set Attribute Requests– Log All Service Errors

Copyright © 2012 Kendall Electric, Inc. All rights reserved.

Page 18: Copyright © 2012 Kendall Electric, Inc. All rights reserved. Socket Services Lunch & Learn Presented by: Eric Paquette Automation Specialist Kendall Electric

Socket Object Logging (cont’d)

• A view of the EWEB Log Web Page

Copyright © 2012 Kendall Electric, Inc. All rights reserved.

Page 19: Copyright © 2012 Kendall Electric, Inc. All rights reserved. Socket Services Lunch & Learn Presented by: Eric Paquette Automation Specialist Kendall Electric

Errors

• Message Instruction Errors contain two parts:– Error Code– Extended Error Code

• Error Codes 0 to FE are MSG Errors– See page 165 of 1756-RM003N-EN-P

• Socket Service Errors Codes are generally FF

• When evaluating errors from Socket Service Messages, we typically look at the Extended Error Code– See page 155 of ENET-UM527-EN-P

Copyright © 2012 Kendall Electric, Inc. All rights reserved.

Page 20: Copyright © 2012 Kendall Electric, Inc. All rights reserved. Socket Services Lunch & Learn Presented by: Eric Paquette Automation Specialist Kendall Electric

Knowledgebase Articles

• 48879 – Summary of EWEB socket Information

• 32962 – Sample Application in Ladder

• 40626 – Socket Service Hints

• 470690 – List of Hardware with Socket Support

• 66505 – Basic Socket Code in Structured Text

• 33240 – Using EWEB with Ethernet Printers

• 33672 – EWEB TCP Server application sample

• 34357 – Send UDP multicast messages

Copyright © 2012 Kendall Electric, Inc. All rights reserved.

Page 21: Copyright © 2012 Kendall Electric, Inc. All rights reserved. Socket Services Lunch & Learn Presented by: Eric Paquette Automation Specialist Kendall Electric

Let’s see it in action!

Demo

Copyright © 2012 Kendall Electric, Inc. All rights reserved.

Page 22: Copyright © 2012 Kendall Electric, Inc. All rights reserved. Socket Services Lunch & Learn Presented by: Eric Paquette Automation Specialist Kendall Electric

Copyright © 2010 Kendall Electric, Inc. All rights reserved.

Thank you for attending this Lunch & Learn session!

Questions?