Download as pdf or txt
Download as pdf or txt
You are on page 1of 82

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.

Part Number: 177603-1CD


Revision: 0

MANUAL NO.
Moto.GSI.SDK/Manual 1.29
1 of 82
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 Division
100 Automation Way
Miamisburg, OH 45342
Phone: 937-847-6200

www.motoman.com

Moto.GSI.SDK/Manual
ii 2 of 82
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.

Moto.GSI.SDK/Manual
iii 3 of 82
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 Association
900 Victors Way
P.O. Box 3724
Ann Arbor, Michigan 48106
TEL: (734) 994-6088
FAX: (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.

Moto.GSI.SDK/Manual
iv 4 of 82
177603-1CD
Moto.GSI.SDK Notes for Safe Operation

Notes for Safe Operation


Read 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”.

Indicates an imminent hazardous


DANGER situation which, if not avoided, could
result in death or serious injury to
personnel.

Indicates a potentially hazardous


WARNING situation which, if not avoided, could
result in death or serious injury to
personnel.

Indicates a potentially hazardous


CAUTION 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.

Always be sure to follow explicitly


MANDATORY the items listed under this heading.

PROHIBITED Must never be performed.

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


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

To ensure safe and efficient operation at all times, be sure


NOTE 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.

Moto.GSI.SDK/Manual
v 5 of 82
177603-1CD

Moto.GSI.SDK Notes for Safe Operation

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.

Moto.GSI.SDK/Manual
vi 6 of 82
177603-1CD
Moto.GSI.SDK Notes for Safe Operation

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.

Moto.GSI.SDK/Manual
vii 7 of 82
177603-1CD

Moto.GSI.SDK Definition of Terms Used Often in This Manual

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.

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:
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 Manipulator cable
controller
FS100 programming pendant Programming pendant
dummy connector dummy connector

Moto.GSI.SDK/Manual
viii 8 of 82
177603-1CD
Moto.GSI.SDK Description of the Operation Procedure

Description of the Operation Procedure


In 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 Trademark
In 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 Tips
All 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 Devices


The 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.

Moto.GSI.SDK/Manual
ix 9 of 82
177603-1CD

Moto.GSI.SDK Programming, Operation, and Maintenance Safety

Programming, Operation, and Maintenance Safety


All 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.

Moto.GSI.SDK/Manual
x 10 of 82
177603-1CD
Moto.GSI.SDK Maintenance Safety

Maintenance Safety
Turn 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 Information


This 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.

Moto.GSI.SDK/Manual
xi 11 of 82
177603-1CD

Moto.GSI.SDK Customer Support Information

Customer Support Information


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

(937) 847-3200

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

techsupport@motoman.com

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 use e-mail for routine inquiries only. If you have an


NOTE urgent or emergency need for service, replacement parts,
or information, you must contact YASKAWA Customer
Support at the telephone number shown above.

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

• 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

Moto.GSI.SDK/Manual
xii 12 of 82
177603-1CD
Moto.GSI.SDK Table of Contents

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

Moto.GSI.SDK/Manual
xiii 13 of 82
177603-1CD

Moto.GSI.SDK Table of Contents

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

Moto.GSI.SDK/Manual
xiv 14 of 82
177603-1CD
Moto.GSI.SDK Table of Contents

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

Moto.GSI.SDK/Manual
xv 15 of 82
177603-1CD
Moto.GSI.SDK 1 Introduction

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 II
MotoPlus Moto.GSI
Where is the protocol On a PC using MotoPlusSDK Programming pendant.
implementation done? Job engine (Inform language).
Which tools do I need? MotoPlusSDK Moto.GSI.SDK
Who will do the protocol Developer familiar with C or C++ & MotoPlus Every robot programmer: Service
implementation? development technicians, customer etc.
(VXWorks platform):
=> Development section of Motoman
subsidiary or high level System Integrators.
When to select this solution? Complex or time critical communication Simple protocols
tasks/protocols.
Standard protocols.

Moto.GSI.SDK/Manual
1-1 16 of 82
177603-1CD

Moto.GSI.SDK 1 Introduction

Moto.GSI.SDK/Manual
1-2 17 of 82
177603-1CD
Moto.GSI.SDK 2 Quickstart Guide
2.1 Scope of Delivery

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.

Moto.GSI.SDK/Manual
2-3 18 of 82
177603-1CD

Moto.GSI.SDK 2 Quickstart Guide


2.2 Installation of Moto.GSI.SDK

2.2.2.1 Variable Limits

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.

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.

Moto.GSI.SDK/Manual
2-4 19 of 82
177603-1CD
Moto.GSI.SDK 2 Quickstart Guide
2.2 Installation of 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)}.

Moto.GSI.SDK/Manual
2-5 20 of 82
177603-1CD

Moto.GSI.SDK 2 Quickstart Guide


2.2 Installation of 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.

Moto.GSI.SDK/Manual
2-6 21 of 82
177603-1CD
Moto.GSI.SDK 2 Quickstart Guide
2.2 Installation of 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.

Moto.GSI.SDK/Manual
2-7 22 of 82
177603-1CD

Moto.GSI.SDK 2 Quickstart Guide


2.3 Testing the Installation

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 !”

Moto.GSI.SDK/Manual
2-8 23 of 82
177603-1CD
Moto.GSI.SDK 3 System Overview
3.1 Components

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.

Moto.GSI.SDK/Manual
3-1 24 of 82
177603-1CD

Moto.GSI.SDK 3 System Overview


3.2 System Architecture

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

Moto.GSI.SDK/Manual
3-2 25 of 82
177603-1CD
Moto.GSI.SDK 3 System Overview
3.3 Return Values & Parameters

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.

Moto.GSI.SDK/Manual
3-3 26 of 82
177603-1CD

Moto.GSI.SDK 3 System Overview


3.6 Global Variables

3.6 Global Variables

WARNING
By 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.

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.

Moto.GSI.SDK/Manual
3-4 27 of 82
177603-1CD
Moto.GSI.SDK 3 System Overview
3.7 User Data

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.

NOTE The backslash is not displayed correctly on the screen. To


enter a carriage return use ‘\r’. For a line feed enter ‘\n’.

Fig. 3-2: Moto GSI Admin UI

Moto.GSI.SDK/Manual
3-5 28 of 82
177603-1CD

Moto.GSI.SDK 3 System Overview


3.8 Moto GSI Admin UI

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

Moto.GSI.SDK/Manual
3-6 29 of 82
177603-1CD
Moto.GSI.SDK 3 System Overview
3.9 Inform String Functions

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] Gets ASCII code of the first string character
• [Code]
Example: – ASCII Code
SET S000 “A” – B
ASC B000 S000 • [String]
– Source string
B000 contains 65. – S, const.
CHR$ [String] [Code] Gets the character belonging to the specified ASCII
code
Example: • [String]
SET B000 65 – ASCII character
CHR$ S000 B000 – S
• [Code]
S000 contains “A”. – ASCII code
– B, const.
LEN [Length][String] Returns the length of a string
• [Length]
Example: – Length of a string
SET S000 “Ben has 2 dogs” – B, I, D
LEN B000 S000 • [String]
– Source string
B000 contains 14. – S
CAT$ [String1][String2][String3] Concatenates 2 strings resulting in a new string
• [String1]
Example: – Resulting string
SET S001 “Ben has 2” – S
SET S002 “ dogs” • [String2]
CAT$ S000 S001 S002 – Source string1
– S, const.
S000 contains “Ben has 2 dogs”. • [String3]
– Source string2
– S, const.
MID$[String1][String2][Pointer][Length] Copies a part of a given string
• [String1]
Example: – Resulting string
SET S001 “Ben has 2 dogs” – S
MID$ S000 S001 5 3 • [String2]
– Source string
S000 contains “has”. – 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

Moto.GSI.SDK/Manual
3-7 30 of 82
177603-1CD

Moto.GSI.SDK 3 System Overview


3.9 Inform String Functions

Instruction Description
STRSTR [Pointer] [String1][String2] [StartPos] Searches a substring in a string
• [Pointer]
Example: – Position, 0 if the substring is not found
SET S000 “Ben has 2 dogs” – B
STRSTR B000 S000 “hat” • [String1]
– Source string
B000 contains 5. – S
• [String2]
– Search string
– S, const.
• [StartPos]
– Index where to start searching (1 based)
– B, Omit
VAL2STR [String] [Value] Converts numerical value into a string.
• [String]
Example: – String representation
SET R000 14.2 – S
VAL2STR S000 R000 • [Value]
– Numerical value
S000 contains “14.2”. – B, I, D, R
VAL [Value] [String] Radix=[Base] Converts a string into a numerical value.
• [Value]
Example 1: – Numerical value
SET S000 “11” – B, I, D, R
VAL B000 S000 • [String]
– String to convert
R000 contains 11. – S
• [Base]
Example 2: – Number system, e.g. 2 for binary, 10 for decimal
SET S000 “11” or 16 for hexadecimal
VAL B000 S000 Radix=2 – const., Omit

B000 contains 3.

Moto.GSI.SDK/Manual
3-8 31 of 82
177603-1CD
Moto.GSI.SDK 3 System Overview
3.10 Function Overview

3.10 Function Overview

Function Name Description Input Output Supported in Version

Moto.GSI.JobAPI.Socket

CloseAllHandle Closes all open Channel(B) 1.24


handles Retvalpointer(I)
CloseHandle Closes a handle by Channel(B) 1.0
closing socket and Retvalpointer(I)
deleting input buffer Handle(B)

SendData Sends data to the Channel(B) 1.0


communication socket Retvalpointer(I)
Handle(B)
Datapointer(I)
Datalength(I)
ReadData Reads data from the Channel(B) Read data is written 1.0
input buffer Retvalpointer(I) to Datapointer
Handle(B)
Datapointer(I)
Datalength(I)
CheckPatternBin2 Checks if input buffer Channel(B) Selected pattern 1.0 (1.1)
CheckPatternBin contains data Retvalpointer(I) element 1.24
CheckPattern according to the Handle(B)
CheckPatternBin2 specified pattern and Patternpointer(I)
Blocking length Patternlength(I)
Elementno(B)
Elementlength(B)
ClearQ(B)
ClearQ/Timout(I)

ClearData Clears the input buffer Channel(B)


Retvalpointer(I)
Handle(B)

Moto.GSI.JobAPI.Helpers

GSI_MakeBArray Converts a string into Retvalpointer(I) Byte representation


a byte array Datapointer(I) of string at
Datalength(I) Datapointer
String(S)
GSI_MakeString Converts a byte array Retvalpointer(I) String written to SVar at position Retvalpointer
into a string Datapointer(I)
Datalength(I)
GSI_GetTime Returns the system Channel(B) System time written 1.22
time Retvalpointer(I) to SVar at position
Index(I) Index
GSI_ByteToFloat Converts a byte array Channel(B) Float value at 1.24
to a float value Retvalpointer(I) IndexRVar
according to IEEE 754 IndexRVar(I)
IndexBstart(I)
Reversebytes(I)
GSI_FloatToByte Converts a float value Channel(B) Byte representation 1.24
to it’s byte Retvalpointer(I) at IndexBstart
representation IndexRvar(I)
according to IEEE 754 IndexBstart(I)
Reversebytes(I)

Moto.GSI.SDK/Manual
3-9 32 of 82
177603-1CD

Moto.GSI.SDK 3 System Overview


3.10 Function Overview

Function Name Description Input Output Supported in Version

GSI_GetPosVarCoord Reads out the used Channel(B) 1.26


coord system of a Retvalpointer(I)
PVar IndexPVar(I)

Moto.GSI.JobAPI.TCPClient

TCPConnect Establishes a TCP Channel(B) Valid handle 1.0


connection and Retvalpointer(I)
initializes an input IPaddress(S)
buffer Port(S)
TelnetConnect Helper function to Channel(B) Valid handle 1.1
login onto a telnet Retvalpointer(I)
server IPaddress(S)
Port(S)
Datapointer(I)
Datalength(I)

Moto.GSI.JobAPI.ModBus

ModBus_Read Reads data from Channel(B) Valid handle 1.28


ModBus server Retvalpointer(I)
Function(I)
ModBusAddress(I)
Count(I)
RobotAddress(I)
Type(I)
ModBus_Write Writes data to Channel(B) Valid handle 1.28
ModBus server Retvalpointer(I)
Function (I)
ModBusAddress (I)
RobotAddress (I)
Count (I)
Swap(I)

Moto.GSI.JobAPI.UDPPeer

UDPBind Opens a UDP socket Channel(B) Valid Handle 1.0


and binds to the Retvalpointer(I)
specified port IPaddress(S)
RemotePort(S)
LocalPort(S)

Moto.GSI.JobAPI.RS232

GSI_RS232OPEN Opens a serial RS232 Channel(B) Valid Handle 1.0


socket with specified Retvalpointer(I)
parameters ComPort(B)
Baudrate(B)
DataBits(B)
StopBits(B)
Parity(B)
GSI_FloatToByte Converts a float value Channel(B) Byte representation 1.24
to it’s byte Retvalpointer(I) at IndexBstart
representation IndexRvar(I)
according to IEEE 754 IndexBstart(I)
Reversebytes(I)
GSI_GetPosVarCoord Reads out the used Channel(B) 1.26
coord system of a Retvalpointer(I)
PVar IndexPVar(I)

Moto.GSI.SDK/Manual
3-10 33 of 82
177603-1CD
Moto.GSI.SDK 3 System Overview
3.10 Function Overview

Function Name Description Input Output Supported in Version

Moto.GSI.JobAPI.TCPClient

TCPConnect Establishes a TCP Channel(B) Valid handle 1.0


connection and Retvalpointer(I)
initializes an input IPaddress(S)
buffer Port(S)
TelnetConnect Helper function to Channel(B) Valid handle 1.1
login onto a telnet Retvalpointer(I)
server IPaddress(S)
Port(S)
Datapointer(I)
Datalength(I)

Moto.GSI.JobAPI.ModBus

ModBus_Read Reads data from Channel(B) Valid handle 1.28


ModBus server Retvalpointer(I)
Function(I)
ModBusAddress(I)
Count(I)
RobotAddress(I)
Type(I)
ModBus_Write Writes data to Channel(B) Valid handle 1.28
ModBus server Retvalpointer(I)
Function (I)
ModBusAddress (I)
RobotAddress (I)
Count (I)
Swap(I)

Moto.GSI.JobAPI.UDPPeer

UDPBind Opens a UDP socket Channel(B) Valid Handle 1.0


and binds to the Retvalpointer(I)
specified port IPaddress(S)
RemotePort(S)
LocalPort(S)

Moto.GSI.JobAPI.RS232

GSI_RS232OPEN Opens a serial RS232 Channel(B) Valid Handle 1.0


socket with specified Retvalpointer(I)
parameters ComPort(B)
Baudrate(B)
DataBits(B)
StopBits(B)
Parity(B)

Moto.GSI.JobAPI.FTP

FTPConnect Opens a connection Channel(B) 1.1


to a ftp server Retvalpointer(I)
IPaddress(S)
Port(S)
Datapointer(I)
Datalength(I)
FTPDisconnect Closes the connection Channel(B) 1.1
to a ftp server Retvalpointer(I)

Moto.GSI.SDK/Manual
3-11 34 of 82
177603-1CD

Moto.GSI.SDK 3 System Overview


3.10 Function Overview

Function Name Description Input Output Supported in Version

FTPPutJob Transfer a job file Channel(B) 1.1


(Controller to FTP Retvalpointer(I)
server) Datapointer(I)
Datalength(I)
FTPGetJob Transfer a job file Channel(B) 1.1
(FTP server to Retvalpointer(I)
controller) Datapointer(I)
Datalength(I)

Moto.GSI.JobAPI.SMTP

SMTPSend Send a mail Channel(B)


Retvalpointer(I)
IPaddress(S)
Port(S) 1.1
Datapointer(I)
Datalength(I)

Moto.GSI.JobAPI.PositionOutput

InitUDPPosOutput Initialize output of the Channel(B)


current position per Retvalpointer(I)
UDP Robot(I) Frame(I)
Tool(I) 1.22
IO(I)
Delay(I) RecMode(I)
StartUDPPosOutput Channel(B) 1.22
Retvalpointer(I)
IPaddress(S)
Port(S)
StopUDPPosOutput Channel(B) 1.22
Retvalpointer(I)
SetPosOutputHeader Adds an additional Channel(B)
header line to the Retvalpointer(I)
record file which can PVarIndex(I) 1.26
be customized by
user

Moto.GSI.JobAPI.SpeedOutput

StartSpeedOutput Channel(B) 1.23


Retvalpointer(I)

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

StopSpeedOutput Channel(B) 1.23


Retvalpointer(I)

Moto.GSI.SDK/Manual
3-12 35 of 82
177603-1CD
Moto.GSI.SDK 4 Function Reference
4.1 GSI_TCPCONNECT

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 e.g. “192.168.0.10”
TCP Server
Port S Port of external device which acts as TCP 0 to 65535. Port Number must be
Server entered as string
e.g. “502”
Return Values
Type Description Remarks
RetValPointer B B[RetValPointer] holds a valid communication 1-19: Success, valid handle
handle or Error number if socket could not be 254: Error
established 251: Error, no free handle available

Moto.GSI.SDK/Manual
4-1 36 of 82
177603-1CD

Moto.GSI.SDK 4 Function Reference


4.2 GSI_TELNETCONNECT

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 0 to 65535
Server
DataPtr I Index of the first data byte of the telnet login Data must be separated by
data. The parameters must be ordered as \r (hex: 0D)
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
DataLen I Length of the login data
Return Values
Type Description Remarks
RetValPointer B B[RetValPointer] holds a valid communication 1-19: Success, valid handle
handle or Error number if socket could not be 254: Error
established 251: Error, no free handle available

Moto.GSI.SDK/Manual
4-2 37 of 82
177603-1CD
Moto.GSI.SDK 4 Function Reference
4.3 GSI_UDPBIND

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 0 to 65535
data from external device arrives. If 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 1-19: Success, valid handle
handle or Error number if socket could not be 254: Error
established 251: Error, no free handle available

Moto.GSI.SDK/Manual
4-3 38 of 82
177603-1CD

Moto.GSI.SDK 4 Function Reference


4.4 GSI_RS232OPEN

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 baud
2:300 baud
3:600 baud
4:1200 baud
5:2400 baud
6:4800 baud
7:9600 baud
8:19200 baud
DataBits B Number of Data Bits 7: 7 data bits
8: 8 data bits
StopBits B Number of Stop Bits 0: 1 stop bit
1: 1.5 stop bits
2: 2 stop bits
Parity B Parity Bits 0: no parity
1: odd
2: even
Return Values
Type Description Remarks
RetValPointer B B[RetValPointer] holds a valid communication 1-19: Success, valid handle
handle or Error number if socket could not be 254: Error
established 251: Error, no free handle available

Moto.GSI.SDK/Manual
4-4 39 of 82
177603-1CD
Moto.GSI.SDK 4 Function Reference
4.5 GSI_SENDDATA

4.5 GSI_SENDDATA
(CHANNEL, RETVALPOINTER, HANDLE, DATAPOINTER,
DATALENGTH)
Sends specified data to the socket given by a valid communication
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
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 1-19: Success, valid handle
handle or Error-number if socket could not be 254: Error
established 251: Error, no free handle available

Example 1
…..

Moto.GSI.SDK/Manual
4-5 40 of 82
177603-1CD

Moto.GSI.SDK 4 Function Reference


4.6 GSI_CHECKPATTERNBIN2

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

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 0:length is disregarded
pattern element (specified by element number) >0:pattern element must have
specified length
ClearQ B Clears communication receiving queue 0:do not clear queue
1:clear queue
Return Values
Type Description Remarks
RetValPointer B If pattern was found the number of bytes of the 1-128: Success, no of read
corresponding pattern element instance is characters
stored in B[RetValPointer] otherwise error 254: Error
code. 253: Pattern not found
252: 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]

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


found

Moto.GSI.SDK/Manual
4-6 41 of 82
177603-1CD
Moto.GSI.SDK 4 Function Reference
4.6 GSI_CHECKPATTERNBIN2

Example 1 (Returns Pattern Element 1):


B300 B301 B302 B303 B304 B305 B306 B307 B308
Pattern o k : * , * !
Queue o k : 2 3 , 4 5 !

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


Length 1 2
Var B200 B201 B202
Val 2 50 51
Char 2 3

Example 2 (Returns Pattern Element 2):


B300 B301 B302 B303 B304 B305 B306 B307 B308
Pattern o k : * , * !
Queue o k : 2 3 , 4 5 !

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


Length 1 2
Var B200 B201 B202
Val 2 52 53
Char 4 5

Example 3 (Returns whole pattern):


Length B300 B301 B302 B303 B304 B305 B306 B307 B308
Pattern o k : * , * !
Queue o k : 2 3 , 4 5 !

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


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 !

Moto.GSI.SDK/Manual
4-7 42 of 82
177603-1CD

Moto.GSI.SDK 4 Function Reference


4.6 GSI_CHECKPATTERNBIN2

Example 4:
Length B300 B301 B302 B303 B304 B305 B306 B307 B308
Pattern o k : * , * !
Queue o k : 2 3 , 4 5 !

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


Length 1 2 3 4 5 6 7 8 9
Var B200
Val 253
Char

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

Moto.GSI.SDK/Manual
4-8 43 of 82
177603-1CD
Moto.GSI.SDK 4 Function Reference
4.7 GSI_CHECKPATTERNBIN2BLOCKING

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.

The functionality is the same as for


NOTE 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 0:length is disregarded
pattern element (specified by element number) >0:pattern element must have
specified length
ClearQ/Timeout I Clears communication receiving queue and 0:Wait forever, don’t clear queue
timeout. E.g. a value of -10 indicates a timeout >=1 Time to wait in seconds and
of 10 seconds and that the input queue is not clear queue
deleted after the pattern is found <=-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 1-128: Success, no of read
corresponding pattern element instance is characters
stored in B[RetValPointer] otherwise error 254: Error
code. 253: Pattern not found
252: 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]

Moto.GSI.SDK/Manual
4-9 44 of 82
177603-1CD

Moto.GSI.SDK 4 Function Reference


4.7 GSI_CHECKPATTERNBIN2BLOCKING

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.

Moto.GSI.SDK/Manual
4-10 45 of 82
177603-1CD
Moto.GSI.SDK 4 Function Reference
4.8 GSI_CHECKPATTERNBIN/GSI_CHECKPATTERN

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

NOTE In new projects use


GSI_CHECKPATTERBIN2BLOCKING() instead!

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.

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 0:length is disregarded
pattern element (specified by element number) >0:pattern element must have
specified length
ClearQ B Clears communication receiving queue 0:do not clear queue
1:clear queue
Return Values
Type Description Remarks
RetValPointer B Result is stored in B[RetValPointer] 1-128: Success, no of read
characters
254: Error
253: Pattern not found/Timeout
252: 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.

Moto.GSI.SDK/Manual
4-11 46 of 82
177603-1CD

Moto.GSI.SDK 4 Function Reference


4.9 GSI_CLOSEHANDLE

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: Success
252: Error, invalid handle

Moto.GSI.SDK/Manual
4-12 47 of 82
177603-1CD
Moto.GSI.SDK 4 Function Reference
4.10 GSI_CLOSEHANDLE

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: Success
252: Error

Moto.GSI.SDK/Manual
4-13 48 of 82
177603-1CD

Moto.GSI.SDK 4 Function Reference


4.11 GSI_READDATA

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
characters
253: No characters in queue
254: Error
252: Error, invalid handle
DataPointer B B[DataPointer] holds first byte of read data.

Moto.GSI.SDK/Manual
4-14 49 of 82
177603-1CD
Moto.GSI.SDK 4 Function Reference
4.12 GSI_CLEARDATA

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: Success
254: Error, invalid handle
252: Error, invalid handle

Moto.GSI.SDK/Manual
4-15 50 of 82
177603-1CD

Moto.GSI.SDK 4 Function Reference


4.13 GSI_MODBUS_READ

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 1
READDISCRETEINPUTS 2
READHOLDINGREG 3
READINPUTREG 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 to
RVariables[RobotAddr],…
Type I Convert readout data to type 0=BYTE
1=SBYTE
2=USHORT
3=SHORT
4=INT
5=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

Moto.GSI.SDK/Manual
4-16 51 of 82
177603-1CD
Moto.GSI.SDK 4 Function Reference
4.14 GSI_MODBUS_WRITE

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 5
WRITESINGLEREGISTER 6
WRITEMULTIPLECOILS15
WRITEMULTIPLEREGISTER 16
ModBusAddr I Server side start address to be read
RobotAddr I Controller side start address to read data WRITESINGLECOIL
WRITEMULTIPLECOILS:
Data is read directly from IO’s
Use a valid IO address e.g.
For universal output 1 enter 10010

WRITESINGLEREGISTER
WRITEMULTIPLEREGISTER:
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
WRITESINGLEREGISTER
WRITEMULTIPLEREGISTER
0=Don’t swap
1=Swap
Return Values
Type Description Remarks
RetValPointer B Result is stored in B[RetValPointer] 255: Success
< 255: Error

Moto.GSI.SDK/Manual
4-17 52 of 82
177603-1CD

Moto.GSI.SDK 4 Function Reference


4.15 GSI_MAKEBARRAY

4.15 GSI_MAKEBARRAY
(RETVALPOINTER, DATAPOINTER, DATALENGTH, STRING)
String to byte array conversion. ASCII value is used for coding.

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.

Example
…..

Moto.GSI.SDK/Manual
4-18 53 of 82
177603-1CD
Moto.GSI.SDK 4 Function Reference
4.16 GSI_MAKESTRING

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.

Moto.GSI.SDK/Manual
4-19 54 of 82
177603-1CD

Moto.GSI.SDK 4 Function Reference


4.17 GSI_FTPCONNECT

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 must be separated by
parameters. The parameters must be ordered ‘\r' (hex: 0D)
as follows: Username’\r’Password
DataLen I Length of the login data
Return Values
Type Description Remarks
RetValPointer B B[RetValPointer] holds the return value 1: Success
1: Already connected
254: Error

Moto.GSI.SDK/Manual
4-20 55 of 82
177603-1CD
Moto.GSI.SDK 4 Function Reference
4.18 GSI_FTPDISCONNECT

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

Moto.GSI.SDK/Manual
4-21 56 of 82
177603-1CD

Moto.GSI.SDK 4 Function Reference


4.19 GSI_FTPPUTJOB

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: Success
1: Already connected
254: Error

Moto.GSI.SDK/Manual
4-22 57 of 82
177603-1CD
Moto.GSI.SDK 4 Function Reference
4.20 GSI_FTPGETJOB

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: Success
253: Not connected
254: Error

Moto.GSI.SDK/Manual
4-23 58 of 82
177603-1CD

Moto.GSI.SDK 4 Function Reference


4.21 GSI_SMTPSEND

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 must be separated by
parameters. The parameters must be ordered ‘\r’ (hex: 0D)
as follows: Username’\r’Password’\r’
SenderAddress‘\r’ReceiverAddress
’\r’Message
DataLen I Length of the SMTP data
Return Values
Type Description Remarks
RetValPointer B B[RetValPointer] holds the return value 1: Success
253: Send Error
254: Connection Error

Moto.GSI.SDK/Manual
4-24 59 of 82
177603-1CD
Moto.GSI.SDK 4 Function Reference
4.22 GSI_INITUDPPOSOUTPUT

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++.

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
NOTE
• 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 0: Base coordinate
(Only if ). If RecMode=1 base coordinate is 1: Robot coordinate
used 2, 3, …:User coordinate number
Only for RecMode=0
Tool I Tool number 0-23
Only for RecMode=0
IO I IO that will be logged together with the position 0: OFF else ON
e.g. 10010
Delay I Delay of the IO in cycles to position data Only for RecMode=1
RecMode I Position Record Mode 0=Command Position
1=Feedback Position
(Only DX100/DX200)
Return Values
Type Description Remarks
RetValPointer B B[RetValPointer] holds the return value 1: Success
254: Connection Error

Moto.GSI.SDK/Manual
4-25 60 of 82
177603-1CD

Moto.GSI.SDK 4 Function Reference


4.23 GSI_SETPOSOUTPUTHEADER

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: Success
253: Error

Moto.GSI.SDK/Manual
4-26 61 of 82
177603-1CD
Moto.GSI.SDK 4 Function Reference
4.24 GSI_SETPOSOUTPUT

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.

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: Success
254: Error

4.24.1 UDP Packet Output Format


Packet size: 32 Bytes

Type Description Remarks


Counter UCHAR Counter is incremented on each packet to 0.255
detect lost packets on server side
IO UCHAR State of the selected IO 0: OFF
1: ON
Config UCHAR Relative position information D00 -> 0:Front 1:Back
Only for RecMode=0 D01 -> 0:Upper arm 1:Lower arm
D02 -> 0:Flip 1:No flip
D03 -> 0:R<180 1:R>=180
D04 -> 0:T<180 1:T>=180
D05 -> 0:S<180 1:S>=180
D06 -> 0:L<0 1: L>=0
D07 - 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)

Moto.GSI.SDK/Manual
4-27 62 of 82
177603-1CD

Moto.GSI.SDK 4 Function Reference


4.25 GSI_STOPUDPPOSOUTPUT

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

Moto.GSI.SDK/Manual
4-28 63 of 82
177603-1CD
Moto.GSI.SDK 4 Function Reference
4.26 GSI_GETTIME

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: Success
254: Error

Moto.GSI.SDK/Manual
4-29 64 of 82
177603-1CD

Moto.GSI.SDK 4 Function Reference


4.27 GSI_STARTSPEEDOUTPUT

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.

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 - R8
Base:
8-15 = B1 - B8
Station:
16-39 = S1 - S24
Register I Output start register to write the servo speed in Register: 0-544
pulses per second. The following 15 registers Please see below
are also used “Output Register Layout”
Cycle I Write cycle of the registers based on the 1: each cycle
controllers clock (DX 4ms, FS 2ms) 2: every second cycle
3,…
Return Values
Type Description Remarks
RetValPointer B B[RetValPointer] holds the return value 1: Success
253: Parameter error
254: Task error

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

Moto.GSI.SDK/Manual
4-30 65 of 82
177603-1CD
Moto.GSI.SDK 4 Function Reference
4.28 GSI_STOPSPEEDOUTPUT

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

Moto.GSI.SDK/Manual
4-31 66 of 82
177603-1CD

Moto.GSI.SDK 4 Function Reference


4.29 GSI_BYTETOFLOAT

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 reverse
1: Reverse
Return Values
Type Description Remarks
RetValPointer B B[RetValPointer] holds the return value 1: Success
254: Error

Moto.GSI.SDK/Manual
4-32 67 of 82
177603-1CD
Moto.GSI.SDK 4 Function Reference
4.30 GSI_FLOATTOBYTE

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 reverse
1: Reverse
Return Values
Type Description Remarks
RetValPointer B B[RetValPointer] holds the return value 1: Success
254: Error

Moto.GSI.SDK/Manual
4-33 68 of 82
177603-1CD

Moto.GSI.SDK 4 Function Reference


4.31 GSI_GETPOSVARCOORD

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 = PULSE
2 = BASE
3 = ROBOT
4 = TOOL
5 = USER (
In this case B[RetValPointer+1]
holds the number of the used user
frame)

Moto.GSI.SDK/Manual
4-34 69 of 82
177603-1CD
Moto.GSI.SDK 5 Examples
5.1 TCP

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.

Moto.GSI.SDK/Manual
5-1 70 of 82
177603-1CD

Moto.GSI.SDK 5 Examples
5.1 TCP

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.

Moto.GSI.SDK/Manual
5-2 71 of 82
177603-1CD
Moto.GSI.SDK 5 Examples
5.1 TCP

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
2 0 1 0 16 0 7

Scout:
MT Status
82 0

2. Start of image processing


Control:
MT Number of data Command SCOUT on
2 0 1 0 6 0 1

Scout:
MT Status
82 0

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
1 0 2 0 9 0 10

Scout:
MT Status deviation [mm] Height [mm]
81 0 HB LB HB LB

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
2 0 1 0 6 0 0

Scout:
NT Status
82 0

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.

Moto.GSI.SDK/Manual
5-3 72 of 82
177603-1CD

Moto.GSI.SDK 5 Examples
5.1 TCP

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

Moto.GSI.SDK/Manual
5-4 73 of 82
177603-1CD
Moto.GSI.SDK 5 Examples
5.1 TCP

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

Fig. 5-4: MetaSLS command implementation, job


“GSI_METASLS_COMMAND”

Moto.GSI.SDK/Manual
5-5 74 of 82
177603-1CD

Moto.GSI.SDK 5 Examples
5.2 UDP Peer

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

Moto.GSI.SDK/Manual
5-6 75 of 82
177603-1CD
Moto.GSI.SDK 5 Examples
5.2 UDP Peer

• 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.

Moto.GSI.SDK/Manual
5-7 76 of 82
177603-1CD

Moto.GSI.SDK 5 Examples
5.3 RS232/COM

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

Moto.GSI.SDK/Manual
5-8 77 of 82
177603-1CD
Moto.GSI.SDK 5 Examples
5.4 SMTP – Sending E-Mails

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,“user01@mail.de” as sender address, “user02@mail.de” as
receiver address and “Hello World” as Message. Running this code sends
an E-Mail from user01@mail.de to user02@mail.de 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

Moto.GSI.SDK/Manual
5-9 78 of 82
177603-1CD

Moto.GSI.SDK 5 Examples
5.5 FTP – Transfer jobs

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

Moto.GSI.SDK/Manual
5-10 79 of 82
177603-1CD
Moto.GSI.SDK Appendix A
A.1 ASCII Table

Appendix A

A.1 ASCII Table

Moto.GSI.SDK/Manual
A-1 80 of 82
177603-1CD

Moto.GSI.SDK Appendix B
B.1 FAQ

Appendix B

B.1 FAQ

 Is there any App Gallery/Store for downloading ready- to-use


Moto.GSI.Apps
Currently there is no such library.

 Is there a TCP Server functionality included in Moto.GSI


TCP server functionality will be supported

Moto.GSI.SDK/Manual
B-1 81 of 82
Moto.GSI.SDK
Manual

HEAD OFFICE
2-1 Kurosakishiroishi, Yahatanishi-ku, Kitakyushu 806-0004, Japan
Phone +81-93-645-7703 Fax +81-93-645-7802

YASKAWA America Inc. (Motoman Robotics Division)


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

YASKAWA Europe GmbH Robotics Divsion )


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

YASKAWA Nordic AB
Verkstadsgatan 2, Box 504 ,SE-385 25 Torsas, Sweden
Phone +46-480-417-800 Fax +46-486-414-10

YASKAWA Electric (China) Co., Ltd.


22F, One Corporate Avenue, No.222, Hubin Road, Huangpu District, Shanghai 200021, China
Phone +86-21-5385-2200 Fax 㸩86-21-5385-3299
YASKAWA SHOUGANG ROBOT Co. Ltd.
No7 Yongchang North Road, Beijing E&T Development AreaChina 100176
Phone +86-10-6788-2858 Fax +86-10-6788-2878

YASKAWA India Private Ltd. (Robotics Division)


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

YASKAWA Electric Korea Corporation


35F, Three IFC, 10 Gukjegeumyung-ro, Yeongdeungpo-gu, Seoul, Korea 07326
Phone +82-2-784-7844 Fax +82-2-784-8495

YASKAWA Electric Taiwan Corporation


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

YASKAWA Electric (Singapore) PTE Ltd.


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

YASKAWA Electric (Thailand) Co., Ltd.


59,1st-5th Floor, Flourish Building, Soi Ratchadapisek 18,Ratchadapisek Road,
Huaykwang, Bangkok 10310, THAILAND
Phone +66-2-017-0099 Fax +66-2-017-0199

PT. YASKAWA Electric Indonesia


Secure Building-Gedung B Lantai Dasar & Lantai 1 JI. Raya Protokol Halim Perdanakusuma,
Jakarta 13610, Indonesia
Phone +62-21-2982-6470 Fax +62-21-2982-6741

Specifications are subject to change without notice


for ongoing product modifications and improvements.

MANUAL NO.

Moto.GSI.SDK/Manual 1.29
82 of 82

You might also like