ABB IRC5 Compact Applications Manual

Specifications

Brand: ABB
Category: Controller
Model: IRC5 Compact (Applications Manual)
File Type: PDF
File Size: —
Pages: 48

Read Online

Read the ABB IRC5 Compact Applications Manual online using the built-in PDF viewer.

Text of the manual

Robot Reference Interface

RobotWare 5.60 Document ID: 3HAC031973-001 Revision: F © Copyright 2008-2009,2013 ABB. All rights reserved.

The information in this manual is subject to change without notice and should not

be construed as a commitment by ABB. ABB assumes no responsibility for any errors that may appear in this manual. Except as may be expressly stated anywhere in this manual, nothing herein shall be construed as any kind of guarantee or warranty by ABB for losses, damages to persons or property, fitness for a specific purpose or the like. In no event shall ABB be liable for incidental or consequential damages arising from use of this manual and products described herein. This manual and parts thereof must not be reproduced or copied without ABB's written permission. Additional copies of this manual may be obtained from ABB. The original language for this publication is English. Any other languages that are supplied have been translated from English. © Copyright 2008-2009,2013 ABB. All rights reserved. ABB AB Robotics Products Se-721 68 Västerås Sweden

Table of contents

7 Overview of this manual ................................................................................................................... 9 Product documentation, IRC5 .......................................................................................................... 11 Safety ................................................................................................................................................ 13 1 Introduction to Robot Reference Interface 15 2 Installation 15 2.1 Connecting the communication cable .................................................................... 16 2.2 Prerequisites .................................................................................................... 17 2.3 Data orchestration ............................................................................................. 18 2.4 Supported data types ......................................................................................... 19 3 Configuration 19 3.1 Interface configuration ....................................................................................... 20 3.2 Interface settings .............................................................................................. 21 3.3 Device description ............................................................................................. 24 3.4 Device configuration .......................................................................................... 27 4 Configuration examples 27 4.1 RAPID programming .......................................................................................... 28 4.2 Example configuration ....................................................................................... 33 5 RAPID reference information 33 5.1 RAPID instructions ............................................................................................ 33 5.1.1 SiConnect - Sensor Interface Connect ......................................................... 36 5.1.2 SiClose - Sensor Interface Close ................................................................ 38 5.1.3 SiGetCyclic - Sensor Interface Get Cyclic .................................................... 40 5.1.4 SiSetCyclic - Sensor Interface Set Cyclic ..................................................... 42 5.2 RAPID data types .............................................................................................. 42 5.2.1 sensor - External device descriptor ............................................................. 44 5.2.2 sensorstate - Communication state of the device .......................................... 45 Index 3HAC031973-001 Revision: F 5 © Copyright 2008-2009,2013 ABB. All rights reserved. Table of contents

Overview of this manual

About this manual This manual explains the basics of how and when to use the RobotWare option Robot Reference Interface. Usage This manual can be used either as a reference to find out if an option is the right choice for solving a problem, or as a description of how to use an option. Detailed information regarding syntax for RAPID routines and configuration of system parameters is not described here, but can be found in the respective reference manual. Who should read this manual? This manual is mainly intended for robot programmers. Prerequisites The reader should be: • Familiar with industrial robots and their terminology. • Familiar with the RAPID programming language. • Familiar with RobotStudio and how to work with system parameters. References Document ID Reference 3HAC031045-001 Operating manual - General safety information Technical reference manual - RAPID Instructions, Functions and Data 3HAC16581-1 types 3HAC032104-001 Operating manual - RobotStudio Sample code available on www.abb.com/robotics (ABB Library) Revisions Description Revision First edition - Released with RobotWare 5.12. Minor corrections. A SiConnect has a new switch \NoStop. Updates in sensor. SiTool and SiWobj are no longer needed for calculations. Current tool and workobject are used instead. Released with RobotWare 5.14. B The following updates are made: • The correct unit for robot joints is radians, see Example configura- tion on page 28. • Corrected code in examples, see Example configuration on page28. Correction of connections in Connecting the communication cable on page 15. C Continues on next page 3HAC031973-001 Revision: F 7 © Copyright 2008-2009,2013 ABB. All rights reserved. Overview of this manual

Released with RobotWare 5.15.

D Clarifications added regarding the direction of data exchange in Introduc- tion to Robot Reference Interface on page 13. Released with RobotWare 5.15.01. • All references to the protocol high-priority UDP (HP-UDP) are re- moved throughout the manual. The protocol is not supported. • The attribute Link is changed from optional to mandatory in Properties on page 26. • Minor corrections. E Released with RobotWare 5.60. • Updated the graphic in the section Connecting the communication cable on page 15. • Updated information related to Network ports in the section Device description on page 21. F 8 3HAC031973-001 Revision: F © Copyright 2008-2009,2013 ABB. All rights reserved. Overview of this manual Continued

Product documentation, IRC5

Categories for manipulator documentation The manipulator documentation is divided into a number of categories. This listing is based on the type of information in the documents, regardless of whether the products are standard or optional. All documents listed can be ordered from ABB on a DVD. The documents listed are valid for IRC5 manipulator systems. Product manuals Manipulators, controllers, DressPack/SpotPack, and most other hardware will be delivered with a Product manual that generally contains: • Safety information. • Installation and commissioning (descriptions of mechanical installation or electrical connections). • Maintenance (descriptions of all required preventive maintenance procedures including intervals and expected life time of parts). • Repair (descriptions of all recommended repair procedures including spare parts). • Calibration. • Decommissioning. • Reference information (safety standards, unit conversions, screw joints, lists of tools ). • Spare parts list with exploded views (or references to separate spare parts lists). • Circuit diagrams (or references to circuit diagrams). Technical reference manuals The technical reference manuals describe reference information for robotics products. • Technical reference manual - Lubrication in gearboxes: Description of types and volumes of lubrication for the manipulator gearboxes. • Technical reference manual - RAPID overview: An overview of the RAPID programming language. • Technical reference manual - RAPID Instructions, Functions and Data types: Description and syntax for all RAPID instructions, functions, and data types. • Technical reference manual - RAPID kernel: A formal description of the RAPID programming language. • Technical reference manual - System parameters: Description of system parameters and configuration workflows. Application manuals Specific applications (for example software or hardware options) are described in Application manuals. An application manual can describe one or several applications. Continues on next page 3HAC031973-001 Revision: F 9 © Copyright 2008-2009,2013 ABB. All rights reserved. Product documentation, IRC5

An application manual generally contains information about:

• The purpose of the application (what it does and when it is useful). • What is included (for example cables, I/O boards, RAPID instructions, system parameters, DVD with PC software). • How to install included or required hardware. • How to use the application. • Examples of how to use the application. Operating manuals The operating manuals describe hands-on handling of the products. The manuals are aimed at those having first-hand operational contact with the product, that is production cell operators, programmers, and trouble shooters. The group of manuals includes (among others): • Operating manual - Emergency safety information • Operating manual - General safety information • Operating manual - Getting started, IRC5 and RobotStudio • Operating manual - Introduction to RAPID • Operating manual - IRC5 with FlexPendant • Operating manual - RobotStudio • Operating manual - Trouble shooting IRC5, for the controller and manipulator. 10 3HAC031973-001 Revision: F © Copyright 2008-2009,2013 ABB. All rights reserved. Product documentation, IRC5 Continued

Safety of personnel

A robot is heavy and extremely powerful regardless of its speed. A pause or long stop in movement can be followed by a fast hazardous movement. Even if a pattern of movement is predicted, a change in operation can be triggered by an external signal resulting in an unexpected movement. Therefore, it is important that all safety regulations are followed when entering safeguarded space. Safety regulations Before beginning work with the robot, make sure you are familiar with the safety regulations described in the manual Operating manual - General safety information. 3HAC031973-001 Revision: F 11 © Copyright 2008-2009,2013 ABB. All rights reserved. Safety

1 Introduction to Robot Reference Interface

Introduction Robot Reference Interface is an option, supporting data exchange on the cyclic channel. It provides the possibility to periodically send planned and actual robot position data from the robot controller, as well as the exchange of other RAPID variables from and to the robot controller. The message contents are represented in XML format and are configured using appropriate sensor configuration files. Robot Reference Interface The cyclic communication channel (TCP or UDP) can be executed in the high-priority network environment of the IRC5 Controller which ensures a stable data exchange up to 250Hz. Robot Sensor Rapid data Motion data RRI Cyclic channel (TCP or UDP) read/write Receive commands, parameters and robot data Return parameters and sensor data read only Cabinet status read only xx0800000128 3HAC031973-001 Revision: F 13 © Copyright 2008-2009,2013 ABB. All rights reserved. 1 Introduction to Robot Reference Interface

2.1 Connecting the communication cable

Overview This section describes where to connect the communication cable on the controller. For further instructions, see the corresponding product manual for your robot system. Location A B xx1300000609 Service port on the computer unit (connected to the service port on the controller) A WAN port on the computer unit B Note Action Note The service connection can only be used if it is free. Use one of these two connections (A or B). 1 3HAC031973-001 Revision: F 15 © Copyright 2008-2009,2013 ABB. All rights reserved. 2 Installation 2.1 Connecting the communication cable

This section describes the prerequisites for using Robot Reference Interface.

UDP/IP or TCP IP Robot Reference Interface supports the communication over the standard IP protocols UDP or TCP. Recommendations The delay in the overall communication mostly depends on the topology of the employed network. In a switched network the transmission will be delayed due to buffering of the messages in the switches. In a parallel network collisions with multiple communication partners will lead to messages being resent. Therefore we recommended using a dedicated Ethernet link between the external system and the robot controller to provide the required performance for real-time applications. Robot Reference Interface can be used to communicate with any processor-based devices, that support IP via Ethernet and can serialize data into XML format. 16 3HAC031973-001 Revision: F © Copyright 2008-2009,2013 ABB. All rights reserved. 2 Installation 2.2 Prerequisites

2.3 Data orchestration

Overview The outgoing message can be combined from any data from the RAPID level and internal data from the cabinet and motion topic. The orchestration of the data is defined in the device configuration by setting the Link attribute of internally linked data to Intern. Illustration xx0800000178 Data from the Controller topic Comment Description Type Name The mapping of the members for the Op- Mode type can be defined in the configura- tion file. Operation mode of the robot. OpMode OperationMode Data from the Motion topic Comment Description Type Name There is a delay of approxim- ately 8ms. Time stamp for the robot posi- tion from drive feedback. Time FeedbackTime Current tool and workobject are used for calculation. Robot TCP calculated from drive feedback. Frame FeedbackPose Robot joint values gathered from drive feedback. Joints FeedbackJoints Prediction time from approxim- ately 24ms to 60ms depending on robot type. Timestamp for planned robot TCP position and joint values. Time PredictedTime Current tool and workobject are used for calculation. Planned robot TCP. Frame PlannedPose Planned robot joint values. Joints PlannedJoints 3HAC031973-001 Revision: F 17 © Copyright 2008-2009,2013 ABB. All rights reserved. 2 Installation 2.3 Data orchestration

2.4 Supported data types

Overview This section contains a short description of the Robot Reference Interface supported data types, for more detailed information about the supported data types see References on page 7. Data types Robot Reference Interface supports the following simple data types: RAPID type mapping Description Data type bool Boolean value. bool num Single precision, floating point value. real Time in seconds expressed as floating point value. num time string String with max length of 80 characters. string Cartesian position and orientation in Euler Angles pose (Roll-Pitch-Jaw). frame robjoint Robot joint values. joints In addition, user-defined records can also be transferred from the external system to the robot controller, which are composed from the supported simple data types. User defined record types must be specified in the configuration file of the external device. See Device configuration on page 24 for a description on how to create user-defined record types. 18 3HAC031973-001 Revision: F © Copyright 2008-2009,2013 ABB. All rights reserved. 2 Installation 2.4 Supported data types

3.1 Interface configuration

Configuration files The configuration and settings files for the interface must be located in the folder HOME/GSI. This ensures that the configuration files are included in system backups. xx0800000177 Related information For more detailed information of the Settings.xml file see Interface settings on page 20. For more detailed information of the Description.xml file see Device description on page 21. For more detailed information of the Configuration.xml file see Device configuration on page 24. 3HAC031973-001 Revision: F 19 © Copyright 2008-2009,2013 ABB. All rights reserved. 3 Configuration 3.1 Interface configuration

3.2 Interface settings

Overview This section describes the use of the xml file Settings.xml. Settings.xml The settings file Settings.xml contains the general settings for the GSI interface. It is located in the folder HOME/GSI. For the option Robot Reference Interface this file refers to a list of all communication clients for external systems installed in the controller. The Settings.xml file can be defined according to the XML schema Settings.xsd. Example For each communication client installed on the controller, the file Settings.xml must contain a Client entry in the Clients section. The Convention attribute identifies the protocol convention used by the client, for the Robot Reference Interface option only CDP is supported. The Name attribute identifies the name of the client and also specifies the folder with the device related configuration files. CDP stands for cyclic data protocol and is the internal name of the protocol, on which Robot Reference Interface messages are transferred. An internal client node of the interface module will be created, which is able to connect to the external system MySensor that runs a data server application and can communicate via Robot Reference Interface with the robot. For each sensor system, a subdirectory named with the sensor system identifier, for example MySensor, contains further settings. 20 3HAC031973-001 Revision: F © Copyright 2008-2009,2013 ABB. All rights reserved. 3 Configuration 3.2 Interface settings

3.3 Device description

Overview This section describes the use of the xml file Description.xml. Description.xml The device description file Description.xml is located in the corresponding subdirectory of the device. It specifies the general device parameters, network connection and CDP specific communication settings for an installed device. A device description can be defined according to the XML schema Description.xsd. Example This is an example of a device description: AnyDevice CDP IntelligentCamera MachineVision 2000 30 false Name The first section defines the general device parameters. The Name element identifies the name of the device and should correspond to the device name specified in the settings file. It must correspond to the identifier specified for the device descriptor on the RAPID level, because the descriptor name will be used initially to refer to the device in the RAPID instructions. Comment Value Description Attribute Element Maximum 16 characters Any string Device identifier Name Convention The Convention element identifies the protocol that should be used by the device, for the Robot Reference Interface option only the Cyclic Data Protocol (CDP) is supported. Comment Value Description Attribute Element CDP Protocol type Convention Continues on next page 3HAC031973-001 Revision: F 21 © Copyright 2008-2009,2013 ABB. All rights reserved. 3 Configuration 3.3 Device description

Type and Class

The Type and Class elements identifies the device type and class and are currently not validated, therefore they can also contain undefined device types or classes. Comment Value Description Attribute Element Not validated Any string Sensor type Type Not validated Any string Sensor class Class Network The Network section defines the network connection settings for the device. The Address attribute specifies the IP address or host name of the device on the network. The optional Port attribute is used to specify the physical Ethernet port on the controller side that the cable is plugged into. Valid values are WAN and Service. The attribute can be omitted if the WAN port is used for communication. Comment Value Description Attribute Element Network settings Network Any valid IP ad- 10.49.65.249 dress or host name IP address or host name of the device Address DE-L-0328122 Optional. Can be omit- ted if WAN port is used. WAN Service Physical Ethernet port on the controller Port Channel The Channel element defines the settings for the communication channel between the robot controller and the external device. The Type attribute identifies the channel type, only Cyclic is supported by Robot Reference Interface. The Protocol attribute identifies the IP protocol used on the channel, for Robot Reference Interface you can specify to use Tcp or Udp. The Port attribute specifies the logical port number for the channel on the device side. Comment Value Description Attribute Element Channel settings Channel Cyclic Channel type Type Tcp The IP protocol type Protocol Udp Any available port num- ber on the device, maxim- um 65535. uShort The logical port num- ber of the channel Port Continues on next page 22 3HAC031973-001 Revision: F © Copyright 2008-2009,2013 ABB. All rights reserved. 3 Configuration 3.3 Device description Continued

The Settings section contains communication parameters specific to the CDP

protocol. The TimeOut element defines the timeout for not received messages. This element identifies the time until the connection is considered broken and is only needed for bidirectional communication. The MaxLost attribute defines the maximum number of not acknowledged or lost messages allowed. The DryRun element identifies, if the acknowledgement of messages is supervised and can be used to setup an unidirectional communication. Comment Value Description Element Time in milliseconds, a multiple of 4 ms. Time out for commu- nication TimeOut Integer Maximum loss of packages allowed MaxLost If TRUE, TimeOut and MaxLost will not be checked. Bool Interface run mode DryRun If the element DryRun in the Description.xml is set to FALSE, communication supervision is established on the protocol level of the Robot Reference Interface, using the settings for TimeOut and MaxLost. This supervision requires that each message that is sent out from the robot controller is answered by the connected device. The supervision generates a communication error, if the maximum response time or the maximum number of lost packages is exceeded. Each sent out message has an ID, which needs to be used for the ID in the reply too, to identify the reply message and to detect which packages have been lost. See also the example in section Transmitted XML messages on page 31. 3HAC031973-001 Revision: F 23 © Copyright 2008-2009,2013 ABB. All rights reserved. 3 Configuration 3.3 Device description Continued

3.4 Device configuration

Overview The device configuration file Configuration.xml is located in the corresponding subdirectory of the device. It defines the enumerated and complex types used by the device and identifies the available parameters, which can be subscribed for cyclic transmission. The configuration file can be defined according to the XML schema Configuration.xsd. The following document shows a simplified device configuration. Example Enums In the Enums section each Enum element defines an enumerated type. The Name attribute of the Enum element specifies the name of the enumerated type, the optional Link attribute identifies if the members of the enumerated type have internal linkage. Comment Value Descriptions Attribute Element Enum Maximum 16 characters. A valid RAPID symbol name Name of enumer- ated type Name Optional. Can be omitted if members only have RAPID linkage. Linkage of mem- Intern bers of enumer- ated type Link Continues on next page 24 3HAC031973-001 Revision: F © Copyright 2008-2009,2013 ABB. All rights reserved. 3 Configuration 3.4 Device configuration

Each Member element defines a member element of the enumerated type. The

Name attribute specifies the name of the member on the controller side (on RAPID level). The Alias attribute identifies the name of the member on the device side (and in the transmitted message). Comment Value Descriptions Attribute Element Member Maximum 16 characters.Valid internal RAPID symbol names. See Data orchestra- tion on page 17. A valid RAPID symbol name Name of enumer- ated type mem- ber Name Optional. The alias name is used on the device side and in message String Alias name of enumerated type member Alias Record In the Records section each Record element defines a declaration of a complex type. In RAPID this complex type will be represented as a RECORD declaration. The Name attribute identifies the name of the complex type on the controller side. The Alias attribute defines the alias name of the type on the device side and in the message. Comment Value Descriptions Attribute Element Record Maximum 16 characters. A valid RAPID symbol name Name of the com- plex type. Name Optional. The alias name is used on the device side and in message. String Alias name of complex type. Alias Field Each Field element defines a field element of a complex type. The Name attribute identifies the name of the field. The Type attribute identifies the enumerated, complex or simple type associated with the field. The Size attribute defines the size of a multi-dimensional field. The Link attribute identifies if the field has internal linkage. Comment Value Descriptions Attribute Element Field Maximum 16 characters.Valid internal RAPID symbol names. See Data orchestra- tion on page 17. A valid RAPID symbol name Name of the com- plex type field Name Described in section Suppor- ted data types on page 18. All supported data types Data type of the field Type Optional. Only basic types can be defined as array. Integer Dimensions of the field (size of array) Size Optional. Can be omitted if field has RAPID linkage. Intern Linkage of com- plex type field Link Optional. The alias name is used on device side and in message. String Alias name of complex type field Alias Continues on next page 3HAC031973-001 Revision: F 25 © Copyright 2008-2009,2013 ABB. All rights reserved. 3 Configuration 3.4 Device configuration Continued

In the Properties section each Property element defines a RAPID variable that can

be used in the SiGetCyclic and SiSetCyclic instructions. Comment Value Descriptions Attribute Element Property An valid RAPID Maximum 16 characters. symbol name Name of the property Name Described in section Suppor- ted data types on page 18. All supported data types Data type of the property Type Optional. Only basic types can be defined as array. Integer Dimension (Size of array) Size Optional. Can be omitted if property is read and write en- abled. None ReadOnly WriteOnly Access Flag Flag ReadWrite Mandatory if field has RAPID linkage. Intern Linkage of prop- erty Link Optional. The alias name is used on device side and in message. Alias name of the String property Alias 26 3HAC031973-001 Revision: F © Copyright 2008-2009,2013 ABB. All rights reserved. 3 Configuration 3.4 Device configuration Continued

4 Configuration examples

4.1 RAPID programming RAPID module A RAPID module containing the corresponding RAPID record declarations and variable declarations must be created and loaded. The FlexPendant user interface is not included in RobotWare. 3HAC031973-001 Revision: F 27 © Copyright 2008-2009,2013 ABB. All rights reserved. 4 Configuration examples 4.1 RAPID programming

4.2 Example configuration

Overview The files Settings.xml, Description.xml, and Configuration.xml are located in the folder HOME\GSI\ xx0800000177 Note The name of the folder must correspond to the name of the device. See Device description on page 21. In this example we have used the name AnyDevice. The network address used in Description.xml is to the PC running the server, not the robot controller. See Device description on page 21. Settings.xml AnyDevice CDP IntelligentCamera MachineVision 2000 Continues on next page 28 3HAC031973-001 Revision: F © Copyright 2008-2009,2013 ABB. All rights reserved. 4 Configuration examples 4.2 Example configuration

Continues on next page 3HAC031973-001 Revision: F 29 © Copyright 2008-2009,2013 ABB. All rights reserved. 4 Configuration examples 4.2 Example configuration Continued

This is an example for an RRI implementation. The out data uses an array of 18

num (robdata). The in data receives a string and an array of 18 num (sensdata). This needs to defined according the file configuration.xml. RECORD applicationdata num Item1; num Item2; num Item3; num Item4; num Item5; num Item6; num Item7; num Item8; num Item9; num Item10; num Item11; num Item12; num Item13; num Item14; num Item15; num Item16; num Item17; num Item18; ENDRECORD RECORD robdata applicationdata AppData; ENDRECORD RECORD sensdata string ErrString;applicationdata AppData; ENDRECORD ! Sensor Declarations PERS sensor AnyDevice := [1,4,0]; PERS robdata DataOut := [[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]]; PERS sensdata DataIn := ["No",[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]]; ! Setup Interface Procedure PROC RRI_Open() SiConnect AnyDevice; ! Send and receive data cyclic with 64 ms rate SiGetCyclic AnyDevice, DataIn, 64; SiSetCyclic AnyDevice, DataOut, 64; ENDPROC ! Close Interface Procedure PROC RRI_Close() ! Close the connection SiClose RsMaster; ENDPROC ENDMODULE Continues on next page 30 3HAC031973-001 Revision: F © Copyright 2008-2009,2013 ABB. All rights reserved. 4 Configuration examples 4.2 Example configuration Continued

Transmitted XML messages

Each XML message has the data variable name as root element with the attributes Id (the message ID) and Ts (the time stamp of the message). The subelements are then the record fields. The values of a multiple value field (array or record) are expressed as attributes. Message sent out from robot controller The time unit is second (float) with a resolution of 1 ms. The position (length) unit is millimeter (float). The position (angle) unit is radians. Description Data type Name Last received robot data message ID Integer Id Time stamp (message) Float Ts Operation mode Operationmode RobMode Time stamp (actual position) Float TS_act Actual cartesian position Pose P_act Actual joint position Joint J_act Time stamp (desired position) Float TS_des Desired cartesian position Pose P_des Desired joint position Joint J_des Free defined application data Array of 18 Floats AppData Auto 1.200 1.200 Message received from robot controller The time unit is seconds (float). Description Data type Name Last received data message ID. This ID must correspond to the ID sent from the robot controller. Integer Id Time stamp Float Ts Error message String EStr Continues on next page 3HAC031973-001 Revision: F 31 © Copyright 2008-2009,2013 ABB. All rights reserved. 4 Configuration examples 4.2 Example configuration Continued

Free defined application data

Array of 18 floats AppData The corresponding XML message on the network would look like this: xxxx 32 3HAC031973-001 Revision: F © Copyright 2008-2009,2013 ABB. All rights reserved. 4 Configuration examples 4.2 Example configuration Continued

5 RAPID reference information

5.1 RAPID instructions 5.1.1 SiConnect - Sensor Interface Connect Usage SiConnect is used to establish a connection to an external device. Basic examples A basic example of the instruction SiConnect is illustrated below. See also More examples on page 33. Example 1 PERS sensor AnyDevice; ... SiConnect AnyDevice; Establish a connection to the device called AnyDevice. Arguments SiConnect Sensor [\NoStop] Sensor Data type: sensor The descriptor for the external device to connect to. The argument is a persistent variable and its name must be the same as the name specified as the client in setup file Settings.xml. [\NoStop] Data type: switch \NoStop will prevent system stop when a communication error with the sensor is detected. It can be useful if no robot movements are depending on the sensor. When \Nostop is used, movements in the system will continue even if the communication with the sensor is lost. If using \NoStop it is possible to do error handling in a TRAP routine, with the use of IError or IPers. Program execution Loads the current sensor configuration and establishes the connection to the external device. The sensor stays connected, even if the program pointer is set to main. More examples More examples of how to use the instruction SiConnect are illustrated below. Example 1 PERS sensor AnyDevice; PERS robdata DataOut := [[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]]; Continues on next page 3HAC031973-001 Revision: F 33 © Copyright 2008-2009,2013 ABB. All rights reserved. 5 RAPID reference information 5.1.1 SiConnect - Sensor Interface Connect

PERS sensdata DataIn :=

["No",[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]]; VAR num SampleRate:=64; ... ! Setup Interface Procedure PROC RRI_Open() SiConnect AnyDevice; ! Send and receive data cyclic with 64 ms rate SiGetCyclic AnyDevice, DataIn, SampleRate; SiSetCyclic AnyDevice, DataOut, SampleRate; ENDPROC When calling routine RRI_Open, first a connection to the device with name AnyDevice is opened. Then, cyclic transmission is started at rate SampleRate. Example 2 PERS sensor AnyDevice; ... SiConnect AnyDevice \NoStop; ! Send and receive data cyclic with 64 ms rate SiGetCyclic AnyDevice, DataIn, SampleRate; SiSetCyclic AnyDevice, DataOut, SampleRate; ... TRAP sensorChange IF AnyDevice.state = STATE_ERROR THEN ... ENDIF ENDTRAP Establish a connection to the device called AnyDevice with the optional argument \NoStop preventing the system to stop if the connection to AnyDevice is broken. Handle error states in the TRAP routine. Error handling If UDP is used as communication protocol no guarantees are given regarding the success of the connect operation and therefore no error handling is possible at the connect moment. If TCP is used as communication protocol the system variable ERRNO is set to ERR_COMM_INIT if the connect operation fails. This error can then be handled in an error handler. The switch \NoStop makes it possible to handle communication errors detected after a successful connect. \NoStop means that movements and execution of RAPID continues and that a TRAP routine can be used to handle specific errors using IError or specific state changes using IPers. NOTE: IPers and IError are not safe interrupts, so if an error is detected after a stop, no TRAP will be executed. A way to handle this problem is to have a SiConnect \NoStop in the restart shelf, to be sure that the application tries to reestablish the connection to the client. Continues on next page 34 3HAC031973-001 Revision: F © Copyright 2008-2009,2013 ABB. All rights reserved. 5 RAPID reference information 5.1.1 SiConnect - Sensor Interface Connect Continued

[ Sensor ':=' ] < persistent (PERS) of sensor >

[ '\' NoStop ] ';' Related information See For information about SiClose - Sensor Interface Close on page36. Close connection to an external system. SiSetCyclic - Sensor Interface Set Cyclic on page 40. Register data for cyclic transmission. SiGetCyclic - Sensor Interface Get Cyclic on page 38 Subscribe on cyclic data transmission. sensor - External device descriptor on page 42. Descriptor to the external device. sensorstate - Communication state of the device on page 44. Communication state of a device. 3HAC031973-001 Revision: F 35 © Copyright 2008-2009,2013 ABB. All rights reserved. 5 RAPID reference information 5.1.1 SiConnect - Sensor Interface Connect Continued

5.1.2 SiClose - Sensor Interface Close

Usage SiClose closes an existing connection to an external device. Basic examples Basic example of the instruction SiClose is illustrated below. Example 1 PERS sensor AnyDevice; ... SiClose AnyDevice; Close the connection to the device called AnyDevice. Arguments SiClose Sensor Sensor Data type: sensor The descriptor for the external device that should be closed. The argument is a persistent variable, and its name must be the same as the name specified as the client in the setup file Settings.xml. Program execution Closes an existing connection to the external device. Error handling If UDP is used as communication protocol then there is no guarantee regarding the success of the close operation and therefore no error handling is possible. If TCP is used as communication protocol the system variable ERRNO is set to ERR_COMM_INIT if the close operation fails. This error can then be handled in an error handler. Syntax SiClose [ Sensor ':=' ] < persistent (PERS) of sensor > ';' Related information See For information about SiConnect - Sensor Interface Connect on page 33. Establish a connection to an external system. SiSetCyclic - Sensor Interface Set Cyclic on page 40. Register data for cyclic transmission. SiGetCyclic - Sensor Interface Get Cyclic on page 38. Subscribe on cyclic data transmission. sensor - External device descriptor on page 42. Descriptor to the external device. Continues on next page 36 3HAC031973-001 Revision: F © Copyright 2008-2009,2013 ABB. All rights reserved. 5 RAPID reference information 5.1.2 SiClose - Sensor Interface Close

For information about

sensorstate - Communication state of the device on page 44. Communication state of a device. 3HAC031973-001 Revision: F 37 © Copyright 2008-2009,2013 ABB. All rights reserved. 5 RAPID reference information 5.1.2 SiClose - Sensor Interface Close Continued

5.1.3 SiGetCyclic - Sensor Interface Get Cyclic

Usage SiGetCyclic subscribes data for cyclic transmission from an external device. Basic examples A basic example of the instruction SiGetCyclic is illustrated below. See also More examples on page 38. Example 1 SiConnect AnyDevice; ! Receive data cyclic with 64 ms rate SiGetCyclic AnyDevice, DataIn, 64; The example shows how to establish connection to an external device and set up a cyclic transmission from the device AnyDevice. Arguments SiGetCyclic Sensor Data Rate Sensor Data type: sensor A descriptor for the external device to receive cyclic data from. The argument is a persistent variable, and its name must be the same as the name specified as the client in setup file Settings.xml. Data Data type: anytype Reference to a persistent containing the data to receive from the client specified in argument Sensor. The variable must be defined as Readable in the file Configuration.xml. Rate Data type: num Transfer rate in milliseconds (only multiples of 4ms are supported). Program execution Instruction SiGetCyclic subscribes data for cyclic transmission from an external device. For SiGetCyclic and SiSetCyclic instructions, a transfer rate of 0 stops (unregisters / unsubscribes) the cyclic transmission of the given data or data set. More examples More examples of how to use the instruction SiGetCyclic are illustrated below. Example 1 PERS sensor AnyDevice; PERS robdata DataOut := [[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]]; Continues on next page 38 3HAC031973-001 Revision: F © Copyright 2008-2009,2013 ABB. All rights reserved. 5 RAPID reference information 5.1.3 SiGetCyclic - Sensor Interface Get Cyclic

PERS sensdata DataIn :=

["No",[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]]; VAR num SampleRate:=64; ... ! Setup Interface Procedure PROC RRI_Open() SiConnect AnyDevice; ! Send and receive data cyclic with 64 ms rate SiGetCyclic AnyDevice, DataIn, SampleRate; SiSetCyclic AnyDevice, DataOut, SampleRate; ENDPROC When calling routine RRI_Open, first a connection to the device with name AnyDevice is opened. Then, cyclic transmission is started at rate SampleRate. Syntax SiGetCyclic [ Sensor ':=' ] < persistent (PERS) of sensor > ',' [ Data ':=' ] < persistent (PERS) of anytype > ',' [ Rate ':=' ] < expression (IN) of num > ] ';' Related information See For information about SiConnect - Sensor Interface Connect on page 33. Establish a connection to an external system. SiClose - Sensor Interface Close on page36. Close connection to an external system. SiSetCyclic - Sensor Interface Set Cyclic on page 40. Register data for cyclic transmission. sensor - External device descriptor on page 42. Descriptor to the external device. sensorstate - Communication state of the device on page 44. Communication state of a device. 3HAC031973-001 Revision: F 39 © Copyright 2008-2009,2013 ABB. All rights reserved. 5 RAPID reference information 5.1.3 SiGetCyclic - Sensor Interface Get Cyclic Continued

5.1.4 SiSetCyclic - Sensor Interface Set Cyclic

Usage SiSetCyclic registers data for cyclic transmission to an external device. Basic examples A basic example of the instruction SiSetCyclic is illustrated below. See also More examples on page 40. Example 1 PERS sensor AnyDevice; PERS robdata DataOut := [[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]]; ... SiConnect AnyDevice; SiSetCyclic AnyDevice, DataOut, 40; Establish a connection to the device called AnyDevice. Then register data for cyclic transmission to the external device AnyDevice every 40 ms. Arguments SiSetCyclic Sensor Data Rate Sensor Data type: sensor A descriptor for the external device to send data to. Data Data type: anytype Reference to a persistent of any complex or supported simple type containing the data to be sent to the client specified in argument Sensor. The variable must be defined as Writable in the Configuration.xml file. Rate Data type: num Transfer rate in milliseconds (only multiples of 4 ms are supported). Program execution Instruction SiSetCyclic registers data for cyclic transmission to an external device. For SiGetCyclic and SiSetCyclic instructions, a transfer rate of 0 stops (unregisters / unsubscribes) the cyclic transmission of the given data or data set. More examples More examples of how to use the instruction SiSetCyclic are illustrated below. Example 1 PERS sensor AnyDevice; PERS robdata DataOut := [[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]]; Continues on next page 40 3HAC031973-001 Revision: F © Copyright 2008-2009,2013 ABB. All rights reserved. 5 RAPID reference information 5.1.4 SiSetCyclic - Sensor Interface Set Cyclic

PERS sensdata DataIn :=

["No",[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]]; VAR num SampleRate:=64; ... ! Setup Interface Procedure PROC RRI_Open() SiConnect AnyDevice; ! Send and receive data cyclic with 64 ms rate SiGetCyclic AnyDevice, DataIn, SampleRate; SiSetCyclic AnyDevice, DataOut, SampleRate; ENDPROC When calling routine RRI_Open, first a connection to the device with name AnyDevice is opened. Then, cyclic transmission is started at rate SampleRate. Syntax SiSetCyclic [ Sensor ':=' ] < persistent (PERS) of sensor > ',' [ Data ':=' ] < persistent (PERS) of anytype > [ Rate ':=' ] < expression (IN) of num > ] ';' Related information See For information about SiConnect - Sensor Interface Connect on page 33. Establish a connection to an external system. SiClose - Sensor Interface Close on page36. Close connection to an external system. SiGetCyclic - Sensor Interface Get Cyclic on page 38. Subscribe on cyclic data transmission. sensor - External device descriptor on page 42. Descriptor to the external device. sensorstate - Communication state of the device on page 44. Communication state of a device. 3HAC031973-001 Revision: F 41 © Copyright 2008-2009,2013 ABB. All rights reserved. 5 RAPID reference information 5.1.4 SiSetCyclic - Sensor Interface Set Cyclic Continued

5.2 RAPID data types

5.2.1 sensor - External device descriptor Usage sensor is a descriptor to the external device to connect to. Description The descriptor for a device on the RAPID level is encapsulated in the record data type sensor. It holds information about the sensor device such as id, error code and sensor communication state. Components id Data type: num The internal identifier of the device, which will be set on the first operation with the device from RAPID level. (Not implemented yet). error Data type: num The error parameter is set when parameter state is set to STATE_ERROR. When state goes from STATE_ERROR to STATE_CONNECTED parameter error is set to 0. Error Error number No error. 0 Communication interface initialization failed. 112600 Communication interface error. 112602 state Data type: sensorstate Reflects the actual communication state of the device. Examples Example of the data type sensor is shown below. Example 1 PERS sensor AnyDevice; PERS robdata DataOut := [[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]]; PERS sensdata DataIn := ["No",[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]]; VAR num SampleRate:=64; ... ! Setup Interface Procedure PROC RRI_Open() SiConnect AnyDevice; ! Send and receive data cyclic with 64 ms rate Continues on next page 42 3HAC031973-001 Revision: F © Copyright 2008-2009,2013 ABB. All rights reserved. 5 RAPID reference information 5.2.1 sensor - External device descriptor

SiGetCyclic AnyDevice, DataIn, SampleRate;

SiSetCyclic AnyDevice, DataOut, SampleRate; ENDPROC When calling routine RRI_Open, first a connection to the device AnyDevice is opened. Then, cyclic transmission is started at rate SampleRate. Structure Related information See For information about SiConnect - Sensor Interface Connect on page 33. Establish a connection to an external system. SiClose - Sensor Interface Close on page36. Close connection to an external system. SiSetCyclic - Sensor Interface Set Cyclic on page 40. Register data for cyclic transmission. SiGetCyclic - Sensor Interface Get Cyclic on page 38 Subscribe on cyclic data transmission. sensorstate - Communication state of the device on page 44. Communication state of a device. 3HAC031973-001 Revision: F 43 © Copyright 2008-2009,2013 ABB. All rights reserved. 5 RAPID reference information 5.2.1 sensor - External device descriptor Continued

5.2.2 sensorstate - Communication state of the device

Usage sensorstate is used to represent an actual communication state of a device. Description A sensorstate constant is used to reflect the actual communication state of a device. It can be used from RAPID to evaluate the state of the connection with the sensor. Predefined data The following symbolic constants of the data type sensorstate are predefined and can be used to evaluate what communication state the device is in. Value Constant -1 STATE_ERROR 0 STATE_UNDEFINED 1 STATE_CONNECTED 2 STATE_OPERATING 3 STATE_CLOSED Characteristics sensorstate is an alias data type for num and consequently inherits its characteristics. Related information See For information about SiConnect - Sensor Interface Connect on page 33. Establish a connection to an external system. SiClose - Sensor Interface Close on page36. Close connection to an external system. SiSetCyclic - Sensor Interface Set Cyclic on page 40. Register data for cyclic transmission. SiGetCyclic - Sensor Interface Get Cyclic on page 38 Subscribe on cyclic data transmission. sensor - External device descriptor on page 42. Descriptor to the external device. 44 3HAC031973-001 Revision: F © Copyright 2008-2009,2013 ABB. All rights reserved. 5 RAPID reference information 5.2.2 sensorstate - Communication state of the device

communication channel, 13

communication client, 20 comunication cable connecting, 15 configuration.xml, 24 configuration example, 28 configuration files, 19 convention, 21 D data exchange, 13 data types sensor, 42 sensorstate, 44 supported, 18 description.xml, 21 E elements channel, 22 class, 22 convention, 21 enum, 24 field, 25 member, 25 network, 22 property, 26 record, 25 settings, 23 type, 22 enums element, 24 Ethernet link, 16 F FeedbackJoints, 17 FeedbackPose, 17 FeedbackTime, 17 field element, 25 frame, 18 I instructions SiClose, 36 SiConnect, 33 SiGetCyclic, 38 SiSetCyclic, 40 IP protocols, 16 J joints, 18 M member element, 25 messages outgoing, 17 received, 31 sent, 31 N network, 22 num, 18 O OperationMode, 17 outgoing message, 17 P PlannedJoints, 17 PlannedPose, 17 pose, 18 PredictedTime, 17 prerequisites, 16 property element, 26 R RAPID variables, 13 real, 18 received message, 31 record element, 25 robjoints, 18 S safety, 11 send message, 31 sensor, 42 sensorstate, 44 service connection, 15 settings.xml, 20 settings element, 23 SiClose, 36 SiConnect, 33 SiGetCyclic, 38 SiSetCyclic, 40 SiTool, 27 SiWobj, 27 string, 18 system parameters Controller topic, 17 Motion topic, 17 T time, 18 type, 22 W WAN port, 15 3HAC031973-001 Revision: F 45 © Copyright 2008-2009,2013 ABB. All rights reserved. Index

Discrete Automation and Motion

Robotics S-721 68 VÄSTERÅS, Sweden Telephone +46 (0) 21 344 400 ABB AS, Robotics Discrete Automation and Motion Box 265 N-4349 BRYNE, Norway Telephone: +47 51489000 ABB Engineering (Shanghai) Ltd. 5 Lane 369, ChuangYe Road KangQiao Town, PuDong District SHANGHAI 201319, China Telephone: +86 21 6105 6666 www.abb.com/robotics 3HAC031973-001, Rev F, en

Other Controller Manuals