Omron eV+3 User Manual

eV+3
User's Manual
I651-E-02
Copyright Notice
The information contained herein is the property of Omron Robotics and Safety Technologies, Inc., and shall not be reproduced in whole or in part without prior written approval of Omron Robotics and Safety Technologies, Inc.. The information herein is subject to change without notice and should not be con­strued as a commitment by Omron Robotics and Safety Technologies, Inc. The documentation is peri­odically reviewed and revised.
Omron Robotics and Safety Technologies, Inc., assumes no responsibility for any errors or omissions in
the documentation.
Copyright Omron Robotics and Safety Technologies, Inc. by OMRON Corporation. All rights reserved.
Sysmac and SYSMAC are trademarks or registered trademarks of OMRON Corporation in Japan and
other countries for OMRON factory automation products.
EtherCAT® is a registered trademark and patented technology, licensed by Beckhoff Automation GmbH,
Germany.
DeviceNet is a trademark of ODVA.
Other company names and product names in this document are the trademarks or registered trademarks
of their respective companies.
Created in the United States of America.
Table of Contents
Chapter 1: Introduction 9
1.1 Intended Audience
1.2 Related Manuals
1.3 System Overview
The eV+ Operating System 10 The eV+Language 10
1.4 eV+ Keywords
1.5 Monitor CommandPrograms and V+programs
1.6 eV+ File Management
File Name Requirements 12 File Types 12 Programs and Subroutines 13
11
12
12
Chapter 2: Keyword Usage 15
2.1 Using Function Keywords
Function Keyword Syntax 15 Variable Assignments and Data Types 15 Using Functions as KeywordParameters 15 Function Keywords Used Within Expressions 16
2.2 Using Monitor Command Keywords
Monitor Command Keyword Syntax 16
2.3 Using Program Command Keywords
Program Command Keyword Syntax 17
2.4 Using System Parameter Keywords
Available System Parameters 18 Viewing and Setting System Parameters 19
2.5 Using System Switch Keywords
Available System Switches 20 Viewing and Setting System Switches 21
15
16
17
18
20
9
9
9
Chapter 3: eV+ System Operations 23
3.1 System Messages
Message Types 23 Message Handling 23
3.2 Digital I/O Control
I/OUsageConsiderations 24 Basic I/O Control 24 Soft Signals 25
3.3 Disk I/O Operations
22352-000 Rev. B eV+3User'sManual 3
23
24
25
Logical Unit Numbers 25 I/O Operation Error Status 25 Attaching and Detaching Logical Units 26 Attaching and Detaching Disk Devices 26 Reading and Writing with I/O Devices 27 Input Wait Modes 28 Output Wait Modes 28 Disk File Operations 28 Advanced Disk Operations 31
Chapter 4: Motion Control Operations 33
4.1 Motion Control Overview
4.2 Joint-interpolated Motion vs. Straight-line Motion
4.3 Safe Approaches and Departures
4.4 Continuous-Path Trajectories
4.5 Breaking Continuous-Path Operation
4.6 Procedural Motion
4.7 Motion Control Timing Considerations
4.8 Robot Speed and Performance
Robot Speed 37 Robot End-effector / Tool Tip Speed Considerations 38 Robot Performance 38
4.9 Motion Modifiers
33
33
33
34
35
36
37
37
38
Chapter 5: Variables and Data Types 41
5.1 Variable Creation
5.2 Variable Classifications
Variable Classification Scope 41 External Variables 43 Global Variables 44 Local Variables 45 Automatic Variables 45
5.3 Variable Name Requirements
5.4 Variable Initialization
5.5 Variable Operators
Assignment Operators 47 Mathematical Operators 47 Relational Operators 48 Logical Operators 48 String Operators 49 Order of Evaluation 49
5.6 Numeric Representation
Numeric Expressions 50
5.7 String Data Types
ASCII Values 51
41
41
46
46
47
50
50
4 eV+3User'sManual 22352-000 Rev. B
5.8 Real Integer Data Types
Real and Integer Value Ranges 51
5.9 Logical Constants
5.10 Location Data Types
Creating Location Variables 53 Modifying Location Variables 53
5.11 Arrays
Global Array Access Restriction 56
5.12 Variable Context
Interpretation of Context Specification for Variables 58
51
52
52
55
56
Chapter 6: Monitor CommandPrograms 59
6.1 Monitor Command Program Overview
6.2 Monitor CommandProgram Names
6.3 Monitor CommandProgram Contents
6.4 Executing Monitor CommandPrograms
Executing Monitor CommandPrograms from the Monitor Window 60 Autostarting a Monitor CommandProgram 60 Monitor CommandProgram Processing 61
59
59
59
60
Chapter 7: V+programs 63
7.1 V+program Format
Program Lines 63 Program Structure 64
7.2 V+ Program Execution
Program Tasks 64 V+program Processing 66
7.3 Program Control
Unconditional Branching 67 Conditional Branching 68 Looping Structures 69 Loading Programs and Variables to SystemMemory 71 Removing Programs and Variables from System Memory 72
7.4 V+ Program Interrupts
WAIT Program Interrupts 72 WAIT.EVENT Program Interrupts 73 REACT and REACTI Program Interrupts 73 REACTE Program Interrupts 74 HALT, STOP, and PAUSE Program Interrupts 74 Additional Program Interrupt Keywords 75 Program Interrupt Example 75
7.5 V+program Stacks
V+ Program Stack Requirements 77
7.6 Exchanging Information Between V+programs
63
64
66
72
76
78
22352-000 Rev. B eV+3User'sManual 5
Exchanging Information Using Global Variables 78 Exchanging Information Using Soft-signals 78 Exchanging Information Using the Program Argument List 78
7.7 Reentrant and Recursive Programs
Reentrant Programs 81 Recursive Programs 81
7.8 Asynchronous Processing
Error Trapping 82
80
81
Chapter 8: T20 Pendant Programming 83
8.1 Attaching and Detaching the T20 Pendant
8.2 Writing to the T20 Pendant Display
8.3 Detecting User Input
Detecting Pendant Key Presses 84
8.4 Other Pendant Programming Functions
83
83
84
85
Appendix 87
A.1 Warning, Information, and Error Messages
System Warning Messages 87 System Information Messages 87 System Error Messages 88
87
6 eV+3User'sManual 22352-000 Rev. B
Revision History
Revision
Code
A July, 2020 Original release
B August, 2020 Minor corrections and updates
ReleaseDate Details
22352-000 Rev. B eV+3User'sManual 7
This manual contains information that is necessary to use eV+. Please read this manual and make sure you understand the functionality of eV+ before attempting to use it.

1.1 Intended Audience

This manual is intended for the following personnel, who must also have knowledge of com­mon programming practices and robotic control methods.
l Personnel in charge of introducing FA systems. l Personnel in charge of designing FA systems. l Personnel in charge of installing and maintaining FA systems. l Personnel in charge of managing FA systems and facilities.

1.2 Related Manuals

Use the following related manuals for reference.
Manual Description

Chapter 1: Introduction

Table 1-1. Related Manuals
eV+3KeywordReferenceManual (Cat. No. I652)
Sysmac Studio Robot Integrated System Build­ing Function with Robot Integrated CPU Unit Operation Manual (Cat. No. W595)
Robot User Guides User Guide for the robot in use.
T20 Pendant User’s Manual (Cat. No. I601) Describes the use of the optional T20 manual
NJ-series Robot Integrated CPU Unit User's Manual (Cat. No. O037)
Robot Safety Guide (Cat. No. I590) Contains safety information forOMRON indus-

1.3 System Overview

eV+ is an interpreted programming language and control system for OMRON industrial robots. This system offers a variety of keywords supporting robot motion, I/O, vision, file oper­ations, and communication with other devices. Real-time interpretation and forward pro­cessing of programs in parallel tasks provides continuous path trajectory generation, as well as on-line program generation, debugging, and modification.
Provides references to eV+ Keyword use and functionality.
Learning about the operating procedures and functions of the Sysmac Studio to configure Robot Integrated System using Robot Integ­rated CPU Unit.
control pendant.
Describes the settings and operation of the CPU Unit and programming concepts for OMRON robot control.
trial robots.
When the eV+ system is used with the NJ-series Robot IntegratedCPUUnit, I/O, logic, safety, and motion control functions can be created using IEC 61131-3 programming language
22352-000 Rev. B eV+3User'sManual 9
1.3 System Overview
NA-series PT
Teaching pendant T20
(with built-in EtherCAT communications)
Slave Terminal
Vision sensor
OMRON robot
Robot Integrated CPU Unit NJ501-R
I/O control
external devices
1S-series Servo Drives G5-series Servo Drives
Server
Relational database
USB
Camera
FH-series Vision Systems
Robots controllable by NJ Robotics function
EtherCAT
Application Controller
Sysmac Studio
EtherNet/IP
Front Panel
Safety devices
Encoder, digital I/O
specifications. With the addition of shared variables, shared signals, and function blocks for interacting with V+ program execution, a user can develop an entire control solution from the Sysmac Studio software.
The eV+ Operating System runs on OMRON robots while communicating with other system objects to facilitate programming and runtime functionality. The general system overview is shown below.
Figure 1-1. System Overview

The eV+ Operating System

The eV+ Operating System is automatically launched when the robot controller and NJ-series Robot IntegratedCPUUnit are powered ON. The operating system accepts instructions from application programs, input from workcell peripheral devices, and operator input from the pendant. The tasks performed by the operating system include the following.
l Managing the execution of application programs. l Managing the flow of information to and from storage devices. l Monitoring external devices attached to the controller. l Reporting errors generated during processing.
The eV+Language
The eV+ language is comprised of keywords that provide control, data manipulation, and other application-specific functionality. These keywords are used in statements with specific syntax detailed in this document with examples. Statements are executed in a consecutive manner until the .END statement is reached. This is referred to as a program cycle. Keywords may be used to create V+programs or issue individual commands in the Monitor Window. Refer to the eV+3KeywordReferenceManual (Cat. No. I652) for other syntax and statement examples.
IMPORTANT: An error "Command not supported"will be returned if a keyword is issued on a system that does not include the NJ-series Robot IntegratedCPUUnit as the Host System.
10 eV+3User'sManual 22352-000 Rev. B

1.4 eV+ Keywords

eV+keywords are a set of instructions that are used to perform various operations for a robot­based application. Keywords are used to create statements arranged in steps for the following programmatic functionality.
l Robot motion control l Error processing and handling l Arithmetic functions l System parameter and switch manipulation l Data management l I/O control and external device communication l Logic and other conditional evaluations l Subroutine execution and control l Executing various system functions l T20 Pendant functions
Depending on the type of keyword, they can be used to build a program or they can be issued individually using the Monitor Window in the Sysmac Studio.
Keywords are categorized into six types as described below.
Chapter 1: Introduction
Table 1-2. eV+ Keyword Types
Keyword Type Usage
Functionkeywords Used to return values from the eV+ Operating System.
Refer to Using Function Keywords on page 15for more information.
Monitor command keywords
Other keywords Used to specify units when using the SPEEDprogram command
Program command keywords
System parameter keywords
Used to issue individual operations in the Monitor Window or to create Monitor CommandPrograms.
Refer to Using Monitor Command Keywords on page 16for more inform­ation.
keyword.
Refer to the eV+3KeywordReferenceManual (Cat. No. I652) for more information.
Used to command operations in V+programs.
Refer to Using Program Command Keywords on page 17for more information.
Used to manipulate system parameters in V+programs or with the Mon­itor Window.
Refer to Using System Parameter Keywordsfor more information.
System switch keywords
Used to manipulate system switches in V+programs or with theMonitor Window.
Refer toUsing System Switch Keywords on page 20for more inform­ation.
22352-000 Rev. B eV+3User'sManual 11
1.5 Monitor CommandPrograms and V+programs
Keywords andSyntax
In order for keywords to work with the eV+ operating system, they must be issued with a spe­cific syntax. This syntax generally consists of a keyword and associated parameters in a spe­cific order, separated by characters such as commas, brackets, and parentheses. This syntax is detailed in this manual and also in the eV+3KeywordReferenceManual (Cat. No. I652). An example of keyword syntax is shown below.
SET loc_name = SHIFT(loc_value BY 5, 5, 5)
When creating V+programs with the Sysmac Studio, syntax is checked and formatted as the characters are input. Refer to theSysmac Studio Robot Integrated System Building Function with Robot Integrated CPU Unit Operation Manual (Cat. No. W595) for more information.
1.5 Monitor CommandPrograms and V+programs
There are two types of programs that the eV+ Operating System can execute: Monitor CommandPrograms and V+programs.
V+programs contain the logic, motion control, and vision keywords that control a robot dur­ing run-time. Refer to V+programs on page 63 for more information.
Monitor CommandPrograms are used to perform system-level functions such as loading files, changing the default directory path, and executing main eV+ programs after system boot up. Refer to Monitor CommandPrograms on page 59 for more information.

1.6 eV+ File Management

The eV+ Operating System has a file management system very similar to other operating sys­tems. Each file within a subdirectory must have a unique name. There are several file exten­sions that are used for different types of files in the eV+ system as described in File Types on page 12.
New files can be created with the Sysmac Studio or by issuing specific keywords. Refer to the
Sysmac Studio Robot Integrated System Building Function with Robot Integrated CPU Unit Operation Manual (Cat. No. W595) and the eV+3KeywordReferenceManual (Cat. No. I652) for more inform-
ation.

File Name Requirements

The eV+file name requirements are described below.
l File names can have a maximum of eight characters. l File names must have an extension (file type) designation that is 1 to 3 characters in
length. Refer to File Types on page 12 for more information.
l File names can only include alphanumeric characters and the underscore (_) character.
No other special characters are permitted.
l File names cannot contain blank spaces. l Keywords cannot be used as file names. Do not name files the same as any keywords.
NOTE: File names are not case-sensitive.

File Types

There are several file types that are used by the eV+ Operating System. File types that are used during system development, commissioning, debugging, and other typical operations are lis­ted below.
12 eV+3User'sManual 22352-000 Rev. B
Chapter 1: Introduction
IMPORTANT: Direct access and editing of these files is not necessary under nor­mal use.
Table 1-3. eV+ File Type Descriptions
File
Type
.v2
.cal System calibration data files.
.xml Robot specification and other parameter files.
.rtf Text files (Readme).
.pg V+program or group of programs (module)
V+ programs
Global variables referenced by the programs and subroutines can be stored in the file.
All of the subroutines referenced (directly or indirectly) by the specified program can be stored in the file.
Refer to the eV+3KeywordReferenceManual (Cat. No. I652) for information about storing programs and variables in a disk file using the STOREkeyword.
Refer to the Sysmac Studio Robot Integrated System Building Function with Robot Integrated CPU Unit Operation Manual (Cat. No. W595) for information about saving programs and variables to the controller.
In addition to the programs specified to store in the file, any subroutines referenced by those programs are also stored in the file.
Refer to the eV+3KeywordReferenceManual (Cat. No. I652) for information about storing programs and variables in a disk file using the STOREPand STOREM keywords.
Description

Programs and Subroutines

V+ is an interpreted language, therefore linking and compiling are not required. Main pro­grams and subroutines always exist as separate programs. The eV+ file structure allows you to keep a main program and all the subroutines it calls or executes together in a single file so that when a main program is loaded, all the subroutines it calls are also loaded. A single file that contains a program and subroutines is also referred to as a module.
If a program calls a subroutine that is not resident in system memory, the error *Undefined pro­gram or variable name* will result.
Additional Information: Refer to the STORE_andMODULEkeyword descrip­tions in the eV+3KeywordReferenceManual (Cat. No. I652) for more information.
Refer to the Sysmac Studio Robot Integrated System Building Function with Robot Integrated CPU Unit Operation Manual (Cat. No. W595) for more information about creating a program file.
22352-000 Rev. B eV+3User'sManual 13
This chapter describes how to use the different types of keywords with the eV+ system.

2.1 Using Function Keywords

Function keywords are issued within V+ Program statements and can be used in several dif­ferent ways as described below.
Additional Information: Refer to the eV+3KeywordReferenceManual (Cat. No. I652) for more information about specific function keywords.

Function Keyword Syntax

eV+ provides you with a wide variety of predefined function keywords for performing string, mathematical, and other data manipulation. In most cases, you must provide the data that is input to a function keyword. The keyword then returns a value based on a specific operation on that data. Function keywords can be used anywhere that a value or expression would be used.
Correct syntax for function keywords must be observed when creating statements in V+ pro­grams. If incorrect syntax is used, eV+ will return an *Illegal monitor command* error.

Chapter 2: Keyword Usage

Variable Assignments and Data Types

When a function keyword is issued, a value is returned by the eV+ Operating System. The data type of the value that is returned must match the data type of the variable that is assigned to the function. For example, if the $TIME function keyword is issued, eV+ will return a string data type value. The examples below demonstrate various data types used with variable assignments.
$current_time = $MID($TIME(,time),11,8)
SET #pos1 = #PHERE
SETBELT %main.belt = BELT(%main.belt)
Additional Information: Refer to Variables and Data Types on page 41 for more information
Using Functions as KeywordParameters
A function keyword can be used as a parameter as long as the data type returned by that func­tion is the correct type. For example, consider the SQRT function statement shown below. The SQRT function keyword uses the syntax "SQRT(value)" for reference.
i = SQRT(SQR(x))
The statement above returns the absolute value of variable "x" and assignes it to variable "i". Any function that returns a numerical value can be substituted for "SQR(x)"in the statement above.
22352-000 Rev. B eV+3User'sManual 15
2.2 Using Monitor Command Keywords

Function Keywords Used Within Expressions

A function keyword can be used as an expression as long as the data type returned by that function is the correct type. For example, consider the IF ... THEN conditional statement shown below. The IF ... THEN keyword uses the syntax "IF logical_expTHEN" for reference.
IFLEN($string_variable) > 12 THEN
The statement above evaluates the expression "LEN($string_variable) > 12". This expression includes the LENfunction keyword that returns the number of characters in the variable "$string_variable". Any function that returns a numerical value can be substituted for LEN ($string_variable) in the statement above.

2.2 Using Monitor Command Keywords

Monitor command keywords can be issued in the Monitor Window or with the use of a Com­mand Program. Most monitorcommand keywords include at least one parameter that controls how the eV+ system executes the operation. This additional information is specified when the keyword is issued in the Monitor Window. Parameters must be entered in the order they are listed and they must use correct syntax.
Additional Information: Refer to the eV+3KeywordReferenceManual (Cat. No. I652) for more information about specific monitorcommand keywords.
Refer to the Sysmac Studio Robot Integrated System Building Function with Robot Integrated CPU Unit Operation Manual (Cat. No. W595) for more information about
the Monitor Window.

Monitor Command Keyword Syntax

Correct syntax for monitorcommand keywords must be observed when creating statements in V+ programs. If incorrect syntax is used, eV+ will return an *Illegal monitor command* error.
In general, monitorcommand keywords have the following formats. The keyword is shown in uppercase and the arguments are shown in lowercase. Required keywords, parameters, and symbols such as equal signs and parentheses are shown in bold text. Optional keywords, para­meters, and symbols are shown in regular text.
KEYWORD
KEYWORD req_param
KEYWORD (req_param)
KEYWORD opt_param
KEYWORD opt_param1, opt_param2, ... , opt_paramX
KEYWORD req_param, opt_param = value
KEYWORD @task:program_step(expression)
KEYWORD req_param1 = req_param2
KEYWORD req_param1 = req_param2 KEYWORD opt_param
Additional Information: All required or optional monitorcommand keyword parameters and associated syntax is described for each keyword in the eV+3KeywordReferenceManual (Cat. No. I652). Refer to specific keyword details in that manual for more information.
16 eV+3User'sManual 22352-000 Rev. B
Chapter 2: Keyword Usage
Monitor Command Keyword Parameter Entry
Monitor command keyword parameters can be optional or required. If a parameter is required, a value must be entered on the command line or the command will not execute correctly. A space is required between the keyword and the parameters that follow it. A comma is typically used to separate parameters but some monitorcommand keywords may require an equal sign (=) assignment operator.
If a parameter is optional, its value can be omitted and the system will substitute a default value. For example, the STATUSmonitorcommand keyword can be issued as shown below. The STATUSsyntax is "STATUSselect" for reference, where "select" is an optional parameter.
STATUS
Issuing the STATUS monitorcommand keyword as shown above will return status inform­ation for all the program tasks.
Issuing the STATUSmonitorcommand keyword with a parameter value as shown below will return status information for only system task number 1.
STATUS 1
Spaces before and after parameter separators are optional. If one or more parameters follow an omitted parameter, the parameter separator(s) must be typed. If all the parameters following an omitted parameter are optional, and those parameters are also omitted, the separators do not need to be typed. Refer to the example below that demonstrates these concepts. The XSTEP syn­tax is "XSTEP task program (param_list), cycles, step" with all parameters being optional, for reference.
XSTEP assembly,,23

2.3 Using Program Command Keywords

Program command keywords are used to create V+ programs for robot control and other func­tions such as I/O control, file operations, error handling, and data management. This section provides details about the usage of program command keywords when creating V+ programs.

Program Command Keyword Syntax

Correct syntax for program command keywords must be observed when creating statements in V+ programs. If incorrect syntax is used, the statement will cause errors in the V+ Editor and the program cannot be executed.
Symbols such as commas, brackets, and parentheses may be required for program commandkeyword syntax when parameters are present. program command keywords may contain parameters that define or specify information needed for the operation. Some program command keywords do not require any parameters while other program command keywords have required or optional parameters.
In general, program command keywords have the following formats (not an exhaustive list­ing). The keyword is shown in uppercase and the arguments are shown in lowercase. Required keywords, parameters, and symbols such as equal signs and parentheses are shown in bold text. Optional keywords, parameters, and symbols are shown in regular text.
KEYWORD
KEYWORD req_param
KEYWORD opt_param
KEYWORD (parameter)opt_param
22352-000 Rev. B eV+3User'sManual 17
2.4 Using System Parameter Keywords
KEYWORD opt_param1, opt_param2, ... , opt_paramX
KEYWORD req_param, opt_param = value
KEYWORD req_param1 = req_param2
KEYWORD req_param1 = req_param2 KEYWORD opt_param
Additional Information: All required or optional program commandkeyword parameters and associated syntax is described for each keyword in the eV+3KeywordReferenceManual (Cat. No. I652). . Refer to a specific keyword details in that manual for more information.
No Required Parameters
Some program commandkeywords do not require any parameters such as LEFTY, RIGHTY, ABOVE, and BELOW. Keywords that do not require parameters can be used as shown below.
ABOVE MOVE point1 BREAK
Required or Optional Parameters
Some program commandkeywords have parameters that are required or optional. When using a keyword that uses multiple parameters, symbols such as commas, brackets, and par­entheses may be required. If required parameters or syntax is incorrect, an error will occur. Refer to Warning, Information, and Error Messages on page 87 for error information and the eV+3KeywordReferenceManual (Cat. No. I652) for more information about the use of symbols to complete the correct syntax for eV+.
NOTE: When program lines are entered, extra blank spaces can be used between any elements in the line. The eV+ editor adds or deletes spaces in pro­gram lines to make them conform with the standard spacing. The editors also automatically format the lines to uppercase for all keywords and lowercase for all user-defined names.

2.4 Using System Parameter Keywords

System parameters determine certain operating characteristics of the eV+ system. These para­meters have numeric values that can be changed from the Monitor Window or from within a program to suit particular system configurations and needs. The various parameters are described in this section along with the operations for displaying and changing their values.

Available System Parameters

Use the following table to understand the available system parameters and their basic func­tions. Refer to the eV+3KeywordReferenceManual (Cat. No. I652) for setting details, examples, and other information.
Table 2-1. System Parameter Details
Parameter Description
BELT.MODE Set characteristics of the conveyor tracking feature of the eV+ system.
DEVIATION Adds a path deviation from 1 to 100% to the motion in the singularity
region when a robot is in singularity.
18 eV+3User'sManual 22352-000 Rev. B
Chapter 2: Keyword Usage
Parameter Description
NOT.CALIBRATED Represents the calibration status of the robot(s) controlled by the eV+ sys-
tem.
VTIMEOUT Sets a timeout value so that an error message is returned if no response is
received following a vision command.
JOG.TIME Sets the keep-alive time of a jog operation.
Each time a jog operation is executed, this parameter setting specifies the time the axis or joint moves.

Viewing and Setting System Parameters

System parameters can be viewed and set in the Monitor Window. They can also be controlled by V+ programs. Use this section to understand how to view and set system parameters.
Viewing and Setting System Parameters with the Monitor Window
The PARAMETERmonitorcommand keyword is used to view and set parameter values as shown in the examples below.
Viewing Parameter Values
The following example will display all parameters and their current values in the Monitor Window.
PARAMETER
The following example will display the BELT.MODEparameter current value in the MonitorWindow.
PARAMETER BELT.MODE
Setting Parameter Values
The following example will set theBELT.MODEparameter to 4.
PARAMETER BELT.MODE = 4
Reading and Writing System Parameters with V+ Programs
Parameters can be set during V+ program execution by using the PARAMETER program com­mand keyword.
NOTE: It is common practice to use a Monitor CommandProgram to set para­meters. Refer to Monitor CommandPrograms on page 59 for more information.
The following program statement will set the BELT.MODE system parameter to have bits 1 and 3 set to 1 (mask values 1 + 4) using thePARAMETERprogram command keyword.
PARAMETER BELT.MODE = 5
A parameter value can be returned during V+ program execution or using the Monitor Win­dow.
The following program statement will return the current setting of the BELT.MODE system parameter in the Monitor Window.
22352-000 Rev. B eV+3User'sManual 19
2.5 Using System Switch Keywords
TYPE "The BELT.MODE parameter is set to", PARAMETER(BELT.MODE)

2.5 Using System Switch Keywords

System switches determine certain operating characteristics of the eV+ system. These switches can be turned ONor OFF from the Monitor Window or from within a program.. The various system switches are described in this section along with the operations for displaying and con­trolling them.

Available System Switches

Use the following table to understand the available system switches and their basic functions. Refer to the eV+3KeywordReferenceManual (Cat. No. I652) for settings, details, examples, and other information.
Switch Description
AUTO.POWER.OFF When this switch is ON, errors will disable high power. When this switch
is OFF, these errors stop the robot and signal the eV+ system, but do not cause high power to be turned OFF.
The errors are defined as follows.
l (-624) *force protect limit exceeded* l (-1003) *Time-out nulling errors* Mtr l (-1006) *Soft envelope error* Mtr
CP Enables or disables continuous-path motion processing. Refer to Continu-
ous-Path Trajectories on page 34 for more information.
DECEL.100 Enables or disables the use of 100 percent as the maximum deceleration
for the ACCEL program command keyword.
DELAY.IN.TOL Controls the timing of coarse or fine nulling after eV+ completes a
motion segment (positioning tolerance). Refer to COARSEandFINE programcommand keyword details.
DRY.RUN This switch enables or disables the transmission of motion commands to
the robot. Turn this switch ON to test programs for proper logical flow and external communication functionality to prevent collisions.
NOTE: The T20 pendant can still be used to move the robot when DRY.RUN is enabled if there is no task attached to the robot. Otherwise, a Robot Interlocked error (-621) will occur.
MESSAGES Setting this switch to ON will allow messages to be displayed on the Mon-
itor Window while using theTYPE program command keyword.
Setting this switch OFFwill prevent messages from being displayed on the Monitor Window with the TYPE program command keyword.
OBSTACLE Enables or disables up to 4 different obstacles that are defined for a robot.
POWER This switch controls and displays the robot high power. This switch is
automatically enabled whenever robot high power is turned ON.
If the robot timing specifications in the system configuration is non-zero, enabling high power is a two-step process. In this case, after enabling high power from the T20 Pendant, Monitor Window, or software, the sys-
20 eV+3User'sManual 22352-000 Rev. B
Chapter 2: Keyword Usage
Switch Description
tem flashes the high power indicator for the duration of the timing spe­cification setting (in seconds). If a timeout occurs, the message *HIGHPOWERbutton not pressed*will appear.
Refer to Warning, Information, and Error Messages on page 87 for more information.
Refer to the Sysmac Studio Robot Integrated System Building Function with Robot Integrated CPU Unit Operation Manual (Cat. No. W595) for more information about robot timing specification settings.
ROBOT Enables or disables one robot or all robots.
SCALE.ACCEL Enables or disables the scaling of acceleration and deceleration as a func-
tion of program speed as long as the program speed is below a preset threshold.
SCALE.ACCEL.ROT Specifies whether or not the SCALE.ACCEL system switch accounts for
the cartesian rotational speed during straight-line motions.
UPPER Determines whether comparisons of string values will consider lowercase
letters the same as uppercase letters. When this switch is ON, all lower­case letters are considered as though they are uppercase.

Viewing and Setting System Switches

System switches can be viewed and set in theMonitorWindow. Then can also be controlled by V+ programs. Use this section to understand how to view and set system switches.
Viewing and Setting System Switches from the Monitor Window
The SWITCH monitorcommand keyword is used to view and set switches as shown in the examples below.
Viewing System Switches
The following example will display all switches and their current values in the Monitor Win­dow.
SWITCH
The following example will display the POWER switch current state in the MonitorWindow.
SWITCH POWER
Setting SystemSwitches
The following example will turn ON the AUTO.POWER.OFF switch.
ENABLE AUTO.POWER.OFF
The following example will turn OFF the AUTO.POWER.OFFswitch.
DISABLE AUTO.POWER.OFF
22352-000 Rev. B eV+3User'sManual 21

Chapter 3: eV+ System Operations

The following sections describe various eV+system operations.

3.1 System Messages

System messages have designated numbers and strings for identification. These can be used to detect and recover from various eV+ conditions with V+ programs or using the Monitor Win­dow.
Additional Information: Refer to Warning, Information, and Error Messages on page 87

Message Types

There are three different message types:
l Informational messages (message numbers 0 to 49) l Warning messages (message numbers 50 to 299) l Error messages (messages with negative values)
System Behavior
The eV+ system will behave differently depending on the type of message and eV+ state when the message occurs.
Informational andwarning messages do not impact the system operation and can be used for observational purposes.
Errors messages have an impact on system operation. They will not completely stop the eV+ system, but individual tasks associated with the error will stop running.
System behavior after errors occur depend on the running task, robot status, and type of error. If the robot is running and on the same task where an error occurs, the robot will be stopped with maximum deceleration and an error message(s) will be generated. If an error occurs on a task that is not running a robot, only this task will be stopped and the robot will not be affected.

Message Handling

eV+ will internally store system message information in order to be accessed with the ERROR and REACTEkeyword operations.
The following information is stored for access using the ERRORkeyword operation.
l The last system message of a task (current or selected) l The last system message of each attached robot l The last message of the eV+ system l A category, source, and name for each system message.
Additional Information: Refer to the eV+3KeywordReferenceManual (Cat. No. I652) for more information about the ERROR and REACTEkeyword operations.
22352-000 Rev. B eV+3User'sManual 23
3.2 Digital I/O Control

3.2 Digital I/O Control

When eV+ starts, blocks of system memory are assigned to internal and external digital I/O detected by the system.
Several program command keywords are available for digital I/Ocontrol purposes. Digital input signals can be monitored for changes and outputs can be turned ON and OFF con­ditionally.
Refer to the robot user guide for more information about default signal allocation.
I/OUsageConsiderations
The RESETand DEF.DIO program command keywords have no effect on Host I/Osignal num­bers 4001 to 4999.
The IOmonitor command keyword will return the value of signals that are mapped in the host and returns "-"for signals that are not mapped.
The SIG.INSfunction keyword will return TRUE if the host signal is available and FALSEif it is not available (not mapped).
Refer to the eV+3KeywordReferenceManual (Cat. No. I652) for more information.

Basic I/O Control

Use the following examples to understand basic I/Ocontrol functionality with program com­mand keywords.
Input Signal Examples
The following example halts program execution until a switching device attached to digital input channel 1001 is closed.
WAIT SIG(1001)
The following example evaluates input signal 1002 and calls a program "service.feeder" when the signal turns ON.
IF SIG(1002) THEN
CALL service.feeder()
END
NOTE: The example above will call "service.feeder" if signal 1002 is ON only when the condition is evaluated.
Output Signal Examples
The following example turns OFFdigital output signal 33.
SIGNAL(-33)
The following example turns ON digital output signal 33.
SIGNAL(33)
The following example controls multiple digital output signals with a single statement.
SIGNAL(33),(-34),(35)
24 eV+3User'sManual 22352-000 Rev. B

Soft Signals

Soft signals are provided in the range of 2001 to 2999. These signals are accessible with all V+ programs and can be used with the SIG and SIGNALkeywords for interaction between V+ pro­grams on different tasks or interaction between V+ programs and functionality in an ApplicationManager..

3.3 Disk I/O Operations

The following sections describe the basic procedures and functions for disk I/O operations.

Logical Unit Numbers

All eV+ disk I/Ooperations reference an integer value called a Logical Unit Number (LUN). The LUN provides a method of identifying which device or file is being referenced by an I/Ooperation. A LUN device can refer to a robot, a disk, a TCP protocol device driver, a TFTPserver, or a UDP protocol device driver.
The LUNspecifier is a parameter used in several keywords listed below. Refer to the eV+3KeywordReferenceManual (Cat. No. I652) for more information.
The following program command keywords use the LUN parameter.
Chapter 3: eV+ System Operations
l ATTACH l DETACH l FCMND l FOPEN l FSET l READ l WRITE

I/O Operation Error Status

Unlike most other eV+ keywords, I/O operations are expected to fail under certain cir­cumstances. For example, when reading a file, an error status is returned to the program to indicate when the end of the file is reached. The program is expected to manage this error and continue execution.
For these reasons, eV+ I/O keywords normally do not stop program execution when an error occurs. Instead, the success or failure of the operation is saved internally for access by the IOSTAT real-valued function. For example, a reference to IOSTAT(5) returns a value indicating the status of the last I/O operation performed on LUN 5. The values returned by IOSTAT fall into one of following three categories.
Table 3-1. IOSTATKeyword Return Values
Value Description
1 The I/O operation completed successfully.
0 The I/O operation has not yet completed. This value appears only if
a pre-read or no-wait I/O operation is being performed.
<0 The I/O operation completed with an error. The error code indic-
ates what type of error occurred.
Additional Information: Refer to Warning, Information, and Error Messages on page 87 The $ERROR string function keyword can be used in a program (or with
22352-000 Rev. B eV+3User'sManual 25
3.3 Disk I/O Operations
the LISTS monitor command keyword) to generate the text associated with most
I/O errors.
NOTE: It is not necessary to use IOSTAT after use of a GETC keyword since errors are returned directly by the GETC keyword.

Attaching and Detaching Logical Units

An I/O device must be attached using the ATTACH program command keyword before it can be accessed by a program. Once a specific device (such as the teach pendant) is attached by one program task, it cannot be used by another program task.
Most I/O requests fail if the device associated with the referenced Logical Unit Number is not attached. When a program is finished with a device, it detaches the device with the DETACH program command keyword. This allows other programs to process any pending I/O oper­ations.
A physical device type can be specified when the logical unit is attached. If a device type is specified, it supersedes the default, but only for the logical unit attached. The specified device type remains selected until the logical unit is detached.
When a control program completes execution normally, all I/O devices attached by it are auto­matically detached. If a program stops abnormally, most device attachments are preserved. If the control program task is resumed and attempts to reattach these logical units, it may fail because of the attachments still in effect.
Additional Information: The KILL monitorcommand forces a program to detach all the devices that it has attached.
If attached by a program, the Monitor Window and teach pendant are detached whenever the program halts or pauses for any reason, including error conditions and single-step mode. If the program is resumed, the Monitor Window and the teach pendant are automatically reattached if they were attached before the termination.
Attach Request Response Mode
An attach request can optionally specify immediate mode. Normally, an attach request is queued and the calling program is suspended if another control program task is attached to the device. When the device is detached, the next attachment in the queue will be processed. In immediate mode, the ATTACH program command keyword completes immediately with an error if the requested device is already attached by another control program task.
Attach requests can also specify no-wait mode. This mode allows an attach request to be queued without forcing the program to wait for it to complete. The IOSTAT function must then be used to determine when the attach has completed.
If a task is already attached to a logical unit, it will get an error immediately if it attempts to attach again without detaching, regardless of the type of wait mode specified.

Attaching and Detaching Disk Devices

Use the sections below to understand how to attach and detach disk devices.
Attaching DiskDevices
The type of device to be accessed is determined by the DEFAULT monitor command keyword or the ATTACH program command keyword. If the default device type set by the DEFAULT
26 eV+3User'sManual 22352-000 Rev. B
Chapter 3: eV+ System Operations
keyword is not appropriate at a particular time, the ATTACH keyword can be used to override the default.
The following example attaches to an available disk logical unit and returns the number of the logical unit in the variable "dlun", which can then be used in other disk I/O operations.
ATTACH (dlun, 4) "DISK"
If the device name is omitted from the keyword syntax, the default device for the specified LUN is used. It is recommended that you always specify a device name with the ATTACH keyword. The device SYSTEM refers to the device specified with the DEFAULT monitorcommand. Once the attachment is made, the device cannot be changed until the logical unit is detached. However, any of the units available on the device can be specified when opening a file. For example, the eV+ DISK units are A, C and D. After attaching a DISK device LUN, a program can open and close files on any of these disk units before detaching the LUN.
Detaching Disk Devices
When a disk logical unit is detached, any disk file that was open on that unit is automatically closed. However, error conditions detected by the close operation may not be reported. There­fore, it is good practice to use the FCLOSE keyword to close files and to check the error status afterwards. FCLOSE ensures that all buffered data for the file is written to the disk, and updates the disk directory to reflect any changes made to the file. The DETACH keyword frees up the logical unit.
The following example will close a file and detach a disk LUN.
FLCOSE(dlun)
IFIOSTAT(dlun) THEN
TYPE $ERROR(IOSTAT(dlun))
END
DETACH(dlun)

Reading and Writing with I/O Devices

The READ program command keyword processes input from all devices. The basic READ keyword issues a request to the device attached on the indicated LUN and waits until a com­plete data record is received before program execution continues. The length of the last record read can be obtained with the IOSTAT function with its second argument set to a value of 2.
The GETC real-valued function returns the next data byte from an I/O device without waiting for a complete data record. It is commonly used to read data from the Monitor Window. It also can be used to read disk files in a byte-by-byte manner. Special mode bits to allow reading with no echo are supported for Monitor Window read operations.
Monitor Window input can be performed using the PROMPT program command keyword. The GET.EVENT real-valued function can be used to read input from the Monitor Window. This may be useful in writing programs that operate on both graphics and non-graphics-based systems. To read data from a disk device, a file must be open on the corresponding logical unit. The FOPEN_ program command keywords open disk files.
The WRITE program command keyword processes output to disk devices and to the Monitor Window. The basic WRITE keyword issues a request to the device attached on the indicated LUN, and waits until the complete data record is output before program execution continues. WRITE keywords accept format control specifiers that determine how output data is formatted, and whether or not an end of record mark should be written at the end of the record.
Monitor Window output can be performed using the PROMPT or TYPE keywords. A file must be opened using the FOPENW or FOPENA keywords before data can be written to a disk
22352-000 Rev. B eV+3User'sManual 27
3.3 Disk I/O Operations
device. FOPENW opens a new file. FOPENA opens an existing file and appends data to that file.
Additional Information: Refer to the eV+3KeywordReferenceManual (Cat. No. I652) for usage considerations, details, and examples of the keywords described
above.

Input Wait Modes

Normally, eV+ waits until the data from an input keyword is available before continuing with program execution. However, the READ keyword and GETC keyword accept an optional para­meter that specifies no-wait mode.
In no-wait mode, these keywords return immediately with the error status -526 (No data received) if there is no data available. A program can loop and use these operations repeatedly until a successful read is completed or until some other error is received. The disk devices do not recognize no-wait mode on input and treat such requests as normal input-with-wait requests.

Output Wait Modes

Normally, eV+ waits for each I/O operation to be completed before continuing to the next pro­gram statement.
The following example causes eV+ to wait for the entire record of 50 spaces to be transmitted (about 50 ms for 9600 baud rate) before continuing to the next program statement.
TYPE /X50
Similarly, WRITE program command keywords to disk files will wait for any required phys­ical output to complete before continuing.
This waiting is not performed if the /N (no wait) format control specifier is used in an output keyword. Instead, eV+ immediately executes the next program statement. The IOSTAT function
checks whether or not the output has completed. It returns a value of zero if the previous I/O is not complete. If a second output keyword for a particular Logical Unit Number is encountered before the first no-wait operation has completed, the second statement auto­matically waits until the first is done. This scheme means the no-wait output is effectively double-buffered. If an error occurs in the first operation, the second operation is canceled, and the IOSTAT value is correct for the first operation. The IOSTAT function can be used with a second parameter of 3 to explicitly check for the completion of a no-wait write.

Disk File Operations

Disk file operations that are available with the eV+ system are described below.
The FDIRECTORY monitor command keyword is used to display the names of the files in a directory. A disk file can be accessed either sequentially, where data records are accessed from the beginning of the file to its end, or randomly, where data records are accessed in any order. Refer to Advanced Disk Operations on page 31 for more information about sequential and ran­dom access for disk files.
The FCMNDprogram command keyword is used to perform the following operations.
l Rename a file l Create a subdirectory l Delete a subdirectory
Additional Information: The FCMND keyword is similar to other disk I/O keywords in that a logical unit must be attached and the success or failure of the
28 eV+3User'sManual 22352-000 Rev. B
Chapter 3: eV+ System Operations
command is returned via the IOSTAT real-valued function. Refer to the eV+3KeywordReferenceManual (Cat. No. I652) for more information about the IOSTATfunction.
Accessing the Disk Directories
The eV+ directory structure is identical to that used by the IBM PC DOS operating system. For each file, the directory structure contains the file name, attributes, creation time and date, and file size. Directory entries may be read after successfully executing an FOPEND keyword.
Each directory record returned by a READ keyword operation contains an ASCII string with the information shown in the following table.
Table 3-2. Disk DirectoryFormat Description
Byte Size (Bytes) Description
1 to 7 7 Attribute codes that are padded with blanks on the right side. The
attribute field is blank if no special attributes are indicated.
The following characters are possible.
l D: Subdirectory l P: File is protected and cannot be read or modified l R:File is read-only and cannot be modified l S:File is system file
9 1 ASCII tab character (9 decimal).
10 to 19 10 ASCIIfile size in sectors, right justified.
20 1 ASCIItab character (9 decimal).
20 to 28 9 File revision date with the format of dd-mm-yy.
NOTE: The file revision date is blank if the system date and time had not been set when the file was cre­ated or last modified.
29 1 ASCIItab character (9 decimal).
30 to 38 9 File revision time with the format hh:mm:ss.
NOTE: The file revision time is blank if the system date and time had not been set when the file was cre­ated or last modified.
39 1 ASCII tab character (9 decimal).
40+ --- ASCIIfile name and extension (size depends on file name length).
Opening a DiskFile
Before a disk file can be opened, the disk the file is on must be attached. The FOPEN_ keywords open disk files (and file directories). These keywords associate a LUN with a disk file. Once a file is open, the READ, GETC, and WRITE keywords can be used to access the file. These keywords use the assigned LUN to access the file so that multiple files may be open on the same disk and the I/O operations for the different disk files will not affect each other.
22352-000 Rev. B eV+3User'sManual 29
3.3 Disk I/O Operations
NOTE: While a file is open for write or append access, another control program task cannot access that file. However, multiple control program tasks can access a file simultaneously in read-only mode.
Writing to a Disk
The following example writes the string stored in "$in.string" to the disk file open on "dlun".
WRITE (dlun) $in.string
The following example returns any error generated during the write operation example above to the "error" variable.
error = IOSTAT(dlun)
Reading from a Disk
The following example reads from the open file on "dlun" up to the first CR/LF or end of file if it is encountered, and stores the result in "$in.string". When the end of file is reached, eV+ error number -504 (Unexpected end of file) is generated. The IOSTAT function must be used to recog­nize this error and halt reading of the file.
DO
READ (dlun) $in.string
TYPE $in.string
UNTIL IOSTAT(dlun) == -504
Additional Information: The GETC function reads the file byte-by-byte if you want to examine individual bytes from the file or if the file is not delimited by CR/LFs.
Multi-functional Example
The following example creates a disk file, writes to the file, closes the file, reopens the file, and reads back its contents.
AUTO dlun, i
AUTO $file.name
$file.name = "data.tst"
ATTACH (dlun, 4) "DISK"
IF IOSTAT(dlun) < 0 GOTO 100
FOPENW (dlun) $file.name
IF IOSTAT(dlun) < 0 GOTO 100
FOR i = 1 TO 10
WRITE (dlun) "Line "+$ENCODE(i)
IF IOSTAT(dlun) < 0 GOTO 100
END
FCLOSE (dlun)
IF IOSTAT(dlun) < 0 GOTO 100
FOPENR (dlun) $file.name
IF IOSTAT(dlun) < 0 GOTO 100
READ (dlun) $txt
WHILE IOSTAT(dlun) > 0 DO
30 eV+3User'sManual 22352-000 Rev. B
Loading...
+ 68 hidden pages