Top Banner
MANUAL NO. Moto.GSI.SDK/Manual Part Number: 177603-1CD Revision: 0 1.29 Moto.GSI.SDK Manual Upon receipt of the product and prior to initial operation, read these instructions thoroughly, and retain for future reference. MOTOMAN INSTRUCTIONS Moto.GSI.SDK INSTRUCTIONS DX200, DX100, OR FS100 INSTRUCTIONS DX200, DX100, OR FS100 OPERATOR’S MANUAL (for each purpose) DX200, DX100, OR FS100 MAINTENANCE MANUAL The DX200, DX100, or FS100 operator’s manual above correspond to a specific usage. Be sure to use the appropriate manual. 1 of 82
82

Moto.GSI.SDK Manual...Moto.GSI.SDK/Manual Moto.GSI.SDK Description of the Operation Procedure Description of the Operation Procedure In the explanation of the operation proc edure,

Mar 13, 2020

Download

Documents

dariahiddleston
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Moto.GSI.SDK Manual...Moto.GSI.SDK/Manual Moto.GSI.SDK Description of the Operation Procedure Description of the Operation Procedure In the explanation of the operation proc edure,

MANUAL NO.

Moto.GSI.SDK/Manual

Part Number: 177603-1CDRevision: 0

1.29

Moto.GSI.SDKManual

Upon receipt of the product and prior to initial operation, read these instructions thoroughly, and retain for future reference.

MOTOMAN INSTRUCTIONS

Moto.GSI.SDK INSTRUCTIONSDX200, DX100, OR FS100 INSTRUCTIONSDX200, DX100, OR FS100 OPERATOR’S MANUAL (for each purpose)DX200, DX100, OR FS100 MAINTENANCE MANUAL

The DX200, DX100, or FS100 operator’s manual above correspond to a specific usage. Be sure to use the appropriate manual.

1 of 82

Page 2: Moto.GSI.SDK Manual...Moto.GSI.SDK/Manual Moto.GSI.SDK Description of the Operation Procedure Description of the Operation Procedure In the explanation of the operation proc edure,

177603-1CD

Moto.GSI.SDK

Copyright © 2016 YASKAWA America, Inc.

Terms of Use and Copyright Notice

All rights reserved. This manual is freely available as a service to YASKAWA customers to assist in the operation of Motoman robots, related equipment and software This manual is copyrighted property of YASKAWA and may not be sold or redistributed in any way. You are welcome to copy this document to your computer or mobile device for easy access but you may not copy the PDF files to another website, blog, cloud storage site or any other means of storing or distributing online content.

Printed in the United States of America

First Printing, 2016

YASKAWA America, Inc.Motoman Robotics Division100 Automation WayMiamisburg, OH 45342Phone: 937-847-6200

www.motoman.com

iiMoto.GSI.SDK/Manual

2 of 82

Page 3: Moto.GSI.SDK Manual...Moto.GSI.SDK/Manual Moto.GSI.SDK Description of the Operation Procedure Description of the Operation Procedure In the explanation of the operation proc edure,

177603-1CD

Moto.GSI.SDK

MANDATORY

General items related to safety are listed in Chapter 1: Safety of the DX200 Instructions. To ensure correct and safe operation, carefully read the DX200 Instructions before reading this manual.

CAUTION

• The drawings and photos in this manual are representative examples and differences may exist between them and the delivered product.

• YASKAWA may modify this software without notice when necessary due to product improvements, modifications, or changes in specifications.If such modification are made, the manual number will also be revised.

• If your copy of the manual is damaged or lost, contact a YASKAWA representative to order a new copy. The representatives are listed on the back cover. Be sure to tell the representative the manual number listed on the front cover.

• YASKAWA is not responsible for incidents arising from unauthorized modification of its products. Unauthorized modification voids your product's warranty.

iiiMoto.GSI.SDK/Manual

3 of 82

Page 4: Moto.GSI.SDK Manual...Moto.GSI.SDK/Manual Moto.GSI.SDK Description of the Operation Procedure Description of the Operation Procedure In the explanation of the operation proc edure,

177603-1CD

Moto.GSI.SDK

We suggest that you obtain and review a copy of the ANSI/RIA National Safety Standard for Industrial Robots and Robot Systems (ANSI/RIA R15.06-2012). You can obtain this document from the Robotic Industries Association (RIA) at the following address:

Robotic Industries Association900 Victors WayP.O. Box 3724

Ann Arbor, Michigan 48106TEL: (734) 994-6088FAX: (734) 994-3338

www.roboticsonline.com

Ultimately, well-trained personnel are the best safeguard against accidents and damage that can result from improper operation of the equipment. The customer is responsible for providing adequately trained personnel to operate, program, and maintain the equipment. NEVER ALLOW UNTRAINED PERSONNEL TO OPERATE, PROGRAM, OR REPAIR THE EQUIPMENT!

We recommend approved Yaskawa training courses for all personnel involved with the operation, programming, or repair of the equipment.

This equipment has been tested and found to comply with the limits for a Class A digital device, pursuant to part 15 of the FCC rules. These limits are designed to provide reasonable protection against harmful interference when the equipment is operated in a commercial environment. This equipment generates, uses, and can radiate radio frequency energy and, if not installed and used in accordance with the instruction manual, may cause harmful interference to radio communications.

ivMoto.GSI.SDK/Manual

4 of 82

Page 5: Moto.GSI.SDK Manual...Moto.GSI.SDK/Manual Moto.GSI.SDK Description of the Operation Procedure Description of the Operation Procedure In the explanation of the operation proc edure,

177603-1CD

Notes for Safe OperationMoto.GSI.SDK

Notes for Safe OperationRead this manual carefully before installation, operation, maintenance, or inspection of the Moto.GSI.SDK.

In this manual, the Notes for Safe Operation are classified as “DANGER”, “WARNING”, “CAUTION”, “MANDATORY”, or “PROHIBITED”.

Even items described as “CAUTION” may result in a serious accident in some situations.

At any rate, be sure to follow these important items.

DANGERIndicates an imminent hazardous situation which, if not avoided, could result in death or serious injury to personnel.

WARNINGIndicates a potentially hazardous situation which, if not avoided, could result in death or serious injury to personnel.

CAUTIONIndicates a potentially hazardous situation which, if not avoided, could result in minor or moderate injury to personnel and damage to equipment. It may also be used to alert against unsafe practices.

MANDATORYAlways be sure to follow explicitly the items listed under this heading.

PROHIBITED Must never be performed.

NOTETo ensure safe and efficient operation at all times, be sure to follow all instructions, even if not designated as “DANGER”, “WARNING” and “CAUTION”.

DANGER• Maintenance and inspection must be performed by specified

personnel.

Failure to observe this DANGER may result in electric shock or injury.

• For disassembly or repair, contact your YASKAWA representative.

• Do not remove the motor, and do not release the brake.

Failure to observe these safety precautions may result in death or serious injury from unexpected turning of the manipulator's arm.

vMoto.GSI.SDK/Manual

5 of 82

Page 6: Moto.GSI.SDK Manual...Moto.GSI.SDK/Manual Moto.GSI.SDK Description of the Operation Procedure Description of the Operation Procedure In the explanation of the operation proc edure,

Notes for Safe Operation177603-1CD

Moto.GSI.SDK

DX Controllers

WARNING• Before operating the manipulator, check that servo power is turned

OFF pressing the emergency stop buttons on the front door of the DX200 and the programming pendant.When the servo power is turned OFF, the SERVO ON LED on the programming pendant is turned OFF.

Injury or damage to machinery may result if the emergency stop circuit cannot stop the manipulator during an emergency. The manipulator should not be used if the emergency stop buttons do not function.

Fig. : Emergency Stop Button

• Once the emergency stop button is released, clear the cell of all items which could interfere with the operation of the manipulator.Then turn the servo power ON.

Injury may result from unintentional or unexpected manipulator motion.

Fig. : Release of Emergency Stop

TURN

• Observe the following precautions when performing teaching operations within the P-point maximum envelope of the manipulator:

– Be sure to use a lockout device to the safeguarding when going inside. Also, display the sign that the operation is being performed inside the safeguarding and make sure no one closes the safeguarding.

– View the manipulator from the front whenever possible.

– Always follow the predetermined operating procedure.

– Keep in mind the emergency response measures against the manipulator’s unexpected motion toward you.

– Ensure that you have a safe place to retreat in case of emergency.

Improper or unintended manipulator operation may result in injury.

• Confirm that no person is present in the P-point maximum envelope of the manipulator and that you are in a safe location before:

– Turning ON the power for the DX200.

– Moving the manipulator with the programming pendant.

– Running the system in the check mode.

– Performing automatic operations.

Injury may result if anyone enters the P-point maximum envelope of the manipulator during operation. Always press an emergency stop button immediately if there is a problem.

The emergency stop buttons are located on the right of front door of the DX200 and the programming pendant.

viMoto.GSI.SDK/Manual

6 of 82

Page 7: Moto.GSI.SDK Manual...Moto.GSI.SDK/Manual Moto.GSI.SDK Description of the Operation Procedure Description of the Operation Procedure In the explanation of the operation proc edure,

177603-1CD

Notes for Safe OperationMoto.GSI.SDK

FS100 Controller

WARNING• Before operating the manipulator, check that servo power is turned

OFF when the emergency stop button on the programming pendant is pressed.When the servo power is turned OFF, the SERVO ON LED on the programing pendant is turned OFF.

Injury or damage to machinery may result if the emergency stop circuit cannot stop the manipulator during an emergency. The manipulator should not be used if the emergency stop button does not function.

Fig. : Emergency Stop Button

• In the case of not using the programming pendant, be sure to supply the emergency stop button on the equipment. Then before operating the manipulator, check to be sure that the servo power is turned OFF by pressing the emergency stop button. Connect the external emergency stop button to the 5-6 pin and 16-17 pin of the robot system signal connector (CN2).

• Upon shipment of the FS100, this signal is connected by a jumper cable in the dummy connector. To use the signal, make sure to supply a new connector, and then input it.

If the signal is input with the jumper cable connected, it does not function, which may result in personal injury or equipment damage.

• Once the emergency stop button is released, clear the cell of all items which could interfere with the operation of the manipulator.Then turn the servo power ON.

Injury may result from unintentional or unexpected manipulator motion.

Fig. : Release of Emergency Stop Button

TURN

• Observe the following precautions when performing teaching operations within the manipulator’s operating range:

– Be sure to use a lockout device to the safeguarding when going inside. Also, display the sign that the operation is being performed inside the safeguarding and make sure no one closes the safeguarding.

– View the manipulator from the front whenever possible.

– Always follow the predetermined operating procedure.

– Keep in mind the emergency response measures against the manipulator’s unexpected motion toward you.

– Ensure that you have a safe place to retreat in case of emergency.

Improper or unintended manipulator operation may result in injury.

viiMoto.GSI.SDK/Manual

7 of 82

Page 8: Moto.GSI.SDK Manual...Moto.GSI.SDK/Manual Moto.GSI.SDK Description of the Operation Procedure Description of the Operation Procedure In the explanation of the operation proc edure,

Definition of Terms Used Often in This Manual177603-1CD

Moto.GSI.SDK

Definition of Terms Used Often in This Manual The MOTOMAN is the YASKAWA industrial robot product.

The MOTOMAN usually consists of the manipulator, the controller, the programming pendant (FS100 optional), FS100 programming pendant dummy connector (optional), and supply cables.

In this manual, the equipment is designated as follows:

CAUTION

• Perform the following inspection procedures prior to conducting manipulator teaching. If problems are found, repair them immediately, and be sure that all other necessary processing has been performed.

– Check for problems in manipulator movement.

– Check for damage to insulation and sheathing of external wires.

• Always return the programming pendant to the hook on the cabinet of the controller after use.

The programming pendant can be damaged if it is left in the manipulator's work area, on the floor, or near fixtures.

• Read and understand the Explanation of Warning Labels in the controller instructions before operating.

Equipment Manual Designation

DX200 controller Controller

DX100 controller Controller

FS100 controller Controller

DX200 programming pendant Programming pendant

DX100 programming pendant Programming pendant

FS100 programming pendant Programming pendant

Cable between the manipulator and the controller

Manipulator cable

FS100 programming pendant dummy connector

Programming pendant dummy connector

viiiMoto.GSI.SDK/Manual

8 of 82

Page 9: Moto.GSI.SDK Manual...Moto.GSI.SDK/Manual Moto.GSI.SDK Description of the Operation Procedure Description of the Operation Procedure In the explanation of the operation proc edure,

177603-1CD

Description of the Operation ProcedureMoto.GSI.SDK

Description of the Operation ProcedureIn the explanation of the operation procedure, the expression “Select • • •” means that the cursor is moved to the object item and the SELECT key is pressed, or that the item is directly selected by touching the screen.

Registered TrademarkIn this manual, names of companies, corporations, or products are trademarks, registered trademarks, or brand names for each company or corporation. The indications of (R) and TM are omitted.

Safeguarding TipsAll operators, programmers, maintenance personnel, supervisors, and anyone working near the system must become familiar with the operation of this equipment. All personnel involved with the operation of the equipment must understand potential dangers of operation. General safeguarding tips are as follows:

• Improper operation can result in personal injury and/or damage to the equipment. Only trained personnel familiar with the operation of this equipment, the operator's manuals, the system equipment, and options and accessories should be permitted to operate this equipment.

• Improper connections can damage the equipment. All connections must be made within the standard voltage and current ratings of the equipment.

• The system must be placed in Emergency Stop (E-Stop) mode whenever it is not in use.

• In accordance with ANSI/RIA R15.06-2012, section 4.2.5, Sources of Energy, use lockout/tagout procedures during equipment maintenance. Refer also to Section 1910.147 (29CFR, Part 1910), Occupational Safety and Health Standards for General Industry (OSHA).

Mechanical Safety DevicesThe safe operation of this equipment is ultimately the users responsibility. The conditions under which the equipment will be operated safely should be reviewed by the user. The user must be aware of the various national codes, ANSI/RIA R15.06-2012 safety standards, and other local codes that may pertain to the installation and use of this equipment.

Additional safety measures for personnel and equipment may be required depending on system installation, operation, and/or location. The following safety equipment is provided as standard:

• Safety barriers

• Door interlocks

• Emergency stop palm buttons located on operator station

Check all safety equipment frequently for proper operation. Repair or replace any non-functioning safety equipment immediately.

ixMoto.GSI.SDK/Manual

9 of 82

Page 10: Moto.GSI.SDK Manual...Moto.GSI.SDK/Manual Moto.GSI.SDK Description of the Operation Procedure Description of the Operation Procedure In the explanation of the operation proc edure,

Programming, Operation, and Maintenance Safety177603-1CD

Moto.GSI.SDK

Programming, Operation, and Maintenance SafetyAll operators, programmers, maintenance personnel, supervisors, and anyone working near the system must become familiar with the operation of this equipment. Improper operation can result in personal injury and/or damage to the equipment. Only trained personnel familiar with the operation, manuals, electrical design, and equipment interconnections of this equipment should be permitted to program, or maintain the system. All personnel involved with the operation of the equipment must understand potential dangers of operation.

• Inspect the equipment to be sure no potentially hazardous conditions exist. Be sure the area is clean and free of water, oil, debris, etc.

• Be sure that all safeguards are in place. Check all safety equipment for proper operation. Repair or replace any non-functioning safety equipment immediately.

• Check the E-Stop button on the operator station for proper operation before programming. The equipment must be placed in Emergency Stop (E-Stop) mode whenever it is not in use.

• Back up all programs and jobs onto suitable media before program changes are made. To avoid loss of information, programs, or jobs, a backup must always be made before any service procedures are done and before any changes are made to options, accessories, or equipment.

• Any modifications to the controller unit can cause severe personal injury or death, as well as damage to the robot! Do not make any modifications to the controller unit. Making any changes without the written permission from YASKAWA will void the warranty.

• Some operations require a standard passwords and some require special passwords.

• The equipment allows modifications of the software for maximum performance. Care must be taken when making these modifications. All modifications made to the software will change the way the equipment operates and can cause severe personal injury or death, as well as damage parts of the system. Double check all modifications under every mode of operation to ensure that the changes have not created hazards or dangerous situations.

• This equipment has multiple sources of electrical supply. Electrical interconnections are made between the controller and other equipment. Disconnect and lockout/tagout all electrical circuits before making any modifications or connections.

• Do not perform any maintenance procedures before reading and understanding the proper procedures in the appropriate manual.

• Use proper replacement parts.

• Improper connections can damage the equipment. All connections must be made within the standard voltage and current ratings of the equipment.

xMoto.GSI.SDK/Manual

10 of 82

Page 11: Moto.GSI.SDK Manual...Moto.GSI.SDK/Manual Moto.GSI.SDK Description of the Operation Procedure Description of the Operation Procedure In the explanation of the operation proc edure,

177603-1CD

Maintenance SafetyMoto.GSI.SDK

Maintenance SafetyTurn the power OFF and disconnect and lockout/tagout all electrical circuits before making any modifications or connections.

Perform only the maintenance described in this manual. Maintenance other than specified in this manual should be performed only by YASKAWA-trained, qualified personnel.

Summary of Warning InformationThis manual is provided to help users establish safe conditions for operating the equipment. Specific considerations and precautions are also described in the manual, but appear in the form of Dangers, Warnings, Cautions, and Notes.

It is important that users operate the equipment in accordance with this instruction manual and any additional information which may be provided by YASKAWA. Address any questions regarding the safe and proper operation of the equipment to YASKAWA Customer Support.

xiMoto.GSI.SDK/Manual

11 of 82

Page 12: Moto.GSI.SDK Manual...Moto.GSI.SDK/Manual Moto.GSI.SDK Description of the Operation Procedure Description of the Operation Procedure In the explanation of the operation proc edure,

Customer Support Information177603-1CD

Moto.GSI.SDK

Customer Support InformationIf you need assistance with any aspect of your Moto.GSI.SDK system, please contact YASKAWA Customer Support at the following 24-hour telephone number:

For routine technical inquiries, you can also contact YASKAWA Customer Support at the following e-mail address:

When using e-mail to contact YASKAWA Customer Support, please provide a detailed description of your issue, along with complete contact information. Please allow approximately 24 to 36 hours for a response to your inquiry.

Please have the following information ready before you call Customer Support:

[email protected]

NOTEPlease use e-mail for routine inquiries only. If you have an urgent or emergency need for service, replacement parts, or information, you must contact YASKAWA Customer Support at the telephone number shown above.

• System Moto.GSI.SDK

• Primary Application ___________________________

• Controller DX200/DX100/FS100

• Software Version Access this information on the Programming Pendant’s LCD display screen by selecting {MAIN MENU} - {SYSTEM INFO} - {VERSION}

• Robot Serial Number Located on the robot data plate

• Robot Sales Order Number Located on the DX200/DX100/FS100 controller data plate

(937) 847-3200

xiiMoto.GSI.SDK/Manual

12 of 82

Page 13: Moto.GSI.SDK Manual...Moto.GSI.SDK/Manual Moto.GSI.SDK Description of the Operation Procedure Description of the Operation Procedure In the explanation of the operation proc edure,

177603-1CD

Table of ContentsMoto.GSI.SDK

Table of Contents

1 Introduction ..................................................................................................................................... 1-1

2 Quickstart Guide ............................................................................................................................. 2-3

2.1 Scope of Delivery............................................................................................................... 2-3

2.1.1 Moto.GSI.SDK Includes........................................................................................ 2-3

2.1.1.1 CDROM Contains.................................................................................... 2-3

2.2 Installation of Moto.GSI.SDK............................................................................................. 2-3

2.2.1 System Requirements .......................................................................................... 2-3

2.2.2 Additional Settings in Maintenance Mode ............................................................ 2-3

2.2.2.1 Variable Limits......................................................................................... 2-4

2.2.3 Installation of Moto.GSI.LIB application file .......................................................... 2-5

2.2.4 Installation of Moto.GSI.JobAPI............................................................................ 2-7

2.2.5 Installation of Moto.GSI.AdminUI ......................................................................... 2-7

2.3 Testing the Installation....................................................................................................... 2-8

3 System Overview............................................................................................................................ 3-1

3.1 Components ...................................................................................................................... 3-1

3.2 System Architecture........................................................................................................... 3-2

3.3 Return Values & Parameters ............................................................................................. 3-3

3.4 Channels ........................................................................................................................... 3-3

3.5 Handle ............................................................................................................................... 3-3

3.6 Global Variables ................................................................................................................ 3-4

3.6.1 Change the GSI Internal Communication Variable Range................................... 3-4

3.7 User Data........................................................................................................................... 3-5

3.8 Moto GSI Admin UI............................................................................................................ 3-5

3.9 Inform String Functions...................................................................................................... 3-7

3.10 Function Overview........................................................................................................... 3-9

4 Function Reference......................................................................................................................... 4-1

4.1 GSI_TCPCONNECT.......................................................................................................... 4-1

4.2 GSI_TELNETCONNECT................................................................................................... 4-2

4.3 GSI_UDPBIND .................................................................................................................. 4-3

4.4 GSI_RS232OPEN ............................................................................................................. 4-4

4.5 GSI_SENDDATA............................................................................................................... 4-5

xiiiMoto.GSI.SDK/Manual

13 of 82

Page 14: Moto.GSI.SDK Manual...Moto.GSI.SDK/Manual Moto.GSI.SDK Description of the Operation Procedure Description of the Operation Procedure In the explanation of the operation proc edure,

Table of Contents177603-1CD

Moto.GSI.SDK

4.6 GSI_CHECKPATTERNBIN2 ............................................................................................. 4-6

4.7 GSI_CHECKPATTERNBIN2BLOCKING........................................................................... 4-9

4.8 GSI_CHECKPATTERNBIN/GSI_CHECKPATTERN.......................................................4-11

4.9 GSI_CLOSEHANDLE...................................................................................................... 4-12

4.10 GSI_CLOSEHANDLE....................................................................................................4-13

4.11 GSI_READDATA ...........................................................................................................4-14

4.12 GSI_CLEARDATA ......................................................................................................... 4-15

4.13 GSI_MODBUS_READ................................................................................................... 4-16

4.14 GSI_MODBUS_WRITE .................................................................................................4-17

4.15 GSI_MAKEBARRAY...................................................................................................... 4-18

4.16 GSI_MAKESTRING.......................................................................................................4-19

4.17 GSI_FTPCONNECT ...................................................................................................... 4-20

4.18 GSI_FTPDISCONNECT ................................................................................................ 4-21

4.19 GSI_FTPPUTJOB..........................................................................................................4-22

4.20 GSI_FTPGETJOB..........................................................................................................4-23

4.21 GSI_SMTPSEND...........................................................................................................4-24

4.22 GSI_INITUDPPOSOUTPUT..........................................................................................4-25

4.23 GSI_SETPOSOUTPUTHEADER .................................................................................. 4-26

4.24 GSI_SETPOSOUTPUT .................................................................................................4-27

4.24.1 UDP Packet Output Format ..............................................................................4-27

4.25 GSI_STOPUDPPOSOUTPUT.......................................................................................4-28

4.26 GSI_GETTIME............................................................................................................... 4-29

4.27 GSI_STARTSPEEDOUTPUT........................................................................................ 4-30

4.27.1 Output Register Layout..................................................................................... 4-30

4.28 GSI_STOPSPEEDOUTPUT..........................................................................................4-31

4.29 GSI_BYTETOFLOAT..................................................................................................... 4-32

4.30 GSI_FLOATTOBYTE..................................................................................................... 4-33

4.31 GSI_GETPOSVARCOORD........................................................................................... 4-34

xivMoto.GSI.SDK/Manual

14 of 82

Page 15: Moto.GSI.SDK Manual...Moto.GSI.SDK/Manual Moto.GSI.SDK Description of the Operation Procedure Description of the Operation Procedure In the explanation of the operation proc edure,

177603-1CD

Table of ContentsMoto.GSI.SDK

5 Examples ........................................................................................................................................ 5-1

5.1 TCP ................................................................................................................................... 5-1

5.1.1 Telnet connection to Cognex Insight camera ....................................................... 5-1

5.1.2 MetaSLS (Scout) Laser Sensor............................................................................ 5-2

5.1.2.1 Communication flow................................................................................ 5-2

5.1.2.2 Implementation........................................................................................ 5-4

5.2 UDP Peer........................................................................................................................... 5-6

5.2.1 “Hello world” ......................................................................................................... 5-6

5.3 RS232/COM ...................................................................................................................... 5-8

5.3.1 Simple “Hello World”............................................................................................. 5-8

5.4 SMTP – Sending E-Mails................................................................................................... 5-9

5.5 FTP – Transfer jobs......................................................................................................... 5-10

5.6 Output of the TCP data per UDP..................................................................................... 5-10

Appendix A .......................................................................................................................................A-1

A.1 ASCII Table .......................................................................................................................A-1

Appendix B .......................................................................................................................................B-1

B.1 FAQ...................................................................................................................................B-1

xvMoto.GSI.SDK/Manual

15 of 82

Page 16: Moto.GSI.SDK Manual...Moto.GSI.SDK/Manual Moto.GSI.SDK Description of the Operation Procedure Description of the Operation Procedure In the explanation of the operation proc edure,

177603-1CD

1 IntroductionMoto.GSI.SDK

1 Introduction

Moto.GSI tools extend the communication capabilities of a DX/FS 100 and DX200 controller by adding general socket communication instructions to the INFORM language, which makes it possible for the standard robot programmer to solve a wide range of communication tasks. So for example, something like the following “instructions” (implemented as jobs) are available after installing Moto.GSI.SDK.

TCPConnect (…,”192.168.11.230”,”5020”) //Connect to TCP server

SendData (<handle>, <data>) //sends data using above TCP socket

..

These instructions are not included in the standard robot controller firmware. They are part of the Moto.GSI.SDK.

Fig. 1-1: Decision Making I

Moto.GSI is based on MotoPlus, therefore limitations and system requirements are the same. If there is a requirement to implement complex protocols or high performance applications, then using MotoPlus directly might be the better choice.

Table 1-1: Decision Making IIMotoPlus Moto.GSI

Where is the protocol implementation done?

On a PC using MotoPlusSDK Programming pendant.Job engine (Inform language).

Which tools do I need? MotoPlusSDK Moto.GSI.SDK

Who will do the protocol implementation?

Developer familiar with C or C++ & MotoPlus development(VXWorks platform):=> Development section of Motoman subsidiary or high level System Integrators.

Every robot programmer: Service technicians, customer etc.

When to select this solution? Complex or time critical communication tasks/protocols.Standard protocols.

Simple protocols

1-1Moto.GSI.SDK/Manual

16 of 82

Page 17: Moto.GSI.SDK Manual...Moto.GSI.SDK/Manual Moto.GSI.SDK Description of the Operation Procedure Description of the Operation Procedure In the explanation of the operation proc edure,

1 Introduction177603-1CD

Moto.GSI.SDK

1-2Moto.GSI.SDK/Manual

17 of 82

Page 18: Moto.GSI.SDK Manual...Moto.GSI.SDK/Manual Moto.GSI.SDK Description of the Operation Procedure Description of the Operation Procedure In the explanation of the operation proc edure,

177603-1CD

2 Quickstart Guide2.1 Scope of Delivery

Moto.GSI.SDK

2 Quickstart Guide

2.1 Scope of Delivery

2.1.1 Moto.GSI.SDK Includes

2.1.1.1 CDROM Contains

• Moto.GSI.Lib executable: MotoGSI.out

• Moto.GSI.JobAPI: Collection of Inform jobs

• Moto.GSI.AdminUI PP application (installer)

• Manual

• Sample apps

2.2 Installation of Moto.GSI.SDK

2.2.1 System Requirements

• DX/FS 100 or DX200 robot controller

• Robot software (firmware) including MotoPlus runtime

– DX100

• -14 software required

– FS100

• Included in standard software.

– DX200

• Included in standard software.

• PP customization function enabled for using the admin UI

• FTP function enabled for using the FTP file transfer functions

2.2.2 Additional Settings in Maintenance Mode

1. Start the Controller in Maintenance Mode

• DX 100/200 - holding Main Menu key during startup

• FS 100 - select the Maintenance Mode on the startup screen (Special settings)

2. Then set the security mode to Management mode.

2-3Moto.GSI.SDK/Manual

18 of 82

Page 19: Moto.GSI.SDK Manual...Moto.GSI.SDK/Manual Moto.GSI.SDK Description of the Operation Procedure Description of the Operation Procedure In the explanation of the operation proc edure,

2 Quickstart Guide2.2 Installation of Moto.GSI.SDK

177603-1CD

Moto.GSI.SDK

2.2.2.1 Variable Limits

1. Select SYSTEM, then SETUP, then OPTION FUNCTION and VARIABLE ALLOCATION.

2. Adjust the variables numbers of the different types to the following values:

• Byte >200 (500 recommended)

• Integer >200 (500 recommended)

• Confirm the modification of the values by [Enter].

3. MotoPlus runtime Autostart activation

• Select MotoPlus APL., then MotoPlus FUNC. setting to show the setting window. Then set APPLI. AUTOSTART AT POWER ON to ENABLE.

CAUTION

Adjusting the variables will reinitialize the job storage area and variables. Please make a complete backup before changing the variable limits. All existing jobs will be deleted by this operation.

2-4Moto.GSI.SDK/Manual

19 of 82

Page 20: Moto.GSI.SDK Manual...Moto.GSI.SDK/Manual Moto.GSI.SDK Description of the Operation Procedure Description of the Operation Procedure In the explanation of the operation proc edure,

177603-1CD

2 Quickstart Guide2.2 Installation of Moto.GSI.SDK

Moto.GSI.SDK

2.2.3 Installation of Moto.GSI.LIB application file

1. Start the DX/FS 100 controller in Maintenance mode

• DX 100/200 - holding Main Menu key during startup

• FS 100 - select the Maintenance Mode on the startup screen (Special settings)

2. Then set the security mode to Management mode.

3. Locate MotoGSI.out file (Moto.GSI.LIB executable) in the Moto.GSI.LIB folder of the CDROM. Copy the file to a CompactFlash card or USB stick and attach it to the Programming Pendant. Then follow the installation procedure below:

a) Select the Main Menu {MotoPlus APL.}

b) Specify the location of the MotoGSI.out file. Select the appropriate file location with the submenus {DEVICE (to select CF/USB)} and {FOLDER (to select the folder which has the application program)}.

2-5Moto.GSI.SDK/Manual

20 of 82

Page 21: Moto.GSI.SDK Manual...Moto.GSI.SDK/Manual Moto.GSI.SDK Description of the Operation Procedure Description of the Operation Procedure In the explanation of the operation proc edure,

2 Quickstart Guide2.2 Installation of Moto.GSI.SDK

177603-1CD

Moto.GSI.SDK

c) Select {LOAD (USER APPLICATION)}. Then, the MotoGSI.out file in the specified folder appears

d) Move the cursor and press [SELECT]. Then, the selection indicator appears on the left of the MotoGSI.out file.

2-6Moto.GSI.SDK/Manual

21 of 82

Page 22: Moto.GSI.SDK Manual...Moto.GSI.SDK/Manual Moto.GSI.SDK Description of the Operation Procedure Description of the Operation Procedure In the explanation of the operation proc edure,

177603-1CD

2 Quickstart Guide2.2 Installation of Moto.GSI.SDK

Moto.GSI.SDK

e) Press [ENTER], then the following confirmation box appears. To load the file select “YES”. If the MotoGSI.out file is already available onto the controller a the “Overwrite confirmation box” appears. Select “YES” to overwrite the existing file.

2.2.4 Installation of Moto.GSI.JobAPI

Moto.GSI.JobAPI consists of a collection of “Inform” jobs. Therefore installation is similar to the installation of user jobs. Moto.GSI.JobAPI job collection is located in the MotoGSIJobAPI folder on CDROM. Please note that none of the GSI jobs has a relation to another GSI job. Therefore only the used jobs must be available on the controller.

2.2.5 Installation of Moto.GSI.AdminUI

Allows easier debugging of Moto.GSI network communication. Basically not required for running Moto.GSI applications. To install the Moto.GSI.AdminUI copy the content of the MotoGSIAdminUI folder of the CDROM to a CompactFlash card or USB Stick and attach it to the Programming Pendant. Start the controller in Installation mode.

• DX and FS100 holding [Select] key + [8] key + [Interlock] key during startup

• DX200 holding [Select] key + [7] key + [Interlock] key during startup

When the installation window appears click application upgrade on the right side. Then select the MotoGSIAdminUI and press execute. After installation restart the controller.

2-7Moto.GSI.SDK/Manual

22 of 82

Page 23: Moto.GSI.SDK Manual...Moto.GSI.SDK/Manual Moto.GSI.SDK Description of the Operation Procedure Description of the Operation Procedure In the explanation of the operation proc edure,

2 Quickstart Guide2.3 Testing the Installation

177603-1CD

Moto.GSI.SDK

2.3 Testing the Installation

Before writing Moto.GSI applications please test the installation by executing one or both of the following jobs

• GSI_MOTOGSI_HELLOWORLD and/or

• GSI_MOTOGSI_VERSION

Executing the jobs should result in a message on the bottom of the Program Pendant display either representing the version number or a “Hello world !”

2-8Moto.GSI.SDK/Manual

23 of 82

Page 24: Moto.GSI.SDK Manual...Moto.GSI.SDK/Manual Moto.GSI.SDK Description of the Operation Procedure Description of the Operation Procedure In the explanation of the operation proc edure,

177603-1CD

3 System Overview3.1 Components

Moto.GSI.SDK

3 System Overview

3.1 Components

The whole Moto.GSI.SDK consists of these basic components:

• MotoPlus Runtime

– MotoPlus requires the MotoPlus runtime. MotoPlusSDK is not necessary. MotoPlus runtime requires a special parameter set.

• Moto.GSI.Lib

– Moto.GSI.Lib is a MotoPlus application.

– Moto.GSI.Lib has to be installed using MotoPlus installation tools.

– Requires a special parameter set.

• Moto.GSI.JobAPI

– Moto.GSI.JobAPI are jobs created for communication between Moto.GSI.Lib and inform job layer. They encapsulate this communication by a simple to use interface consisting of a jobname and a set of parameters.

– Moto.GSI.JobAPI jobs are installed/loaded like standard jobs.

• Moto.GSI.App

– Moto.GSI.Apps are user created applications based on Moto.GSI.SDK.

• Moto.GSI.AdminUI

– Allows easier debugging of Moto.GSI.Apps. Basically not required for running Moto.GSI applications.

3-1Moto.GSI.SDK/Manual

24 of 82

Page 25: Moto.GSI.SDK Manual...Moto.GSI.SDK/Manual Moto.GSI.SDK Description of the Operation Procedure Description of the Operation Procedure In the explanation of the operation proc edure,

3 System Overview3.2 System Architecture

177603-1CD

Moto.GSI.SDK

3.2 System Architecture

Sending and receiving of data is handled differently. Sending is a synchronous process whereas receiving data is done asynchronously in the background. Therefore creating a communication socket automatically creates an input buffer.

For creating a communication socket four different commands are existing

• TCPConnect

• TelnetConnect

• UDPBind

• RS232Open

Once a socket is created there are a couple of functions that operate on the socket for example to send data, to check the input buffer for existing data, to read data from buffer or to close the socket.

Fig. 3-1: System Architecture

3-2Moto.GSI.SDK/Manual

25 of 82

Page 26: Moto.GSI.SDK Manual...Moto.GSI.SDK/Manual Moto.GSI.SDK Description of the Operation Procedure Description of the Operation Procedure In the explanation of the operation proc edure,

177603-1CD

3 System Overview3.3 Return Values & Parameters

Moto.GSI.SDK

3.3 Return Values & Parameters

Moto.GSI.Jobs offer a set of parameters and a return value. Analyzing the return value allows user defined error handling so client has the ability to decide whether an alarm should be triggered or not.

There are two types of parameters

• By value

• By reference

– By reference parameters are similar to pointers. If a ByRef parameter is specified the function expects not a value but the Index of a global variable.

ByRef parameters are used to implement return values. The first parameter of each Moto.GSI job represents the return value.

Beside the return value there are two other special parameters

• Channel

• Handle

3.4 Channels

Channels are used to make the framework “thread-safe”. That means parallel tasks are allowed if different channels are used. If two or more GSI communication executed in concurrent tasks they have to be called with different channel parameters. By default a maximum number of 4 channels (0-3) are available.

3.5 Handle

A communication handle represents a communication socket with an input buffer. By default 20 handles are available.

3-3Moto.GSI.SDK/Manual

26 of 82

Page 27: Moto.GSI.SDK Manual...Moto.GSI.SDK/Manual Moto.GSI.SDK Description of the Operation Procedure Description of the Operation Procedure In the explanation of the operation proc edure,

3 System Overview3.6 Global Variables

177603-1CD

Moto.GSI.SDK

3.6 Global Variables

Communication between Moto.GSI.Lib and Moto.GSI.JobAPI is processed by global variables.

3.6.1 Change the GSI Internal Communication Variable Range

The internal used global variable range can be adjusted by writing new values to S92. If no value is set the default setting is used.

• Start Index: 100

• Used Channels: 4

This setting aligns variables B100-B103 (1 variable per channel) and I100 to I139 (10 variables per channel) for internal GSI communication

By changing the value of SVar[92] to 200:4 the alignment can be changed to

• Start Index: 200

• Used Channels: 4

This setting aligns variables B200-B203 and I200 to I239 for internal GSI communication

Additionally the headers of used GSI jobs have to be adjusted to the new range. The command alignment can be found directly after NOP line. Set the value to the used start index.

WARNINGBy default global B and I type variables in the range between 100 - 200 are used for internal GSI communication.

This variables may not be used for other tasks other-wise unpredictable results will occur.

3-4Moto.GSI.SDK/Manual

27 of 82

Page 28: Moto.GSI.SDK Manual...Moto.GSI.SDK/Manual Moto.GSI.SDK Description of the Operation Procedure Description of the Operation Procedure In the explanation of the operation proc edure,

177603-1CD

3 System Overview3.7 User Data

Moto.GSI.SDK

3.7 User Data

For the transport of user data global byte variables are used. Moto.GSI does not support string data. Basically a string is an array of characters. Moto.GSI uses ASCII representation of characters. That means each character can be represented by a byte value. So finally instead of using strings byte arrays are transmitted. Therefore some helper functions are existing (GSI_MakeString, GSI_MakeBArray) for converting string to byte arrays and vice versa.

This concept allows to overcome the limitation of 16 byte strings currently used in a Motoman robot controller. Byte arrays basically are only limited by the number of available global B variables in the controller. Moto.GSI itself supports a maximum length of 128 bytes.

3.8 Moto GSI Admin UI

The Moto GSI Admin UI is a debugging and information panel for MotoGSI related jobs. After connection it allows to view all currently opened handles and the related information (Handle type, input queue size, ...). Also data can be send and read by active handles, which makes it easy to test the communication with attached devices.

Fig. 3-2: Moto GSI Admin UI

NOTE The backslash is not displayed correctly on the screen. To enter a carriage return use ‘\r’. For a line feed enter ‘\n’.

3-5Moto.GSI.SDK/Manual

28 of 82

Page 29: Moto.GSI.SDK Manual...Moto.GSI.SDK/Manual Moto.GSI.SDK Description of the Operation Procedure Description of the Operation Procedure In the explanation of the operation proc edure,

3 System Overview3.8 Moto GSI Admin UI

177603-1CD

Moto.GSI.SDK

The debug panel can also be used to manipulate the internal byte array see Fig. 3-3 “Internal Byte Array” . Some GSI functions read the input parameters from the byte array. Sometimes it’s quite circumstantial to create the input string on job basis. With the debug panel a string can be easily written to the byte array at a selected start index. It’s also possible to read out the byte array at a specific position.

In the Fig. 3-2 “Moto GSI Admin UI” the String Hello World followed by a \r\n is written to the array at position 10. The length of the string is also displayed (13 bytes)

Fig. 3-3: Internal Byte Array

3-6Moto.GSI.SDK/Manual

29 of 82

Page 30: Moto.GSI.SDK Manual...Moto.GSI.SDK/Manual Moto.GSI.SDK Description of the Operation Procedure Description of the Operation Procedure In the explanation of the operation proc edure,

177603-1CD

3 System Overview3.9 Inform String Functions

Moto.GSI.SDK

3.9 Inform String Functions

Even if strings are not used for transmission in Moto.GSI they can be used as helper functions. Current Inform language supports the following string functions.

Instruction Description

ASC [Code][String]

Example:SET S000 “A”ASC B000 S000

B000 contains 65.

Gets ASCII code of the first string character• [Code]

– ASCII Code– B

• [String]– Source string– S, const.

CHR$ [String] [Code]

Example:SET B000 65CHR$ S000 B000

S000 contains “A”.

Gets the character belonging to the specified ASCII code• [String]

– ASCII character– S

• [Code]– ASCII code– B, const.

LEN [Length][String]

Example:SET S000 “Ben has 2 dogs”LEN B000 S000

B000 contains 14.

Returns the length of a string• [Length]

– Length of a string– B, I, D

• [String]– Source string– S

CAT$ [String1][String2][String3]

Example:SET S001 “Ben has 2”SET S002 “ dogs”CAT$ S000 S001 S002

S000 contains “Ben has 2 dogs”.

Concatenates 2 strings resulting in a new string• [String1]

– Resulting string– S

• [String2]– Source string1– S, const.

• [String3]– Source string2– S, const.

MID$[String1][String2][Pointer][Length]

Example:SET S001 “Ben has 2 dogs”MID$ S000 S001 5 3

S000 contains “has”.

Copies a part of a given string• [String1]

– Resulting string– S

• [String2]– Source string– S, const.

• [Pointer]– First character to copy (first character has

index 1)– B, I, D, const.

• [Length]– Number of chars to copy– B, I, D, const., not specified

3-7Moto.GSI.SDK/Manual

30 of 82

Page 31: Moto.GSI.SDK Manual...Moto.GSI.SDK/Manual Moto.GSI.SDK Description of the Operation Procedure Description of the Operation Procedure In the explanation of the operation proc edure,

3 System Overview3.9 Inform String Functions

177603-1CD

Moto.GSI.SDK

STRSTR [Pointer] [String1][String2] [StartPos]

Example:SET S000 “Ben has 2 dogs”STRSTR B000 S000 “hat”

B000 contains 5.

Searches a substring in a string• [Pointer]

– Position, 0 if the substring is not found– B

• [String1]– Source string– S

• [String2]– Search string– S, const.

• [StartPos]– Index where to start searching (1 based)– B, Omit

VAL2STR [String] [Value]

Example:SET R000 14.2VAL2STR S000 R000

S000 contains “14.2”.

Converts numerical value into a string.• [String]

– String representation– S

• [Value]– Numerical value– B, I, D, R

VAL [Value] [String] Radix=[Base]

Example 1:SET S000 “11”VAL B000 S000

R000 contains 11.

Example 2:SET S000 “11”VAL B000 S000 Radix=2

B000 contains 3.

Converts a string into a numerical value.• [Value]

– Numerical value– B, I, D, R

• [String]– String to convert– S

• [Base]– Number system, e.g. 2 for binary, 10 for decimal

or 16 for hexadecimal– const., Omit

Instruction Description

3-8Moto.GSI.SDK/Manual

31 of 82

Page 32: Moto.GSI.SDK Manual...Moto.GSI.SDK/Manual Moto.GSI.SDK Description of the Operation Procedure Description of the Operation Procedure In the explanation of the operation proc edure,

177603-1CD

3 System Overview3.10Function Overview

Moto.GSI.SDK

3.10 Function Overview

Function Name Description Input Output Supported in Version

Moto.GSI.JobAPI.Socket

CloseAllHandle Closes all open handles

Channel(B) Retvalpointer(I)

1.24

CloseHandle Closes a handle by closing socket and deleting input buffer

Channel(B) Retvalpointer(I) Handle(B)

1.0

SendData Sends data to the communication socket

Channel(B) Retvalpointer(I) Handle(B) Datapointer(I) Datalength(I)

1.0

ReadData Reads data from the input buffer

Channel(B) Retvalpointer(I) Handle(B) Datapointer(I) Datalength(I)

Read data is written to Datapointer

1.0

CheckPatternBin2 CheckPatternBin CheckPatternCheckPatternBin2 Blocking

Checks if input buffer contains data according to the specified pattern and length

Channel(B) Retvalpointer(I) Handle(B) Patternpointer(I) Patternlength(I) Elementno(B) Elementlength(B) ClearQ(B)ClearQ/Timout(I)

Selected pattern element

1.0 (1.1)1.24

ClearData Clears the input buffer Channel(B) Retvalpointer(I) Handle(B)

Moto.GSI.JobAPI.Helpers

GSI_MakeBArray Converts a string into a byte array

Retvalpointer(I) Datapointer(I) Datalength(I) String(S)

Byte representation of string at Datapointer

GSI_MakeString Converts a byte array into a string

Retvalpointer(I) Datapointer(I) Datalength(I)

String written to SVar at position Retvalpointer

GSI_GetTime Returns the system time

Channel(B) Retvalpointer(I) Index(I)

System time written to SVar at position Index

1.22

GSI_ByteToFloat Converts a byte array to a float value according to IEEE 754

Channel(B) Retvalpointer(I) IndexRVar(I) IndexBstart(I) Reversebytes(I)

Float value at IndexRVar

1.24

GSI_FloatToByte Converts a float value to it’s byte representation according to IEEE 754

Channel(B) Retvalpointer(I) IndexRvar(I) IndexBstart(I) Reversebytes(I)

Byte representation at IndexBstart

1.24

3-9Moto.GSI.SDK/Manual

32 of 82

Page 33: Moto.GSI.SDK Manual...Moto.GSI.SDK/Manual Moto.GSI.SDK Description of the Operation Procedure Description of the Operation Procedure In the explanation of the operation proc edure,

3 System Overview3.10Function Overview

177603-1CD

Moto.GSI.SDK

GSI_GetPosVarCoord Reads out the used coord system of a PVar

Channel(B) Retvalpointer(I) IndexPVar(I)

1.26

Moto.GSI.JobAPI.TCPClient

TCPConnect Establishes a TCP connection and initializes an input buffer

Channel(B) Retvalpointer(I) IPaddress(S) Port(S)

Valid handle 1.0

TelnetConnect Helper function to login onto a telnet server

Channel(B) Retvalpointer(I) IPaddress(S) Port(S) Datapointer(I) Datalength(I)

Valid handle 1.1

Moto.GSI.JobAPI.ModBus

ModBus_Read Reads data from ModBus server

Channel(B) Retvalpointer(I) Function(I) ModBusAddress(I) Count(I) RobotAddress(I) Type(I)

Valid handle 1.28

ModBus_Write Writes data to ModBus server

Channel(B) Retvalpointer(I) Function (I) ModBusAddress (I) RobotAddress (I) Count (I)Swap(I)

Valid handle 1.28

Moto.GSI.JobAPI.UDPPeer

UDPBind Opens a UDP socket and binds to the specified port

Channel(B) Retvalpointer(I) IPaddress(S) RemotePort(S) LocalPort(S)

Valid Handle 1.0

Moto.GSI.JobAPI.RS232

GSI_RS232OPEN Opens a serial RS232 socket with specified parameters

Channel(B) Retvalpointer(I) ComPort(B) Baudrate(B) DataBits(B) StopBits(B) Parity(B)

Valid Handle 1.0

GSI_FloatToByte Converts a float value to it’s byte representation according to IEEE 754

Channel(B) Retvalpointer(I) IndexRvar(I) IndexBstart(I) Reversebytes(I)

Byte representation at IndexBstart

1.24

GSI_GetPosVarCoord Reads out the used coord system of a PVar

Channel(B) Retvalpointer(I) IndexPVar(I)

1.26

Function Name Description Input Output Supported in Version

3-10Moto.GSI.SDK/Manual

33 of 82

Page 34: Moto.GSI.SDK Manual...Moto.GSI.SDK/Manual Moto.GSI.SDK Description of the Operation Procedure Description of the Operation Procedure In the explanation of the operation proc edure,

177603-1CD

3 System Overview3.10Function Overview

Moto.GSI.SDK

Moto.GSI.JobAPI.TCPClient

TCPConnect Establishes a TCP connection and initializes an input buffer

Channel(B) Retvalpointer(I) IPaddress(S) Port(S)

Valid handle 1.0

TelnetConnect Helper function to login onto a telnet server

Channel(B) Retvalpointer(I) IPaddress(S) Port(S) Datapointer(I) Datalength(I)

Valid handle 1.1

Moto.GSI.JobAPI.ModBus

ModBus_Read Reads data from ModBus server

Channel(B) Retvalpointer(I) Function(I) ModBusAddress(I) Count(I) RobotAddress(I) Type(I)

Valid handle 1.28

ModBus_Write Writes data to ModBus server

Channel(B) Retvalpointer(I) Function (I) ModBusAddress (I) RobotAddress (I) Count (I)Swap(I)

Valid handle 1.28

Moto.GSI.JobAPI.UDPPeer

UDPBind Opens a UDP socket and binds to the specified port

Channel(B) Retvalpointer(I) IPaddress(S) RemotePort(S) LocalPort(S)

Valid Handle 1.0

Moto.GSI.JobAPI.RS232

GSI_RS232OPEN Opens a serial RS232 socket with specified parameters

Channel(B) Retvalpointer(I) ComPort(B) Baudrate(B) DataBits(B) StopBits(B) Parity(B)

Valid Handle 1.0

Moto.GSI.JobAPI.FTP

FTPConnect Opens a connection to a ftp server

Channel(B) Retvalpointer(I) IPaddress(S) Port(S) Datapointer(I) Datalength(I)

1.1

FTPDisconnect Closes the connection to a ftp server

Channel(B) Retvalpointer(I)

1.1

Function Name Description Input Output Supported in Version

3-11Moto.GSI.SDK/Manual

34 of 82

Page 35: Moto.GSI.SDK Manual...Moto.GSI.SDK/Manual Moto.GSI.SDK Description of the Operation Procedure Description of the Operation Procedure In the explanation of the operation proc edure,

3 System Overview3.10Function Overview

177603-1CD

Moto.GSI.SDK

FTPPutJob Transfer a job file (Controller to FTP server)

Channel(B) Retvalpointer(I) Datapointer(I) Datalength(I)

1.1

FTPGetJob Transfer a job file (FTP server to controller)

Channel(B) Retvalpointer(I) Datapointer(I) Datalength(I)

1.1

Moto.GSI.JobAPI.SMTP

SMTPSend Send a mail Channel(B) Retvalpointer(I) IPaddress(S) Port(S) Datapointer(I) Datalength(I)

1.1

Moto.GSI.JobAPI.PositionOutput

InitUDPPosOutput Initialize output of the current position per UDP

Channel(B) Retvalpointer(I) Robot(I) Frame(I) Tool(I)IO(I)Delay(I) RecMode(I)

1.22

StartUDPPosOutput Channel(B) Retvalpointer(I) IPaddress(S) Port(S)

1.22

StopUDPPosOutput Channel(B) Retvalpointer(I)

1.22

SetPosOutputHeader Adds an additional header line to the record file which can be customized by user

Channel(B) Retvalpointer(I) PVarIndex(I) 1.26

Moto.GSI.JobAPI.SpeedOutput

StartSpeedOutput Channel(B) Retvalpointer(I)

1.23

Control Group(I) Register(I) Cycle(I)

StopSpeedOutput Channel(B) Retvalpointer(I)

1.23

Function Name Description Input Output Supported in Version

3-12Moto.GSI.SDK/Manual

35 of 82

Page 36: Moto.GSI.SDK Manual...Moto.GSI.SDK/Manual Moto.GSI.SDK Description of the Operation Procedure Description of the Operation Procedure In the explanation of the operation proc edure,

177603-1CD

4 Function Reference4.1 GSI_TCPCONNECT

Moto.GSI.SDK

4 Function Reference

4.1 GSI_TCPCONNECT (CHANNEL, RETVALPOINTER, IPADDRESS,PORT)

Creates a socket by connecting to a TCP server identified by IP address and port number. If successful, a communication handle is returned which can be used to send or receive data by this socket.

Parameters

Type Description Remarks

Channel B Moto.GSI/MotoPlus communication channel Default Range: 0-3

RetValPointer I Index of B variable that is used to write result

IPAddress S IP address of external device which acts as TCP Server

e.g. “192.168.0.10”

Port S Port of external device which acts as TCP Server

0 to 65535. Port Number must be entered as stringe.g. “502”

Return Values

Type Description Remarks

RetValPointer B B[RetValPointer] holds a valid communication handle or Error number if socket could not be established

1-19: Success, valid handle254: Error251: Error, no free handle available

4-1Moto.GSI.SDK/Manual

36 of 82

Page 37: Moto.GSI.SDK Manual...Moto.GSI.SDK/Manual Moto.GSI.SDK Description of the Operation Procedure Description of the Operation Procedure In the explanation of the operation proc edure,

4 Function Reference4.2 GSI_TELNETCONNECT

177603-1CD

Moto.GSI.SDK

4.2 GSI_TELNETCONNECT (CHANNEL, RETVALPOINTER, IPADDRESS, PORT, DATAPTR, DATALEN)

Creates a socket by connecting to a telnet server identified by IP address and port number. If successful, a communication handle is returned which can be used to send or receive data by this socket.

Parameters

Type Description Remarks

Channel B Moto.GSI/MotoPlus communication channel Default Range: 0-3

RetValPointer I Index of B variable that is used to write result

IPAddress S IP address of external device which acts as TCP Server

Port S Port of external device which acts as TCP Server

0 to 65535

DataPtr I Index of the first data byte of the telnet login data. The parameters must be ordered as follows:

Username’\r’Password’\r’LogPattern

The LogPattern must be a unique pattern identifying the end of the telnet servers login response in order to detect a correct login

Data must be separated by \r (hex: 0D)

DataLen I Length of the login data

Return Values

Type Description Remarks

RetValPointer B B[RetValPointer] holds a valid communication handle or Error number if socket could not be established

1-19: Success, valid handle254: Error251: Error, no free handle available

4-2Moto.GSI.SDK/Manual

37 of 82

Page 38: Moto.GSI.SDK Manual...Moto.GSI.SDK/Manual Moto.GSI.SDK Description of the Operation Procedure Description of the Operation Procedure In the explanation of the operation proc edure,

177603-1CD

4 Function Reference4.3 GSI_UDPBIND

Moto.GSI.SDK

4.3 GSI_UDPBIND (CHANNEL, RETVALPOINTER, IPADDRESS, REMOTEPORT, LOCALPORT)

Creates a UDP socket by binding to a local port. Specified IP address and Remote Port is stored internally and is used as destination for sending. If successful, a communication handle is returned which can be used to send or receive data by this socket.

Parameters

Type Description Remarks

Channel B Moto.GSI/MotoPlus communication channel Default Range: 0-3

RetValPointer I Index of B variable that is used to write result

IPAddress S IP address of external device acting as UDP Peer

RemotePort S Port of external device acting 0 to 65535

Port S Local Port where data is sent from and where data from external device arrives.

0 to 65535If port is “0” binding port will be selected automatically by the Operating System. This is only suitable if DX/FS 100 is the communication master or in other words DX/FS 100 is sending data to host before receiving data.

Return Values

Type Description Remarks

RetValPointer B B[RetValPointer] holds a valid communication handle or Error number if socket could not be established

1-19: Success, valid handle254: Error251: Error, no free handle available

4-3Moto.GSI.SDK/Manual

38 of 82

Page 39: Moto.GSI.SDK Manual...Moto.GSI.SDK/Manual Moto.GSI.SDK Description of the Operation Procedure Description of the Operation Procedure In the explanation of the operation proc edure,

4 Function Reference4.4 GSI_RS232OPEN

177603-1CD

Moto.GSI.SDK

4.4 GSI_RS232OPEN (CHANNEL, RETVALPOINTER, COMPORT, BAUDRATE, DATABITS STOPBIT PARITY)

Creates a serial RS232 socket binding to specified port. If successful, a communication handle is returned which can be used to send or receive data by this socket.

Parameters

Type Description Remarks

Channel B Moto.GSI/MotoPlus communication channel Default Range: 0-3

RetValPointer I Index of B variable that is used to write result

ComPort B Com port number 1: Port 1 (external)

Baudrate B Baud Rate 1:150 baud2:300 baud3:600 baud4:1200 baud5:2400 baud6:4800 baud7:9600 baud8:19200 baud

DataBits B Number of Data Bits 7: 7 data bits8: 8 data bits

StopBits B Number of Stop Bits 0: 1 stop bit1: 1.5 stop bits2: 2 stop bits

Parity B Parity Bits 0: no parity1: odd2: even

Return Values

Type Description Remarks

RetValPointer B B[RetValPointer] holds a valid communication handle or Error number if socket could not be established

1-19: Success, valid handle254: Error251: Error, no free handle available

4-4Moto.GSI.SDK/Manual

39 of 82

Page 40: Moto.GSI.SDK Manual...Moto.GSI.SDK/Manual Moto.GSI.SDK Description of the Operation Procedure Description of the Operation Procedure In the explanation of the operation proc edure,

177603-1CD

4 Function Reference4.5 GSI_SENDDATA

Moto.GSI.SDK

4.5 GSI_SENDDATA (CHANNEL, RETVALPOINTER, HANDLE, DATAPOINTER, DATALENGTH)

Sends specified data to the socket given by a valid communication handle.

Example 1

…..

Parameters

Type Description Remarks

Channel B Moto.GSI/MotoPlus communication channel Default Range: 0-3

RetValPointer I Index of B variable that is used to write result

Handle B Communication handle

DataPointer I Index of first data byte

DataLength I Number of data bytes to send Max. 128 bytes

Return Values

Type Description Remarks

RetValPointer B B[RetValPointer] holds a valid communication handle or Error-number if socket could not be established

1-19: Success, valid handle254: Error251: Error, no free handle available

4-5Moto.GSI.SDK/Manual

40 of 82

Page 41: Moto.GSI.SDK Manual...Moto.GSI.SDK/Manual Moto.GSI.SDK Description of the Operation Procedure Description of the Operation Procedure In the explanation of the operation proc edure,

4 Function Reference4.6 GSI_CHECKPATTERNBIN2

177603-1CD

Moto.GSI.SDK

4.6 GSI_CHECKPATTERNBIN2 (CHANNEL, RETVALPOINTER, HANDLE, PATTERNPOINTER, PATTRNLENGTH, ELEMENTNO, ELEMENTLENGTH, CLEARQ) See also section 4.7 “GSI_CHECKPATTERNBIN2BLOCKING” function

Checks input queue if content is according to a specified pattern. If pattern is found it returns the instance data of the selected pattern element

Fig. 4-1: GSI_CHECKPATTERNBIN2 sample code - Loop until pattern is found

Parameters

Type Description Remarks

Channel B Moto.GSI/MotoPlus communication channel Default Range: 0-3

RetValPointer I Index of B variable that is used to write result

Handle B Communication handle

PatternPointer I Index of B-Var that holds first pattern byte

PatternLength I Number of pattern bytes

ElementNo B The number of the pattern element to return 0: returns whole pattern instance>0: returns instance of selected pattern element

ElementLength B Required length of instance data of selected pattern element (specified by element number)

0:length is disregarded>0:pattern element must have specified length

ClearQ B Clears communication receiving queue 0:do not clear queue1:clear queue

Return Values

Type Description Remarks

RetValPointer B If pattern was found the number of bytes of the corresponding pattern element instance is stored in B[RetValPointer] otherwise error code.

1-128: Success, no of read characters254: Error253: Pattern not found252: Error, invalid handle

RetValPointer + 1 B If pattern was found the first byte of the corresponding pattern element instance is stored in B[RetValPointer+1]

4-6Moto.GSI.SDK/Manual

41 of 82

Page 42: Moto.GSI.SDK Manual...Moto.GSI.SDK/Manual Moto.GSI.SDK Description of the Operation Procedure Description of the Operation Procedure In the explanation of the operation proc edure,

177603-1CD

4 Function Reference4.6 GSI_CHECKPATTERNBIN2

Moto.GSI.SDK

Example 1 (Returns Pattern Element 1):

CALL JOB:GSI_CHECKPATTERNBIN2 0 200 LB000 300 7 1 0 0:

Example 2 (Returns Pattern Element 2):

CALL JOB:GSI_CHECKPATTERNBIN2 0 200 LB000 300 7 2 0 0:

Example 3 (Returns whole pattern):

CALL JOB:GSI_CHECKPATTERNBIN2 0 200 LB000 300 7 0 0 0

B300 B301 B302 B303 B304 B305 B306 B307 B308

Pattern o k : * , * !

Queue o k : 2 3 , 4 5 !

Length 1 2

Var B200 B201 B202

Val 2 50 51

Char 2 3

B300 B301 B302 B303 B304 B305 B306 B307 B308

Pattern o k : * , * !

Queue o k : 2 3 , 4 5 !

Length 1 2

Var B200 B201 B202

Val 2 52 53

Char 4 5

Length B300 B301 B302 B303 B304 B305 B306 B307 B308

Pattern o k : * , * !

Queue o k : 2 3 , 4 5 !

Length 1 2 3 4 5 6 7 8 9

Var B200 B201 B202 B203 B204 B205 B206 B207 B208 B209

Val 9 111 107 58 50 51 44 52 53 33

Char o k : 2 3 , 4 5 !

4-7Moto.GSI.SDK/Manual

42 of 82

Page 43: Moto.GSI.SDK Manual...Moto.GSI.SDK/Manual Moto.GSI.SDK Description of the Operation Procedure Description of the Operation Procedure In the explanation of the operation proc edure,

4 Function Reference4.6 GSI_CHECKPATTERNBIN2

177603-1CD

Moto.GSI.SDK

Example 4:

CALL JOB:GSI_CHECKPATTERNBIN2 0 200 LB000 300 7 0 6 0

Pattern is not found due to incompatible length (9 instead of 6)

Length B300 B301 B302 B303 B304 B305 B306 B307 B308

Pattern o k : * , * !

Queue o k : 2 3 , 4 5 !

Length 1 2 3 4 5 6 7 8 9

Var B200

Val 253

Char

4-8Moto.GSI.SDK/Manual

43 of 82

Page 44: Moto.GSI.SDK Manual...Moto.GSI.SDK/Manual Moto.GSI.SDK Description of the Operation Procedure Description of the Operation Procedure In the explanation of the operation proc edure,

177603-1CD

4 Function Reference4.7 GSI_CHECKPATTERNBIN2BLOCKING

Moto.GSI.SDK

4.7 GSI_CHECKPATTERNBIN2BLOCKING (CHANNEL, RETVALPOINTER, HANDLE, PATTERNPOINTER, PATTRNLENGTH, ELEMENTNO, ELEMENTLENGTH, CLEARQ/TIMEOUT)

Checks input queue if content is according to a specified pattern. If pattern is found it returns the instance data of the selected pattern element.

NOTEThe functionality is the same as for GSI_CHECKPATTERNBIN2 except that this function returns only when the pattern is found or the timeout value is reached.

Parameters

Type Description Remarks

Channel B Moto.GSI/MotoPlus communication channel Default Range: 0-3

RetValPointer I Index of B variable that is used to write result

Handle B Communication handle

PatternPointer I Index of B-Var that holds first pattern byte

PatternLength I Number of pattern bytes

ElementNo B The number of the pattern element to return 0: returns whole pattern instance>0: returns instance of selected pattern element

ElementLength B Required length of instance data of selected pattern element (specified by element number)

0:length is disregarded>0:pattern element must have specified length

ClearQ/Timeout I Clears communication receiving queue and timeout. E.g. a value of -10 indicates a timeout of 10 seconds and that the input queue is not deleted after the pattern is found

0:Wait forever, don’t clear queue>=1 Time to wait in seconds and clear queue<=-1 Time to wait in seconds and don’t clear queue

Return Values

Type Description Remarks

RetValPointer B If pattern was found the number of bytes of the corresponding pattern element instance is stored in B[RetValPointer] otherwise error code.

1-128: Success, no of read characters254: Error253: Pattern not found252: Error, invalid handle

RetValPointer + 1 B If pattern was found the first byte of the corresponding pattern element instance is stored in B[RetValPointer+1]

4-9Moto.GSI.SDK/Manual

44 of 82

Page 45: Moto.GSI.SDK Manual...Moto.GSI.SDK/Manual Moto.GSI.SDK Description of the Operation Procedure Description of the Operation Procedure In the explanation of the operation proc edure,

4 Function Reference4.7 GSI_CHECKPATTERNBIN2BLOCKING

177603-1CD

Moto.GSI.SDK

Fig. 4-2: GSI_CHECKPATTERNBIN2BLOCKING sample code - The function blocks until the pattern is found

In the sample above we are waiting on any sequence which matches “*;*;*;”. A valid sequence would be “1;2;3;” The first call of function CHECKPATTERN-BIN2_BLOCKING blocks until a valid pattern is found.

After the pattern is found the first element of the found pattern (“1”) is processed and converted to a string. Please note that the input queue is not deleted on the first function call. If the first blocking call returns we know that the pattern is found so all following check pattern function calls would not block so we can easily access the remaining pattern elements (“2”, “3”). On the last CHECKPATTERNBIN2_BLOCKING call the input queue is deleted.

4-10Moto.GSI.SDK/Manual

45 of 82

Page 46: Moto.GSI.SDK Manual...Moto.GSI.SDK/Manual Moto.GSI.SDK Description of the Operation Procedure Description of the Operation Procedure In the explanation of the operation proc edure,

177603-1CD

4 Function Reference4.8 GSI_CHECKPATTERNBIN/GSI_CHECKPATTERN

Moto.GSI.SDK

4.8 GSI_CHECKPATTERNBIN/GSI_CHECKPATTERN (CHANNEL, RETVALPOINTER, HANDLE, PATTERNPOINTER, PATTRNLENGTH, ELEMENTNO, ELEMENTLENGTH, CLEARQ)

Checks input queue if content is according to a specified pattern. If pattern is found it returns the instance data of the selected pattern element. GSI_CHECKPATTERNBIN() and GSI_CHECKPATTERN() basically offer the same functionality. However GSI_CHECKPATTERN() is limited to ASCII based protocols, because it cannot handle byte values equal to 0. In case of doubt GSI_CHECKPATTERNBIN() should be used.

NOTE In new projects use GSI_CHECKPATTERBIN2BLOCKING() instead!

Parameters

Type Description Remarks

Channel B Moto.GSI/MotoPlus communication channel Default Range: 0-3

RetValPointer I Index of B variable that is used to write result

Handle B Communication handle

PatternPointer I Index of B-Var that containing first pattern byte

PatternLength B Number of pattern bytes

ElementNo B The number of the pattern element to return 0: returns whole pattern instance>0: returns instance of selected pattern element

ElementLength B Required length of instance data of selected pattern element (specified by element number)

0:length is disregarded>0:pattern element must have specified length

ClearQ B Clears communication receiving queue 0:do not clear queue1:clear queue

Return Values

Type Description Remarks

RetValPointer B Result is stored in B[RetValPointer] 1-128: Success, no of read characters254: Error253: Pattern not found/Timeout252: Error, invalid handle

PatternPointer B If pattern was found the first byte of the corresponding pattern element instance is stored in B[PatternPointer].

ATTENTION: If pattern is found, pattern data is overwritten by result data.

4-11Moto.GSI.SDK/Manual

46 of 82

Page 47: Moto.GSI.SDK Manual...Moto.GSI.SDK/Manual Moto.GSI.SDK Description of the Operation Procedure Description of the Operation Procedure In the explanation of the operation proc edure,

4 Function Reference4.9 GSI_CLOSEHANDLE

177603-1CD

Moto.GSI.SDK

4.9 GSI_CLOSEHANDLE (CHANNEL, RETVALPOINTER, HANDLE)

Closes specified communication handle and cleans up resources

Parameters

Type Description Remarks

Channel B Moto.GSI/MotoPlus communication channel Default Range: 0-3

RetValPointer I Index of B variable that is used to write result

Handle B Communication handle

Return Values

Type Description Remarks

RetValPointer B Result is stored in B[RetValPointer] 255: Success252: Error, invalid handle

4-12Moto.GSI.SDK/Manual

47 of 82

Page 48: Moto.GSI.SDK Manual...Moto.GSI.SDK/Manual Moto.GSI.SDK Description of the Operation Procedure Description of the Operation Procedure In the explanation of the operation proc edure,

177603-1CD

4 Function Reference4.10GSI_CLOSEHANDLE

Moto.GSI.SDK

4.10 GSI_CLOSEHANDLE (CHANNEL, RETVALPOINTER)

Closes all open communication handles and cleans up resources.

Parameters

Type Description Remarks

Channel B Moto.GSI/MotoPlus communication channel Default Range: 0-3

RetValPointer I Index of B variable that is used to write result

Return Values

Type Description Remarks

RetValPointer B Result is stored in B[RetValPointer] 255: Success252: Error

4-13Moto.GSI.SDK/Manual

48 of 82

Page 49: Moto.GSI.SDK Manual...Moto.GSI.SDK/Manual Moto.GSI.SDK Description of the Operation Procedure Description of the Operation Procedure In the explanation of the operation proc edure,

4 Function Reference4.11GSI_READDATA

177603-1CD

Moto.GSI.SDK

4.11 GSI_READDATA (CHANNEL, RETVALPOINTER, HANDLE, DATAPOINTER, DATALENGTH)

Reads specified number of characters from the input queue and deletes them.

Parameters

Type Description Remarks

Channel B Moto.GSI/MotoPlus communication channel Default Range: 0-3

RetValPointer I Index of B variable that is used to write result

Handle B Communication handle

DataPointer I Index of B-Var that holds first pattern byte

DataLength I Number of pattern bytes Max. 128 bytes

Return Values

Type Description Remarks

RetValPointer B Result is stored in B[RetValPointer] 1-128: Success, number of read characters253: No characters in queue254: Error252: Error, invalid handle

DataPointer B B[DataPointer] holds first byte of read data.

4-14Moto.GSI.SDK/Manual

49 of 82

Page 50: Moto.GSI.SDK Manual...Moto.GSI.SDK/Manual Moto.GSI.SDK Description of the Operation Procedure Description of the Operation Procedure In the explanation of the operation proc edure,

177603-1CD

4 Function Reference4.12GSI_CLEARDATA

Moto.GSI.SDK

4.12 GSI_CLEARDATA (CHANNEL, RETVALPOINTER, HANDLE)

Clears input queue of the specified handle.

Parameters

Type Description Remarks

Channel B Moto.GSI/MotoPlus communication channel Default Range: 0-3

RetValPointer I Index of B variable that is used to write result

Handle B Communication handle

Return Values

Type Description Remarks

RetValPointer B Result is stored in B[RetValPointer] 255: Success254: Error, invalid handle252: Error, invalid handle

4-15Moto.GSI.SDK/Manual

50 of 82

Page 51: Moto.GSI.SDK Manual...Moto.GSI.SDK/Manual Moto.GSI.SDK Description of the Operation Procedure Description of the Operation Procedure In the explanation of the operation proc edure,

4 Function Reference4.13GSI_MODBUS_READ

177603-1CD

Moto.GSI.SDK

4.13 GSI_MODBUS_READ (CHANNEL, RETVALPOINTER, HANDLE, FUNCTION, MODBUSADDR, COUNT, ROBOTADDR, TYPE)

Reads specified value from a Modbus server. Requires a valid communication handle by using GSI_TCPCONNECT

Parameters

Type Description Remarks

Channel B Moto.GSI/MotoPlus communication channel Default Range: 0-3

RetValPointer I Index of B variable that is used to write result

Handle B Communication handle

Function I Modbus function code Supported function codes:READCOIL 1READDISCRETEINPUTS 2READHOLDINGREG 3READINPUTREG 4

ModBusAddr I Server side start address to be read

Count I Number of values to be read

RobotAddr I Controller side start address to write result Type 0-4 are written to DVariables[RobotAddr],…Type 5 toRVariables[RobotAddr],…

Type I Convert readout data to type 0=BYTE1=SBYTE2=USHORT3=SHORT4=INT5=FLOAT

Negative values indicate a byte swap e.g. -2 will swap bytes and interpret data as USHORT

Return Values

Type Description Remarks

RetValPointer B Result is stored in B[RetValPointer] 255: Success< 255: Error

4-16Moto.GSI.SDK/Manual

51 of 82

Page 52: Moto.GSI.SDK Manual...Moto.GSI.SDK/Manual Moto.GSI.SDK Description of the Operation Procedure Description of the Operation Procedure In the explanation of the operation proc edure,

177603-1CD

4 Function Reference4.14GSI_MODBUS_WRITE

Moto.GSI.SDK

4.14 GSI_MODBUS_WRITE (CHANNEL, RETVALPOINTER, HANDLE, FUNCTION, MODBUSADDR, ROBOTADDR, COUNT, SWAP)

Writes specified value to a Modbus server. Requires a valid communication handle by using GSI_TCPCONNECT

Parameters

Type Description Remarks

Channel B Moto.GSI/MotoPlus communication channel Default Range: 0-3

RetValPointer I Index of B variable that is used to write result

Handle B Communication handle

Function I Modbus function code Supported function codes:WRITESINGLECOIL 5WRITESINGLEREGISTER 6WRITEMULTIPLECOILS15WRITEMULTIPLEREGISTER 16

ModBusAddr I Server side start address to be read

RobotAddr I Controller side start address to read data WRITESINGLECOILWRITEMULTIPLECOILS:Data is read directly from IO’sUse a valid IO address e.g.For universal output 1 enter 10010

WRITESINGLEREGISTERWRITEMULTIPLEREGISTER:Data is read directly from DVariables[RobotAddr]

Count I Number of data to be written e.g. DVariables[RobotAddr], DVariables[RobotAddr+1], …

Swap I Swap data bytes Only for WRITESINGLEREGISTERWRITEMULTIPLEREGISTER0=Don’t swap1=Swap

Return Values

Type Description Remarks

RetValPointer B Result is stored in B[RetValPointer] 255: Success< 255: Error

4-17Moto.GSI.SDK/Manual

52 of 82

Page 53: Moto.GSI.SDK Manual...Moto.GSI.SDK/Manual Moto.GSI.SDK Description of the Operation Procedure Description of the Operation Procedure In the explanation of the operation proc edure,

4 Function Reference4.15GSI_MAKEBARRAY

177603-1CD

Moto.GSI.SDK

4.15 GSI_MAKEBARRAY (RETVALPOINTER, DATAPOINTER, DATALENGTH, STRING)

String to byte array conversion. ASCII value is used for coding.

Example

…..

Parameters

Type Description Remarks

RetValPointer I Index of B variable that is used to write result

DataPointer I Index of a B-Var to store first data byte

DataLength I Reserved, currently not used

String S String that is converted to a byte array

Return Values

Type Description Remarks

RetValPointer B B[RetValPointer] contains length of specified string.

DataPointer B B[DataPointer] contains ASCII value of first character of specified string.

4-18Moto.GSI.SDK/Manual

53 of 82

Page 54: Moto.GSI.SDK Manual...Moto.GSI.SDK/Manual Moto.GSI.SDK Description of the Operation Procedure Description of the Operation Procedure In the explanation of the operation proc edure,

177603-1CD

4 Function Reference4.16GSI_MAKESTRING

Moto.GSI.SDK

4.16 GSI_MAKESTRING (RETVALPOINTER, DATAPOINTER, DATALENGTH)

Byte array to string conversion. ASCII value is used for coding

Parameters

Type Description Remarks

RetValPointer I Index of S variable that is used to write result

DataPointer I Index of first data byte

DataLength I Length of array Maximum length of a S variable is limited to 16 characters.

Return Values

Type Description Remarks

RetValPointer B S[RetValPointer] holds string representation of specified byte array.

4-19Moto.GSI.SDK/Manual

54 of 82

Page 55: Moto.GSI.SDK Manual...Moto.GSI.SDK/Manual Moto.GSI.SDK Description of the Operation Procedure Description of the Operation Procedure In the explanation of the operation proc edure,

4 Function Reference4.17GSI_FTPCONNECT

177603-1CD

Moto.GSI.SDK

4.17 GSI_FTPCONNECT (CHANNEL, RETVALPOINTER, IPADDRESS, PORT, DATAPTR, DATALEN)

Creates a connection to the FTP server identified by IP address and port number. There’s only one connection at a time possible so no handle is returned.

Parameters

Type Description Remarks

Channel B Moto.GSI/MotoPlus communication channel Default Range: 0-3

RetValPointer I Index of B variable that is used to write result

IPAddress S IP address of the FTP server e.g. “192.168.0.10”

Port S Port of the FTP server 0 to 65535

DataPtr I Index of the first data byte of the FTP login parameters. The parameters must be ordered as follows: Username’\r’Password

Parameters must be separated by ‘\r' (hex: 0D)

DataLen I Length of the login data

Return Values

Type Description Remarks

RetValPointer B B[RetValPointer] holds the return value 1: Success1: Already connected254: Error

4-20Moto.GSI.SDK/Manual

55 of 82

Page 56: Moto.GSI.SDK Manual...Moto.GSI.SDK/Manual Moto.GSI.SDK Description of the Operation Procedure Description of the Operation Procedure In the explanation of the operation proc edure,

177603-1CD

4 Function Reference4.18GSI_FTPDISCONNECT

Moto.GSI.SDK

4.18 GSI_FTPDISCONNECT (CHANNEL, RETVALPOINTER)

Closes the current FTP connection.

Parameters

Type Description Remarks

Channel B Moto.GSI/MotoPlus communication channel Default Range: 0-3

RetValPointer I Index of B variable that is used to write result

Return Values

Type Description Remarks

RetValPointer B B[RetValPointer] holds the return value 1: Success

4-21Moto.GSI.SDK/Manual

56 of 82

Page 57: Moto.GSI.SDK Manual...Moto.GSI.SDK/Manual Moto.GSI.SDK Description of the Operation Procedure Description of the Operation Procedure In the explanation of the operation proc edure,

4 Function Reference4.19GSI_FTPPUTJOB

177603-1CD

Moto.GSI.SDK

4.19 GSI_FTPPUTJOB (CHANNEL, RETVALPOINTER, DATAPTR, DATALEN)

Transfers the selected job file (.JBI) from the controller to the connected FTP server.

Parameters

Type Description Remarks

Channel B Moto.GSI/MotoPlus communication channel Default Range: 0-3

RetValPointer I Index of B variable that is used to write result

DataPtr I Index of the first data byte of the job name.

DataLen I Length of the job name

Return Values

Type Description Remarks

RetValPointer B B[RetValPointer] holds the return value 1: Success1: Already connected254: Error

4-22Moto.GSI.SDK/Manual

57 of 82

Page 58: Moto.GSI.SDK Manual...Moto.GSI.SDK/Manual Moto.GSI.SDK Description of the Operation Procedure Description of the Operation Procedure In the explanation of the operation proc edure,

177603-1CD

4 Function Reference4.20GSI_FTPGETJOB

Moto.GSI.SDK

4.20 GSI_FTPGETJOB (CHANNEL, RETVALPOINTER, DATAPTR, DATALEN)

Transfers the selected job file (.JBI) from the connected FTP server to the controller.

Parameters

Type Description Remarks

Channel B Moto.GSI/MotoPlus communication channel Default Range: 0-3

RetValPointer I Index of B variable that is used to write result

DataPtr I Index of the first data byte of the job name.

DataLen I Length of the job name

Return Values

Type Description Remarks

RetValPointer B B[RetValPointer] holds the return value 1: Success253: Not connected254: Error

4-23Moto.GSI.SDK/Manual

58 of 82

Page 59: Moto.GSI.SDK Manual...Moto.GSI.SDK/Manual Moto.GSI.SDK Description of the Operation Procedure Description of the Operation Procedure In the explanation of the operation proc edure,

4 Function Reference4.21GSI_SMTPSEND

177603-1CD

Moto.GSI.SDK

4.21 GSI_SMTPSEND (CHANNEL, RETVALPOINTER, IPADDRESS, PORT, DATAPTR, DATALEN)

Sends a mail through SMTP server identified by IP address and port number.

Encrypted connections are not supported.

Parameters

Type Description Remarks

Channel B Moto.GSI/MotoPlus communication channel Default Range: 0-3

RetValPointer I Index of B variable that is used to write result

IPAddress S IP address of the SMTP server e.g. “192.168.0.10”

Port S Port of the SMTP server 0 to 65535

DataPtr I Index of the first data byte of the SMTP parameters. The parameters must be ordered as follows: Username’\r’Password’\r’SenderAddress‘\r’ReceiverAddress’\r’Message

Parameters must be separated by ‘\r’ (hex: 0D)

DataLen I Length of the SMTP data

Return Values

Type Description Remarks

RetValPointer B B[RetValPointer] holds the return value 1: Success253: Send Error254: Connection Error

4-24Moto.GSI.SDK/Manual

59 of 82

Page 60: Moto.GSI.SDK Manual...Moto.GSI.SDK/Manual Moto.GSI.SDK Description of the Operation Procedure Description of the Operation Procedure In the explanation of the operation proc edure,

177603-1CD

4 Function Reference4.22GSI_INITUDPPOSOUTPUT

Moto.GSI.SDK

4.22 GSI_INITUDPPOSOUTPUT (CHANNEL, RETVALPOINTER, ROBOT, FRAME, TOOL, IO, Delay, RecMode)

Initialize the output of the current TCP (Tool control point) in cartesian coordinates per UDP. This function allows also to log the state of the entered IO together with the position data. The CDROM contains a UDP Server sample written in C++.

NOTE

If RecMode = 1 (Feedback Position) additionally the following parameters have to be set on controller side. This function uses Registers 500 to 513. Make sure not to use this registers.

• S1CxG217: 1

• S1CxG218: 1

• S1CxG219: 500

• S1CxG220: 502

• S1CxG221: 504

• S1CxG222: 506

• S1CxG223: 508

• S1CxG224: 510

• S1CxG225: 512

Parameters

Type Description Remarks

Channel B Moto.GSI/MotoPlus communication channel Default Range: 0-3

RetValPointer I Index of B variable that is used to write result

Robot I Control group 0-7 (R1,…,R8)Only for RecMode=0

Frame I Specified coordinate frame(Only if ). If RecMode=1 base coordinate is used

0: Base coordinate1: Robot coordinate2, 3, …:User coordinate numberOnly for RecMode=0

Tool I Tool number 0-23Only for RecMode=0

IO I IO that will be logged together with the position 0: OFF else ONe.g. 10010

Delay I Delay of the IO in cycles to position data Only for RecMode=1

RecMode I Position Record Mode 0=Command Position1=Feedback Position(Only DX100/DX200)

Return Values

Type Description Remarks

RetValPointer B B[RetValPointer] holds the return value 1: Success254: Connection Error

4-25Moto.GSI.SDK/Manual

60 of 82

Page 61: Moto.GSI.SDK Manual...Moto.GSI.SDK/Manual Moto.GSI.SDK Description of the Operation Procedure Description of the Operation Procedure In the explanation of the operation proc edure,

4 Function Reference4.23GSI_SETPOSOUTPUTHEADER

177603-1CD

Moto.GSI.SDK

4.23 GSI_SETPOSOUTPUTHEADER (CHANNEL, RETVALPOINTER, INDEX PVAR)

Insert the values (x,y,z,Rx,Ry,Rz) of the PVar to the first line of the record file. So the first line can be customized by user needs.

Parameters

Type Description Remarks

Channel B Moto.GSI/MotoPlus communication channel Default Range: 0-3

RetValPointer I Index of B variable that is used to write result

Index PVar I Index of P variable which holds the parameters used for first line of record file

Return Values

Type Description Remarks

RetValPointer B B[RetValPointer] holds the return value 1: Success253: Error

4-26Moto.GSI.SDK/Manual

61 of 82

Page 62: Moto.GSI.SDK Manual...Moto.GSI.SDK/Manual Moto.GSI.SDK Description of the Operation Procedure Description of the Operation Procedure In the explanation of the operation proc edure,

177603-1CD

4 Function Reference4.24GSI_SETPOSOUTPUT

Moto.GSI.SDK

4.24 GSI_SETPOSOUTPUT(CHANNEL, RETVALPOINTER, IPADDRESS, PORT)

Periodically sends the TCP in cartesian coordinates to a UDP server located at the given address and port. This function cannot be used together with the GSI_STARTSPEEDOUTPUT function.

4.24.1 UDP Packet Output Format

Packet size: 32 Bytes

Parameters

Type Description Remarks

Channel B Moto.GSI/MotoPlus communication channel Default Range: 0-3

RetValPointer I Index of B variable that is used to write result

IPAddress S IP address of UDP Server e.g. “192.168.0.10”

Port S Port of the UDP Server 0 to 65535

Return Values

Type Description Remarks

RetValPointer B B[RetValPointer] holds the return value 1: Success254: Error

Type Description Remarks

Counter UCHAR Counter is incremented on each packet to detect lost packets on server side

0.255

IO UCHAR State of the selected IO 0: OFF1: ON

Config UCHAR Relative position informationOnly for RecMode=0

D00 -> 0:Front 1:BackD01 -> 0:Upper arm 1:Lower armD02 -> 0:Flip 1:No flipD03 -> 0:R<180 1:R>=180D04 -> 0:T<180 1:T>=180D05 -> 0:S<180 1:S>=180D06 -> 0:L<0 1: L>=0D07 - D15 reserved

Position LONG X-axis coordinate (unit: micron)

Position LONG Y-axis coordinate (unit: micron)

Position LONG Z-axis coordinate (unit: micron)

Position LONG Wrist angle Rx (unit: 0.0001 deg)

Position LONG Wrist angle Ry (unit: 0.0001 deg)

Position LONG Wrist angle Rz (unit: 0.0001 deg)

Position LONG Elbow angle E (unit: 0.0001 deg)

4-27Moto.GSI.SDK/Manual

62 of 82

Page 63: Moto.GSI.SDK Manual...Moto.GSI.SDK/Manual Moto.GSI.SDK Description of the Operation Procedure Description of the Operation Procedure In the explanation of the operation proc edure,

4 Function Reference4.25GSI_STOPUDPPOSOUTPUT

177603-1CD

Moto.GSI.SDK

4.25 GSI_STOPUDPPOSOUTPUT

(CHANNEL, RETVALPOINTER)

Stops the output of the robots TCP per UDP.

Parameters

Type Description Remarks

Channel B Moto.GSI/MotoPlus communication channel Default Range: 0-3

RetValPointer I Index of B variable that is used to write result

Return Values

Type Description Remarks

RetValPointer B B[RetValPointer] holds the return value 1: Success

4-28Moto.GSI.SDK/Manual

63 of 82

Page 64: Moto.GSI.SDK Manual...Moto.GSI.SDK/Manual Moto.GSI.SDK Description of the Operation Procedure Description of the Operation Procedure In the explanation of the operation proc edure,

177603-1CD

4 Function Reference4.26GSI_GETTIME

Moto.GSI.SDK

4.26 GSI_GETTIME

(CHANNEL, RETVALPOINTER, INDEX)

Gets the system time. Format hh:mm:ss:fff

Parameters

Type Description Remarks

Channel B Moto.GSI/MotoPlus communication channel Default Range: 0-3

RetValPointer I Index of B variable that is used to write result

Index I Index of S variable that is used to write the timestamp

Return Values

Type Description Remarks

RetValPointer B B[RetValPointer] holds the return value 1: Success254: Error

4-29Moto.GSI.SDK/Manual

64 of 82

Page 65: Moto.GSI.SDK Manual...Moto.GSI.SDK/Manual Moto.GSI.SDK Description of the Operation Procedure Description of the Operation Procedure In the explanation of the operation proc edure,

4 Function Reference4.27GSI_STARTSPEEDOUTPUT

177603-1CD

Moto.GSI.SDK

4.27 GSI_STARTSPEEDOUTPUT

(CHANNEL, RETVALPOINTER, CONTROL GROUP, REGISTER, CYCLE)

Writes the current speed of the control group in pulses per second into the selected registers. This function cannot be used together with the GSI_STARTPOSITIONOUTPUT function.

4.27.1 Output Register Layout

Since the return value for the speed function is a DWORD (4 Bytes) two registers are needed for each axis. One representing the lower WORD (2 Bytes) the other the higher WORD.

Reg[Start] = 1st axis (S) low word

Reg[Start+1] = 1st axis (S) high word

Reg[Start+2] = 2nd axis (L) low word

Reg[Start+3] = 2nd axis (L) high word

Reg[Start+4] = 3rd axis (U) low word

Reg[Start+5] = 3rd axis (U) high word

Reg[Start+6] = 4th axis (R) low word

Reg[Start+7] = 4th axis (R) high word

Reg[Start+8] = 5th axis (B) low word

Reg[Start+9] = 5th axis (B) high word

Reg[Start+10] = 6th axis (T) low word

Reg[Start+11] = 6th axis (T) high word

Reg[Start+12] = 7th axis (E) low word

Reg[Start+13] = 7th axis (E) high word

Reg[Start+14] = 8th axis low word

Reg[Start+15] = 8th axis high word

Parameters

Type Description Remarks

Channel B Moto.GSI/MotoPlus communication channel Default Range: 0-3

RetValPointer I Index of B variable that is used to write result

Control Group I Selected control group Robot:0-7 = R1 - R8Base:8-15 = B1 - B8Station:16-39 = S1 - S24

Register I Output start register to write the servo speed in pulses per second. The following 15 registers are also used

Register: 0-544Please see below“Output Register Layout”

Cycle I Write cycle of the registers based on the controllers clock (DX 4ms, FS 2ms)

1: each cycle2: every second cycle3,…

Return Values

Type Description Remarks

RetValPointer B B[RetValPointer] holds the return value 1: Success253: Parameter error254: Task error

4-30Moto.GSI.SDK/Manual

65 of 82

Page 66: Moto.GSI.SDK Manual...Moto.GSI.SDK/Manual Moto.GSI.SDK Description of the Operation Procedure Description of the Operation Procedure In the explanation of the operation proc edure,

177603-1CD

4 Function Reference4.28GSI_STOPSPEEDOUTPUT

Moto.GSI.SDK

4.28 GSI_STOPSPEEDOUTPUT

(CHANNEL, RETVALPOINTER)

Stops the output of the speed

Parameters

Type Description Remarks

Channel B Moto.GSI/MotoPlus communication channel Default Range: 0-3

RetValPointer I Index of B variable that is used to write result

Return Values

Type Description Remarks

RetValPointer B B[RetValPointer] holds the return value 1: Success

4-31Moto.GSI.SDK/Manual

66 of 82

Page 67: Moto.GSI.SDK Manual...Moto.GSI.SDK/Manual Moto.GSI.SDK Description of the Operation Procedure Description of the Operation Procedure In the explanation of the operation proc edure,

4 Function Reference4.29GSI_BYTETOFLOAT

177603-1CD

Moto.GSI.SDK

4.29 GSI_BYTETOFLOAT

(CHANNEL, RETVALPOINTER, INDEXRVAR, INDEXBSTART, REVERSEBYTES)

Converts a byte array to a float value according to IEEE 754

Parameters

Type Description Remarks

Channel B Moto.GSI/MotoPlus communication channel Default Range: 0-3

RetValPointer I Index of B variable that is used to write result

RVar I Index of RVar which holds the result

BVarStart I Start BVar array which is used for conversion (BVar, BVar+1, BVar+2, BVar+3)

Reverse I Reverses the byte order 0: Do not reverse1: Reverse

Return Values

Type Description Remarks

RetValPointer B B[RetValPointer] holds the return value 1: Success254: Error

4-32Moto.GSI.SDK/Manual

67 of 82

Page 68: Moto.GSI.SDK Manual...Moto.GSI.SDK/Manual Moto.GSI.SDK Description of the Operation Procedure Description of the Operation Procedure In the explanation of the operation proc edure,

177603-1CD

4 Function Reference4.30GSI_FLOATTOBYTE

Moto.GSI.SDK

4.30 GSI_FLOATTOBYTE

(CHANNEL, RETVALPOINTER, INDEXRVAR, INDEXBSTART, REVERSEBYTES)

Converts a float value to it’s byte representation according to IEEE 754

Parameters

Type Description Remarks

Channel B Moto.GSI/MotoPlus communication channel Default Range: 0-3

RetValPointer I Index of B variable that is used to write result

RVar I Index of RVar which is used for conversion

BVarStart I Conversion result in bytes (BVar, BVar+1, BVar+2, BVar+3)

Reverse I Reverses the byte order 0: Do not reverse1: Reverse

Return Values

Type Description Remarks

RetValPointer B B[RetValPointer] holds the return value 1: Success254: Error

4-33Moto.GSI.SDK/Manual

68 of 82

Page 69: Moto.GSI.SDK Manual...Moto.GSI.SDK/Manual Moto.GSI.SDK Description of the Operation Procedure Description of the Operation Procedure In the explanation of the operation proc edure,

4 Function Reference4.31GSI_GETPOSVARCOORD

177603-1CD

Moto.GSI.SDK

4.31 GSI_GETPOSVARCOORD

(CHANNEL, RETVALPOINTER, INDEXPVAR)

Returns the used coord system of the selected PVar

Parameters

Type Description Remarks

Channel B Moto.GSI/MotoPlus communication channel Default Range: 0-3

RetValPointer I Index of B variable that is used to write result

Index PVar I Index of P variable

Return Values

Type Description Remarks

RetValPointer B B[RetValPointer] holds the return value 1 = PULSE2 = BASE3 = ROBOT4 = TOOL5 = USER (In this case B[RetValPointer+1] holds the number of the used user frame)

4-34Moto.GSI.SDK/Manual

69 of 82

Page 70: Moto.GSI.SDK Manual...Moto.GSI.SDK/Manual Moto.GSI.SDK Description of the Operation Procedure Description of the Operation Procedure In the explanation of the operation proc edure,

177603-1CD

5 Examples5.1 TCP

Moto.GSI.SDK

5 Examples

5.1 TCP

5.1.1 Telnet connection to Cognex Insight camera

The following example shows how to control a Cognex Insight camera by native mode commands. Communication between robot and vision system is often necessary in pick and place applications where the vision system has to send position data of a detected part to the robot. Protocol is an ASCII protocol.

To show the communication flow first a telnet session is executed from pc side.

For the following test a Cognex Insight Explorer and a standard telnet client of Windows 7 operating system is used. Cognex Insight Explorer provides an emulation functionality so physical hardware is not required for testing. In this example we will access one cell of the Insight spreadsheet.

Fig. 5-1: Telnet Session Demonstrating Native Mode Control of Cognex Insight Cameras

The following steps are executed:

1. Establish a telnet connection

• telnet 192.168.255.100

• This is basically identical to opening a TCP socket to port 23

2. Login

• Username is admin

• Password is empty

3. Finally the native mode command get value is used to get the cell content of cell “h3”

• Command syntax: “gvh003” followed by a CRLF.

• The return value is a combination of the command result, 1 if successful, and the cell content.

5-1Moto.GSI.SDK/Manual

70 of 82

Page 71: Moto.GSI.SDK Manual...Moto.GSI.SDK/Manual Moto.GSI.SDK Description of the Operation Procedure Description of the Operation Procedure In the explanation of the operation proc edure,

5 Examples5.1 TCP

177603-1CD

Moto.GSI.SDK

Now the same communication session is implemented by Moto.GSI. The below listing includes comments so that additional explanations are not added to this example.

Fig. 5-2: Cognex Insight Native Mode Example

5.1.2 MetaSLS (Scout) Laser Sensor

This example shows a second example for the implementation of a simple protocol based on TCP. In this case a laser sensor is controlled to measure the position of a welding seam. Protocol is a binary protocol. The communication flow for one measuring cycle can be described as follows.

5.1.2.1 Communication flow

In general: The Scout system is slave and waiting on messages from the controller. The messages from the controller are then answered by the Scout. The seam tracking includes the following commands as a minimum of instructions to get data from the Scout system.

5-2Moto.GSI.SDK/Manual

71 of 82

Page 72: Moto.GSI.SDK Manual...Moto.GSI.SDK/Manual Moto.GSI.SDK Description of the Operation Procedure Description of the Operation Procedure In the explanation of the operation proc edure,

177603-1CD

5 Examples5.1 TCP

Moto.GSI.SDK

1. Selection of the number of the path file (e.g. path file number 1)

The transfer of the path definition file number does select the joint which is used for the actual joint but this command does not start the Scout system. At this point the desired unit can also be transferred to the Scout system.

Control:

MT Number of data Command Path file

Scout:

MT Status

2. Start of image processing

Control:

MT Number of data Command SCOUT on

Scout:

MT Status

3. Demand of coordinates (i.e. y and z) during seam tracking

The number of commands can vary but for all commands there must be a command number.

Control:

MT Number of data CommandNb1 CommandNb2

Scout:

MT Status deviation [mm] Height [mm]

4. Stop image processing

With stoping the image processing the communication between Scout and the control is terminated.

Control:

NT Number of data Command SCOUT off

Scout:

NT Status

Steps 1 and 2 must be done before data can be received from Scout. Step 3 is done as long as seam tracking is working and finally step 4 stops seam tracking.

2 0 1 0 16 0 7

82 0

2 0 1 0 6 0 1

82 0

1 0 2 0 9 0 10

81 0 HB LB HB LB

2 0 1 0 6 0 0

82 0

5-3Moto.GSI.SDK/Manual

72 of 82

Page 73: Moto.GSI.SDK Manual...Moto.GSI.SDK/Manual Moto.GSI.SDK Description of the Operation Procedure Description of the Operation Procedure In the explanation of the operation proc edure,

5 Examples5.1 TCP

177603-1CD

Moto.GSI.SDK

5.1.2.2 Implementation

To simplify the implementation, the command is implemented as a sub job. The main job communication is opened and closed. For command processing sub job “GSI_METASLS_COMMAND” is used.

• Line 012

– Open a TCP socket to 192.168.11.1:5020

• Line 015-021

– Prepare message for selecting path file

• Line 022-023

– Prepare pattern of answer

• Line 028-034

– Prepare message for starting image processing

• Line 035-036

– Prepare pattern of answer

• Line 042-048

– Prepare message for demanding coordinates (measurement results)

• Line 049-050

– Prepare pattern of answer

• Line 056-062

– Prepare message for stopping image processing

• Line 063-064

– Prepare pattern of answer

• Line 069

– Close communication

5-4Moto.GSI.SDK/Manual

73 of 82

Page 74: Moto.GSI.SDK Manual...Moto.GSI.SDK/Manual Moto.GSI.SDK Description of the Operation Procedure Description of the Operation Procedure In the explanation of the operation proc edure,

177603-1CD

5 Examples5.1 TCP

Moto.GSI.SDK

Fig. 5-3: MetaSLS communication flow, job “GSI_METASLS_TEST1”

Fig. 5-4: MetaSLS command implementation, job “GSI_METASLS_COMMAND”

5-5Moto.GSI.SDK/Manual

74 of 82

Page 75: Moto.GSI.SDK Manual...Moto.GSI.SDK/Manual Moto.GSI.SDK Description of the Operation Procedure Description of the Operation Procedure In the explanation of the operation proc edure,

5 Examples5.2 UDP Peer

177603-1CD

Moto.GSI.SDK

5.2 UDP Peer

UDP is a connectionless protocol. That means communication partners have to take care that packets are received completely and in the right order.

5.2.1 “Hello world”

The following example demonstrates a very simple communication application. Controller (192.168.11.230) sends a “HELLOWORLD” string to a pc (192.168.10.245) running a small UDP peer application. Whenever the string is received by this pc application it is displayed in a text box. To complete this communication cycle pc application has to send the string example “HELLODX100” back to the controller. This answer is stored in a global string variable.

Fig. 5-5: PC application representing UDP Peer

Before executing the corresponding job “GSI_UDP_TEST” on controller the pc application has to be started. IP address, remote port and local port have to be specified according to the settings in the job.

After executing “GSI_UDP_TEST” job it will stay in its receiving loop until the sending of string example “HELLODX100” is initiated by the user.

Fig. 5-6: Job listing „Hello world“ example

• Line 001

– Socket is initialized and bound to the local port 11000

– Remote IP =192.168.10.245 and Remote Port=15000 is stored

– Communication Handle is stored in B040

5-6Moto.GSI.SDK/Manual

75 of 82

Page 76: Moto.GSI.SDK Manual...Moto.GSI.SDK/Manual Moto.GSI.SDK Description of the Operation Procedure Description of the Operation Procedure In the explanation of the operation proc edure,

177603-1CD

5 Examples5.2 UDP Peer

Moto.GSI.SDK

• Line 003

– “HELLOWORLD” string is converted into a byte array starting from B040

– Length of string is stored in B041

• Line 004

– Byte array representing “HELLOWORLD” string is sent to pc application

• Line 005

– Receiving pattern is defined by example “*DX100” as we expect an answer like “HELLODX100”.Of course it would be possible to specify “HELLODX100” as a pattern but sometimes the exact answer is not known. So this is good practice for later.

– Pattern is converted into a byte array starting at B090 and with a length given by B043

• Line 009

– Input buffer is checked for an instance of the specified pattern. This is done in a loop (*LCONN1). Length of instance is disregarded (ELEMENTLENGTH=0).

– If pattern was found whole string should be returned (ELEMENTNO=0). Re-ceived data is stored as a byte array starting at B090 with length B044

– Input Buffer is automatically cleared (CLEARQ=1) afterwards.Here that is not required because this is the last communication step and handle is closed shortly after this operation anyway.

• Line 012

– Byte array is converted to a string stored in S010

• Line 013

– Communication is closed, resources are released.

5-7Moto.GSI.SDK/Manual

76 of 82

Page 77: Moto.GSI.SDK Manual...Moto.GSI.SDK/Manual Moto.GSI.SDK Description of the Operation Procedure Description of the Operation Procedure In the explanation of the operation proc edure,

5 Examples5.3 RS232/COM

177603-1CD

Moto.GSI.SDK

5.3 RS232/COM

5.3.1 Simple “Hello World”

A simple example demonstrating the usage of RS232 communication

Fig. 5-7: Sample RS232 communication

5-8Moto.GSI.SDK/Manual

77 of 82

Page 78: Moto.GSI.SDK Manual...Moto.GSI.SDK/Manual Moto.GSI.SDK Description of the Operation Procedure Description of the Operation Procedure In the explanation of the operation proc edure,

177603-1CD

5 Examples5.4 SMTP – Sending E-Mails

Moto.GSI.SDK

5.4 SMTP – Sending E-Mails

The following sample code sends an E-Mail using the GSI_SMTPSEND job. Currently no encrypted connections are supported thus the SMTP server must provide an unencrypted login.

The SMTP parameters must be ordered as follows:

Username’\r’Password’\r’SenderAddress‘\r’ReceiverAddress’\r’Message.

The code sample uses “user01” as Username, “12345678” as Password,“[email protected]” as sender address, “[email protected]” as receiver address and “Hello World” as Message. Running this code sends an E-Mail from [email protected] to [email protected] with “Hello World” as message. The subject of the E-Mail is automatically set to “Moto GSI mail”

Fig. 5-8: Send E-Mail sample

5-9Moto.GSI.SDK/Manual

78 of 82

Page 79: Moto.GSI.SDK Manual...Moto.GSI.SDK/Manual Moto.GSI.SDK Description of the Operation Procedure Description of the Operation Procedure In the explanation of the operation proc edure,

5 Examples5.5 FTP – Transfer jobs

177603-1CD

Moto.GSI.SDK

5.5 FTP – Transfer jobs

With the FTP function it’s possible to move job files (.JBI) from the controller to an arbitrary ftp server and backwards. The login parameters must be ordered as follows:

Username’\r’Password. In the code sample above “test” is used as both Username and Password to login to the FTP server.

After the connection is established the job “EEDR.JBI” is transferred from the controller to the selected FTP server by calling GSI_FTPPUTJOB.

Fig. 5-9: Transfer job to ftp server

5.6 Output of the TCP data per UDP

Fig. 5-10: Starting and stopping of the TCP output per UDP

5-10Moto.GSI.SDK/Manual

79 of 82

Page 80: Moto.GSI.SDK Manual...Moto.GSI.SDK/Manual Moto.GSI.SDK Description of the Operation Procedure Description of the Operation Procedure In the explanation of the operation proc edure,

A-1

177603-1CD

Moto.GSI.SDK/Manual

Appendix AA.1 ASCII Table

Moto.GSI.SDK

Appendix A

A.1 ASCII Table

80 of 82

Page 81: Moto.GSI.SDK Manual...Moto.GSI.SDK/Manual Moto.GSI.SDK Description of the Operation Procedure Description of the Operation Procedure In the explanation of the operation proc edure,

Appendix BB.1 FAQ

B-1

177603-1CD

Moto.GSI.SDK/Manual

Moto.GSI.SDK

Appendix B

B.1 FAQ

Is there any App Gallery/Store for downloading ready- to-use Moto.GSI.AppsCurrently there is no such library.

Is there a TCP Server functionality included in Moto.GSITCP server functionality will be supported

81 of 82

Page 82: Moto.GSI.SDK Manual...Moto.GSI.SDK/Manual Moto.GSI.SDK Description of the Operation Procedure Description of the Operation Procedure In the explanation of the operation proc edure,

Moto.GSI.SDKManual

HEAD OFFICE2-1 Kurosakishiroishi, Yahatanishi-ku, Kitakyushu 806-0004, JapanPhone +81-93-645-7703 Fax +81-93-645-7802

100 Automation Way, Miamisburg, OH 45342, U.S.A. Phone +1-937-847-6200 Fax +1-937-847-6277

YASKAWA America Inc. (Motoman Robotics Division)

Yaskawastrasse 1, 85391 Allershausen, GermanyPhone +49-8166-90-100 Fax +49-8166-90-103

YASKAWA Europe GmbH Robotics Divsion )

Phone +82-2-784-7844 Fax +82-2-784-8495

151 Lorong Chuan, #04-02A, New Tech Park, Singapore 556741Phone +65-6282-3003 Fax +65-6289-3003

YASKAWA Electric (Singapore) PTE Ltd.

No7 Yongchang North Road, Beijing E&T Development Area China 100176Phone +86-10-6788-2858 Fax +86-10-6788-2878

YASKAWA SHOUGANG ROBOT Co. Ltd.

#426, Udyog Vihar, Phase- IV, Gurgaon, Haryana, IndiaFax +91-124-475-8542Phone +91-124-475-8500

YASKAWA India Private Ltd. (Robotics Division)

YASKAWA Electric (China) Co., Ltd.22F, One Corporate Avenue, No.222, Hubin Road, Huangpu District, Shanghai 200021, ChinaPhone +86-21-5385-2200 Fax 86-21-5385-3299

YASKAWA Electric (Thailand) Co., Ltd.59,1st-5th Floor, Flourish Building, Soi Ratchadapisek 18,Ratchadapisek Road, Huaykwang, Bangkok 10310, THAILANDPhone +66-2-017-0099 Fax +66-2-017-0199

12F, No.207, Sec. 3, Beishin Rd., Shindian District, New Taipei City 23143, TaiwanFax +886-2-8913-1513Phone +886-2-8913-1333

YASKAWA Electric Taiwan Corporation

Secure Building-Gedung B Lantai Dasar & Lantai 1 JI. Raya Protokol Halim Perdanakusuma, Jakarta 13610, Indonesia

Fax +62-21-2982-6741Phone +62-21-2982-6470

PT. YASKAWA Electric Indonesia

Phone +46-480-417-800 Fax +46-486-414-10

YASKAWA Nordic ABVerkstadsgatan 2, Box 504 ,SE-385 25 Torsas, Sweden

35F, Three IFC, 10 Gukjegeumyung-ro, Yeongdeungpo-gu, Seoul, Korea 07326YASKAWA Electric Korea Corporation

Specifications are subject to change without noticefor ongoing product modifications and improvements.

MANUAL NO.

Moto.GSI.SDK/Manual 1.2982 of 82