V+ Language User's Guide, v17.x This is a PDF/print version of the V+ Language User's Guide online documentation. A Table of Contents is provided so that you can locate the desired topics. Because the V+ Language User's Guide was designed for online viewing, there may be slight formatting anomalies in the PDF/print version. Additionally, links to external documents will not work in the PDF file.
Copyright Notice The information contained herein is the property of Adept Technology, Inc., and shall not be reproduced in whole or in part without prior written approval of Adept Technology, Inc. The information herein is subject to change without notice and should not be construed as a commitment by Adept Technology, Inc. The documentation is periodically reviewed and revised. Adept Technology, Inc., assumes no responsibility for any errors or omissions in the documentation.
Table Of Contents V+ Language User's Guide Introduction 11 Introduction to the V+ Language User's Guide How Can I Get Help? 12 12 12 13 13 14 15 18 19 21 Programming V+ 23 Compatibility Manual Overview V+ Release Notes Related Publications Dangers, Warnings, Cautions, and Notes Safety Notations and Conventions Output Control Commands Creating a Program The SEE Editor Environments Other V+ Programming Environments Using the SEE Editor V+ Program Types Format of Programs Executing Programs Program Sta
Real and Integer Data Types String Operator Order of Evaluation 102 104 105 107 111 115 116 Program Control 117 Location Data Types Arrays Variable Classes Operators Introduction Unconditional Branch Instructions Program Interrupt Instructions Logical (Boolean) Expressions Conditional Branching Instructions Looping Structures Summary of Program Control Keywords Controlling Programs in Multiple CPU Systems Functions 119 120 122 128 129 132 136 139 141 Using Functions String-Related Functions Locati
Tool Transformations Summary of Motion Keywords 188 190 Input/Output Operations 199 Terminal I/O DeviceNet Summary of I/O Operations 201 205 207 208 210 214 219 223 227 231 237 239 Graphics Programming 243 Creating Windows Monitoring Events Building a Menu Structure 245 248 250 253 255 257 259 261 Digital I/O Pendant I/O Analog I/O Serial and Disk I/O Basics Disk I/O Advanced Disk Operations Serial Line I/O DDCMP Communication Protocol Kermit Communication Protocol Creating Buttons Creating a Sl
Introduction Writing to the Pendant Display Detecting User Input Controlling the Pendant Auto-Starting Programs With the Pendant Programming Example: Pendant Menu Conveyor Tracking 285 286 287 295 299 301 305 Introduction to Conveyor Tracking 307 308 309 310 317 319 Installation Calibration Basic Programming Concepts Conveyor-Tracking Programming Sample Programs Multiprocessor Systems 321 Introduction Requirements for Motion Systems Installing Processor Boards Customizing Processor Workloads Using
Character Sets 357 (Undefined variable: Primary.Product_Name_V)Language User's Guide, version 17.
V+ Language User's Guide Introduction V+ Language User's Guide Introduction The following topics are described in this chapter: Introduction to the V+ Language User's Guide 12 Compatibility 12 Manual Overview 12 V+ Release Notes 13 Related Publications 13 Dangers, Warnings, Cautions, and Notes 14 Safety 15 Notations and Conventions 18 Output Control Commands 19 How Can I Get Help? 21 (Undefined variable: Primary.Product_Name_V)Language User's Guide, version 17.
Introduction to the V+ Language User's Guide Introduction to the V+ Language User's Guide V+ is a computer-based control system and programming language designed specifically for use with Adept Technology industrial robots, vision systems, and motion-control systems. As a real-time system, continuous trajectory computation by V+ permits complex motions to be executed quickly, with efficient use of system memory and reduction in overall system complexity.
V+ Release Notes l Requirements for the system terminal l Accessing external encoders Many V+ keywords are shown in abbreviated form in this user guide. See the V+ Language Reference Guide for complete details on all V+ keywords. V+ Release Notes For information on new features or enhanced keywords listed by V+ software release, select a link below: V+ 14.x Release Notes V+ 15.x Release Notes V+ 16.x Release Notes V+ 17.
Dangers, Warnings, Cautions, and Notes Manual Material Covered the optional AdeptSight vision system. AdeptVision User's Guide This manual describes concepts and strategies for programming the AdeptVision system. AdeptVision Reference Guide This manual provides descriptions of the keywords available with systems that include the optional AdeptVision system.
Safety DANGER: This indicates an imminently hazardous electrical situation which, if not avoided, will result in death or serious injury. DANGER: This indicates an imminently hazardous situation which, if not avoided, will result in death or serious injury. WARNING: This indicates a potentially hazardous electrical situation which, if not avoided, could result in serious injury or major damage to the equipment.
Safety Impacts and Trapping Points Adept recommends that you read the American National Standard for Industrial Robot Systems-Safety Requirements, published by the Robotic Industries Association in conjunction with the American National Standards Institute. The publication, ANSI/RIA R15.06-1986, contains guidelines for robot system installation, safeguarding, maintenance, testing, startup, and operator training.
Safety High Power Enable Light Manually Controlled Robots Adept robots can also be controlled manually when the white HIGH POWER enable light on the front of the controller is illuminated. When this light is lit, robot motion can be initiated from the terminal or the pendant (see Programming the MCP on page 263 or Programming the Adept T1 Pendant for more information). Before you enter the workspace, turn the keyswitch to manual mode and take the key with you.
Notations and Conventions Notations and Conventions This section describes various notations used throughout this manual and conventions observed by the V+ system. Keyboard Keys The system keyboard is the primary input device for controlling the V+ system. Graphicsbased systems use a PC-style keyboard and high-resolution graphics monitor. NOTE: The word terminal is used throughout this manual to refer either to a computer terminal or to the combination of a graphics monitor and a PC-style keyboard.
Output Control Commands Note that the commas preceding the number 300 must be present to correctly relate the number with a Z-direction change. Numeric Arguments All numbers in this manual are decimal unless otherwise noted. Binary numbers are shown as ^B, octal numbers as ^, and hexadecimal numbers as ^H. Several types of numeric arguments can appear in commands and instructions.
Output Control Commands The following special commands control output to the system terminal. For all these commands, which are called control characters, the control (Ctrl) key on the terminal is held down while a letter key is pressed. The letter key can be typed with or without the Shift key. Unlike other V+ commands, control characters do not need to be completed by pressing the Enter or Return key. Ctrl+C Aborts some commands (for example, DIRECTORY, LISTP, I/O).
How Can I Get Help? How Can I Get Help? For details on getting assistance with your Adept software or hardware, you can access the following information sources on the Adept corporate website: l For Contact information: http://www.adept.com/contact/americas l For Product Support information: http://www.adept.com/support/service-and-support/main l For user discussions, support, and programming examples: http://www.adept.com/forum/ l For further information about Adept Technology, Inc.: http://www.
Programming V+ Programming V+ The following topics are described in this chapter: Creating a Program 25 The SEE Editor Environments 27 Other V+ Programming Environments 30 Using the SEE Editor 31 V+ Program Types 33 Format of Programs 35 Executing Programs 37 Program Stacks 39 Flow of Program Execution 41 Subroutines 42 Scheduling of Program Execution Tasks 48 Default Task Configuration 55 (Undefined variable: Primary.Product_Name_V)Language User's Guide, version 17.
Programming V+ V+Language User's Guide, v17.
Creating a Program Creating a Program This section provides a brief overview of creating programs with the SEE editor. For complete details on the SEE editor and program debugger, see The SEE Editor and Debugger on page 61. NOTE: See the AdeptWindows User's Guide for instructions on using AdeptWindows PC. The editor is accessed from the system prompt with the command: SEE prog_name If prog_name is already resident in system memory, it is opened for editing.
Creating a Program lines of code in insert or replace mode. In insert mode, the characters you type are placed to the left of the cursor, and existing code is pushed to the right. In replace mode, the characters you enter replace the character that is under the cursor. Changing Editing Modes To enter command mode press the Edit (F11) key or Esc key.
The SEE Editor Environments The SEE Editor Environments The SEE editor displays on the monitor of older terminal-based systems, or in a "monitor" window within a PC graphics-based system (such as AdeptWindows). The majority of the functions are identical, regardless of the environment in which the SEE editor runs. Note that Adept DeskTop and Adept ACE provide enhanced program editors that include colorcoding, syntax help, and other features that are not available in the SEE editor.
The SEE Editor Environments The SEE Editor Window The SEE Editor Window The items in the following numbered list refer to the numbers in The SEE Editor Window. 1. On ASCII terminals, this area shows the row and column of the cursor location. 2. This line displays the program name and the program's parameter list.
The SEE Editor Environments With a graphics-based system, clicking with the pointer device sets the typing cursor at the pointer location. (The cursor cannot be set lower than the last line in a program.) Also, the scroll bars on the monitor window can be used to scroll through the program. 4. Shows the name of the program currently being edited. If the program is open in read-only mode, /R is appended to the name.1 5.
Other V+ Programming Environments Other V+ Programming Environments In addition to the SEE editor, which was introduced in the previous section, this section describes other programming environments that can be used to create V+ programs. AdeptWindows The SEE editor displays on a "monitor" window within the AdeptWindows PC application program. For details, see the AdeptWindows User's Guide. Adept ACE The Adept ACE Program Editor is an online, interactive editor for V+ and MicroV+ programs.
Using the SEE Editor Using the SEE Editor The following sections give a brief overview on using the SEE editor. For more details, see The SEE Editor and Debugger on page 61. Entering New Lines of Code Once you have opened the editor and moved to insert or replace mode, you can begin entering lines of code. Each complete line of code needs to be terminated with a carriage return.
Using the SEE Editor 1. Put the editor in command mode. 2. Enter the number of lines to discard and press Esc and then k. Saving a Program When you exit the SEE editor, changes to the program you were working on are saved only in system memory. To permanently save a program to disk, use one of the STORE commands described in the V+ Operating System Reference Guide. V+Language User's Guide, v17.
V+ Program Types V+ Program Types There are two types of V+ programs: l Executable Programs l Command Programs Executable programs are described in this section. Command programs are similar to MSDOS batch programs or UNIX scripts, and they are described in the V+ Operating System User's Guide. Executable Programs There are two classes of executable programs: robot control programs and general programs.
V+ Program Types and you want to execute task #0, you must follow this sequence of events: l Start task #0. l Have task #0 DETACH the robot. l l Start the task that will control the robot. (The program executing as task #0 can start up another task.) Have that task ATTACH the robot. For more information on the ATTACH and DETACH instructions, see Creating Windows on page 245. l Note that robots are attached even in DRY.RUN mode.
Format of Programs Format of Programs This section presents the format that V+ programs must follow. The format of the individual lines is described, followed by the overall organization of programs. This information applies to all programs regardless of their type or intended use. Program Lines Each line or step of a program is interpreted by the V+ system as a program instruction.
Format of Programs The example programs in this manual, and the utility programs provided by Adept with your system, provide examples of programming format and style. Notice that Adept programs contain numerous comments and blank lines. When program lines are entered, extra spaces can be entered between any elements in the line. The V+ editors add or delete spaces in program lines to make them conform with the standard spacing.
Executing Programs Executing Programs When V+ is actively following the instructions in a program, it is said to be executing that program. The standard V+ system provides for simultaneous execution of up to seven different programs-for example, a robot control program and up to six additional programs. The optional V+ extensions software provides for simultaneous execution of up to 28 programs. Execution of each program is administered as a separate program task by the system.
Executing Programs instruction at a time. For information on the V+ program debugger, see The Program Debugger on page 85.) Execution of program tasks other than #0 is generally the same as for task #0. The following points highlight the differences: l l l The task number must be explicitly included in all the monitor commands and program instructions that affect program execution, including EXECUTE, ABORT, PROCEED, RETRY, SSTEP, and XSTEP.
Program Stacks Program Stacks When subroutine calls are made, V+ uses aV+n internal storage area called a stack to save information required by the executing program. This information includes: l The name and step number of the calling program. l Data necessary to access subroutine arguments. l The values of any automatic variables specified in the called program. The V+ system allows you to explicitly allocate storage to the stack for each program task.
Program Stacks Stack Space Required by a Subroutine Bytes Required For Notes 20 The actual subroutine call 32 Each subroutine argument (plus one of the following): 4 Each real subroutine argument or automatic variable 1 8 Each double-precision real subroutine argument or automatic variable 1 48 Each transformation subroutine argument or automatic variable 1, 2 varies Each precision-point subroutine argument or automatic variable 1, 2, 3 84 Each belt variable argument or automatic variab
Flow of Program Execution Flow of Program Execution Program instructions are normally executed sequentially from the beginning of a program to its end. This sequential flow may be changed when a GOTO or IF...GOTO instruction, or a control structure, is encountered.
Subroutines Subroutines There are three methods of exchanging information between programs: l global variables l soft-signals l program argument list When using global variables, simply use the same variable names in the different programs. Unless used carefully, this method can make program execution unpredictable and hard to debug. It also makes it difficult to write generalized subroutines because the variable names in the main program and subroutine must always be the same.
Subroutines Argument Mapping When the main program reaches the CALL instruction shown at the top of the figure, the subroutine a_routine is called and the argument list is passed as shown. See the description of the CALL instruction in the V+ Language Reference Guide for additional details on passing arrays. Argument Passing by Value or Reference An important principle to grasp in using subroutine calls is the way that the passed variables are affected.
Subroutines program. Any argument that is to be changed by a subroutine and passed back to the calling routine must be specified as a variable (not an expression or value). In addition to passing variables whose value you want changed, you will also pass variables that are required for the subroutine to perform its task but whose value you do not want changed after the subroutine completes execution. Pass these variables by value.
Subroutines Call by Value Values, as well as variables, can be passed by a CALL statement. The instruction: CALL a_routine(loc_1, 17.5, 121, "some string") is an acceptable call to a_routine. Undefined Arguments If the calling program omits an argument, either by leaving a blank in the argument list (e.g., arg_1, , arg_3) or by omitting arguments at the end of a list (e.g., arg_1, arg_2), the argument are passed as undefined.
Subroutines Recursive Programs Recursive programs are subroutines that call themselves, either directly or indirectly. A direct call occurs when a program actually calls itself, which is useful for some special programming situations. Indirect calls are more common. They occur when program A calls program B, which eventually leads to another call to program A before program B returns.
Subroutines from interrupting it. When a RETURN instruction is executed in the reaction program, the main program priority is automatically reset to the level it had before the reaction subroutine was called. For further information on reactions and program priority, see the following keywords: LOCK, PRIORITY, REACT, and REACTI in the V+ Language Reference Guide.
Scheduling of Program Execution Tasks Scheduling of Program Execution Tasks The V+ system appears to execute all the program tasks at the same time. However, this is actually achieved by rapidly switching between the tasks many times each second, with each task receiving a fraction of the total time available. This is referred to as concurrent execution. The following sections describe how execution time is divided among the different tasks.
Scheduling of Program Execution Tasks Task Scheduling Tasks are scheduled to run with a specified priority in one or more time slices. Tasks may have priorities from -1 to 64, and the priorities may be different in each time slice. The priority meanings are: -1 Do not run in this slice even if no other task is ready to run. 0 Do not run in this slice unless no other task from this slice is ready to run. 1 - 64 Run in this slice according to specified priority.
Scheduling of Program Execution Tasks Slice 1: Task A priority 10, Task B priority 10 Slice 5: Task B priority 15, Task C priority 15 All three tasks, A, B, and C, are in the same round-robin group because task B appears in both. Therefore, task C may run in slice 1 at priority 10, or task A may run in slice 5 at priority 15, depending on which member of the group ran most recently.
Scheduling of Program Execution Tasks motion systems the servo task is generally the most likely to interrupt and is the most time consuming system task.) (Undefined variable: Primary.Product_Name_V)Language User's Guide, version 17.
Scheduling of Program Execution Tasks V+Language User's Guide, v17.
Scheduling of Program Execution Tasks Task Scheduler Execution Priority Example The following example shows how the task priority scheme works.
Scheduling of Program Execution Tasks Priority Example 1 V+Language User's Guide, v17.
Default Task Configuration Default Task Configuration CAUTION: Operation of the V+ system can be adversely affected by incorrect settings of task priorities. Change the default configuration only if you have a good understanding of V+ task scheduling. For details, see Scheduling of Program Execution Tasks on page 48.
Default Task Configuration Task Function Disk Driver Handle requests for I/O to the hard and floppy disk drives and the Compact Flash Serial I/O Service serial I/O ports Pipes Driver Allow a V+ task to service I/O requests like a standard I/O driver NFS Driver Allow access of remote files on network file servers using the Network File Services protocol TCP Driver Handle the TCP network communications protocol on Ethernet Vision Communications Communicate between V+ and vision software Vision
Default Task Configuration System Task Time Slice 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 Monitor 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 56 DDCMP 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 42 Kermit 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 52 Pendant 0 0 0 0 0 0 0 0 0 0 0 0 0 0 50 0 Disk Driver 0 0 0 0 0 0 0 0 0 0 0 0 0 0 39 48 Serial I/O 0 0 0 0 0 0 0 0 0 0 0 0 0 0 44 44 Pipes Driver 0 0 0 0 0 0 0 0 0 0 0 0 0
Default Task Configuration System Task Time Slice 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 Servo Comm 0 0 0 0 0 0 0 0 0 0 0 0 0 0 41 0 Cat 3 Timer 0 45 0 45 0 45 0 45 0 45 0 45 0 45 0 0 User Task Configuration The remaining time is allocated to the user tasks using the controller configuration utility. For details, see the description of CONFIG_C in the Instructions for Adept Utility Programs.
Default Task Configuration User Task Slice 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 6 0 0 0 0 0 0 0 0 0 0 0 0 0 0 15 0 727 0 0 0 0 0 0 0 0 0 0 0 0 0 5 0 0 1The frequency at which the servo tasks interrupts the major cycle is set with the controller configuration utility, CONFIG_C. (Undefined variable: Primary.Product_Name_V)Language User's Guide, version 17.
The SEE Editor and Debugger The SEE Editor and Debugger The following topics are described in this chapter: Basic SEE Editor Operations 63 Sample Editing Session 81 The Program Debugger 85 (Undefined variable: Primary.Product_Name_V)Language User's Guide, version 17.
The SEE Editor and Debugger V+Language User's Guide, v17.
Basic SEE Editor Operations Basic SEE Editor Operations The SEE editor was introduced in the previous chapter. It is described in more detail in this chapter. The following notation is used in the tables in this section: l The control key is indicated by Ctrl+, the alternate key is indicated by Alt+, and the Shift key is indicated by S+. When using the shift, alternate, and control keys, they should be pressed at the same time as the following key.
Basic SEE Editor Operations Cursor Key Without Ctrl Key Home Top of program Page Up Up 1 screen Page Down Down 1 screen End End of program With Ctrl Key Cursor Movement Keys with an AdeptWindows Keyboard Cursor Key Without Ctrl Key Up Arrow Up 1 line Up 1/4 page Down Arrow Down 1 line Down 1/4 page Right Arrow Right 1 character Right 1 item Left Arrow Left 1 character Left 1 item Home Top of program Page Up Up 1 screen Page Down Down 1 screen End End of program With Ctrl Ke
Basic SEE Editor Operations right. Clicking in a scroll bar displays the corresponding section of the program (e.g., clicking in the middle of the scroll bar displays the middle section of the program). Dragging a scroll handle moves the program up or down, or left or right.
Basic SEE Editor Operations Paste (F10) Paste the most recently copied line above the current line. You cannot exit SEE with lines in the attach buffer. (Ctrl+K will remove lines from the copy buffer without pasting them into a program.) Lines cannot be pasted in read-only mode. Paste All (S+F10) Paste the entire copy buffer above the current line. Cut (S+F9) Cut the current line and place it in the copy buffer. Ctrl+Delete Delete the current program line and do not place it in the copy buffer.
Basic SEE Editor Operations NOTE:Press the space bar to abort a search. The latest search and replacement strings are retained between edit sessions. Switching Programs in the Editor The following function keys switch from editing one program to editing another program. (The internal program list mentioned below is described in the next section.) The SEE Editor Function Key Description Key(s) Action New (F2) The editor prompts for the name of the new program to edit.
Basic SEE Editor Operations Key(s) Action accessed, the program opened is the one that called the previous program accessed from the stack. Prog_Down {S} Ctrl+End {A} Changes to editing a program contained on the task execution stack being accessed by the editor. When the new program is opened, its name is added to the internal program list maintained by the editor.
Basic SEE Editor Operations since the last edit session, the program list is not changed and the program at the top of the list (the last program edited) is opened. l l l l l l If no program name is specified and a program task has stopped executing since the last edit session, that program is added to the top of the program list and is displayed for editing. When a SEE program instruction is executed, a temporary program list is created for that editing session.
Basic SEE Editor Operations NOTE: You may occasionally encounter lines that are too long for SEE to process. (Such lines can be created with an editor on another computer, or they may result from a line becoming further indented because of new surrounding control structures.) Any attempt to move the cursor to such a line will result in the message *Line too long*, and the cursor will automatically move to the next line. (The { command [and others] can be used to move the cursor above a long line.
Basic SEE Editor Operations The SEE Editor in Command Mode In addition to the key lists in the preceding tables, the key strokes listed in the following table moves the cursor when the editor is in command mode.
Basic SEE Editor Operations Key Action L Move to line Space Right one character Esc Space Tab Right to next item Back Space Left one character Esc Back Space Esc Tab Left to previous item Return Go to start of next line Esc Return Close line and go to column 1 , (comma) Go to beginning of line . (period) Go to end of line J Jump to column S Skip to character ; Skip to semicolon V+Language User's Guide, v17.
Basic SEE Editor Operations The following table lists the actions that keystrokes perform when the editor is in Command mode. The characters in the column labeled Char. Codes are defined as follows: M The command changes edit mode from Command mode to either Insert mode or Replace mode as indicated in the table. (M) The command changes the mode as indicated only until the next character is typed, and then the editor returns to Command mode.
Basic SEE Editor Operations Keystroke (s) Char.
Basic SEE Editor Operations Keystroke (s) Char.
Basic SEE Editor Operations Keystroke (s) Char.
Basic SEE Editor Operations Keystroke (s) Char. Codes Function (whichever was last) M Memorize current line and column R -M Return to memorized position R V Refresh the full display R X Initiate extended command (see below) R XDEBUG Change to debugger monitor mode R Command Mode Copy Buffer In command mode, a special 25-line copy buffer is maintained.
Basic SEE Editor Operations The command name can be abbreviated to the shortest length that uniquely identifies the command. After the command name (or abbreviation) is entered, press ↵ to indicate the end of the name. As indicated below, some commands display a message on the editor command line. Some of the commands prompt for additional input. All of the following commands can be used when viewing a program in read-only mode. Most of the commands close the current line. AUTO.
Basic SEE Editor Operations WHERE Displays the current cursor column number. (The current cursor line number is always displayed on the information line at the bottom of the edit window.) NOTE: The settings controlled by the extended commands are all retained between editing sessions initiated with the SEE monitor command. When the SEE program instruction is used to initiate program editing, all the settings controlled by the extended commands are set to the initial settings described below.
Basic SEE Editor Operations Key(s) Action Esc Y Define the Y macro. Y Process the Y macro. 0Y Display the current definition of the Y macro. NOTE:Macro definitions are retained between editor sessions initiated with the SEE monitor command (but not between sessions initiated with the SEE program instruction). 1The program list is cleared when the ZERO monitor command is processed. V+Language User's Guide, v17.
Sample Editing Session Sample Editing Session The following steps will create a sample V+ program and subroutine, give an example of parameter passing, and create a disk file of the sample programs. for a correct programming flow chart, see the figure Programming Flow Chart on page 83. 1. With the controller running, make sure there are no other programs in memory by entering the command:1 ZERO 2. The system asks for verification that you want to delete all programs from memory.
Sample Editing Session EXECUTE/c sample 13. The program greets you, asks for your name, and prints the response on the screen. A message is then displayed indicating that the program is completed. 14. If all works correctly, create a program library using the MODULE command. MODULE sampfile = sample, get_response 15. Save your programs to a disk file by entering the commands: STOREM sampfile.
Sample Editing Session Programming Flow Chart 1Memory does not have to be cleared. However, it will make this example simpler. (Undefined variable: Primary.Product_Name_V)Language User's Guide, version 17.
Sample Editing Session 2There is no difference between a subroutine and a program. V+Language User's Guide, v17.
The Program Debugger The Program Debugger V+ systems include a program debugger for interactively executing and modifying application programs. With the debugger, a program can be executed one step at a time (or in larger, user-controlled segments) while the program instructions and the program output are simultaneously displayed in two separate sections of the monitor window. NOTE:The program debugger cannot access protected programs.
The Program Debugger l l From the command line with the DEBUG monitor command (see the V+ Operating System Reference Guide for information on monitor commands). From the SEE editor with the Debug (S+F11) key or the DEBUG extended command. (The function keys and the SEE editor extended commands are described in The SEE Editor in Command Mode.) NOTE:The program debugger cannot be invoked from the SEE editor when the editor has been initiated with the SEE program instruction.
The Program Debugger editor access mode. If the name is omitted, the program primed for the task or the last program executed by the task is selected. An error results if the named program does not exist, and the DEBUG request is aborted. When the specified program is opened for (read-only) editing, its name is added at the top of the SEE editor internal program list. step An optional parameter that allows you to open a program at the step number specified. DEBUG without any parameters is useful when: 1.
The Program Debugger The Debugger Display Once the program debugger has been invoked, the display looks similar to that shown in the following figure. NOTE:The sample shown below represents the display that appears on graphics-based monitor. Example Program Debugger Display (The following numbers refer to the previous figure.) 1 The execution pointer-indicates the next step in the program that is executed.
The Program Debugger 3 The typing cursor. In monitor mode, the cursor appears in the debug window, and debug and monitor commands can be entered. Responses to program prompts appear here. Commands appear below the debug information line. 4 Shows which task the debug session is running in. 5 Shows the debug mode. In monitor mode, debug and other monitor commands can be entered, and the program can be executed.
The Program Debugger l Editor mode As its name indicates, this mode enables full editing access to the program in the editor window. All the features of the SEE editor can be used in this mode. NOTE:Programs that have been loaded from disk files with the read-only attribute cannot be accessed in editor read-write mode. Use the Edit (F11)and Debug (S+F11) keys (or Ctrl+E) to change modes. Debugging Programs The basic strategy for debugging a program is: 1.
The Program Debugger PROMPT instruction, everything you type before pressing ↵is received by the program. Thus, you cannot issue any debugger commands at such times. Positioning the Typing Cursor The typing cursor is positioned in the debug window when: l l The program debugger is initiated. Task execution is initiated or terminated (in the latter case, the edit window will be moved as required to include the execution pointer). l The Redraw (S+F6) or Undo (F6) key is pressed in debug monitor mode.
The Program Debugger (S+F5) NOTE:This command cannot be used while the editor is in read-write access mode. You can use the READONLY or RO extended command to select read-only mode (see SEE Editor Extended Commands for details). As with Display (F5), the typing cursor is used to point to the variable of interest. Pressing Teach (S+F5) causes the current value of the variable to be displayed in the debug window and a prompt for a new value to be assigned to the variable.
The Program Debugger NOTE: All the commands described below (except Ctrl+E) require debug monitor mode for their use. Be careful not to enter Ctrl+O or Ctrl+S while using the debugger. These control characters disable output to the terminal until a second Ctrl+O or a Ctrl+Q is input. Debugger Commands Key(s) Ctrl+B Action Set a breakpoint at the step indicated by the typing cursor (also see Ctrl+N below). (The use of breakpoints is described in Program Breakpoints.
The Program Debugger Key(s) Ctrl+X Action Perform an XSTEP command for the current task from the current position of the execution pointer. This command is equivalent to the following system monitor command: XSTEP debug_task Ctrl+Z Perform an SSTEP command for the current task from the current position of the execution pointer.
The Program Debugger NOTE: You cannot single-step into a subroutine that was loaded from a protected disk file. Thus, you must use Ctrl+Z to step across any CALL of such a routine. NOTE: The execution pointer (->) is not displayed while the system is executing an instruction. Do not type a Ctrl+X or Ctrl+Z until the execution pointer reappears. PAUSE Instructions Debug editor mode can be used to insert PAUSE instructions in the program at strategic points. Execution pauses when those points are reached.
The Program Debugger When program execution stops at a breakpoint, you can use the debugger Ctrl+N command to cancel the breakpoint at the instruction, or you can leave the breakpoint set. In either case, you can type Ctrl+P when you are ready to have program execution resume. NOTE: A BPT command with no parameters clears the breakpoints in all the programs in the system memory (except those programs that are executing).
Data Types and Operators Data Types and Operators The following topics are described in this chapter: Introduction 99 String Data Type 100 Real and Integer Data Types 102 Location Data Types 104 Arrays 105 Variable Classes 107 Operators 111 String Operator 115 Order of Evaluation 116 (Undefined variable: Primary.Product_Name_V)Language User's Guide, version 17.
Data Types and Operators V+Language User's Guide, v17.
Introduction Introduction This chapter describes the data typesV+ used by V+. Dynamic Data Typing and Allocation V+ does not require you to declare variables or their data types. The first use of a variable determines its data type and allocates spaV+ce for that variable. You can create variables and assign them a type as needed. The program instruction: real_var = 13.65 creates the variable real_var as a real variable and assigns it the value 13.
String Data Type String Data Type Variable names are preceded with a dollar ($) sign to indicate that they contain string data.1 The program instruction: $string_name = "Adept V+" allocates the string variable string_name (if it had not previously been allocated) and assigns it the value Adept V+. Numbers can be used as strings with a program instruction such as: $numeric_string = "13.5" where numeric _string is assigned the value 13.5. The program instruction: $numeric_string = 13.
String Data Type Note that the ASCII value '1 (decimal value 49) is not the same as the integer value 1 (decimal value 1.0). Also, it is not the same as the string value "1". Functions That Operate on String Data For a summary of V+ functions that operate on string data, see the section String-Related Functions on page 144. 1The dollar sign is not considered in the character count of the variable name. (Undefined variable: Primary.Product_Name_V)Language User's Guide, version 17.
Real and Integer Data Types Real and Integer Data Types Numbers that have a whole number and a fractional part (or mantissa and exponent if the value is expressed in scientific notation) belong to the data type real. Numeric values having only a whole number belong to the data type integer. In general, V+ does not require you to differentiate between these two data types. If an integer is required and you supply a real, V+ promotes the real to an integer by rounding (not truncation).
Real and Integer Data Types Numeric Expressions In almost all situations where a numeric value of a variable can be used, a numeric expression can also be used. The following examples all result in x having the same value. x x x x x = = = = = 3 6/2 SQRT(9) SQR(2) - 1 9 MOD 6 Logical Expressions V+ does not have a specific logical (Boolean) data type. Any numeric value, variable, or expression can be used as a logical data type. V+ considers 0 to be false and any other value to be true.
Location Data Types Location Data Types This section gives a brief explanation of location data. Motion Control Operations on page 163 covers locations and their use in detail. Transformations A data type particular to V+ is the transformation data type. This data type is a collection of several values that uniquely identify a location in Cartesian space. The creation and modification of location variables are discussed in Motion Control Operations on page 163.
Arrays Arrays V+ supports arrays of up to three dimensions. Any V+ data type can be stored in an array. Like simple variables, array allocation (and typing) is dynamic. Unless they are declared to be AUTOmatic, array sizes do not have to be declared. For example: array.one[2] = 36 allocates space for a one-dimensional array named array.one and places the value 36 in element two of the array. (The numbers inside the brackets ([ ]) are referred to as indices.
Arrays Method 1 If there is a known reasonable upper-bound on the array dimensions, define (by assigning an arbitrary value to it) the highest element of the array. For multi-dimensional arrays, assign the highest element of each possible sub-array. This assignment prevents the arrays from extending. Method 2 Use the TAS function to interlock access to the array. In this case, access to the array is handled exclusively from one or two subroutines that include the TAS to control access to the array.
Variable Classes Variable Classes In addition to having a data type, variables belong to one of three classes, GLOBAL, LOCAL, or AUTOMATIC. These classes determine how a variable can be altered by different calling instances of a program. Global Variables This is the default class. Unless a variable has been specifically declared to be LOCAL or AUTO, a newly created variable is considered global.
Variable Classes Automatic variables are more like the local variables of other high-level languages. If you are writing programs using a recursive algorithm, you will most likely want to use variables in the automatic class. Scope of Variables The scope of a variable refers to the range of programs that can see that variable. The following figureshows the scope of the different variable classes.
Variable Classes programs not having a LOCAL or AUTO b. l l prog_3 declares an AUTO a and cannot use GLOBAL a. After prog_3 completes, the value of AUTO a is deleted. prog_4 declares a LOCAL a and, therefore, cannot use GLOBAL a. Unlike the AUTO a in prog_3, however, the value of LOCAL a is stored and is available for any future CALLs to prog_4. Variable Scope Example (Undefined variable: Primary.Product_Name_V)Language User's Guide, version 17.
Variable Classes Variable Initialization Before a variable can be used it must be initialized. String and numeric variables can be initialized by placing them on the left side of an assignment statement. The statements: var_one = 36 $var_two = "two" initializes the variables var_one and $var_two. var_one = var_two initializes var_one if var_two has already been initialized. Otherwise, an undefined value error is returned.
Operators Operators The following sections discuss the valid operators. Assignment Operator The equal sign (=) is used to assign a value to a numeric or string variable. The variable being assigned a value must appear by itself on the left side of the equal sign. The right side of the equal sign can contain any variable or value of the same data type as the left side, or any expression that resolves to the same data type as the left side.
Operators Relational Operators Symbol Function == equal to < less than > greater than <= or =< less than or equal to >= or => greater than or equal to <> not equal to If x has a value of 6 and y has a value of 10, the following Boolean expressions resolve to -1 (true): x < y y >= x y <> x and these expressions resolve to 0 (false): x > y x <> 6 x == y Note the difference between the assignment operator = and the relational operator ==: z = x == y In this example, z is assigned a value of 0
Operators or value; makes a true expression or value false and vice versa. AND Both expressions must be true before the entire expression is true. OR Either expression must be true before the entire expression is true. XOR One expression must be true and one must be false before the entire expression is true.
Operators COM This operator works on only one number. Each bit is complemented: 1s become 0s and 0s become 1s. Examples: x = ^B1001001 BAND ^B1110011 results in x having a value of ^B1000001. x = COM ^B100001 results in x having a value of ^B11110. V+Language User's Guide, v17.
String Operator String Operator Strings can be concatenated (joined) using the plus sign. For example: $name = "Adept " $incorp = ", Inc." $coname = $name + "Technology" + $incorp results in the variable $coname having the value "Adept Technology, Inc". (Undefined variable: Primary.Product_Name_V)Language User's Guide, version 17.
Order of Evaluation Order of Evaluation Expressions containing more than one operator are not evaluated in a simple left to right manner. The following table lists the order in which operators are evaluated. Within an expression, functions are evaluated first, with expressions within the function evaluated according to the table. The order of evaluation can be changed using parentheses.
Program Control Program Control The following topics are described in this chapter: Introduction 119 Unconditional Branch Instructions 120 Program Interrupt Instructions 122 Logical (Boolean) Expressions 128 Conditional Branching Instructions 129 Looping Structures 132 Summary of Program Control Keywords 136 Controlling Programs in Multiple CPU Systems 139 (Undefined variable: Primary.Product_Name_V)Language User's Guide, version 17.
Program Control V+Language User's Guide, v17.
Introduction Introduction This chapter introduces the structures available in V+ to control program execution. These structures include the looping and branching instructions common to most high-level languages as well as some instructions specific to V+. (Undefined variable: Primary.Product_Name_V)Language User's Guide, version 17.
Unconditional Branch Instructions Unconditional Branch Instructions There are three unconditional branching instructions in V+: l GOTO l CALL l CALLS GOTO The GOTO instruction causes program execution to branch immediately to a program label instruction somewhere else in the program. The syntax for GOTO is: GOTO label label is an integer entered at the beginning of a line of program code.
Unconditional Branch Instructions arg_list is the list of arguments being passed to the subroutine. These arguments can be passed either by value or by reference and must agree with the arguments expected by the program being called. Subroutines and argument lists are described in "Subroutines." The code: 48 49 50 . CALL check_data(locx, locy, length) .
Program Interrupt Instructions Program Interrupt Instructions V+ provides several ways of suspending or terminating program execution. A program can be put on hold until a specific condition becomes TRUE using the WAIT instruction. A program can be put on hold for a specified time period or until an event is generated in another task by the WAIT.EVENT instruction. A program can be interrupted based on a state transition of a digital input signal with the REACT and REACTI instructions.
Program Interrupt Instructions if) a transition is detected, the program suspends execution at the currently executing step. REACT and REACTI suspend execution of the current program and call a specified subroutine. Additionally, REACTI issues a BRAKE instruction to immediately stop the current robot motion. Both instructions specify a subroutine to be run when the digital transition is detected.
Program Interrupt Instructions If signal 1001 transitions during execution of step 43, step 43 completes, the subroutine alarm is called, and execution resumes at step 44. If signal 1001 transitions during execution of step 47, steps 47, 48, and 49 completes (since the program had been given a higher priority than REACT), the subroutine alarm is called, and execution resumes at step 50.
Program Interrupt Instructions Additional Program Interrupt Instructions You can specify a parameter in the instruction line for the I/O instructions ATTACH, READ, GETC, and WRITE that causes the program to suspend until the I/O request has been successfully completed. Third-party boards may also generate system level interrupts. For details, see the descriptions of INT.EVENT, CLEAR.EVENT and WAIT.EVENT in Summary of Program Control Keywords on page 136.
Program Interrupt Instructions major cycle. 8. The signal 1010 transition is detected, and the task 2 reaction is triggered. However, since the reaction is at level 5 and the current program priority is 10, the reaction execution is deferred. 9. Task 2 prog_b issues a LOCK 0 instruction to lower its program priority to level 0. Since a level 5 reaction program is pending, it begins execution immediately and sets the program priority to 5. 10. Signal 1003 is asserted externally.
Program Interrupt Instructions Priority Example 2 1The LOCK instruction can be used to control execution of a program after a REACT or REACTI subroutine has completed. (Undefined variable: Primary.Product_Name_V)Language User's Guide, version 17.
Logical (Boolean) Expressions Logical (Boolean) Expressions The next two sections discuss program control structures whose execution depends on an expression or variable that takes on a Boolean value (a variable that is either true or false, or an expression that resolves to true or false). An expression can take into account any number of variables or digital input signals as long as the final resolution of the expression is a Boolean value.
Conditional Branching Instructions Conditional Branching Instructions Conditional branching instructions allow you to execute blocks of code based on the current values of program variables or expressions. V+ has three conditional branch instructions: l IF...GOTO l IF...THEN...ELSE l CASE value OF IF...GOTO IF...GOTO behaves similarly to GOTO, but a condition can be attached to the branch.
Conditional Branching Instructions 32 33 34 35 36 37 38 39 40 41 42 43 44 . ; If I/O signal 1033 is on and Boolean "need_part" is ; true, then pick up the part ; else alert the operator. IF SIG(1033) AND need_part THEN MOVE loc1 CLOSEI DEPART 50 ELSE TYPE "Part not picked up." END . CASE value OF The IF...THEN...ELSE structure allows a program to take one of two different actions. The CASE structure will allow a program to take one of many different actions based on the value of a variable.
Conditional Branching Instructions 80 81 82 83 PROMPT "Entry must be from 1 to 3", select GOTO 50 END . If the above code is rewritten without an ANY statement, and a value other than 1, 2, or 3 is entered, the program continues to execute at step 83 without executing any program. (Undefined variable: Primary.Product_Name_V)Language User's Guide, version 17.
Looping Structures Looping Structures In many cases, you will want the program to execute a block of code more than once. V+ has three looping structures that allow you to execute blocks of code a variable number of times. The three instructions are: l FOR l DO...UNTIL l WHILE...DO FOR A FOR instruction creates an execution loop that will execute a given block of code a specified number of times. The basic form of a FOR loop is: FOR index = start_val TO end_val STEP incr . code block .
Looping Structures 110 111 112 TYPE " ", /C1 END . A FOR loop can be made to count backward by entering a negative value for the step increment. 13 14 15 16 17 18 19 . ; Count backward from 10 to 1 FOR i = 10 TO 1 STEP -1 TYPE i END . Changing the value of index inside a FOR loop will cause the loop to behave improperly. To avoid problems with the index, make the index variable an auto variable and do not change the index from inside the FOR loop.
Looping Structures 46 47 48 49 50 51 52 53 x = 1 DO PROMPT "Enter a character: ", $ans TYPE $ans x = x + 1 UNTIL (x > 15) OR ($ans == "#") . In this code, either x reaching 15 or # being entered at the PROMPT instruction terminates the loop. As long as the operator enters enough characters, the loop terminates. WHILE...DO WHILE...DO is a looping structure similar to DO...UNTIL except the Boolean expression is evaluated at the beginning of the loop instead of at the end.
Looping Structures 67 68 69 70 71 72 73 ; 1033 to turn "on" WHILE NOT SIG(1033) DO ;Wait for signal END . (Undefined variable: Primary.Product_Name_V)Language User's Guide, version 17.
Summary of Program Control Keywords Summary of Program Control Keywords The following table summarizes the program control instructions. See the V+ Language Reference Guide for details on these commands. Program Control Operations Keyword Type Function ABORT Program Instruction Terminate execution of a control program. CALL Program Instruction Suspend execution of the current program and continue execution with a new program (that is, a subroutine).
Summary of Program Control Keywords Keyword Type Function Function GOTO Program Instruction Perform an unconditional branch to the program step identified by the given label. HALT Program Instruction Stop program execution and do not allow the program to be resumed. IF...GOTO Program Instruction Branch to the specified label if the value of a logical expression is TRUE (nonzero). IF...
Summary of Program Control Keywords Keyword Type Function Instruction RETURN Program Instruction Terminate execution of the current subroutine and resume execution of the last-suspended program at the step following the CALL or CALLS instruction that caused the subroutine to be invoked. RETURNE Program Instruction Terminate execution of an error reaction subroutine and resume execution of the last-suspended program at the step following the instruction that caused the subroutine to be invoked.
Controlling Programs in Multiple CPU Systems Controlling Programs in Multiple CPU Systems V+ systems equipped with multiple CPUs and optional V+ Extensions can run multiple copies of V+. Keep the following considerations in mind when running multiple V+ systems: l l l l l l l A graphics-based system is required. The second, third, etc., V+ copies are displayed in separate windows on the monitor. These windows are labeled Monitor_2, Monitor_3, etc.
Functions Functions The following topics are described in this chapter: Using Functions 143 String-Related Functions 144 Location, Motion, and External Encoder Functions 146 Numeric Value Functions 147 Logical Functions 149 System Control Functions 150 (Undefined variable: Primary.Product_Name_V)Language User's Guide, version 17.
Functions V+Language User's Guide, v17.
Using Functions Using Functions V+ provides you with a wide variety of predefined functions for performing string, mathematical, and general system parameter manipulation. In most cases, you must provide the data that is input to a function. The function then returns a value based on a specific operation on that data. Functions can be used anywhere a value or expression would be used.
String-Related Functions String-Related Functions The value returned from a string function may be another string or a numeric value. String-Related Functions Keyword Function ASC Return a single character value from within a string. $CHR Return a one-character string having a given value. DBLB Return the value of eight bytes of a string interpreted as an IEEE double-precision floating-point number.
String-Related Functions Keyword Function POS Return the starting character position of a substring in a string. $TRANSB Return a 48-byte string containing the binary representation of a transformation value. $TRUNCATE Return all characters in the input string until an ASCII NUL (or the end of the string) is encountered. $UNPACK Return a substring from an array of 128-character string variables. VAL Return the real value represented by the characters in the input string.
Location, Motion, and External Encoder Functions Location, Motion, and External Encoder Functions V+ provides numerous functions for manipulating and converting location variables. See Motion Control Operations for details on motion processing and a table that includes all location-related functions. For details on the external encoders, see Reading Device Data on page 354.
Numeric Value Functions Numeric Value Functions The functions listed in the following table provide trigonometric, statistical, and data type conversion operations. For additional details on arithmetic processing, see Data Types and Operators on page 97. Numeric Value Functions Keyword Function ABS Return absolute value. ATAN2 Return the size of the angle (in degrees) that has its trigonometric tangent equal to value_1/value_2. BCD Convert a real value to Binary Coded Decimal (BCD) format.
Numeric Value Functions Examples of Arithmetic Functions The instructions: $a = "16" x = SQRT(VAL($a)) results in x having a value of 4. The instruction: x = INT(RANDOM*10) creates a pseudorandom number between 0 and 10. V+Language User's Guide, v17.
Logical Functions Logical Functions The following table lists the functions that return Boolean values. These functions require no arguments and essentially operate as system constants. Logical Functions Keyword Function FALSE Return the value used by V+ to represent a logical false result. OFF Return the value used by V+ to represent a logical false result. ON Return the value used by V+ to represent a logical true result. TRUE Return the value used by V+ to represent a logical true result.
System Control Functions System Control Functions The functions listed in the following table return information about the system and system parameters. System Control Functions Keyword Function CAS This function compares a real variable to a test value, and conditionally sets a new value as one indivisible operation. DEFINED Determine whether a variable has been defined. ERROR Return the error number of a recent error that caused program execution to stop or caused a REACTE reaction.
System Control Functions Keyword Function can modify the variable at the same time. TASK Return information about a program execution task. TIME Return an integer value representing either the date or the time specified in the given string parameter. $TIME Return a string value containing either the current system date and time or the specified date and time. TIMER Return the current time value of the specified system timer.
Switches and Parameters Switches and Parameters The following topics are described in this chapter: Introduction 155 Parameters 156 Switches 159 (Undefined variable: Primary.Product_Name_V)Language User's Guide, version 17.
Switches and Parameters V+Language User's Guide, v17.
Introduction Introduction System parameters determine certain operating characteristics of the V+ system. These parameters have numeric values that can be changed from the command line or from within a program to suit particular system configurations and needs. The various parameters are described in this chapter along with the operations for displaying and changing their values. System switches are similar to system parameters in that they control the operating behavior of the V+ system.
Parameters Parameters See the V+ Language Reference Guide for more detailed descriptions of the keywords discussed here. Whenever a system parameter name is used, it can be abbreviated to the minimum length required to identify the parameter. For example, the HAND.TIME parameter can be abbreviated to H, since no other parameter name begins with H.
Parameters Summary of Basic System Parameters System parameters are set to defaults when the V+ system is initialized. The default values are indicated with each parameter description below. The settings of the parameter values are not affected by the ZERO command. If your robot system includes optional enhancements (such as vision), you will have other system parameters available. Consult the documentation for the options for details. The basic system parameters are shown in the following table.
Parameters Parameter TERMINAL Use This parameter determines how the V+ will interact with an ASCII system terminal. The acceptable values are 0 through 4, and they have the interpretations shown in the following table. Default Min Max 41 0 4 NOTES: 1The default value for TERMINAL is changed with the utility CONFIG_C.V2 on the Adept Utility Disk. See the Instructions for Adept Utility Programs.
Switches Switches System switches govern various features of the V+ system. The switches are described below. See the V+ Language Reference Guide and the V+ Operating System Reference Guide for more detailed descriptions of the keywords discussed here. As with system parameters, the names of system switches can be abbreviated to the minimum length required to identify the switch. Viewing Switch Settings The SWITCH monitor command displays the setting of one or more system switches: SWITCH switch_name, ...
Switches Summary of Basic System Switches The default switch settings at system power-up are given in the following table. (The switch settings are not affected by the ZERO command.) Optional enhancements to your V+ system may include additional system switches. If so, they are described in the documentation for the options. Basic System Switches Switch AUTO.POWER.OFF Use When this switch is enabled V+ will treat software errors as hard errors and disable HIGH POWER.
Switches Switch Use Default is disabled. FORCE Controls whether the (optional) stop-on-force feature of the V+ system is active. Default is disabled. INTERACTIVE Suppresses display of various messages on the system terminal. In particular, when the INTERACTIVE switch is disabled, V+ does not ask for confirmation before performing certain operations and does not output the text of error messages.
Switches Switch Use SET.SPEED Enable/disable the ability to set the monitor speed from the manual control pendant. Default is enabled. TRACE Enable/disable a special mode of program execution in which each program step is displayed on the system terminal before it is executed. This is useful during program development for checking the logical flow of execution (also see the DRY.RUN switch). Default is disabled.
Motion Control Operations Motion Control Operations The following topics are described in this chapter: Introduction 165 Location Variables 166 Creating and Altering Location Variables 173 Motion Control Instructions 180 Tool Transformations 188 Summary of Motion Keywords 190 (Undefined variable: Primary.Product_Name_V)Language User's Guide, version 17.
Motion Control Operations V+Language User's Guide, v17.
Introduction Introduction A primary focus of the V+ language is to drive motion devices. This chapter discusses the language elements that generate controller output to move a motion device from one location to another. Before we introduce the V+ motion instructions, we should examine the V+ location variables and see how they relate to the space in which the motion device operates. (Undefined variable: Primary.Product_Name_V)Language User's Guide, version 17.
Location Variables Location Variables Locations can be specified in two ways in V+: transformations and precision points. A transformation is a set of six components that uniquely identifies a location in Cartesian space and the orientation of the motion device end-of-arm tooling at that location. A transformation can also represent the location of an arbitrary local reference frame. A precision point includes an element for each joint in the motion device.
Location Variables Adept Robot Cartesian Space Transformations The first three components of a transformation variable are the values for the points on the X, Y, and Z axes. In an Adept SCARA robot, the origin of this Cartesian space is the base of the robot. The Z axis points straight up through the middle of the robot column. The X axis points straight out, and the Y axis runs left to right as you face the robot.
Location Variables XYZ Elements of a Transformation The second three components of a transformation variable specify the orientation of the endof-arm tooling. These three components are yaw, pitch, and roll. These elements are figured as ZYZ' Euler values. The following figures demonstrate how these values are interpreted. Yaw Yaw is a rotation about the local reference frame Z axis.
Location Variables When you are using a robot, the local frame of reference defined by the XYZ components is located at the end of the robot tool flange. (This local reference frame is referred to as the tool coordinate system.) In the figure Yaw, the large Cartesian space represents a world coordinate system. The small Cartesian space represents a local tool coordinate system (which is centered at the motion device tooling flange). Yaw (Undefined variable: Primary.
Location Variables Pitch Pitch is defined as a rotation about the local reference frame Y axis, after yaw has been applied. The figure Pitch shows the local reference frame with a yaw of 30 degrees and a pitch of 40 degrees. For example, deflection of a wrist joint is reflected in the pitch component. The movement of a fifth axis on a SCARA robot is reflected in the pitch component.
Location Variables Pitch Roll Roll is defined as a rotation about the Z axis of the local reference frame after yaw and pitch have been applied. The figure Roll shows a local reference frame in the primary robot Cartesian space and the direction roll would take within that space. In this example the transformation has a value of X = 30, Y = 100, Z = 125, yaw = 30, pitch = 40, and roll = 20. This location can be reached only by a mechanism with fifth and sixth axes. Roll (Undefined variable: Primary.
Location Variables Special Situations When the Z axes of the local and primary reference frames are parallel, roll and yaw produce the same motion in the same plane, although the two motions may be in different directions. This is always the case with a four-axis SCARA robot. The system automatically reflects rotation of the quill in the roll component of a transformation variable, and the yaw component is forced to 0 degrees.
Creating and Altering Location Variables Creating and Altering Location Variables Creating Location Variables The most straightforward method of creating a location variable is to place the robot or motion device at a location and enter the monitor command: HERE loc_name Transformations vs. Precision Points A location can be specified using either the six components described in the previous section, or by specifying the state the robot joints would be in when a location is reached.
Creating and Altering Location Variables SHIFT Alter the Cartesian components of an existing transformation. The POINT and SET operations can be used in conjunction with the transformation functions SHIFT and TRANS to create location variables based on specific modifications of existing variables. SET loc_name = SHIFT(loc_value BY 5, 5, 5) will create the location variable loc_name. The location of loc_name are shifted 5 mm in the positive X, Y, and Z directions from loc_value.
Creating and Altering Location Variables Multiple relative transformations can be chained together. If we define loc_d to have the value 0, 50, 0, 0, 0, 0: SET loc_d = TRANS(0,50) and then issue the following MOVE instruction: MOVE loc_a:loc_b:loc_d the robot moves to a position x = -50 mm, y =70 mm, and z = 30 mm relative to loc_a.
Creating and Altering Location Variables Relative Transformation This figure shows the first three locations from the previous code examples. Defining a Reference Frame In the example shown in the figure Relative Locations, a pallet is brought into the workcell on a conveyor. The program that follows teaches three locations that define the pallet reference frame (pallet.frame) and then removes the parts from the pallet. The program that follows V+Language User's Guide, v17.
Creating and Altering Location Variables runs regardless of where the pallet is placed in the workcell as long as it is within the robot's working envelope. Relative Locations ; Get the locations to define the pallet DETACH () ;Release robot for use by the MCP PROMPT "Place robot at pallet origin. ", $ans HERE loc.origin ;Record the frame origin PROMPT "Place robot at point on the pallet x-axis. ", $ans HERE loc.x.axis ;Record point on x-axis PROMPT "Place robot at point in positive y direction.
Creating and Altering Location Variables ; Create the local reference frame "pallet.frame" SET pallet.frame = FRAME(loc.origin, loc.x.axis,loc.pos.y, loc.origin) cell.space = 50 ;Spacing of cells on pallet ; Remove the palletized items FOR i = 0 TO 3 FOR J = 0 TO 2 APPRO pallet.frame:TRANS(i*cell.space, j*cell.space), 25 MOVE pallet.frame:TRANS(i*cell.space, j*cell.
Creating and Altering Location Variables APPRO assm.frame:loc.1, 25 MOVE assm.frame:loc.1 ;Activate gripper DEPART 25 APPRO assm.frame:loc.1, 25 MOVE assm.frame:loc.2 ;Activate gripper DEPART 25 ; etc. In the above example, the frame must be taught each time the assembly moves-the locations on the assembly must be taught only once. The instruction HERE assm.frame:loc.1 tells the system to record the location loc.1 relative to assm.frame rather than relative to the world coordinate frame.
Motion Control Instructions Motion Control Instructions V+ processes robot motion instructions differently from the way you might expect. With V+, a motion instruction such as MOVE part is interpreted to mean start moving the robot to location 'part'. As soon as the robot starts moving to the specified destination, the V+ program continues without waiting for the robot motion to complete. The instruction sequence: MOVE part.1 SIGNAL 1 MOVE part.
Motion Control Instructions robot arm to approach a location from directly above the board so nearby parts are not disturbed. Assuming you were using a four-axis Adept robot, the instructions: APPRO place, 50 MOVE place DEPART 50 causes joint-interpolated motion to a point 50 mm above place, movement down to place, and movement straight up to 50 mm above place. If the instructions APPROS, DEPARTS, and MOVES had been used, the motions would have been straight line instead of joint interpolated.
Motion Control Instructions MOVE pick the robot begins moving toward the location by accelerating smoothly to the commanded speed. Sometime later, when the robot is close to the destination location pick, the robot decelerates smoothly to a stop at location pick. This motion is referred to as a single motion segment, since it is produced by a single motion instruction. When a sequence of motion instructions is executed, such as: MOVE loc.1 MOVE loc.2 the robot begins moving toward loc.
Motion Control Instructions The following instructions always cause V+ to suspend program execution until the robot stops (see the V+ Language Reference Guide for detailed information on these instructions): BASE BREAK CLOSEI CPOFF DETACH (0) HALT OPENI PAUSE RELAXI TOOL Also, the robot decelerates to a stop when the BRAKE (not to be confused with BREAK) instruction is executed (by any program task), and when the reaction associated with a REACTI instruction is triggered.
Motion Control Instructions The robot tool moves at the constant speed of 0.75 inch per second through each location defined in the array path[]. (One way to create the path array is to use the V+ TEACH command to move the robot along the desired path and to press repeatedly the RECORD button on the manual control pendant.) In the next example, the robot tool is to be moved along a circular arc.
Motion Control Instructions than the configured trajectory cycle time (for example 0), the trajectory cycle time is used as the minimum motion time. Robot Speed A robot move has three phases: an acceleration phase where the robot accelerates to the maximum speed specified for the move, a velocity phase where the robot moves at a rate not exceeding the specified maximum speed, and a deceleration phase where the robot decelerates to a stop (or transitions to the next motion).
Motion Control Instructions command can scale down these maximum rates so that the robot acceleration and/or deceleration takes more time. You can also define optional acceleration profiles that alter the maximum rate of change for acceleration and deceleration (using the SPEC utility) l l l l l The location tolerance settings (COARSE/FINE, NULL/NONULL) for the move. The more accurately a robot must get to the actual location, the more time the move will take.
Motion Control Instructions l l SINGLE/MULTIPLE* SPEED* Customizing the Calibration Routine The following information is required only if you need to customize the calibration sequence. Most AdeptMotion users do not need to do this. When a CALIBRATE command or instruction is processed, the V+ system loads the file CAL_ UTIL.V2 (see the dictionary page for the CALIBRATE command for details) and executes a program contained in that file.
Tool Transformations Tool Transformations A tool transformation is a special transformation that is used to account for robot grippers (or parts held in grippers) that are offset from the center of the robot tool flange. If a location is taught using a part secured by an offset gripper, the actual location recorded is not the part location, but the center of the tool flange to which the offset gripper is attached, as shown in the following figure.
Tool Transformations Defining a Tool Transformation If the dimensions of a robot tool are known, the POINT command can be used to define a tool transformation to describe the tool. The null tool has its center at the surface of the tool mounting flange and its coordinate axes parallel to that of the last joint of the robot. The null tool transformation is equal to [0,0,0,0,0,0].
Summary of Motion Keywords Summary of Motion Keywords The following table summarizes the keywords associated with motion in V+. For complete details on any keyword, click on the keyword name in the table, or refer to the keyword documentation available in the V+ Language Reference Guide. Motion Control Operations Keyword Type Function ABOVE PI Request a change in the robot configuration during the next motion so that the elbow is above the line from the shoulder to the wrist.
Summary of Motion Keywords Keyword Type Function BASE TF Return the transformation value that represents the translation and rotation set by the last BASE command or instruction. BELOW PI Request a change in the robot configuration during the next motion so that the elbow is below the line from the shoulder to the wrist. BRAKE PI Abort the current robot motion. BREAK PI Suspend program execution until the current motion completes. CALIBRATE PI Initialize the robot positioning system.
Summary of Motion Keywords Keyword Type Function DEPART PI Start a joint-interpolated robot motion away from the current location. DEPARTS PI Start a straight-line robot motion away from the current location. DEST TF Return a transformation value representing the planned destination location for the current robot motion. DISTANCE RF Determine the distance between the points defined by two location values. DRIVE PI Move an individual joint of the robot. DRY.
Summary of Motion Keywords Keyword Type Function FRAME TF Return a transformation value defined by four positions. HAND RF Return the current hand opening. HAND.TIME P Establish the duration of the motion delay that occurs during OPENI, CLOSEI, and RELAXI instructions. HERE PI Set the value of a transformation or precision-point variable equal to the current robot location. HERE TF Return a transformation value that represents the current location of the robot tool point. HOUR.
Summary of Motion Keywords Keyword Type Function MMPS CF Specify the units for a SPEED instruction as millimeters per second. MOVE PI Initiate a joint-interpolated robot motion to the position and orientation described by the given location. MOVES PI Initiate a straight-line robot motion to the position and orientation described by the given location.
Summary of Motion Keywords Keyword Type Function round-off errors. NOT.CALIBRATED P Indicate (or assert) the calibration status of the robots connected to the system. NULL TF Return a null transformation value-one with all zero components. NULL PI Enable nulling of joint position errors. OPEN PI Open the robot gripper. OPENI PI Open the robot gripper immediately.
Summary of Motion Keywords Keyword Type Function READY PI Move the robot to the READY location above the workspace, which forces the robot into a standard configuration. RELAX PI Limp the pneumatic hand. RELAXI PI Limp the pneumatic hand immediately. RIGHTY PI Request a change in the robot configuration during the next motion so that the first two links of the robot resemble a human's right arm (see LEFTY). ROBOT S Enable or disable one robot or all robots.
Summary of Motion Keywords Keyword Type Function sign. SET.SPEED S Control whether or not the monitor speed can be changed from the manual control pendant. The monitor speed cannot be changed when the switch is disabled. SHIFT TF Return a transformation value resulting from shifting the position of the transformation parameter by the given shift amounts. SINGLE PI Limit rotations of the robot wrist joint to the range 180 degrees to +180 degrees (see MULTIPLE). SOLVE.
Summary of Motion Keywords Keyword Type Function PI: Program Instruction, RF: Real-Valued Function, TF: Transformation Function, S: Switch, P: Parameter, PF: Precision-Point Function, CF: Conversion Factor V+Language User's Guide, v17.
Input/Output Operations Input/Output Operations The following topics are described in this chapter: Terminal I/O 201 Digital I/O 205 Pendant I/O 207 Analog I/O 208 Serial and Disk I/O Basics 210 Disk I/O 214 Advanced Disk Operations 219 Serial Line I/O 223 DDCMP Communication Protocol 227 Kermit Communication Protocol 231 DeviceNet 237 Summary of I/O Operations 239 (Undefined variable: Primary.Product_Name_V)Language User's Guide, version 17.
Input/Output Operations V+Language User's Guide, v17.
Terminal I/O Terminal I/O The program instruction used to output text to the monitor screen is TYPE. The program line: TYPE "This is a terminal output instruction." outputs the text between the quotation marks to the current cursor location. If a variable x has a value of 27, the instruction: TYPE "The value of x is ", x, "." outputs The value of x is 27. to the monitor. The TYPE instruction has qualifiers for entering blank spaces and moving the cursor.
Terminal I/O Terminal Types In order for V+ to echo input characters properly and to generate certain displays on character-based terminals, the type of terminal being used must be specified to the system. The default terminal type (which is recorded on the V+ system disk) is assumed each time the V+ system is booted from disk.1 After the system is booted, the TERMINAL system parameter can be set to specify a different terminal type.
Terminal I/O Char. Decimal Name Action Ctrl+I 09 Tab Move to the next tab stop Ctrl+M 13 Return Complete this input line Ctrl+R 18 Retype the current input line Ctrl+U 21 Delete the entire current line Ctrl+W 23 Start/stop slow output mode Ctrl+Z 26 Complete this input with an end of file error DEL 1207 Delete Delete the previous input character During a PROMPT or READ instruction, all control characters are ignored except those listed above.
Terminal I/O 1The default terminal type and communication characteristics of the serial line are set with the configuration program in the file CONFIG_C.V2 on the Adept Utility Disk. 2Terminal behavior is configurable using the /FLUSH and /FLOW arguments to the FSET instruction. See the V+ Language Reference Guide. V+Language User's Guide, v17.
Digital I/O Digital I/O Adept controllers can communicate in a digital fashion with external devices using the Digital I/O capability. Digital input reads the status of a signal controlled by user-installed equipment. A typical digital input operation is to wait for a microswitch on a workcell conveyor to close, indicating that an assembly is in the proper place. The WAIT instruction and SIG function are used to halt program execution until a digital input channel signal achieves a specified state.
Digital I/O High-Speed Interrupts Normally, the digital I/O system is checked once every V+ major cycle (every 16 ms). In some cases, the delay or uncertainty resulting may be unacceptable. Digital signals 1001 1004 can be configured as high-speed interrupts. When a signal configured as a high-speed interrupt transitions, its state is read at system interrupt level, resulting in a maximum delay of 1 ms. The controller configuration utility CONFIG_C is used to configure high-speed interrupts. See the INT.
Pendant I/O Pendant I/O Most of the standard V+ I/O operations can be used to read data from the manual control pendant keypad and to write data to the pendant display. For information on accessing the manual control pendant, see Programming the MCP on page 263 or Programming the Adept T1/T2 Pendant on page 283. (Undefined variable: Primary.Product_Name_V)Language User's Guide, version 17.
Analog I/O Analog I/O Up to eight analog I/O modules for a total of 32 output and 256 input channels1 can be installed in an Adept MV controller. The following figure shows the I/O channel numbers for each installed module. Analog I/O modules can be configured for different input/output ranges. The actual input and output voltages are determined by setting on the AIO module. Regardless of the input/output range selected, the AIO.IN function returns a value in the -1.0 to 1.0 range and the AIO.
Analog I/O 1Analog I/O boards can be configured for differential input rather than single-ended input. Differential input reduces the number of channels on a single board from 32 to 16. 2The analog I/O board used by the Adept MV controller is supplied by Xycom, Inc. The model number is XVME-540. The phone number for Xycom is (800) 289-9266. (Undefined variable: Primary.Product_Name_V)Language User's Guide, version 17.
Serial and Disk I/O Basics Serial and Disk I/O Basics The following sections describe the basic procedures that are common to both serial and disk I/O operations. Disk I/O on page 214 covers disk I/O in detail. Serial Line I/O on page 223 covers serial I/O in detail. Logical Units All V+ serial and disk I/O operations reference an integer value called a Logical Unit Number or LUN. The LUN provides a shorthand method of identifying which device or file is being referenced by an I/O operation.
Serial and Disk I/O Basics The error message associated with a negative value from IOSTAT can be found in the V+ Language Reference Guide. The $ERROR string function can be used in a program (or with the LISTS monitor command) to generate the text associated with most I/O errors. It is good practice to use IOSTAT to check each I/O operation performed, even if you think it cannot fail (hardware problems can cause unexpected errors).
Serial and Disk I/O Basics If the program is resumed, the terminal and the manual control pendant are automatically reattached if they were attached before the termination. NOTE: It is possible that another program task could have attached the terminal or manual control pendant. That would result in an error message when the stopped task is restarted. Reading The READ instruction processes input from all devices.
Serial and Disk I/O Basics 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, V+ waits for each I/O operation to be completed before continuing to the next program instruction.
Disk I/O Disk I/O The following sections discuss disk I/O. Attaching Disk Devices A disk LUN refers to a local disk device, such as a 3-1/2 inch diskette drive, the hard disk on a SIO based system, or the Compact Flash in an AWC (AdeptWindows Controller) system. Also, a remote disk may be accessed via the Kermit protocol or a network. The type of device to be accessed is determined by the DEFAULT command or the ATTACH instruction.
Disk I/O directories. If a disk is thought of as a file cabinet, then a directory can be thought of as a drawer in that cabinet. Directories allow files (the file folders in our file cabinet analogy) that have some relationship to each other to be grouped together and separated from other files. See the chapter Using Files in the V+ Operating System User's Guide for more details on the directory structure. Disk File Operations All I/O requests to a disk device are made to a file on that device.
Disk I/O preceded with a \, the path is absolute. Otherwise, the path is relative and is added to the current DEFAULT path specification. (If unit is specified and is different from the default unit, the path is always absolute.) filename is a name with 1 to 8 characters, which is used as the name of the file on the disk. ext is the filename extension-a string with 0 to 3 characters, which is used to identify the file type. The four open commands are: 1. Open for read only (FOPENR).
Disk I/O reads (from the open file on dlun) up to the first CR/LF (or end of file if it is encountered) and store the result in $in.string. When the end of file is reached, V+ error number -504 Unexpected end of file is generated. The IOSTAT() function must be used to recognize this error and halt reading of the file: DO READ (dlun) $in.string TYPE $in.
Disk I/O IF IOSTAT(dlun) < 0 GOTO 100 ; Open a new file and check status FOPENW (dlun) $file.name IF IOSTAT(dlun) < 0 GOTO 100 ; Write the text FOR i = 1 TO 10 WRITE (dlun) "Line "+$ENCODE(i) IF IOSTAT(dlun) < 0 GOTO 100 END ; Close the file FCLOSE (dlun) IF IOSTAT(dlun) < 0 GOTO 100 ; Reopen the file and read its contents FOPENR (dlun) $file.
Advanced Disk Operations Advanced Disk Operations This section introduces additional parameters to the FOPEN and FOPENR program instructions. For details, see the FOPEN and FOPENR documentation in the V+ Language Reference Guide for details. Variable-Length Records The default disk file access mode is variable-length record mode. In this mode, records can have any length (up to a maximum of 512 bytes) and can cross the boundaries of 512-byte sectors.
Advanced Disk Operations may contain either variable-length or fixed-length records. Random-Access Files In some applications, disk files need to be read or written in a nonsequential or random order. V+ supports random access only for files with fixed-length records. Records are numbered starting with 1.
Advanced Disk Operations When a file is being created, information about the file size is not stored in the disk directory until the file is closed. Closing a file also forces any partial sector buffers to be written to the disk. Note that aborting a program does not force files associated with it to be closed. The files are not closed (and the directory is not updated) until a KILL command is executed or until the aborted program is executed again.
Advanced Disk Operations Byte Size Description 13-20 8 ASCII file size, in sectors, right justified 21 1 ASCII space character (32 decimal) 22-28 7 Attribute codes, padded with blanks on right 29-37 9 File revision date in the format dd-mmyy 38 1 ASCII space character (32 decimal) 39-46 8 File revision time in the format hh:mm:ss The following characters are possible in the file attribute code field of directory entries: File Attribute Codes Character Meaning D Entry is a subdirecto
Serial Line I/O Serial Line I/O The V+ controller has several serial lines that are available for general use. This section describes how these lines are used for simple serial communications. To use a serial line for a special protocol such as DDCMP and Kermit (described later in this chapter), the line must be configured using the Adept controller configuration utility program.
Serial Line I/O with success, so it is possible to single-step through a program or proceed from a PAUSE instruction without loss of data. Input Processing Input data is received by V+ according to the byte format specified by the I/O configuration program. The size of the buffer can be set with the CONFIG_C utility program. Data errors such as parity or framing errors are also buffered and are returned in the proper order.
Serial Line I/O Serial I/O Examples The first example attaches to a serial line and performs simple WRITEs and READs on the line: .PROGRAM serial.io() ; ABSTRACT: Example program to write and read lines of ; text to and from serial port 1 on the SIO module.
Serial Line I/O $buffer = "" ;Initialize buffer to empty done = FALSE ;Assert not done DO CLEAR.EVENT c = GETC(line,1) ;Read byte from the ser. line WHILE c == ienod DO ;While there is no data... WAIT.EVENT 1 ;Wait for an event CLEAR.EVENT c = GETC(line,1) ;Read byte from the ser. line END IF c < 0 GOTO 90 ;Check for errors IF c == etx THEN ;If ETX seen...
DDCMP Communication Protocol DDCMP Communication Protocol DDCMP is a rigorous protocol that automatically handles the detection of errors and the retransmission of messages when an error occurs. (The name stands for Digital Data Communications Message Protocol.) Originally, this protocol was used in Digital Equipment Corporation's computer network DECnet. The Adept implementation of DDCMP does not support maintenance messages or multidrop lines.
DDCMP Communication Protocol Code Description 9 Bytes lost due to receiver overrun 16 Message too long for buffer 17 Header format error (but check code was okay) Controller Configuration for DDCMP DDCMP makes use of one or more of the general-purpose controller serial lines. To be used for DDCMP, a serial line must be configured using the Adept CONFIG_C utility program available in the file CONFIG_C.
DDCMP Communication Protocol can be polled using the function IOSTAT(lun, 1) to detect when the read is completed. Keep in mind that the DDCMP acknowledge was sent when the data was originally received and buffered, not when the READ instruction is executed. Output Processing Output on a DDCMP line is performed using the V+ WRITE instruction. Each WRITE instruction sends a single data message with a maximum length of 512 bytes.
DDCMP Communication Protocol For example, the instruction FCMND (lun, 501) $CHR(2)+$CHR(20)+$CHR(8) specifies a time-out interval of 2 seconds, with a maximum of 20 time-outs and 8 NAK retries. 1The original publication on DECnet is entitled DECnet Digital Network Architecture, Digital Data Communications Message Protocol (DDCMP) Specification, Version 4.0, March 1, 1978. Digital Equipment Corporation order number AA-D599A-TC. Information on DECnet is available at the following URL: http://www.cisco.
Kermit Communication Protocol Kermit Communication Protocol The Kermit protocol is an error-correcting protocol for transferring sequential files between computers over asynchronous serial communication lines. This protocol is available as an option to the Adept V+ system. Kermit is nonproprietary and was originally developed at Columbia University. Computer users may copy Kermit implementations from one another, or they may obtain copies from Columbia University for a nominal charge.
Kermit Communication Protocol Once you are able to communicate with the remote system, you may have to log onto the remote system. After you have reached the point of being able to enter commands to the system, the Kermit program may be started simply by typing: KERMIT or a similar command appropriate to the operating system of the remote computer. The Kermit program starts up in its command mode, with a prompt such as: C-Kermit> You may then enter commands directly to the Kermit program.
Kermit Communication Protocol File Access Using Kermit After the remote Kermit server has been initiated, you are ready to use the Kermit line for file access. In general, to access a file via Kermit with the V+ system, all you have to do is specify the KERMIT> physical device in a normal V+ file-access command or instruction. For example, the command: LOAD K>file_spec loads (from the remote system) the programs or data contained in the specified file.
Kermit Communication Protocol FDIRECTORY LOAD STORER VLOAD and VSTORE can be used with Kermit only in binary mode. The specific commands for the remote system will depend on the system you are using. Binary Files Disk files created by the V+ system are called ASCII files because the files contain only ASCII characters. V+ application programs (and other computers) can create non-ASCII disk files, which contain information that is not interpreted as ASCII characters.
Kermit Communication Protocol transfer binary files using Kermit. An ASCII file may be accessed as a binary file, but not vice versa. A file that is transferred back and forth over the Kermit line must be transferred in the same file mode each time. For example, if a file is copied in binary mode from the remote system to the V+ system, then it must be copied back to the remote system in binary mode in order to preserve the file contents.
Kermit Communication Protocol Columbia University Center for Computing Activities 612 West 115th Street New York, NY 10025 (USA) Web site: http://www.columbia.edu/kermit/ 2Only one line can be configured at any one time for use with Kermit. The controller configuration program is in the file CONFIG_C.V2. V+Language User's Guide, v17.
DeviceNet DeviceNet Adept supports DeviceNet and DeviceNet protocols on both the Adept SmartController and Adept MV controller platforms. For more information on the Adept DeviceNet environment, hardware and software configuration and V+ programming for DeviceNet components, select a topic from the table below. To... Refer to...
DeviceNet To... Refer to... to programs. V+Language User's Guide, v17.
Summary of I/O Operations Summary of I/O Operations The following table summarizes the V+ I/O instructions: System Input/Output Operations Keyword Type Function AIO.IN RF Read a channel from one of the analog IO boards. AIO.INS RF Test whether an analog input or output channel is installed. AIO.OUT PI Write to a channel on one of the analog IO boards. ATTACH PI Make a device available for use by the application program. BITS PI Set or clear a group of digital signals based on a value.
Summary of I/O Operations Keyword Type Function performed depends on the device referenced. FCLOSE PI Close the disk file, graphics window, or graphics icon currently open on the specified logical unit. FCMND PI Generate a device-specific command to the input/output device specified by the logical unit. FEMPTY PI Empty any internal buffers in use for a disk file or a graphics window by writing the buffers to the file or window if necessary. FOPENR PI Open a disk file for read-only.
Summary of I/O Operations Keyword Type Function KERMIT.TIMEOUT P Establish the delay parameter that the V+ driver for the Kermit protocol will send to the remote server. KEYMODE PI Set the behavior of a group of keys on the manual control pendant. PENDANT RF Return input from the manual control pendant. PROMPT PI Display a string on the system terminal and wait for operator input. READ PI Read a record from an open file or from an attached device that is not file oriented.
Graphics Programming Graphics Programming The following topics are described in this chapter: Creating Windows 245 Monitoring Events 248 Building a Menu Structure 250 Creating Buttons 253 Creating a Slide Bar 255 Graphics Programming Considerations 257 Communicating With the System Windows 259 Additional Graphics Instructions 261 (Undefined variable: Primary.Product_Name_V)Language User's Guide, version 17.
Graphics Programming V+Language User's Guide, v17.
Creating Windows Creating Windows V+ communicates to windows through logical units, with logical unit numbers (LUNs) 20 to 23 reserved for window use. (Each task has access to its own set of four LUNs.) The basic strategy for using a window (or any of the graphics instructions) is: 1. ATTACH to a logical unit 2. FOPEN a window on the logical unit 3. Perform the window's tasks (or graphics operations) 4. FCLOSE the window 5. FDELETE the window 6.
Creating Windows FCLOSE Instruction FCLOSE closes a window to input and output (but does not erase it or remove it from memory). The syntax for FCLOSE is: FCLOSE (glun) glun The logical unit number specified in the FOPEN instruction that opened the window. FDELETE Instruction FDELETE removes a closed, attached window from the screen and from graphics memory. The syntax for FDELETE is FDELETE (glun) "window_name" glun The same values as specified in the FOPEN instruction that created the window.
Creating Windows FDELETE (glun) "Test" DETACH (glun) (Undefined variable: Primary.Product_Name_V)Language User's Guide, version 17.
Monitoring Events Monitoring Events The key to pointing-device-driven programming is an event loop. In an event loop, you wait for an event (from the keyboard or pointer device) and when the correct event occurs in the proper place, your program initiates some appropriate action. V+ can monitor many different events including button up, button down, double click, open window, and menu select. The example code in the following sections will use event 2, button up, and event 14, menu select.
Monitoring Events If event[0] is 14, a click on a menu bar selection was detected, in which case: If event[1] is 0, a click has been made to the top-level menu bar. In this case, an FSET instruction must be executed to display the pull-down options under the menu bar selection and event[2] is the number (from left to right) of the menu bar option selected. If event[1] is 1, then a selection from a pull-down menu has been made and event[2] is the number of the pull-down option selected.
Building a Menu Structure Building a Menu Structure The strategy for implementing a menu is: 1. Declare the top-level bar menu. 2. Start a loop monitoring event 14 (menu selection). 3. When event 14 is detected, check to see if the mouse event was on the top-level bar menu or on a pull-down option. 4. If the event was a top-level menu selection, then display the proper pull-down options. 5.
Building a Menu Structure ; ; event[1] will have event[2] will have menu = item = the value of the top-level selection (menu) the value of the pull-down selection (item) event[1] event[2] ; The outer CASE structure checks the top-level menu selection ; The inner CASE structure checks the item selected from the pull-down CASE menu OF VALUE 1: ;Menu 1 CASE item OF VALUE 1: ;code for Item 1-1 VALUE 2: ;code for Item 1-2 END VALUE 2: ;Menu 2 CASE item OF VALUE 1: ;code for Item 2-1 VALUE 2: ;code for Item 2
Building a Menu Structure Sample Menu Defining Keyboard Shortcuts If you are using AdeptWindows, you can create keyboard shortcuts on menu and pull-down items by placing an ampersand (&) before the desired letter. For example: FSET(lun) "/menu '&File' '&Edit'" In this example, the letters F and E are used as shortcuts when pressed with the ALT key. Thus, pressing ALT+F displays the File menu and ALT+E displays the Edit menu.
Creating Buttons Creating Buttons Creating a button in a window is a simple matter of placing a graphic representing your button on the screen, and then looking to see if a mouse event occurred within the confines of that graphic. GPANEL Instruction The GPANEL instruction is useful for creating standard button graphics. The syntax for GPANEL is: GPANEL (glun, mode) x, y, dx, dy glun The logical unit of the window the button is in.
Creating Buttons ; The status of a button event will be stored in event[0].; Look to see if that event was a button-up event. IF event[0] == btn.up THEN ; Check if the button-up event was within the button area ; The x location is in event[1], the y location in event[2] hit = (event[2] > 99) AND (event[2] < 146) hit = hit AND (event[3] > 99) AND (event[3] < 146) END UNTIL hit ; The code for reacting to a button press is placed here.
Creating a Slide Bar Creating a Slide Bar V+ allows you to create a V+feature similar to the window scroll bars called slide bars. The syntax for a slide bar is: GSLIDE (glun, mode) slide_id = x, y, len, max_pos, arrow.inc, handle glun The logical unit of the window the slide bar is created in. mode is replaced with: 0 indicating a horizontal slide bar is to be created or updated. 1 indicating a slide bar is to be deleted. 2 indicating a vertical slide bar is to be created or updated.
Creating a Slide Bar btn.smov = 8 btn.sup = 9 btn.dclk = 3 ; Slide bar position and start-up values x = 20 y = 60 length = 200 max.pos = 100 arrow_inc = 10 handle_pos = 50 ; Enable monitoring of slide bars and pointer drags FSET (glun) "/event object move_b2" ; Display the slide bar GSLIDE (glun, 0) 1 = x, y, length, max_pos, arrow_inc, handle_pos ; Begin monitoring events and take action when the slide bar ; is moved.
Graphics Programming Considerations Graphics Programming Considerations Buttons and menus can be monitored in the same window. However, the code will get complicated, and you might consider using different windows when the button and menu structure becomes complex. Only one pull-down menu can be active at any time. Design your windows with the following mechanical and aesthetic considerations: l l l l Keep your windows as simple and uncluttered as possible. Use color carefully and purposefully.
Graphics Programming Considerations ; of an error number.
Communicating With the System Windows Communicating With the System Windows The Adept system has three operating system level windows: the main window, the monitor window, and the vision window (on systems with the AdeptVision option). The Main Window You can place menu options on the top-level menu bar by opening the window \Screen_1.
Communicating With the System Windows but will not delete the vision window. You can close and detach from the vision window, but you cannot delete it. To preserve the vision system pull-down menus, open the window in write-only mode: FOPEN (glun) "Vision /WRITEONLY" The following example opens the vision window, writes to the vision window, and detaches the vision window: .PROGRAM label.
Additional Graphics Instructions Additional Graphics Instructions The following table lists the graphics instructions available in the V+ programming language. For complete details on any instruction, click on the command name in the table, or refer to the keyword documentation available in the V+ Language Reference Guide. List of Graphics Instructions Command Action GARC Draw an arc or circle in a graphics window. GCHAIN Draw a chain of points. GCLEAR Clear an entire window to the background color.
Additional Graphics Instructions Command Action GTEXTURE Develop a texture for subsequent graphics. Set subsequent graphics to transparent or opaque. GTRANS Define a transformation to apply to all subsequent G instructions. GTYPE Display a text string. V+Language User's Guide, v17.
Programming the MCP Programming the MCP The following topics are described in this chapter: Introduction 265 Writing to the Pendant Display 266 Detecting User Input 267 Controlling the Pendant 273 Auto-Starting Programs With the MCP 277 Programming Example: MCP Menu 279 (Undefined variable: Primary.Product_Name_V)Language User's Guide, version 17.
Programming the MCP V+Language User's Guide, v17.
Introduction Introduction This chapter provides an overview of strategies for programming the manual control pendant (MCP). For information on programming the Adept T1/T2 pendant, see Programming the Adept T1/T2 Pendant on page 283. ATTACHing and DETACHing the Pendant Before an application program can communicate with the MCP, the MCP must first be ATTACHed using the ATTACH instruction. The logical unit number for the MCP is 1.
Writing to the Pendant Display Writing to the Pendant Display The Pendant Display The MCP display is a 2-line, 80-character LCD display. You can use the WRITE instruction to write data to the display.
Detecting User Input Detecting User Input Input from the pendant can be received in two ways: l l A series of button presses from the data entry buttons can be read. The READ instruction is used for this type of input. A single button press from any of the buttons can be detected. These single button presses can be monitored in three different modes: l l l The buttons can be monitored like keys on a normal keyboard. The buttons can be monitored in toggle mode (on or off).
Detecting User Input V+Language User's Guide, v17.
Detecting User Input MCP Button Map Keyboard Mode The default mode is keyboard. If a PENDANT( ) instruction requests keyboard input, the button number of the first keyboard-type button pressed is returned. The following code detects the first soft button pressed: ; Set the soft keys to keyboard mode KEYMODE 1,5 = 0 ; Wait for a button press from buttons 1 - 5 DO button = PENDANT(0) UNTIL button < 6 (Undefined variable: Primary.Product_Name_V)Language User's Guide, version 17.
Detecting User Input The arguments to the KEYMODE instruction indicate that pendant buttons 1 through 5 are to be configured in keyboard mode. The 0 argument to the PENDANT( ) function indicates that the button number of the first keyboard button pressed is to be returned. Toggle Mode To detect the state of a button in toggle mode, the PENDANT( ) function must specify the button to be monitored. When a button is configured as a toggle button, its state is maintained as on (-1) or off (0).
Detecting User Input IF PENDANT(45) THEN TYPE $CHR(12) END UNTIL PENDANT(8) ;Cursor down (line feed) Monitoring the MCP Speed Bar The speed bar on the MCP returns a value from -128 to 127 depending on where it is being pressed. An argument of -2 to the PENDANT( ) function returns the value of the speed bar. The following code displays the state of the speed bar.
Detecting User Input Reading the State of the MCP It is good programming practice to check the state of the MCP before ATTACHing to it. The instruction: cur.state = PENDANT(-3) returns a value to be interpreted as follows: 1. Indicates that one of the predefined function buttons has been pressed. 2. Indicates that the MCP is in background mode (not ATTACHed to an application program). 3. Indicates that an error is being displayed. 4.
Controlling the Pendant Controlling the Pendant The MCP responds to a number of control codes that affect the LCD panel (whether or not the buttons are repeat buttons) and the LEDs associated with the pendant buttons. The control codes are listed in the table Pendant Control Codes. The control codes are sent as ASCII values using the WRITE instruction. The normal way to send control codes is to use the $CHR( ) function to convert a control code to its ASCII value.
Controlling the Pendant cancel blinking of previously entered characters. It also does not cancel blinking of character positions set by control code 22. $CHR(7) causes the pendant to beep. Pendant LCD Display The Pendant LEDs The LEDs on the soft buttons, the F buttons, and the REC/DONE button can be lit (either continuously or intermittently).
Controlling the Pendant The following table lists all the control codes used with the pendant.
Controlling the Pendant Double Byte Control Codes Code Function Second Code 16 (Not Used) 17 (Not Used) 18 Position cursor 19 (Not Used) 20 (Not Used) 21 (Not Used) 22 Enable blinking positions starting at current cursor location Number of blinking positions (1-80) 23 Disable blinking positions starting at current cursor location Number of blinking positions (1-80) 24 Enable repeat mode for button Button number 25 Disable repeat mode for button Button number 26 (Not Used) 27 (
Auto-Starting Programs With the MCP Auto-Starting Programs With the MCP The CMD predefined function button provides three options for loading and auto-starting a program from the pendant. These three options are AUTO START, CMD1, and CMD2. The program file requirements for all three options are the same: 1. The file being loaded must be on the default disk. The default disk is specified with the DEFAULT DISK command. The utility CONFIG_C can be used to specify a default disk at startup.
Auto-Starting Programs With the MCP 1The default disk is not the same as the boot drive. The boot drive is set in hardware and is used during the boot procedure to specify the drive that contains the operating system. Once the system is loaded, the default disk is the drive and path specification for loading and storing files. V+Language User's Guide, v17.
Programming Example: MCP Menu Programming Example: MCP Menu The following code implements a menu structure on the MCP. (For a program example that illustrates using the MCP to teach robot locations, see Teaching Locations With the MCP on page 344.) .PROGRAM mcp.main( ) ; ABSTRACT: This program creates and monitors a menu structure on the MCP. ; ; INPUT PARAMS: None ; ; OUTPUT PARAMS: None ; ; GLOBAL VARS: mcp MCP logical unit ;mcp.clr.scr_pendant control code, clear display & home cursor ;mcp.cur.
Programming Example: MCP Menu GOTO 100 END DO ;Main processing loop ; Display the top-level menu CALL mcp.disp.main() ; Get the operator selection (must be between 1 and 5) DO button = PENDANT(0) UNTIL (button < 6) ; Turn on the LED of the selected button WRITE (mcp) $CHR(mcp.on.led), $CHR(button), /S ; Respond to the menu item selected CASE button OF VALUE 1: ;Verify program exit CALL mcp.main.quit(quit) VALUE 2: CALL mcp.option.2() VALUE 3: CALL mcp.option.3() VALUE 4: CALL mcp.option.
Programming Example: MCP Menu .END .PROGRAM mcp.disp.main( ) ;ABSTRACT: This program is called to display a main menu above the five ;soft keys on the MCP. The program assumes the MCP has been attached. ; ; INPUT PARAMS: None ; ; OUTPUT PARAMS: None ; ; GLOBAL VARS: mcpMCP logical unit ;mcp.clr.scrn_pendant control code, clear display & home cursor ;mcp.cur.pos_pendant control code, set cursor position ;mcp.beep_pendant control code, beep the pendant ;mcp.
Programming Example: MCP Menu ; ; quit = FALSE ;assume quit will not be verified ; Display submenu and start the "NO" option blinking WRITE (mcp) $CHR(mcp.clr.scr), "Quit. Are you sure?" WRITE (mcp) $CHR(mcp.tab), $CHR(mcp.tab), $CHR(mcp.tab), " YES", /S WRITE (mcp) $CHR(mcp.tab), $CHR(mcp.blink.char), " NO", $CHR (mcp.noblink.cha), /S button = PENDANT(0) ; Set quit to true if verified, else turn off the "NO" soft button LED IF button == 2 THEN quit = TRUE ELSE WRITE (mcp) $CHR(mcp.off.
Programming the Adept T1/T2 Pendant Programming the Adept T1/T2 Pendant The following topics are described in this chapter: Introduction 285 Writing to the Pendant Display 286 Detecting User Input 287 Controlling the Pendant 295 Auto-Starting Programs With the Pendant 299 Programming Example: Pendant Menu 301 (Undefined variable: Primary.Product_Name_V)Language User's Guide, version 17.
Programming the Adept T1/T2 Pendant V+Language User's Guide, v17.
Introduction Introduction This section provides an overview of how to program the Adept T1/T2 pendant. You can refer to the Adept T1 Pendant User’s Guide or Adept T2 Pendant User’s Guide for information on installing and operating the pendant. For information on programming the MCP, see Programming the MCP on page 263. Legacy Issues with the MCP and T1/T2 Pendant The previous generation of the pendant was called the MCP (manual control pendant).
Writing to the Pendant Display Writing to the Pendant Display Pendant Display The pendant display window is a 2-line, 80-character display. You can use the WRITE instruction to write data to the display.
Detecting User Input Detecting User Input Input from the pendant can be received in two ways: l l A series of button presses from the data-entry buttons can be read. The READ instruction is used to receive this type of input. A single-button press from any of the buttons can be detected. These single-button presses can be monitored in three different modes: l l l The buttons can be monitored like keys on a normal keyboard. The buttons can be monitored in toggle mode (on or off).
Detecting User Input Detecting Pendant Button Presses Individual pendant button presses are detected with the PENDANT( ) real-valued function. (The figure T1/T2 Pendant Button Map provides a reference for the numbers of the buttons on the T1/T2 pendant.) This function returns the number of the first acceptable button press. The interpretation of a button press is determined by previous execution of the KEYMODE instruction. See the V+ Language Reference Guide for complete details.
Detecting User Input T1/T2 Pendant Button Map Keyboard Mode The default mode is Keyboard. If a PENDANT( ) function requests any keyboard input, the button number of the first Keyboard mode button pressed is returned.
Detecting User Input Toggle Mode To detect the state of a button in Toggle mode, the PENDANT( ) function must specify the button to be monitored. When a button is configured as a toggle button, its state is maintained as on (-1) or off (0). The state is toggled each time the button is pressed. If an indicator bar (LED) is associated with the button, it is also toggled.
Detecting User Input When a button has been configured as a level button, the state of the button is on as long as the button is pressed. When the button is not pressed, its state is off. The following code uses the buttons labeled 2, 4, 6, and 8 (button numbers 45, 47, 49, and 51 - don't confuse the button labels with the numbers returned by the PENDANT function) to move the cursor around the terminal display.
Detecting User Input determined by the position of the speed slider. Note that the speed indicator to the right of the speed bar indicates a value between 1 and 100. The speed indicator expresses a percentage of the maximum value. The direction (negative or positive) is specified by the button pressed. For example, pressing the Joint-1 “+” button will send a positive value from 1 to 127, and the Joint-1 “-“ button will send a negative value from –128 to –1.
Detecting User Input Special Condition Send Button Code Send Speed Signal Manual T1/T2 On no yes Manual T1/T2 Off yes no COMP - yes yes OFF - yes yes Mode Finally, for backward compatibility with the MCP4, pressing the STEP button and the Speed Bar simultaneously will also send the speed signal. This is useful when the Front Panel key switch is in "Manual" position (described in the next section).
Detecting User Input MCP.NO.POT System Switch The V+ system switch MCP.NO.POT is included in V+ 16.2 and later revisions. When this switch is enabled, the functionality is changed from that description above. The differences are that the error message mentioned in the previous section is not displayed, and the Speed Bar does not need to be pressed. Refer to the V+ Language Reference Guide for the complete details on this switch.
Controlling the Pendant Controlling the Pendant The pendant responds to a number of control codes that affect the pendant display window, whether or not the buttons are repeat buttons, and the LEDs associated with the pendant buttons. (Repeat-button presses are recorded as long as the button is held down.) The control codes are listed in the table Pendant Control Codes. The control codes are sent as ASCII values using the WRITE instruction.
Controlling the Pendant Pendant Display Window NOTE: Avoid “flooding” the Pendant Display Window with text or codes by using the WRITE instruction repeatedly. If multiple characters or codes must be sent, use the WAIT.EVENT instruction between the WRITE instructions to avoid the overflow. Remember that this display is used for sending messages, which the user must have time to read.
Controlling the Pendant Pendant Control Codes Single Byte Control Codes Code Function 1 (Not Used) 2 Enable blink mode for subsequent characters 3 Disable blink mode for subsequent characters (characters will still blink if they appear in a blinking position set by code 22) 4 Display cursor (make the cursor visible) 5 Hide cursor (make the cursor invisible) 6 (Not Used) 7 Beep 8 Backspace (ignored if cursor is in character position 1) 9 Tab to next soft button 10 Line feed (move down i
Controlling the Pendant Double Byte Control Codes Code Function Second Code 17 (Not Used) 18 Position cursor 19 (Not Used) 20 (Not Used) 21 (Not Used) 22 Enable blinking positions starting at current cursor location Number of blinking positions (1-80) 23 Disable blinking positions starting at current cursor location Number of blinking positions (1-80) 24 Enable repeat mode for button Button number 25 Disable repeat mode for button Button number 26 (Not Used) 27 (Not Used) 28 T
Auto-Starting Programs With the Pendant Auto-Starting Programs With the Pendant The CMD predefined function button provides three options for loading and auto-starting a program from the pendant. These three options are AUTO START, CMD1, and CMD2. The program file requirements for all three options are the same: 1. The file being loaded must be on the default disk. The default disk is specified with the DEFAULT DISK command. The utility CONFIG_C can be used to specify a default disk at startup.
Auto-Starting Programs With the Pendant 1The default disk is not the same as the boot drive. The boot drive is set in hardware and is used during the boot procedure to specify the drive that contains the operating system. Once the system is loaded, the default disk is the drive and path specification for loading and storing files. V+Language User's Guide, v17.
Programming Example: Pendant Menu Programming Example: Pendant Menu The following code implements a menu structure on the Adept T1/T2 pendant. (For a program example that illustrates using the MCP to teach robot locations, see Teaching Locations With the MCP on page 344.) .PROGRAM mcp.main( ) ; ABSTRACT: This program creates and monitors a menu structure on the MCP. ; ; INPUT PARAMS: None ; ; OUTPUT PARAMS: None ; ; GLOBAL VARS: mcp MCP logical unit ;mcp.clr.
Programming Example: Pendant Menu GOTO 100 END DO ;Main processing loop ; Display the top-level menu CALL mcp.disp.main() ; Get the operator selection (must be between 1 and 5) DO button = PENDANT(0) UNTIL (button < 6) ; Turn on the LED of the selected button WRITE (mcp) $CHR(mcp.on.led), $CHR(button), /S ; Respond to the menu item selected CASE button OF VALUE 1: ;Verify program exit CALL mcp.main.quit(quit) VALUE 2: CALL mcp.option.2() VALUE 3: CALL mcp.option.3() VALUE 4: CALL mcp.option.
Programming Example: Pendant Menu .END .PROGRAM mcp.disp.main( ) ;ABSTRACT: This program is called to display a main menu above the five ;soft keys on the MCP. The program assumes the MCP has been attached. ; ; INPUT PARAMS: None ; ; OUTPUT PARAMS: None ; ; GLOBAL VARS: mcpMCP logical unit ;mcp.clr.scrn_pendant control code, clear display & home cursor ;mcp.cur.pos_pendant control code, set cursor position ;mcp.beep_pendant control code, beep the pendant ;mcp.
Programming Example: Pendant Menu ; ; quit = FALSE ;assume quit will not be verified ; Display submenu and start the "NO" option blinking WRITE (mcp) $CHR(mcp.clr.scr), "Quit. Are you sure?" WRITE (mcp) $CHR(mcp.tab), $CHR(mcp.tab), $CHR(mcp.tab), " YES", /S WRITE (mcp) $CHR(mcp.tab), $CHR(mcp.blink.char), " NO", $CHR (mcp.noblink.cha), /S button = PENDANT(0) ; Set quit to true if verified, else turn off the "NO" soft button LED IF button == 2 THEN quit = TRUE ELSE WRITE (mcp) $CHR(mcp.off.
Conveyor Tracking Conveyor Tracking This chapter describes the Adept Conveyor Tracking (moving-line) feature. The Adept ACE software provides a graphical interface for programming your Adept motion (and vision) system. Further, the ACE Process Manager, which is included with the Adept ACE software, allows you to build conveyor-tracking applications through a point-and-click interface. Therefore, Adept strongly recommends that you use the Adept ACE software for this functionality.
Conveyor Tracking V+Language User's Guide, v17.
Introduction to Conveyor Tracking Introduction to Conveyor Tracking This chapter describes the Adept Conveyor Tracking (moving-line) feature. The moving-line feature allows the programs to specify locations that are automatically modified to compensate for the instantaneous position of a conveyor belt. Motion locations that are defined relative to a belt can be taught and played back while the belt is stationary or moving at arbitrarily varying speeds.
Installation Installation To set up a conveyor belt for use with a robot controlled by the V+ system: 1. Install all the hardware components and securely fasten them in place. The conveyor frame and robot base must be mounted rigidly so that no motion can occur between them. 2. Install the encoder on the conveyor. 3.
Calibration Calibration The position and orientation of the conveyor belt must be precisely known in order for the robot to track motion of the belt. Use the Belt Calibration group in the Adept ACE Process Manager to calibrate the location of the conveyor belt relative to the robot. For details, see the section Belt Calibrations in the Adept ACE User's Guide. Optionally, use the file BELT_ CAL.V2 on the Adept Utility Disk contains a program to calibrate the relationship between the belt and the robot.
Basic Programming Concepts Basic Programming Concepts This section describes the basic concepts of the conveyor-tracking feature. First, the data used to describe the relationship of the conveyor belt to the robot is presented. Then a description is given of how belt-relative motion instructions are specified. Finally, a description is presented of how belt-relative locations are taught. The V+ operations associated with belt tracking are disabled when the BELT system switch is disabled.
Basic Programming Concepts millimeters of belt travel. 4. An encoder offset, which is used to adjust the origin of the belt frame of reference. 5. Window parameters, which define the working range of the robot along the belt. These components of belt variables are described in detail in the following sections. Unlike other V+ data types, belt variables cannot be stored in a disk file for later loading.
Basic Programming Concepts The encoder variables contained in this final equation are described in later sections. The Belt Encoder Six belt encoders are supported by the conveyor tracking feature. Each belt encoder generates pulses that indicate both the distance that the belt has moved and the direction of travel. The pulses are counted by the belt interface, and the count is stored as a signed 24-bit number.
Basic Programming Concepts This factor can be determined either directly from the details of the mechanical coupling of the encoder to the belt or experimentally by reading the encoder as the belt is moved. The Adept belt calibration program supports either method of determining the encoder scaling factor. If the encoder counter decreases as the belt moves in its normal direction of travel, the scaling factor will have a negative value.
Basic Programming Concepts of the window (is downstream of the window), it is flagged as an error condition and the application program can specify what action is to be taken. (See the description of the BELT.MODE system parameter in V+ Language Reference Guide.
Basic Programming Concepts directs the robot to perform a straight-line motion to location loc_1, which is specified relative to the location defined by the belt variable %belt. If a belt variable is specified, it must be the first (that is, leftmost) element in a compound transformation. Only one belt variable can appear in any compound transformation. Motions relative to a belt can be only of the straight-line type.
Basic Programming Concepts Defining Belt-Relative Locations In order to define locations relative to a belt, belt-relative compound transformations can be used as parameters to all the standard V+ teaching aids.
Conveyor-Tracking Programming Conveyor-Tracking Programming This section describes how to access the conveyor-tracking capabilities within V+. A functional overview is presented that summarizes the extensions to V+ for Conveyor Tracking. All the V+ conveyor-tracking keywords are described in detail in the V+ Language Reference Guide.
Conveyor-Tracking Programming Window Testing The following function allows an application program to incorporate its own specialized working-region strategy, independent of the strategy provided as an integral part of the V+ conveyor tracking system. WINDOW Real-valued function that indicates where a belt-relative location is (or will be at some future time) relative to a belt window. Status Information The following function indicates the current operating status of the conveyor-tracking software.
Sample Programs Sample Programs The following program is an example of a robot task working from a moving conveyor belt. The task consists of the following steps: 1. Wait for a signal that a part is present. 2. Pick up the part. 3. Place the part at a new location on the belt. 4. Return to a rest location to wait for the next part. CAUTION: These programs are meant only to illustrate programming techniques useful in typical applications.
Sample Programs The WINDOW instruction in the above program indicates that whenever a window violation occurs, a subroutine named window.error is to be executed. The following is an example of what such a routine might contain. ; *** WINDOW VIOLATION ROUTINE *** TYPE /B, /C1, "** WINDOW ERROR OCCURRED **", /C1 ; Find out which end of window was violated IF DISTANCE(HERE,window.1) < DISTANCE(HERE,window.2) THEN ; Error occurred at window.2 TYPE "Part moved downstream out of reach" ;...
Multiprocessor Systems Multiprocessor Systems The following topics are described in this chapter: Introduction 323 Requirements for Motion Systems 324 Installing Processor Boards 326 Customizing Processor Workloads 327 Using Multiple V+ Systems 328 Restrictions With Multiprocessor Systems 333 (Undefined variable: Primary.Product_Name_V)Language User's Guide, version 17.
Multiprocessor Systems V+Language User's Guide, v17.
Introduction Introduction In most cases, your controller has already been preconfigured at the factory with sufficient processors for your application. Occasionally, however, your applications may be more demanding and need multiple processors and possibly multiple. You can have an auxiliary processor board installed in an Adept MV controller.
Requirements for Motion Systems Requirements for Motion Systems This section details the motion boards setup when more than one motion board is present in the system. Allocating Servos with an MI-3 or MI-6 Board When associating servo processes with a motion interface board, all channels of a motion interface board must be serviced by the same processor.
Requirements for Motion Systems The force sensor loads the processor computationally only when a force-sensing operation is taking place, and the load is somewhat less than a single serviced axis. (Undefined variable: Primary.Product_Name_V)Language User's Guide, version 17.
Installing Processor Boards Installing Processor Boards This section provides an overview of installing auxiliary processor boards, including: l Board locations l Slot ordering l Board addressing l System controller functions Processor Board Locations In each controller, the first slot available for processor boards must be occupied by an AWC processor. This processor must be addressed as board 1 and it must have the system controller functions enabled.
Customizing Processor Workloads Customizing Processor Workloads Generally, the default assignment of processor workloads is sufficient for most applications. However, if the default assignments do not suit your application, you can customize them. You can assign the following system tasks to the auxiliary processor: l Vision processing You can assign each vision system in the controller to a specific processor. l Servo processing You can assign the servo task for each VMI board to a specific processor.
Using Multiple V+ Systems Using Multiple V+ Systems For applications demanding extremely intensive V+ processing, it is possible to run a copy of V+ on every processor. This section details the requirements and considerations needed to run multiple V+ systems. Requirements for Running Multiple V+ Systems You must have the following items before you can use multiple processors to run multiple V+ systems.
Using Multiple V+ Systems The autostart function is enabled for all processors using CONFIG_C utility "Controller NVRAM" menu selection. See the Instructions for Adept Utility Programs for more details. Accessing the Command Prompt If you are not using autostart, you must enable the MONITORS system switch and use the Adept pull-down menu to select the Monitor window for the system you want to command. You can then enter V+ commands (such as LOAD and EXECUTE) at the V+ command prompt (.).
Using Multiple V+ Systems l l IOGETL l IOGETW the string function $IOGETS Each of the above keywords has a type parameter. Type 0 (zero), the default, is used to access memory on other Adept V+ processors. See the V+ Language Reference Guide for more details. You can use the real-valued function IOTAS to interlock access to this memory.
Using Multiple V+ Systems CAUTION: V+ does not enforce any memory-protection schemes for use of the application shared memory area. It is your responsibility to keep track of memory usage. If you are using application or utility programs (for example, Adept AIM VisionWare or AIM MotionWare) you should read the documentation provided with that software to be sure that there is no conflict with your usage of the shared area.
Using Multiple V+ Systems Efficiency Considerations You can put your shared data on any processor. However, it is most efficient to put the data on the processor that will use it most often, or that is performing the most time-critical operations. (It takes slightly longer to access data on another processor than to access data on the local processor.) If you wish, you can put some of your data on one processor and other data on a different processor.
Restrictions With Multiprocessor Systems Restrictions With Multiprocessor Systems You can set up certain tasks to operate on any processor board, including servo tasks, vision tasks, and in some cases, V+ user tasks.
Example V+ Programs Example V+ Programs The following topics are described in this chapter: Introduction 337 Pick and Place 338 Menu Program 342 Teaching Locations With the MCP 344 Defining a Tool Transformation 346 (Undefined variable: Primary.Product_Name_V)Language User's Guide, version 17.
Example V+ Programs V+Language User's Guide, v17.
Introduction Introduction This chapter contains a sampling of V+ programs. The first program is presented twice: once in its entirety exactly as it is displayed by V+ and a second time with a line-by-line explanation. The program keywords are detailed in the V+ Language Reference Guide. NOTE:The programs in this manual are not necessarily complete. In most cases further refinements could be added to improve the programs.
Pick and Place Pick and Place This program demonstrates a simple pick-and-place application. The robot picks up parts at one location and places them at another. Features Introduced l Program initialization l Variable assignment l System parameter modification l FOR loop l Motion instructions l Hand control l Terminal output Program Listing .PROGRAM move.parts() ; ABSTRACT: Pick up parts at location pick and put them down at place parts = 100 ;Number of parts to be processed height1 = 25.
Pick and Place RETURN ;End of the program .END Detailed Description This program has five sections: formal introduction, initialization of variables, initialization of the robot location, performance of the desired motion sequence, and notice to the operator of completion of the task. Each of these sections is described in detail below. The first line of every program must have the form of the line below. It is a good practice to follow that line with a brief description of the purpose of the program.
Pick and Place Initially, you should also make sure that the robot has the desired hand opening, is at a safe starting location, and that SCARA robots have the desired configuration. RIGHTY Make sure the robot has a right-handed configuration (with the elbow of the robot to the right side of the workspace). This is important if there are obstructions in the workspace that must be avoided. This instruction causes the robot to assume the requested configuration during its next motion.
Pick and Place DEPARTS height1 Now that the robot is grasping the part, we can back away from the part holder. This instruction moves the hand back height1 millimeters, following a straight-line path to make sure the part does not hit its holder. APPRO place, height2 MOVES place OPENI DEPARTS height2 Similar to the above motion sequence, these instructions cause the part to be moved to the put-down location and released. END This marks the end of the FOR loop.
Menu Program Menu Program This program displays a menu of operations from which an operator can choose. Features Introduced l Subroutines l Local variables l Terminal interaction with operator l String variables l WHILE and CASE structures Program Listing .PROGRAM sub.menu() ; ABSTRACT: This program provides the operator with a menu of ; operation selections on the system terminal. After accepting ; input from the keyboard, the program executes the desired ; operation.
Menu Program TYPE /B, /C1, "** Invalid input **" END ;End of CASE structure UNTIL quit ;End of DO structure .END (Undefined variable: Primary.Product_Name_V)Language User's Guide, version 17.
Teaching Locations With the MCP Teaching Locations With the MCP NOTE: This procedure does not apply to the Adept T20 pendant. This program demonstrates how an operator can teach locations with the manual control pendant, thus allowing the controller to operate without a system terminal. The two-line liquid crystal display (LCD) of the pendant is used to prompt the operator for the locations to be taught. The operator can then manually position the robot at a desired location and press a key on the pendant.
Teaching Locations With the MCP WAIT PENDANT(3) ;Wait for key to be HERE start ;Record the location pressed "start" WAIT NOT PENDANT(3) ; Prompt for second location WRITE (1) $clear.display, "Move robot to 'PICK' & press RECORD" WRITE (1) /X17, "RECORD", $CHR(5), /S WAIT PENDANT(3) ;Wait for key to be HERE pick ;Record the location pressed "pick" WAIT NOT PENDANT(3) ; Prompt for third location WRITE (1) $clear.
Defining a Tool Transformation Defining a Tool Transformation The following program establishes a reference point from which tool transformations can be taught. .PROGRAM def.tool() ; ABSTRACT: Invoke a new tool transformation based on a predefined reference ; location and, optionally, teach the reference location.
Defining a Tool Transformation TYPE /C2, "All done. The tool transformation has been set ", /S TYPE "equal to 'new.tool' .", /C1 DETACH (1) RETURN ;Detach the pendant ;Return to calling program (or STOP) .END Because of computational errors introduced when compound transformations are used, the accuracy of the program presented above can be improved by using a simple tool with no oblique rotations as the reference tool.
External Encoder Device External Encoder Device The following topics are described in this chapter: Introduction 351 Parameters 352 Device Setup 353 Reading Device Data 354 (Undefined variable: Primary.Product_Name_V)Language User's Guide, version 17.
External Encoder Device V+Language User's Guide, v17.
Introduction Introduction The external-encoder inputs on the system controller are normally used for conveyor belt tracking with a robot. However, these inputs can also be used for other sensing applications. In such applications, the DEVICE real-valued function and SETDEVICE program instruction allow the external encoders to be accessed in a more flexible manner than the belt-oriented instructions and functions.
Parameters Parameters The external encoder device type is 0. This means that the type parameter in all DEVICE or SETDEVICE instructions that reference the external encoders must have a value of zero. The standard Adept controller allows two external encoder units. These units are numbered 0 and 1. All DEVICE functions and SETDEVICE instructions that reference the external encoders must specify one of these unit numbers for the unit parameter. V+Language User's Guide, v17.
Device Setup Device Setup The SETDEVICE program instruction allows the external encoders to be initialized and various parameters to be set up. The action taken by the SETDEVICE instruction depends upon the value of the command parameter. The syntax of the SETDEVICE instruction is SETDEVICE (0, unit, error, command) p1, p2 The following table describes the valid commands.
Reading Device Data Reading Device Data The DEVICE real-valued function returns information about the encoder error status, position, and velocity. The scale factor, offset, and limits defined by the SETDEVICE instruction affect the velocity and position values returned. The syntax for this function is DEVICE(0, unit, error, select) The value returned depends upon the value of the select parameter, as described in the following table.
Reading Device Data select 3 Description Read Predicted Position The predicted position of the encoder (in millimeters) is returned. The position is predicted 32 milliseconds in the future, based upon the current position and velocity. The value is scaled the same as the current position described above. 4 Read Latched Position The position or the encoder (in millimeters) when the last external trigger occurred is returned.
Character Sets Character Sets The tables ASCII Control Values and Adept Character Set list the standard Adept character set. Values 0 to 127 (decimal) are the standard ASCII character set. Characters 1 to 31 are the common set of special and line-drawing characters. Characters 0 and 127 to 141 are Adept additions to the standard sets. Characters 32 to 255 (excluding 127 through 141) are the ISO standard 8859-1 character set.
Character Sets ASCII Control Values Character Decimal Value Hex.
Character Sets Character Decimal Value Hex.
Character Sets Character Decimal Value Hex. Value RS 030 1E Record separator US 031 1F Unit separator DEL 127 7F Delete Meaning of Control Character Adept Character Set Dec. Value Hex.
Character Sets Dec. Value Hex.
Character Sets Dec. Value Hex.
Character Sets Dec. Value Hex. Value 031 1F centered dot 032 20 space 033 21 exclamation ! ! 034 22 double quote " " 035 23 pound # # 036 24 dollar sign $ $ 037 25 percent % % 038 26 ampersand & & 039 27 single quote ' ' 040 28 open paren ( ( 041 29 close paren ) ) 042 2A asterisk * * 043 2B plus + + 044 2C comma , , 045 2D hyphen - - 046 2E period . .
Character Sets Dec. Value Hex.
Character Sets Dec. Value Hex. Value Description Font 1 066 42 B B B 067 43 C C C 068 44 D D D 069 45 E E E 070 46 F F F 071 47 G G G 072 48 H H H 073 49 I I I 074 4A J J J 075 4B K K K 076 4C L L L 077 4D M M M 078 4E N N N 079 4F O O O 080 50 P P P 081 51 Q Q Q 082 52 R R R 083 53 S S S 084 54 T T T Fonts 2, 3, 4, 5, & 6 (Undefined variable: Primary.Product_Name_V)Language User's Guide, version 17.
Character Sets Dec. Value Hex. Value Description Font 1 085 55 U U U 086 56 V V V 087 57 W W W 088 58 X X X 089 59 Y Y Y 090 5A Z Z Z 091 5B left bracket [ [ 092 5C back slash \ \ 093 5D right bracket ] ] 094 5E circumflex (caret) ^ ^ 095 5F underscore _ _ 096 60 grave accent 097 61 a a a 098 62 b b b 099 63 c c c 100 64 d d d 101 65 e e e Fonts 2, 3, 4, 5, & 6 V+Language User's Guide, v17.
Character Sets Dec. Value Hex. Value Description 102 66 f f f 103 67 g g g 104 68 h h h 105 69 i i i 106 6A j j j 107 6B k k k 108 6C l l l 109 6D m m m 110 6E n n n 111 6F o o o 112 70 p p p 113 71 q q q 114 72 r r r 115 73 s s s 116 74 t t t 117 75 u v u 118 76 v v v 119 77 w w w 120 78 x x x Font 1 Fonts 2, 3, 4, 5, & 6 (Undefined variable: Primary.Product_Name_V)Language User's Guide, version 17.
Character Sets Dec. Value Hex. Value Description 121 79 y y y 122 7A z z z 123 7B right brace } { 124 7C bar | | 125 7D left brace } } 126 7E tilde ~ ~ 127 7F solid 128 80 copyright © © 129 81 registered trademark ® ® 130 82 trademark TM TM 131 83 bullet · 132 84 superscript+ + 133 85 double quote (modified) " 134 86 checkmark 135 87 rightpointing Font 1 Fonts 2, 3, 4, 5, & 6 V+Language User's Guide, v17.
Character Sets Dec. Value Hex. Value Description Font 1 Fonts 2, 3, 4, 5, & 6 ≈ ≈ triangle 136 88 approximately equal symbol 137 89 OE ligature a 138 8A oe ligature i 139 8B beta ß u 140 8C Sigma Σ e 141 8D Omega Ω o 142 8E blank ya 143 8F blank yu 144 90 dotless i 145 91 grave accent Dbl next consonant 146 92 acute accent - 147 93 circumflex A 148 94 tilde I 149 95 macron ı ¯ yo U (Undefined variable: Primary.
Character Sets Dec. Value Hex.
Character Sets Dec. Value Hex. Value Description Font 1 Fonts 2, 3, 4, 5, & 6 e 166 A6 broken bar ¦ o 167 A7 section § a 168 A8 dieresis ¨ i 169 A9 copyright © u 170 AA feminine ordinal ª e 171 AB left guillemot « o 172 AC logical not ¬ ¬ya 173 AD en dash 174 AE registered 175 AF 176 - yu ® yo macron ¯ Dbl next consonant B0 degree ° - 177 B1 plus/minus ± A 178 B2 superscript2 ² I 179 B3 superscript3 ³ U (Undefined variable: Primary.
Character Sets Dec. Value Hex.
Character Sets Dec. Value Hex.
Character Sets Dec. Value Hex.
Character Sets Dec. Value Hex.
Character Sets Dec. Value Hex. Value Description 246 F6 247 Font 1 Fonts 2, 3, 4, 5, & 6 o dieresis ö YA F7 divide ÷ YU 248 F8 o slash ø YO 249 F9 u grave ù RA 250 FA u acute ú RI 251 FB u circumflex û RU 252 FC u dieresis ü RE 253 FD y acute ý RO 254 FE thorn þ WA 255 FF y dieresis ÿ N V+Language User's Guide, v17.