v_langrg Reference Guide - V+ Language Reference Guide Th...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: V+ Language Reference Guide Th is is a PDF/prin t version of th e V+ Lan gu age Referen ce Gu ide on lin e docu men tation . A Table of Con ten ts is provided so th at you can locate th e desired topics. Becau se th e V+ Operatin g S ystem Referen ce Gu ide was design ed for on lin e viewin g, th ere may be sligh t formattin g an omalies in th e PDF/prin t version . Addition ally, lin ks to extern al docu men ts will n ot work in th e PDF file. For optimal viewin g an d n avigation , please u se th e HTML version of th is docu men t, wh ich can be accessed from th e Adept Docu men t Library. NOTE: Please see th e V+ Release Notes, wh ich are in clu ded with you r V+ software, for a description of an y recen t ch an ges. V+ Lan gu age Referen ce Gu ide Page 1 Copyright Notice Th e in formation con tain ed h erein is th e property of Adept Tech n ology, In c., an d sh all n ot be reprodu ced in wh ole or in part with ou t prior written approval of Adept Tech n ology, In c. Th e in formation h erein is su bject to ch an ge with ou t n otice an d sh ou ld n ot be con stru ed as a commitmen t by Adept Tech n ology, In c. Th e docu men tation is periodically reviewed an d revised. Adept Tech n ology, In c., assu mes n o respon sibility for an y errors or omission s in th e docu men tation . Critical evalu ation of th e docu men tation by th e u ser is welcomed. You r commen ts assist u s in preparation of fu tu re docu men tation . Please su bmit you r commen ts to: tech pu bs@adept.com. Copyrigh t ♥ 1 9 9 4 - 2 0 0 9 by Adept Tech n ology, In c. Adept, th e Adept logo, th e Adept Tech n ology logo, AdeptVision , AIM, Blox, Bloxview, FireBlox, Fireview, Meta Con trols, MetaCon trols, Metawire, Soft Mach in es, an d Visu al Mach in es are registered trademarks of Adept Tech n ology, In c. Brain on Board is a registered trademark of Adept Tech n ology, In c. in German y. Adept ACE , ACE PackXpert, Adept 1 0 6 0 / 1 0 6 0 +, Adept 1 8 5 0 / 1 8 5 0 XP, Adept 5 4 0 Adept 5 6 0 , Adept An yFeeder, Adept Award, Adept C4 0 , Adept C6 0 , Adept CC, Adept Cobra 3 5 0 , Adept Cobra 3 5 0 CR/E SD, Adept Cobra 5 5 0 , Adept 5 5 0 Clean Room, Adept Cobra 6 0 0 , Adept Cobra 8 0 0 , Adept Cobra i6 0 0 , Adept Cobra i8 0 0 , Adept Cobra PLC Server, Adept Cobra PLC8 0 0 , Adept Cobra s6 0 0 , Adept Cobra s8 0 0 , Adept Cobra s8 0 0 In verted, Adept Cobra Smart6 0 0 , Adept Cobra Smart8 0 0 , Adept DeskTop, Adept FFE , Adept FlexFeeder 2 5 0 , Adept IC, Adept iSigh t, Adept Impu lse Feeder, Adept Lin eVision , Adept MB-1 0 ServoKit, Adept MC, Adept Motion Blox-1 0 , Adept Motion Blox-4 0 L, Adept Motion Blox-4 0 R, Adept MV Adept MV-1 0 , Adept MV-1 9 , Adept MV4 , Adept MV-5 , Adept MV-8 , Adept OC, Adept Pyth on , Adept Qu attro s6 5 0 , Adept Qu attro s6 5 0 H, Adept sDIO, Adept SmartAmp, Adept SmartAxis, Adept SmartCon troller CS, Adept SmartCon troller CX, Adept SmartModu le, Adept SmartMotion , Adept SmartServo, Adept sMI6 , Adept sSigh t, Adept Viper s6 5 0 , Adept Viper s8 5 0 , Adept Viper s1 3 0 0 , Adept Viper s1 7 0 0 , AdeptCartesian , AdeptCast, AdeptForce, AdeptFTP, AdeptGE M, AdeptModu les, AdeptMotion , AdeptMotion Servo, AdeptMotion VME , AdeptNet, AdeptNFS, AdeptOn e, AdeptOn e-MV, AdeptOn e-XL, AdeptRAPID, AdeptSigh t, AdeptSix, AdeptSix 3 0 0 , AdeptSix 3 0 0 CL, AdeptSix 3 0 0 CR, AdeptSix 6 0 0 , AdeptTCP/IP, AdeptTh ree, AdeptTh ree-MV, AdeptTh reeXL, AdeptTwo, AdeptVision , AVI AdeptVision , AGS AdeptVision GV, AdeptVision I, AdeptVision II, AdeptVision VME , AdeptVision VXL, AdeptVision XGS, AdeptVision XGS II, AdeptWin dows, AdeptWin dows Con troller, AdeptWin dows DDE , AdeptWin dows Offlin e E ditor, AdeptWin dows PC, AIM Comman d Server, AIM Dispen se, AIM PCB, AIM Vision Ware, A-Series, FlexFeedWare, HyperDrive, IO Blox, IO Blox 8 8 , MicroV+, Motion Blox, Motion Ware, ObjectFin der, ObjectFin der 2 0 0 0 , PackOn e, PalletWare, sAVI, S-Series, UltraOn e, V, V+ an d Vision Teach are trademarks of Adept Tech n ology, In c. An y trademarks from oth er compan ies u sed in th is pu blication are th e property of th ose respective compan ies. Created in th e Un ited States of America V+ Lan gu age Referen ce Gu ide Page 3 Table Of Contents Introduction 17 Compat ibilit y Licenses Relat ed Publicat ions Dangers, Warnings, Caut ions, and Not es in Manual Convent ions H ow Can I Get H elp? Keyword Overview 17 17 17 19 20 22 23 25 27 56 New or Enhanced Keywords Overview and Grouping by Funct ion V + Language Quick Reference Keyword Descriptions 91 92 93 95 96 97 100 102 104 106 107 108 109 111 112 114 115 118 119 120 122 Descript ions of V + Keywords A BORT program inst ruct ion A BOV E program inst ruct ion A BS real-valued funct ion A CCEL program inst ruct ion A CCEL real-valued funct ion A DW syst em swit ch A IO.IN real-valued funct ion A IO.INS real-valued funct ion A IO.OUT program inst ruct ion A LIGN program inst ruct ion A LTER program inst ruct ion A LTOFF program inst ruct ion A LTON program inst ruct ion A LWA YS keyword A MOV E program inst ruct ion A ND operat or A NY program inst ruct ion A PPRO program inst ruct ion A PPRO program inst ruct ion V+ Lan gu age Referen ce Gu ide Page 5 A S C real-valued funct ion A TA N2 real-valued funct ion A TTA CH program inst ruct ion A UTO program inst ruct ion A UTO.POWER.OFF syst em swit ch A V R syst em swit ch A V R.LOG syst em swit ch A V R.LOGS IZE syst em paramet er A V R.TRA CE syst em swit ch BA ND operat or BA S E program inst ruct ion BA S E t ransformat ion funct ion BCD real-valued funct ion BELOW program inst ruct ion BELT real-valued funct ion BELT syst em swit ch BELT.MODE syst em paramet er BITS program inst ruct ion BITS real-valued funct ion BMA S K real-valued funct ion BOR operat or BRA KE program inst ruct ion BREA K program inst ruct ion BS TA TUS real-valued funct ion BXOR operat or BY keyword CA LIBRA TE program inst ruct ion CA LL program inst ruct ion CA LLP program inst ruct ion CA LLS program inst ruct ion CA S real-valued funct ion CA S E program inst ruct ion $CH R st ring funct ion CLEA R.EV ENT program inst ruct ion CLOS E and CLOS EI program inst ruct ion CLOS E and CLOS EI program inst ruct ion V+ Lan gu age Referen ce Gu ide Page 6 124 125 126 134 137 139 140 141 142 143 145 147 148 149 150 152 154 156 158 160 161 163 164 165 167 169 170 174 177 179 181 183 186 187 188 190 COA RS E program inst ruct ion COM operat or CONFIG real-valued funct ion COS real-valued funct ion CP syst em swit ch CPOFF program inst ruct ion CPON program inst ruct ion CUBRT real-valued funct ion CYCLE.END program inst ruct ion DBLB real-valued funct ion $DBLB st ring funct ion DCB real-valued funct ion DECEL.100 syst em swit ch $DECODE st ring funct ion DECOMPOS E program inst ruct ion DEF.DIO program inst ruct ion $DEFA ULT st ring funct ion DEFBELT program inst ruct ion DEFINED real-valued funct ion DELA Y program inst ruct ion DELA Y.IN.TOL syst em swit ch DELA Y.POWER.OFF syst em swit ch DEPA RT and DEPA RTS program inst ruct ion DEPA RT and DEPA RTS program inst ruct ion DES T t ransformat ion funct ion DETA CH program inst ruct ion DEV ICE program inst ruct ion DEV ICE real-valued funct ion DEV ICES program inst ruct ion DIS A BLE program inst ruct ion DIS PLA Y.CA MERA syst em paramet er DIS TA NCE real-valued funct ion DN.RES TA RT program inst ruct ion DN.TH ROTTLE syst em paramet er DO program inst ruct ion DOS program inst ruct ion V+ Lan gu age Referen ce Gu ide Page 7 192 194 195 200 201 202 204 206 207 209 211 212 213 214 218 220 222 224 227 229 231 233 234 236 238 240 242 245 247 250 252 253 254 255 256 258 260 262 264 267 269 271 273 275 276 278 281 282 283 288 289 290 295 297 298 300 311 313 315 317 320 322 323 338 342 344 346 347 349 351 353 370 DRIV E program inst ruct ion DRY.RUN syst em swit ch DURA TION program inst ruct ion DURA TION real-valued funct ion DX, DY, DZ real-valued funct ion DX, DY, DZ real-valued funct ion DX, DY, DZ real-valued funct ion ELS E program inst ruct ion ENA BLE program inst ruct ion $ENCODE st ring funct ion END program inst ruct ion .END keyword ERROR real-valued funct ion $ERROR st ring funct ion ES TOP program inst ruct ion EXECUTE program inst ruct ion EXIT program inst ruct ion FA LS E real-valued funct ion FCLOS E program inst ruct ion FCMND program inst ruct ion FDELETE program inst ruct ion FEMPTY program inst ruct ion FINE program inst ruct ion FLIP program inst ruct ion FLTB real-valued funct ion $FLTB st ring funct ion FOPEN program inst ruct ion FOPEN_ program inst ruct ion FOR program inst ruct ion FORCE._ program inst ruct ion FRA CT real-valued funct ion FRA ME t ransformat ion funct ion FREE real-valued funct ion FS EEK program inst ruct ion FS ET program inst ruct ion GA IN.S ET program inst ruct ion V+ Lan gu age Referen ce Gu ide Page 8 GA RC program inst ruct ion GCH A IN program inst ruct ion GCLEA R program inst ruct ion GCLIP program inst ruct ion GCOLOR program inst ruct ion GCOPY program inst ruct ion GETC real-valued funct ion GET.EV ENT real-valued funct ion GETEV ENT program inst ruct ion GFLOOD program inst ruct ion GGETLINE program inst ruct ion GICON program inst ruct ion GLINE program inst ruct ion GLINES program inst ruct ion GLOBA L program inst ruct ion GLOGICA L program inst ruct ion GOTO program inst ruct ion GPA NEL program inst ruct ion GPOINT program inst ruct ion GRECTA NGLE program inst ruct ion GS CA N program inst ruct ion GS LIDE program inst ruct ion GTEXTURE program inst ruct ion GTRA NS program inst ruct ion GTYPE program inst ruct ion H A LT program inst ruct ion H A ND real-valued funct ion H A ND.TIME syst em paramet er H ERE program inst ruct ion H ERE t ransformat ion funct ion H OUR.METER real-valued funct ion ID real-valued funct ion $ID st ring funct ion IDENTICA L real-valued funct ion IF logical_expr TH EN program inst ruct ion IF logical_expr GOTO program inst ruct ion V+ Lan gu age Referen ce Gu ide Page 9 374 376 379 380 382 385 387 389 390 399 401 404 409 411 414 416 420 422 424 426 428 431 434 436 439 442 443 444 446 448 449 450 459 460 461 463 465 466 468 470 471 473 475 476 478 480 482 484 487 490 493 494 495 496 499 501 503 506 507 509 511 514 516 517 519 521 523 525 526 528 529 531 IGNORE program inst ruct ion INRA NGE real-valued funct ion INS TA LL program inst ruct ion INT real-valued funct ion INT.EV ENT program inst ruct ion INTB real-valued funct ion $INTB st ring funct ion INTERA CTIV E syst em swit ch INV ERS E t ransformat ion funct ion IOGET real-valued funct ions $IOGETS st ring funct ion IOPUT program inst ruct ion IOS TA T real-valued funct ion IOTA S real-valued funct ion IPS keyword JH ERE program inst ruct ion JMOV E program inst ruct ion JOG program inst ruct ion KERMIT.RETRY syst em paramet er KERMIT.TIMEOUT syst em paramet er KEYMODE program inst ruct ion KILL program inst ruct ion LA S T real-valued funct ion LA TCH t ransformat ion funct ion LA TCH ED real-valued funct ion LEFTY program inst ruct ion LEN real-valued funct ion LNGB real-valued funct ion $LNGB st ring funct ion LOCA L program inst ruct ion LOCK program inst ruct ion MA X real-valued funct ion MC program inst ruct ion MCP.MES S A GE syst em swit ch MCP.NO.POT syst em swit ch MCS program inst ruct ion V+ Lan gu age Referen ce Gu ide Page 1 0 MCS .MES S A GE syst em swit ch MES S A GES syst em swit ch $MID st ring funct ion MIN real-valued funct ion MMPS keyword MOD operat or MONITORS syst em swit ch MOV E and MOV ES program inst ruct ion MOV E and MOV ES program inst ruct ion MOV EF program inst ruct ion MOV EF program inst ruct ion MOV ET program inst ruct ion MOV ET program inst ruct ion MULTIPLE program inst ruct ion NETWORK real-valued funct ion NEXT program inst ruct ion NOFLIP program inst ruct ion NONULL program inst ruct ion NOOV ERLA P program inst ruct ion NORMA L t ransformat ion funct ion NOT operat or NOT.CA LIBRA TED syst em paramet er NULL program inst ruct ion NULL t ransformat ion funct ion OFF real-valued funct ion ON real-valued funct ion OPEN program inst ruct ion OPEN program inst ruct ion OR operat or OUTS IDE real-valued funct ion OV ERLA P program inst ruct ion PA CK program inst ruct ion PA NIC program inst ruct ion PA RA METER program inst ruct ion PA RA METER real-valued funct ion PA US E program inst ruct ion V+ Lan gu age Referen ce Gu ide Page 1 1 533 534 535 536 537 538 539 540 542 544 549 554 556 558 559 561 563 564 566 568 569 570 572 574 575 576 577 579 581 583 584 586 588 589 591 593 PA YLOA D program inst ruct ion #PDES T precision-point funct ion PENDA NT real-valued funct ion #PH ERE precision-point funct ion PI real-valued funct ion #PLA TCH precision-point funct ion POS real-valued funct ion POWER syst em swit ch #PPOINT precision- point funct ion PRIORITY real-valued funct ion .PROGRA M program inst ruct ion PROMPT program inst ruct ion RA NDOM real-valued funct ion REA CT program inst ruct ion REA CTE program inst ruct ion REA CTI program inst ruct ion REA D program inst ruct ion REA DY program inst ruct ion RELA X and RELA XI program inst ruct ion RELA X and RELA XI program inst ruct ion RELEA S E program inst ruct ion RES ET program inst ruct ion RETURN program inst ruct ion RETURNE program inst ruct ion RIGH TY program inst ruct ion ROBOT syst em swit ch ROBOT.OPR program inst ruct ion ROBOT.OPR real-valued funct ion RUNS IG program inst ruct ion RX, RY, RZ t ransformat ion funct ions RX, RY, RZ t ransformat ion funct ions RX, RY, RZ t ransformat ion funct ions S CA LE t ransformat ion funct ion S CA LE.A CCEL syst em swit ch S CA LE.A CCEL.ROT syst em swit ch S CREEN.TIMEOUT syst em paramet er V+ Lan gu age Referen ce Gu ide Page 1 2 594 597 598 601 602 603 604 605 607 609 610 613 615 616 619 621 623 628 630 632 634 636 637 638 639 640 642 649 651 653 654 655 656 657 659 660 662 665 668 670 672 673 674 675 677 680 681 683 685 686 688 689 691 700 702 704 707 709 713 714 715 725 727 729 731 733 735 736 737 739 742 744 S EE program inst ruct ion S ELECT program inst ruct ion S ELECT real-valued funct ion S ET program inst ruct ion S ET.EV ENT program inst ruct ion #S ET.POINT precision point funct ion S ET.S PEED syst em swit ch S ETBELT program inst ruct ion S ETDEV ICE program inst ruct ion S H IFT t ransformat ion funct ion S IG real-valued funct ion S IG.INS real-valued funct ion S IGN real-valued funct ion S IGNA L program inst ruct ion S IN real-valued funct ion S INGLE program inst ruct ion S OLV E.A NGLES program inst ruct ion S OLV E.FLA GS real-valued funct ion S OLV E.TRA NS program inst ruct ion S PEED program inst ruct ion S PEED real-valued funct ion S PIN program inst ruct ion S QR real-valued funct ion S QRT real-valued funct ion S TA TE real-valued funct ion S TA TUS real-valued funct ion S TOP program inst ruct ion S TRDIF real-valued funct ion S WITCH program inst ruct ion S WITCH real-valued funct ion $S YMBOL st ring funct ion S YMBOL.PTR real-valued funct ion $S YS .INFO st ring funct ion TA S real-valued funct ion TA S K real-valued funct ion TERMINA L syst em paramet er V+ Lan gu age Referen ce Gu ide Page 1 3 746 748 751 753 755 756 759 760 761 762 763 765 766 767 768 769 772 774 776 777 779 780 781 783 786 788 790 793 797 TIME program inst ruct ion TIME real-valued funct ion $TIME st ring funct ion $TIME4 st ring funct ion TIMER program inst ruct ion TIMER real-valued funct ion TOOL program inst ruct ion TOOL t ransformat ion funct ion TPS real-valued funct ion TRA CE syst em swit ch TRA NS t ransformat ion funct ion $TRA NS B st ring funct ion TRA NS B t ransformat ion funct ion TRUE real-valued funct ion $TRUNCA TE st ring funct ion TYPE program inst ruct ion UNIDIRECT program inst ruct ion $UNPA CK st ring funct ion UNTIL program inst ruct ion UPPER syst em swit ch V A L real-valued funct ion V A LUE program inst ruct ion WA IT program inst ruct ion WA IT.EV ENT program inst ruct ion WH ILE program inst ruct ion WINDOW program inst ruct ion WINDOW real-valued funct ion WRITE program inst ruct ion XOR operat or ID Option Words 799 800 801 802 805 807 Int roduct ion t o ID Opt ion Words Cont roller Opt ion Word Robot Opt ion Words S yst em Opt ion Words Processor Opt ion Word V+ Lan gu age Referen ce Gu ide Page 1 4 V ision Opt ion Word 808 System Messages 810 811 812 903 Int roduct ion t o S yst em Messages S yst em Messages - A lphabet ical List S yst em Messages - Numerical List V+ Lan gu age Referen ce Gu ide Page 1 5 In trodu ction Introduction Introduction Licenses R elated Publications Dangers, Warnings, Cautions, and Notes Conventions How Can I Get Help? Compatibility Th is gu ide is for u se with V+ systems version 1 4 .0 an d later. Th is gu ide provides referen ce material an d description s of keywords for th e V+ programmin g lan gu age. For in formation on th e V+ operatin g system an d description s of th e mon itor comman ds, see th e V+ Operatin g System User's Gu ide an d th e V+ Operatin g System Referen ce Gu ide. See th e V+ Release Notes for a su mmary of ch an ges for each version . Licenses Th e V+ Operatin g System software requ ires th e appropriate " V+ version licen se" to be in stalled in th e n on volatile RAM (NVRAM) on th e Adept con troller's system processor board. If th is licen se is n ot in stalled, th e system displays a * Protection E rror* after attemptin g to boot th e con troller. Th e Adept con troller is su pplied with th e AdeptTCP/IP an d th e AdeptNFS licen ses in stalled. Th is allows you to con n ect you r Adept con troller to an E th ern et n etwork an d to sh are files on it. Becau se Adept provides on ly an NFS Clien t, you mu st in stall NFS Server software on on e compu ter of you r n etwork. See th e AdeptNE T User's Gu ide an d th e Adept MV Con troller User's Gu ide or th e Adept SmartCon troller User's Gu ide for more in formation . Altern atively, you can u se Adept DeskTop, wh ich can commu n icate with th e Adept con troller with or with ou t NFS, to sh are files between you r PC an d con troller. R elated Publications Th is referen ce gu ide is a compan ion to th e V+ Lan gu age User's Gu ide, wh ich covers th e prin ciples of th e V+ programmin g lan gu age an d robot-con trol system. In addition to bein g a complete programmin g lan gu age, V+ is also a complete operatin g system th at con trols equ ipmen t con n ected to Adept con trollers. Th e V+ Operatin g System V+ Lan gu age Referen ce Gu ide Page 1 7 Related Pu blication s User's Gu ide an d V+ Operatin g System Referen ce Gu ide detail th e V+ operatin g system. You mu st be familiar with th e operatin g system in order to effectively u se th e V+ programmin g lan gu age. Th e most cu rren t releases of some related pu blication s may be for an earlier version of th e V+ system. You n eed to u se th em in con ju n ction with th e release n otes pu blish ed sin ce th ose books were pu blish ed. You may also n eed to refer to on e or more of th e man u als listed in th e table Related Pu blication s. Related Pu blication s Man u al Material Covered Adept SmartCon troller User's Gu ide In stru ction s for settin g u p, con figu rin g, an d main tain in g th e con troller on wh ich V+ ru n s. Adept MV Con troller User's Gu ide AdeptForce VME User's Gu ide In stallation , operation , an d programmin g of th e AdeptForce VME produ ct. Adept SmartMotion Developer's Gu ide Th ese man u als describe th e in stallation , con figu ration , an d tu n in g of an Adept motion system. Adept SmartMotion In stallation Gu ide AdeptMotion VME Developer's Gu ide AdeptNet User's Gu ide Use an d programmin g of th e AdeptNet produ ct. AdeptVision Referen ce Gu ide (if you r system is equ ipped with AdeptVision ) E n h an cemen ts to th e V+ lan gu age th at are added wh en th e AdeptVision option is in stalled. In stru ction s for Adept Utility Programs In stru ction s for ru n n in g variou s setu p an d con figu ration software u tilities. AdeptWin dows User's Gu ide In stru ction s for u sin g th e AdeptWin dows software produ ct. V+ Release Notes Late-breakin g ch an ges n ot in man u als; su mmary of ch an ges. V+ Lan gu age Referen ce Gu ide Page 1 8 Dan gers, Warn in gs, Cau tion s, an d Notes in Man u al Robot or motion device u ser's gu ides (if con n ected to you r system) In stru ction s for in stallin g an d main tain in g th e motion device con n ected to you r system. Dangers, Warnings, Cautions, and Notes in Manual Th ere are fou r levels of special n otation u sed in th is man u al. In descen din g order of importan ce, th ey are: DANGER: Th is in dicates an immin en tly h azardou s electrical situ ation wh ich , if n ot avoided, will resu lt in death or seriou s in ju ry. DANGER: Th is in dicates an immin en tly h azardou s situ ation wh ich , if n ot avoided, will resu lt in death or seriou s in ju ry. W ARNI NG: Th is in dicates a poten tially h azardou s electrical situ ation wh ich , if n ot avoided, cou ld resu lt in seriou s in ju ry or major damage to th e equ ipmen t. W ARNI NG: Th is in dicates a poten tially h azardou s situ ation wh ich , if n ot avoided, cou ld resu lt in seriou s in ju ry or major damage to th e equ ipmen t. CAUTI ON: Th is in dicates a situ ation wh ich , if n ot avoided, cou ld resu lt in min or in ju ry or damage to th e equ ipmen t. NOTE: Th is provides su pplemen tary in formation , emph asizes a poin t or procedu re, or gives a tip for easier operation . V+ Lan gu age Referen ce Gu ide Page 1 9 Con ven tion s Conventions T ypographic Conventions Th e followin g typograph ic con ven tion s are u sed th rou gh ou t th is man u al: Th is ALL CAPITALS Represen ts V+ file n ames, directory n ames, comman ds, keywords, an d attribu tes; also acron yms. A ph ysical key or bu tton th at you mu st press, su ch as th e Y, N, an d E NTE R keys. monospace Mon itor displays an d code examples. bold Bold type is u sed for su brou tin e n ames, variable n ames, an d program n ames, su ch as a.diskcopy. Bold type also is u sed for win dow items th at you ch oose an d win dow items th at do n ot h ave in itial capital letters in all prin cipal words. bold/regu lar In a typin g or en terin g in stru ction s, an yth in g th at you mu st type exactly as it appears. For example, if you are asked to type execu te 1 a.diskcopy, you type all th e bold ch aracters exactly as th ey are prin ted. Wh at you type is sh own in lowercase letters u n less it mu st be typed in u ppercase letters to work properly. You may always su bstitu te a cu rren tly valid sh ortcu t form wh en typin g a V+ comman d. In order for th e V+ system to process you r typin g, you mu st con clu de you r en try by pressin g th e E NTE R or RE TURN key. In Syn tax, place h olders, in formal syn tax defin ition s, for in formation th at you provide. You mu st replace su ch a place h older written in bold weigh t bu t n eed n ot replace an option al on e, wh ich is written in regu lar weigh t. italics In dicates n ew terms an d oth er emph asized words. In itial Capitals Th e n ame of an object su ch as a win dow, screen , men u , dialog box, or dialog box compon en t. E xamples are th e Display men u an d th e Task Profiler win dow. V+ Lan gu age Referen ce Gu ide Page 2 0 Con ven tion s " Qu otation marks" Men u items, prompts, or an y literal text th at is bein g referen ced. Keyboard Conventions Key combin ation s appear in th e followin g format: Notation Mean in g KE Y1 +KE Y2 A plu s sign (+) between keys mean s th at you mu st press an d h old down KE Y1 , th en press KE Y2 . For example, " Press CTRL+Z" mean s th at you press CTRL an d h old it down wh ile you press Z. Selecting, Choosing, and Pressing Items In a con text u sin g win dows, th e terms select, ch oose, an d press h ave differen t an d specific mean in gs. Selectin g an item u su ally mean s markin g or h igh ligh tin g it, as in pickin g a radio bu tton . Selectin g alon e does n ot in itiate an action . Ch oosin g an item carries ou t an action . For example, ch oosin g a men u item may open a win dow or carry ou t a comman d. You can also in itiate an action by ch oosin g a comman d bu tton (a pu sh bu tton or a stan dard bu tton ). You often mu st select an item before you can ch oose it. Often you can u se a combin ation of keyboard an d mou se tech n iqu es for selectin g an d ch oosin g. Pressin g refers to ph ysical bu tton s or keys. For example, you press th e save key or press th e E NTE R key. By con trast, you select or ch oose a win dow bu tton . Values, Variables, and E xpressions Th e parameters to V+ keywords can gen erally be satisfied with a specific valu e of th e correct data type, a variable of th e correct data type, or an expression th at resolves to th e correct type. Un less specifically stated, parameters can be replaced with a valu e, variable, or expression (of th e correct type). Th e most common case wh ere a parameter can n ot be satisfied with all th ree option s occu rs wh en data is bein g retu rn ed in on e of th e parameters. In th is case, a variable mu st be u sed; th e parameter description states th is restriction . Integers and Real Values In V+ in tegers an d real valu es are n ot differen t data types. Real valu es satisfy parameters requ irin g in tegers by rou n din g th e real valu e. Wh ere real valu es are requ ired, an in teger is V+ Lan gu age Referen ce Gu ide Page 2 1 How Can I Get Help? con sidered a special case of a real valu e with n o fraction al part. Special Notation Nu mbers sh own in oth er th an decimal format are preceded with a carat (^) an d th e letter H for h exadecimal or B for bin ary, an d with ju st a carat for Octal. For example, ^HF = ^B1 1 1 1 = ^1 7 = 1 5 . How Can I Get Help? For details on gettin g assistan ce with you r Adept software or h ardware, you can access th e followin g in formation sou rces on th e Adept corporate website: l For Con tact in formation : h ttp://www.adept.com/con tact/americas l For Produ ct Su pport in formation : h ttp://www.adept.com/su pport/service-an d-su pport/main l For fu rth er in formation abou t Adept Tech n ology, In c.: h ttp://www.adept.com V+ Lan gu age Referen ce Gu ide Page 2 2 Keyword Overview Keyword Overview New or Enhanced Keywords Keywords Grouped by Function Alphabetical Quick R eference V+ Lan gu age Referen ce Gu ide Page 2 3 New or E n h an ced Keywords New or Enhanced Keywords For in formation on n ew or en h an ced keywords listed by V+ software release, select a lin k below: V+ 1 4 .x Release Notes V+ 1 5 .x Release Notes V+ 1 6 .x Release Notes V+ 1 7 .x Release Notes V+ Lan gu age Referen ce Gu ide Page 2 5 Overview an d Grou pin g by Fu n ction Overview and Grouping by Function Th ere are fou r types of programmin g keywords described in th is docu men tation : l Program In stru ction s l Fu n ction s l System Parameters l System Switch es In addition , th is docu men tation also refers to mon itor comman ds. Mon itor comman ds are part of th e V+ operatin g system. Th e V+ operatin g system comman ds are detailed in th e V+ Operatin g System Referen ce Gu ide. If you r system is equ ipped with AdeptVision , addition al program in stru ction s, fu n ction s, switch es, parameters, an d mon itor comman ds are detailed in th e AdeptVision Referen ce Gu ide. Th e keywords are presen ted in alph abetical order, with th e description for each keyword startin g on a n ew page. For details on wh at is in clu ded, see Docu men tation Con ven tion s for Keywords. Th e tables in th e n ext section su mmarize th e keywords u sed by th e V+ lan gu age. For an alph abetical listin g of all keywords, th eir parameters, an d a brief description of each keyword, see th e V+ Lan gu age Qu ick Referen ce. Keyword Groups Th e V+ keyword su mmary grou ps keywords as follows: l l l Con veyor Belt Operation s lists th e keywords wh ose primary u se is with trackin g con veyor belt operation s. Graph ics Operation s lists th e keywords u sed primarily with graph ics-based systems to man age win dows, graph ics, an d even t-driven programmin g for a graph ical u ser in terface (GUI). System In pu t/Ou tpu t Operation s lists th e keywords wh ose primary u se is for system in pu t/ou tpu t operation s. Th ese in clu de disk I/O, serial I/O, digital I/O, an d termin al I/O. l Logical an d Bit Operation s lists th e V+ logical operators. l Motion Con trol Operation s lists th e keywords th at con trol motion devices. l l Nu meric Valu e Operation s lists th e n u merical operation s (squ are root, modu lo, trigon ometric, an d similar fu n ction s). Program Con trol Operation s lists th e keywords primarily con cern ed with program con trol. In stru ction s for operation s su ch as creatin g programs an d program flow are in V+ Lan gu age Referen ce Gu ide Page 2 7 Overview an d Grou pin g by Fu n ction th is grou p. l Strin g Operation s lists th e strin g operators (su bstrin g, strin g con version s, an d similar fu n ction s). Con veyor Belt Operation s Keyword Type Fu n ction BE LT S Con trol th e fu n ction of th e con veyor trackin g featu res of th e V+ system. BE LT (%belt_ var, mode) RF Retu rn in formation abou t a con veyor belt bein g tracked with th e con veyor trackin g featu re. BE LT.MODE P Set ch aracteristics of th e con veyor trackin g featu re of th e V+ system. BSTATUS RF Retu rn in formation abou t th e statu s of th e con veyor trackin g system. DE FBE LT %belt_ var = n om_ tran s, belt_ n u m, vel_ avg, scale_ fact PI Defin e a belt variable for u se with a robot trackin g con veyor belt. SE TBE LT %belt_ var = expression PI Set th e en coder offset of th e specified belt variable equ al to th e valu e of th e expression . WINDOW %belt_ var = location , location , program, priority PI Set th e bou n daries of th e operatin g region of th e specified belt variable for con veyor trackin g. WINDOW (tran sformation , time, mode) RF Retu rn a valu e th at in dicates wh ere th e location described by th e belt-relative tran sformation valu e is relative to th e predefin ed bou n daries of th e workin g ran ge on a movin g con veyor belt. P: Parameter, PI: Program In stru ction , RF: Real-Valu ed Fu n ction , S: Switch Graph ics Operation s Keyword Type Fu n ction V+ Lan gu age Referen ce Gu ide Page 2 8 Overview an d Grou pin g by Fu n ction FDE LE TE (logical_ u n it) object PI Delete th e specified file, th e specified graph ics win dow an d all its ch ild win dows, or th e specified graph ics icon . FOPE N (logical_ u n it, mode) attribu te_ list PI Create an d open a n ew graph ics win dow, or open an existin g graph ics win dow, for su bsequ en t in pu t an d/or ou tpu t. FSE T (logical_ u n it) attribu te_ list PI Set or modify attribu tes of a graph ics win dow or serial lin e. GARC (lu n , mode) xc, yc, radiu s, an g0 , an gn PI Draw an arc or a circle in a graph ics win dow. GCHAIN (lu n ) x, y, poin ts, direction [in dex] PI Draw a ch ain of poin ts in a graph ics win dow to form a complex figu re. GCLE AR (lu n ) PI Clear an en tire graph ics win dow to th e backgrou n d color. GCLIP (lu n ) x, y, dx, dy PI Set th e clippin g rectan gle for all graph ics in stru ction s (except GFLOOD) to su ppress all su bsequ en t graph ics th at fall ou tside th e rectan gle. GCOLOR (lu n ) foregrn d, backgrn d PI Set th e foregrou n d an d backgrou n d colors for su bsequ en t graph ics ou tpu t. GCOPY (lu n ) x, y = src_ x, src_ y, dx, dy PI Copy on e region of a win dow to an oth er region in th e same win dow. GE TE VE NT (lu n , mode) even ts[in dex] PI Retu rn in formation describin g in pu t from a graph ics win dow. GFLOOD (logical_ u n it) x, y PI Flood a region in a graph ics win dow with color. GGE TLINE (logical_ u n it) $ data[in dex], n u m.pix = x, y, n x PI Retu rn pixel in formation from a sin gle pixel row in a graph ics win dow. GICON (lu n , mode) x, y, $ n ame, in dex PI Draw a predefin ed graph ic symbol (icon ) in a graph ics win dow. V+ Lan gu age Referen ce Gu ide Page 2 9 Overview an d Grou pin g by Fu n ction GLINE (lu n ) x0 , y0 , xn , yn PI Draw a sin gle lin e segmen t in a graph ics win dow. GLINE S (logical_ u n it, mode) poin ts, coord[offset,in dex] PI Draw mu ltiple lin e segmen ts in a graph ics win dow. GLOGICAL (logical_ u n it) code, plan es PI Set th e logical operation to be performed between n ew graph ics ou tpu t an d graph ics data already displayed, an d select wh ich bit plan es are affected by graph ics in stru ction s. GPANE L (lu n , mode) x, y, dx, dy PI Draw a rectan gu lar pan el with sh adowed or grooved edges. GPOINT (lu n ) x, y PI Draw a sin gle poin t in a graph ics win dow. GRE CTANGLE (lu n , mode) x, y, dx, dy PI Draw a rectan gle in a graph ics win dow. GSCAN (lu n ) lin es, data[offset,in dex] PI Draw a n u mber of h orizon tal lin es in a graph ics win dow to form a complex figu re. GSLIDE (lu n , mode) id = x, y, len gth , max_ pos, arrow_ in c, h an dle PI Draw a slide bar in preparation for receivin g slide even ts. GTE XTURE (lu n ) mode, pattern PI Set th e opaqu e/tran sparen t mode an d th e textu re pattern for su bsequ en t graph ics ou tpu t. GTRANS(lu n , mode) array[,] PI Scale, rotate, an d offset su bsequ en t graph ics in stru ction s. GTYPE (lu n , mode) x, y, $ text, fon t_ n u mb PI Display a text strin g in a graph ics win dow. ... SCRE E N.TIME OUT P E stablish th e time-ou t period for blan kin g th e screen of th e graph ics mon itor (VGB on ly). P: Parameter, PI: Program In stru ction V+ Lan gu age Referen ce Gu ide Page 3 0 Overview an d Grou pin g by Fu n ction S ystem I n pu t/Ou tpu t Operation s Type Keyword Fu n ction AIO.IN (ch an n el, gain ) RF Read a ch an n el from on e of th e an alog IO boards. AIO.INS (ch an n el) RF Test wh eth er an an alog in pu t or ou tpu t ch an n el is in stalled. AIO.OUT ch an n el = valu e PI Write to a ch an n el on on e of th e an alog IO boards. ATTACH (lu n , mode) $ device PI Make a device available for u se by th e application program. BITS first_ sig, n u m_ sigs = valu e PI Set or clear a grou p of digital sign als based on a valu e. BITS (first_ sig, n u m_ sigs) RF Read mu ltiple digital sign als an d retu rn th e valu e correspon din g to th e bin ary bit pattern presen t on th e sign als. $ DE FAULT () SF Retu rn a strin g con tain in g th e cu rren t system defau lt device, u n it, an d directory path for file access. DE F.DIO sign al = address, type PI Assign th ird-party digital I/O boards to stan dard V+ sign al n u mbers, for u se by stan dard V+ in stru ction s, fu n ction s, an d mon itor comman ds. DE TACH (logical_ u n it) PI Release a specified device from th e con trol of th e application program. DE VICE (type, u n it, error, p1 , p2 , ...) ou t[i], in [j], ou t_ tran s, in _ tran s PI Sen d a comman d or data to an extern al device an d, option ally, retu rn data to th e program. (Th e actu al operation performed depen ds on th e device referen ced.) DE VICE (type, u n it, error, p1 , p2 ,...) RF Retu rn a real valu e from a specified device. Th e valu e may be data or statu s V+ Lan gu age Referen ce Gu ide Page 3 1 Overview an d Grou pin g by Fu n ction in formation , depen din g u pon th e device an d th e parameters. DE VICE S (type, u n it, error, p1 , p2 , ...) $ ou t, $ in PI Sen d comman ds or data to an extern al device an d option ally retu rn data. Th e actu al operation performed depen ds on th e device referen ced. FCLOSE (logical_ u n it) PI Close th e file, graph ics win dow, or graph ics icon cu rren tly open on th e specified logical u n it. FCMND (logical_ u n it, comman d_ code) $ ou t_ strin g, $ in _ strin g PI Gen erate a device-specific comman d to th e in pu t/ou tpu t device specified by th e logical u n it. FE MPTY (logical_ u n it) PI E mpty an y in tern al bu ffers in u se for a file or a graph ics win dow by writin g th e bu ffers to th e file or win dow if n ecessary. FOPE NA PI Open an existin g file for read-writeappen d as in dicated by th e last letter of th e in stru ction n ame. FOPE ND PI Open a file for read-directory as in dicated by th e last letter of th e in stru ction n ame. FOPE NR PI Open an existin g file for read-on ly as in dicated by th e last letter of th e in stru ction n ame. FOPE NW PI Open a n ew file for read-write as in dicated by th e last letter of th e in stru ction n ame. FSE E K (logical_ u n it, record_ n u mber) PI Position a file open for ran dom access an d in itiate a read operation on th e specified record. FSE T (logical_ u n it) attribu te_ list PI Set serial I/O port con figu ration parameters. V+ Lan gu age Referen ce Gu ide Page 3 2 Overview an d Grou pin g by Fu n ction GE TC (lu n , mode) RF Retu rn th e n ext ch aracter (byte) from a device or in pu t record on th e specified logical u n it. IGNORE sign al PI Can cel th e effect of a RE ACT or RE ACTI in stru ction . IOGE T_ (address, type, cpu ) RF Retu rn a valu e from a device on th e VME bu s. $ IOGE TS (address, len gth , type, cpu ) SF Retu rn a strin g valu e from a device on th e VME bu s. IOPUT_ address, type, cpu = valu e PI Sen d a valu e to a device on th e VME bu s. IOSTAT (lu n , mode) RF Retu rn statu s in formation for th e last in pu t/ou tpu t operation for a device associated with a logical u n it. IOTAS (address, type, cpu ) RF Con trol access to sh ared devices on th e VME bu s. ... KE RMIT.RE TRY P E stablish th e maximu m n u mber of times th e (local) Kermit driver sh ou ld retry an operation before reportin g an error. ... KE RMIT.TIME OUT P E stablish th e delay parameter th at th e V+ driver for th e Kermit protocol will sen d to th e remote server. KE YMODE first_ key, last_ key = mode, settin g PI Set th e beh avior of a grou p of keys on th e man u al con trol pen dan t. NE TWORK(compon en t, code) RF Retu rn n etwork statu s an d IP address in formation . PE NDANT (select) RF Retu rn in pu t from th e man u al con trol pen dan t. PROMPT ou tpu t_ strin g, variable_ list PI Display a strin g on th e system termin al an d wait for operator in pu t. V+ Lan gu age Referen ce Gu ide Page 3 3 Overview an d Grou pin g by Fu n ction RE AD (lu n , record_ n u m, mode) var_ list PI Read a record from an open file or from an attach ed device th at is n ot file orien ted. RE SE T PI Tu rn off all th e extern al ou tpu t sign als. SE TDE VICE (type, u n it, error, comman d) p1 , p2 , ... PI In itialize a device or set device parameters. (Th e actu al operation performed depen ds on th e device referen ced.) SIG (sign al_ n u m, ..., sign al_ num) RF Retu rn th e logical AND of th e states of th e in dicated digital sign als. SIG.INS (sign al_ n u m) RF Retu rn an in dication of wh eth er or n ot a digital I/O sign al is con figu red for u se by th e system, or wh eth er or n ot a software sign al is available in th e system. SIGNAL sign al_ n u m, ..., sign al_ num PI Tu rn on or off extern al digital ou tpu t sign als or in tern al software sign als. TYPE ou tpu t_ specification , ..., ou tpu t_ specification PI Display th e in formation described by th e ou tpu t specification s on th e system termin al. A blan k lin e is ou tpu t if n o argu men t is provided. WRITE (lu n , record_ n u m, mode) format_ list PI Write a record to an open file or to an attach ed device th at is file orien ted. P: Parameter, PI: Program In stru ction , RF: Real-Valu ed Fu n ction , SF: Strin g Fu n ction Logical an d Bit Operation s Keyword Type Fu n ction AND valu e ... O Perform th e logical AND operation on two valu es. BAND valu e ... O Perform th e bin ary AND operation on two valu es. BMASK (bit, bit, ..., bit) RF Create a bit mask by specifyin g wh ich bits to set. V+ Lan gu age Referen ce Gu ide Page 3 4 Overview an d Grou pin g by Fu n ction ... valu e BOR valu e ... O Perform th e bin ary OR operation on two valu es. BXOR O Perform th e bin ary exclu sive-OR operation on two valu es. ... COM valu e ... O Perform th e bin ary complemen t operation on a valu e. FALSE RF Retu rn th e valu e u sed by V+ to represen t a logical false resu lt. ... valu e MOD valu e ... O Compu te th e modu lu s of two valu es. ... NOT valu e ... O Perform logical n egation of a valu e. OFF RF Retu rn th e valu e u sed by V+ to represen t a logical false resu lt. ON RF Retu rn th e valu e u sed by V+ to represen t a logical tru e resu lt. OR O Perform th e logical OR operation on two valu es. ... TRUE RF Retu rn th e valu e u sed by V+ to represen t a logical tru e resu lt. ... valu e XOR valu e... O Perform th e logical exclu sive-OR operation on two valu es. O: Operator, RF: Real-Valu ed Fu n ction Motion Con trol Operation s Keyword ABOVE Type PI Fu n ction Requ est a ch an ge in th e robot con figu ration du rin g th e n ext motion so th at th e elbow is above th e lin e from th e sh ou lder to th e wrist. V+ Lan gu age Referen ce Gu ide Page 3 5 Overview an d Grou pin g by Fu n ction ACCE L (profile) acceleration , deceleration PI Set acceleration an d deceleration for robot motion s. ACCE L (select) RF Retu rn th e cu rren t robot acceleration or deceleration settin g. ALIGN PI Align th e robot tool Z axis with th e n earest world axis. ALTE R (con trol) Dx, Dy, Dz, Rx, Ry, Rz PI Specify th e magn itu de of th e real-time path modification th at is to be applied to th e robot path du rin g th e n ext trajectory compu tation . ALTOFF PI Termin ate real-time path -modification mode (alter mode). ALTON (lu n ) mode PI E n able real-time path -modification mode (alter mode), an d specify th e way in wh ich ALTE R coordin ate in formation will be in terpreted. ALWAYS K Used with certain program in stru ction s to specify a lon g-term effect. APPRO location , distan ce PI Start a join t-in terpolated robot motion toward a location defin ed relative to specified location . APPROS location , distan ce PI Start a straigh t-lin e robot motion toward a location defin ed relative to specified location . AUTO.POWE R.OFF S Con trol wh eth er or n ot V+ disables h igh power wh en certain motion errors occu r. BASE X_ sh ift, Y_ sh ift, Z_ sh ift, Z_ rotation PI Tran slate an d rotate th e World referen ce frame relative to th e robot. BASE TF Retu rn th e tran sformation valu e th at represen ts th e tran slation an d rotation set by th e last BASE comman d or in stru ction . V+ Lan gu age Referen ce Gu ide Page 3 6 Overview an d Grou pin g by Fu n ction BE LOW PI Requ est a ch an ge in th e robot con figu ration du rin g th e n ext motion so th at th e elbow is below th e lin e from th e sh ou lder to th e wrist. BRAKE PI Abort th e cu rren t robot motion . BRE AK PI Su spen d program execu tion u n til th e cu rren t motion completes. CALIBRATE mode, statu s PI In itialize th e robot position in g system. CLOSE PI Close th e robot gripper. CLOSE I PI Immediately close th e robot gripper. COARSE toleran ce ALWAYS PI E n able a low-precision featu re of th e robot h ardware servo. CONFIG (select) RF Retu rn a valu e th at provides in formation abou t th e robot's geometric con figu ration or th e statu s of th e motion servo-con trol featu res. ... CP S Con trol th e con tin u ou s-path featu re. CPOFF ALWAYS PI In stru ct th e V+ system to stop th e robot at th e completion of th e n ext motion in stru ction (or all su bsequ en t motion in stru ction s) an d n u ll position errors. CPON ALWAYS PI In stru ct th e V+ system to execu te th e n ext motion in stru ction (or all su bsequ en t motion in stru ction s) as part of a con tin u ou s path . ..DE CE L 1 0 0 [robot_ n u m] S E n able or disable th e u se of 1 0 0 percen t as th e maximu m deceleration for th e accel program in stru ction . DE COMPOSE array_ n ame[in dex] = location PI E xtract th e (real) valu es of in dividu al compon en ts of a location valu e. V+ Lan gu age Referen ce Gu ide Page 3 7 Overview an d Grou pin g by Fu n ction DE LAY.IN.TOL S Con trol th e timin g of COARSE or FINE n u llin g after V+ completes a motion segmen t. DE LAY.POWE R.OFF S E n able/disable th e E STOP timer delay featu re for servo errors. Th is switch is on ly operation al for systems equ ipped with an AWC-II board as th e main CPU. Th is switch is on ly available in V+ 1 4 .1 or h igh er. DE LAY time PI Cau se robot motion to stop for th e specified period of time. DE PART distan ce PI Start a join t-in terpolated robot motion away from th e cu rren t location . DE PARTS distan ce PI Start a straigh t-lin e robot motion away from th e cu rren t location . DE ST TF Retu rn a tran sformation valu e represen tin g th e plan n ed destin ation location for th e cu rren t robot motion . DISTANCE (location _ 1 , location _ 2 ) RF Determin e th e distan ce between th e poin ts defin ed by two location valu es. DRIVE join t, ch an ge, speed PI Move an in dividu al join t of th e robot. ... DRY.RUN S Con trol wh eth er or n ot V+ commu n icates with th e robot. DURATION time ALWAYS PI Set th e min imu m execu tion time for su bsequ en t robot motion s. DURATION (select) RF Retu rn th e cu rren t settin g of on e of th e motion DURATION specification s. DX (location ) RF Retu rn th e X displacemen t compon en t of a given tran sformation valu e. DY (location ) RF Retu rn th e Y displacemen t compon en t of a given tran sformation valu e. V+ Lan gu age Referen ce Gu ide Page 3 8 Overview an d Grou pin g by Fu n ction DZ (location ) RF Retu rn th e Z displacemen t compon en t of a given tran sformation valu e. E STOP PI Assert th e emergen cy-stop sign al to stop th e robot. FINE toleran ce ALWAYS PI E n able a h igh -precision featu re of th e robot h ardware servo. FLIP PI Requ est a ch an ge in th e robot con figu ration du rin g th e n ext motion so th at th e pitch an gle of th e robot wrist h as a n egative valu e. FRAME (location _ 1 , location _ 2 , location _ 3 , location _ 4 ) TF Retu rn a tran sformation valu e defin ed by fou r position s. GAIN.SE T set, motor PI Select a set of gain parameters for on e or more join ts of th e cu rren t robot. HAND RF Retu rn th e cu rren t h an d open in g. HAND.TIME P E stablish th e du ration of th e motion delay th at occu rs du rin g OPE NI, CLOSE I, an d RE LAXI in stru ction s. HE RE location _ var PI Set th e valu e of a tran sformation or precision -poin t variable equ al to th e cu rren t robot location . HE RE TF Retu rn a tran sformation valu e th at represen ts th e cu rren t location of th e robot tool poin t. HOUR.ME TE R RF Retu rn th e cu rren t valu e of th e robot h ou r meter. IDE NTICAL (location , location ) RF Determin e wh eth er two location valu es are exactly th e same. INRANGE (location ) RF Retu rn a valu e th at in dicates wh eth er a location can be reach ed by th e robot, an d if n ot, wh y n ot. V+ Lan gu age Referen ce Gu ide Page 3 9 Overview an d Grou pin g by Fu n ction INVE RSE (tran sformation ) TF Retu rn th e tran sformation valu e th at is th e math ematical in verse of th e given tran sformation valu e. JOG (statu s) robot, mode, axis, speed PI Moves (" jogs" ) th e specified axis or join t of th e robot. E ach time JOG execu tes, th e specified axis or join t moves for 2 0 0 ms. LATCH (select) TF Retu rn a tran sformation valu e represen tin g th e location of th e robot at th e occu rren ce of th e last extern al trigger. LATCHE D (select) RF Retu rn th e statu s of th e extern al trigger an d of th e in formation it cau ses to be latch ed. LE FTY PI Requ est a ch an ge in th e robot con figu ration du rin g th e n ext motion so th at th e first two lin ks of a SCARA robot resemble a h u man 's left arm. MOVE location PI In itiate a join t-in terpolated robot motion to th e position an d orien tation described by th e given location . MOVE S location PI In itiate a straigh t-lin e robot motion to th e position an d orien tation described by th e given location . MOVE F location , depart_ clr, appro_ clr, depart_ tqe, h oriz_ accel_ tqe, h oriz_ decel_ tqe, appro_ tqe, model PI In itiate a th ree-segmen t pick-an d-place robot motion to th e specified destin ation (join t-in terpolated for th e h orizon tal segmen t), movin g th e robot at th e fastest allowable speed. MOVE SF location , depart_ clr, appro_ clr, depart_ tqe, h oriz_ accel_ tqe, h oriz_ decel_ tqe, appro_ tqe, model PI In itiate a th ree-segmen t pick-an d-place robot motion to th e specified destin ation (straigh t-lin e for th e h orizon tal segmen t), movin g th e robot at th e fastest allowable speed. V+ Lan gu age Referen ce Gu ide Page 4 0 Overview an d Grou pin g by Fu n ction MOVE T location , h an d_ open in g PI In itiate a join t-in terpolated robot motion to th e position an d orien tation described by th e given location an d simu ltan eou sly operate th e h an d. MOVE ST location , h an d_ open in g PI In itiate a straigh t-lin e robot motion to th e position an d orien tation described by th e given location an d simu ltan eou sly operate th e h an d. MULTIPLE ALWAYS PI Allow fu ll rotation s of th e robot wrist join ts. NOFLIP PI Requ est a ch an ge in th e robot con figu ration du rin g th e n ext motion so th at th e pitch an gle of th e robot wrist h as a positive valu e. NONULL ALWAYS PI In stru ct th e V+ system n ot to wait for position errors to be n u lled at th e en d of con tin u ou s-path motion s. NOOVE RLAP always PI Gen erate a program error if a motion is plan n ed th at will cau se selected mu ltitu rn axes to tu rn more th an 1 8 0 degrees (th e lon g way arou n d) in order to avoid a limit stop. NORMAL (tran sformation _ valu e) TF Correct a tran sformation for an y math ematical rou n d-off errors. ... NOT.CALIBRATE D P In dicate (or assert) th e calibration statu s of th e robots con n ected to th e system. NU L L TF Retu rn a n u ll tran sformation valu e-on e wh ose compon en ts are all zero. NULL ALWAYS PI In stru ct th e V+ system to wait for position errors to be n u lled at th e en d of con tin u ou s path motion s. OPE N PI Open th e robot gripper. V+ Lan gu age Referen ce Gu ide Page 4 1 Overview an d Grou pin g by Fu n ction OPE NI PI Immediately open th e robot gripper. OVE RLAP always PI Disable th e NOOVE RLAP limit-error ch eckin g eith er for th e n ext motion or for all su bsequ en t motion s. PAYLOAD valu e, motor PI Set an in dication of th e cu rren t robot payload. #PDE ST PF Retu rn a precision -poin t valu e represen tin g th e plan n ed destin ation location for th e cu rren t robot motion . #PLATCH (select) PF Retu rn a precision -poin t valu e represen tin g th e location of th e robot at th e occu rren ce of th e last extern al trigger. ... POWE R S Con trol or mon itor th e statu s of robot power. #PPOINT (j1 _ valu e, j2 _ valu e, j3 _ valu e, j4 _ valu e, j5 _ valu e, j6 _ valu e, j7 _ valu e, j8 _ valu e, j9 _ valu e, j1 0 _ valu e, j1 1 _ valu e, j1 2 _ valu e) PF Retu rn a precision -poin t valu e composed from th e given compon en ts. RE ACTI sign al_ n u m, program, priority PI In itiate con tin u ou s mon itorin g of a specified digital sign al. Au tomatically stop th e cu rren t robot motion if th e sign al tran sition s properly an d, option ally, trigger a su brou tin e call. RE ADY PI Move th e robot to th e RE ADY location above th e workspace, wh ich forces th e robot in to a stan dard con figu ration . RE LAX PI Limp th e pn eu matic h an d. RE LAXI PI Immediately limp th e pn eu matic h an d. RIGHTY PI Requ est a ch an ge in th e robot con figu ration du rin g th e n ext motion so th at th e first two lin ks of th e robot resemble a h u man 's righ t arm. V+ Lan gu age Referen ce Gu ide Page 4 2 Overview an d Grou pin g by Fu n ction ... ROBOT [in dex] S E n able or disable on e robot or all robots. ROBOT.OPR (mode, in dex) RF Retu rn robot-specific data for th e cu rren tly selected robot. RX (an gle) TF Retu rn a tran sformation describin g a rotation abou t X. RY (an gle) TF Retu rn a tran sformation describin g a rotation abou t Y. RZ (an gle) TF Retu rn a tran sformation describin g a rotation abou t Z. SCALE (tran sformation BY scale_ factor) TF Retu rn a tran sformation valu e equ al to th e tran sformation parameter with th e position scaled by th e scale factor. ... SCALE .ACCE L [robot_ n u m] S Scale acceleration an d deceleration as a fu n ction of program speed wh en program speed is below 1 0 0 %. ... SCALE .ACCE L.ROT [robot_ num] S Specify wh eth er or n ot th e SCALE .ACCE L switch takes in to accou n t th e Cartesian rotation al speed du rin g straigh t-lin e motion s. SE LE CT device_ type = u n it PI Select th e u n it of th e n amed device for access by th e cu rren t task. SE T location _ var = location _ valu e PI Set th e valu e of th e location variable on th e left equ al to th e location valu e on th e righ t of th e equ al sign . #SE T.POINT PF Retu rn th e comman ded join t-an gle position s compu ted by th e trajectory gen erator du rin g th e last trajectoryevalu ation cycle. ... SE T.SPE E D S Con trol wh eth er or n ot th e mon itor speed can be ch an ged from th e man u al con trol pen dan t. Th e mon itor speed can n ot be ch an ged wh en th e switch is dis- V+ Lan gu age Referen ce Gu ide Page 4 3 Overview an d Grou pin g by Fu n ction abled. SHIFT (tran sformation BY x_ sh ift, y_ sh ift, z_ sh ift) TF Retu rn a tran sformation valu e resu ltin g from sh iftin g th e position of th e tran sformation parameter by th e given sh ift amou n ts. SINGLE ALWAYS PI Limit rotation s of th e robot wrist join t to th e ran ge -1 8 0 degrees to +1 8 0 degrees. SOLVE .ANGLE S o.jts[o.idx], o.flags, error = tran s, i.jts[i.idx],i.flags PI Compu te th e robot join t position s (for th e cu rren t robot) th at are equ ivalen t to a specified tran sformation . SOLVE .FLAGS (join ts[in dex]) RF Retu rn bit flags represen tin g th e robot con figu ration specified by an array of join t position s. SOLVE .TRANS tran sform, error = join ts[in dex] PI Compu te th e tran sformation equ ivalen t to a given set of join t position s for th e cu rren t robot. SPE E D speed_ factor, r_ speed_ factor u n its ALWAYS PI Set th e n omin al speed for su bsequ en t robot motion s. SPE E D valu e IPS ALWAYS CF Specify th e u n its for a SPE E D in stru ction as in ch es per secon d. SPE E D valu e MMPS ALWAYS CF Specify th e u n its for a SPE E D in stru ction as millimeters per secon d. SPE E D (select) RF Retu rn on e of th e system motion speed factors. SPIN speeds[in dex] PI Rotate on e or more con tin u ou s-tu rn join ts of th e selected robot at a specified speed. STATE (select) RF Retu rn a valu e th at provides in formation abou t th e robot system state. TOOL tran sformation _ valu e PI Set th e in tern al tran sformation u sed to represen t th e location an d orien tation V+ Lan gu age Referen ce Gu ide Page 4 4 Overview an d Grou pin g by Fu n ction of th e tool tip relative to th e tool-mou n tin g flan ge of th e robot. TOOL TF Retu rn th e valu e of th e tran sformation specified in th e last TOOL comman d or in stru ction . TRANS (X_ valu e, Y_ valu e, Z_ valu e, y_ valu e, p_ valu e, r_ valu e) TF Retu rn a tran sformation valu e compu ted from th e given X, Y, Z position displacemen ts an d y, p, r orien tation rotation s. UNIDIRE CT direction s[in dex] PI Specify th at a con tin u ou s-tu rn join t is tu rn in g on ly in a sin gle direction . CF: Con version Factor, P: Parameter, PF: Precision -Poin t Fu n ction , PI: Program In stru ction , RF: Real-Valu ed Fu n ction , S: Switch , TF: Tran sformation Fu n ction Nu meric Valu e Operation s Keyword Type Fu n ction ABS (valu e) RF Retu rn absolu te valu e. ATAN2 (valu e_ 1 , valu e_ 2 ) RF Retu rn th e size of th e an gle (in degrees) th at h as its trigon ometric tan gen t equ al to valu e_ 1 /valu e_ 2 . BCD (valu e) RF Con vert a real valu e to Bin ary Coded Decimal (BCD) format. COS (an gle) RF Retu rn th e trigon ometric cosin e of a given an gle. DCB (valu e) RF Con vert BCD digits in to an equ ivalen t in teger valu e. FRACT (valu e) RF Retu rn th e fraction al part of th e argu men t. INT (valu e) RF Retu rn th e in teger part of th e valu e. INTB ($ strin g, first_ ch ar) RF Retu rn th e valu e of two bytes of a V+ Lan gu age Referen ce Gu ide Page 4 5 Overview an d Grou pin g by Fu n ction strin g in terpreted as a sign ed 1 6 -bit bin ary in teger. MAX (valu e, ..., valu e) RF Retu rn th e maximu m valu e con tain ed in th e list of valu es. MIN (valu e, ..., valu e) RF Retu rn th e min imu m valu e con tain ed in th e list of valu es. OUTSIDE (low, test, h igh ) RF Test a valu e to see if it is ou tside a specified ran ge. PI RF Retu rn th e valu e of th e math ematical con stan t pi (3 .1 4 1 5 9 3 ). RANDOM RF Retu rn a pseu doran dom n u mber. SIGN (valu e) RF Retu rn th e valu e 1 , with th e sign of th e valu e parameter. SIN (valu e) RF Retu rn th e trigon ometric sin e of a given an gle. SQR (valu e) RF Retu rn th e squ are of th e parameter. SQRT (valu e) RF Retu rn th e squ are root of th e parameter. VAL (strin g) RF Retu rn th e real valu e represen ted by th e ch aracters in th e in pu t strin g. RF: Real-Valu ed Fu n ction , SF: Strin g Fu n ction Program Con trol Operation s Keyword Type Fu n ction ABORT task_ n u m PI Termin ate execu tion of a program task. ANY PI Sign al th e begin n in g of an altern ative grou p of in stru ction s for th e V+ Lan gu age Referen ce Gu ide Page 4 6 Overview an d Grou pin g by Fu n ction CASE stru ctu re. AUTO type variable, ..., variable PI Declare temporary variables th at are au tomatically created on th e program stack wh en th e program is en tered. SCALE (tran sformation BY valu e) K Complete th e syn tax of th e SCALE an d SHIFT fu n ction s. CALL program(arg_ list) PI Su spen d execu tion of th e cu rren t program an d con tin u e execu tion with a n ew program (th at is, a su brou tin e). CALLP var(arg_ list) PI Call a program given a poin ter to th e program. CALLS strin g(arg_ list) PI Su spen d execu tion of th e cu rren t program an d con tin u e execu tion with a n ew program (th at is, a su brou tin e) specified with a strin g valu e. CASE valu e OF PI In itiate processin g of a CASE stru ctu re by defin in g th e valu e of in terest. CLE AR.E VE NT task, flag, processor PI Clear an even t associated with th e specified task. CYCLE .E ND task_ n u m, stop_ flag PI Termin ate th e specified con trol program th e n ext time it execu tes a STOP program in stru ction (or its equ ivalen t). Su spen d processin g of an application program or comman d program u n til a program completes execu tion . DISPLAY.CAME RA S Con trol th e amou n t of virtu al camera data displayed wh en a SWITCH or PARAME TE R mon itor comman d is issu ed. V+ Lan gu age Referen ce Gu ide Page 4 7 Overview an d Grou pin g by Fu n ction DE FINE D (var_ n ame) RF Determin e wh eth er a variable h as been defin ed. DISABLE (switch , ... switch ) PI Tu rn off on e or more system con trol switch es. DO PI In trodu ce a DO program stru ctu re. DOS strin g, error PI E xecu te a program in stru ction defin ed by a strin g expression . E LSE PI Separate th e altern ate grou p of statemen ts in an IF ... THE N con trol stru ctu re. E NABLE switch , ..., switch PI Tu rn on on e or more system con trol switch es. E ND PI Mark th e en d of a con trol stru ctu re. .E ND PI Mark th e en d of a V+ program. E RROR (sou rce, select) RF Retu rn th e error n u mber of a recen t error th at cau sed program execu tion to stop or cau sed a RE ACTE reaction . E XE CUTE /C task_ n u m program(param_ list), cycles, step, priority[i] PI Begin execu tion of a con trol program. E XIT cou n t PI Bran ch to th e statemen t followin g th e n th n ested loop of a con trol stru ctu re. FOR loop_ var = in itial TO fin al STE P in cremen t PI E xecu te a grou p of program in stru ction s a certain n u mber of times. FRE E (memory, select) RF Retu rn th e amou n t of u n u sed free memory storage space. GE T.E VE NT (task) RF Retu rn even ts th at are set for th e specified task. GLOBAL type variable, ..., var- PI Declare a variable to be global an d V+ Lan gu age Referen ce Gu ide Page 4 8 Overview an d Grou pin g by Fu n ction iable specify th e type of th e variable. GOTO label PI Perform an u n con dition al bran ch to th e program step iden tified by th e given label. HALT PI Stop program execu tion an d do n ot allow th e program to be resu med. ID (compon en t, device, board) RF Retu rn valu es th at iden tify th e con figu ration of th e cu rren t system. $ ID (select) SF Retu rn valu es th at iden tify th e con figu ration of th e cu rren t system. IF logical_ expr GOTO label PI Bran ch to th e specified label if th e valu e of a logical expression is TRUE (n on zero). IF logical_ expr THE N... THE N PI Con dition ally execu te a grou p of in stru ction s (or on e of two grou ps) depen din g on th e resu lt of a logical expression . INSTALL password, op PI In stall an Adept software option . ... INTE RACTIVE S Con trol th e display of message h eaders on th e system termin al an d requ ests for con firmation before performin g certain operation s. INT.E VE NT sou rce, level PI Sen d a SE T.E VE NT in stru ction to th e cu rren t task if an in terru pt occu rs on a specified VME bu s vector or a specified digital I/O tran sition s to positive. KILL task_ n u mber PI Clear a program execu tion stack an d detach an y I/O devices th at are attach ed. LAST (array_ n ame) RF Retu rn th e h igh est in dex u sed for an array (dimen sion ). V+ Lan gu age Referen ce Gu ide Page 4 9 Overview an d Grou pin g by Fu n ction LOCAL type variable, ..., variable PI Declare perman en t variables th at are defin ed on ly with in th e cu rren t program. LOCK priority PI Set th e program reaction lock-ou t priority to th e valu e given . MC mon itor_ comman d PI In trodu ce a mon itor comman d with in a comman d program. ... MCP.ME SSAGE S Con trol h ow system error messages are h an dled wh en th e con troller keyswitch is n ot in th e PE NDANT position . MCS strin g PI In voke a mon itor comman d from an application program. ... MCS.ME SSAGE S E n able or disable ou tpu t to th e system termin al from mon itor comman ds execu ted with th e MCS in stru ction . ... ME SSAGE S S E n able or disable ou tpu t to th e system termin al from TYPE in stru ction s. ... MONITORS S E n able or disable selectin g of mu ltiple mon itor win dows. NE XT cou n t PI Bran ch to th e top of th e n ext iteration of a loopin g con trol stru ctu re. PANIC PI Simu late an extern al E -stop or pan ic bu tton press; stop all robots immediately, bu t do n ot tu rn off HIGH POWE R. PARAME TE R parameter_ n ame = valu e PI Set th e valu e of a system parameter. PARAME TE R (parameter_ n ame) RF Retu rn th e cu rren t settin g of th e n amed system parameter. V+ Lan gu age Referen ce Gu ide Page 5 0 Overview an d Grou pin g by Fu n ction PAUSE PI Stop program execu tion bu t allow th e program to be resu med. PRIORITY RF Retu rn th e cu rren t reaction lock-ou t priority for th e program. RE ACT sign al_ n u m, program, priority PI In itiate con tin u ou s mon itorin g of a specified digital sign al an d au tomatically trigger a su brou tin e call if th e sign al properly tran sition s. RE ACTE program_ n ame PI In itiate th e mon itorin g of errors th at occu r du rin g execu tion of th e cu rren t program task. RE LE ASE task PI Allow th e n ext available program task to ru n . RE TURN PI Termin ate execu tion of th e cu rren t su brou tin e an d resu me execu tion of th e last-su spen ded program at th e step followin g th e CALL or CALLS in stru ction th at cau sed th e su brou tin e to be in voked. RE TURNE PI Termin ate execu tion of th e cu rren t su brou tin e, an d resu me execu tion of th e su spen ded program at its n ext step. A program may h ave been su spen ded by issu in g a CALL, CALLP, or CALLS in stru ction , or by th e triggerin g of a RE ACT, RE ACTE , or RE ACTI con dition . RUNSIG sign al_ n u m PI Tu rn on (or off) th e specified digital sign al as lon g as execu tion of th e in vokin g program task con tin u es. SE E (lu n ) prog_ spec, step PI In voke th e screen -orien ted program editor to allow a program to be created, viewed, or modified. SE LE CT (device_ type, mode) RF Retu rn th e u n it n u mber th at is cu rren tly selected by th e cu rren t task for th e device n amed. V+ Lan gu age Referen ce Gu ide Page 5 1 Overview an d Grou pin g by Fu n ction SE T.E VE NT task, flag, processor PI Set an even t associated with th e specified task. STATUS (program_ n ame) RF Retu rn statu s in formation for an application program. STOP PI Termin ate execu tion of th e cu rren t program cycle. SWITCH switch _ n ame = valu e PI E n able or disable a system switch based on a valu e. SWITCH switch _ n ame[in dex] = valu e RF Retu rn an in dication of th e settin g of a system switch . SYMBOL.PTR (strin g, type) RF Determin e th e valu e of a poin ter to a u ser symbol in V+ memory. TAS (variable, n ew_ valu e) RF Retu rn th e cu rren t valu e of a realvalu ed variable an d assign it a n ew valu e. Th e two action s are don e in divisibly so n o oth er program task can modify th e variable at th e same time. TASK (select, task_ n u m) RF Retu rn in formation abou t a program execu tion task. ... TE RMINAL P Determin e h ow V+ will in teract with th e system termin al. TIME time_ strin g PI Set th e date an d time. TIME (strin g, select) RF Retu rn an in teger valu e represen tin g eith er th e date or th e time specified in th e given strin g parameter. $ TIME (date, time) SF Retu rn a strin g valu e con tain in g eith er th e cu rren t system date an d time or th e specified date an d time. TIME R timer_ n u mber = time_ valu e PI Set th e specified system timer to th e given time valu e. V+ Lan gu age Referen ce Gu ide Page 5 2 Overview an d Grou pin g by Fu n ction TIME R (timer_ n u mber) RF Retu rn th e cu rren t time valu e of th e specified system timer. TPS RF Retu rn th e n u mber of ticks of th e system clock th at occu r per secon d (Ticks Per Secon d). ... TRACE S Con trol th e display of program steps on th e system termin al du rin g program execu tion . UNTIL expression PI In dicate th e en d of a DO ... UNTIL con trol stru ctu re an d specify th e expression th at is evalu ated to determin e wh en to exit th e loop. Th e loop con tin u es to be execu ted u n til th e expression valu e is n on -zero. VALUE expression _ list: PI In dicate th e valu es th at a CASE statemen t expression mu st match in order for th e program statemen ts immediately followin g to be execu ted. WAIT con dition PI Pu t th e program in to a wait loop u n til th e con dition is TRUE . WAIT.E VE NT mask, timeou t PI Su spen d program execu tion u n til a specified even t h as occu rred or u n til a specified amou n t of time h as elapsed. WHILE con dition DO PI In itiate processin g of a WHILE stru ctu re if th e con dition is TRUE or skippin g of th e WHILE stru ctu re if th e con dition is in itially FALSE . K: Keyword, P: Parameter, PI: Program In stru ction , RF: Real-Valu ed Fu n ction , S: Switch , SF: Strin g Fu n ction S trin g Operation s Keyword Type Fu n ction V+ Lan gu age Referen ce Gu ide Page 5 3 Overview an d Grou pin g by Fu n ction ASC (strin g, in dex) RF Retu rn an ASCII ch aracter valu e from with in a strin g. $ CHR (valu e) SF Retu rn a on e-ch aracter strin g h avin g a given valu e. $ DBLB (valu e) SF Retu rn an 8 -byte strin g con tain in g th e bin ary represen tation of a real valu e in dou ble-precision IE E E floatin g-poin t format. DBLB ($ strin g, first_ ch ar) RF Retu rn th e valu e of eigh t bytes of a strin g in terpreted as an IE E E dou ble-precision floatin g-poin t n u mber. $ DE CODE ($ strin g_ var, strin g_ exp, mode) SF E xtract part of a strin g as delimited by given break ch aracters. $ E NCODE (ou tpu t_ specification , ou tpu t_ specification , ...) SF Retu rn a strin g created from ou tpu t specification s. Th e strin g produ ced is similar to th e ou tpu t of a TYPE in stru ction . $ E RROR (error_ code) SF Retu rn th e error message associated with th e given error code. $ FLTB (valu e) SF Retu rn a 4 -byte strin g con tain in g th e bin ary represen tation of a real valu e in sin gle-precision IE E E floatin g-poin t format. FLTB ($ strin g, first_ ch ar) RF Retu rn th e valu e of fou r bytes of a strin g in terpreted as an IE E E sin gleprecision floatin g-poin t n u mber. $ INTB (valu e) SF Retu rn a 2 -byte strin g con tain in g th e bin ary represen tation of a 1 6 -bit in teger. LE N (strin g) RF Retu rn th e n u mber of ch aracters in th e given strin g. $ LNGB (valu e) SF Retu rn a 4 -byte strin g con tain in g th e bin ary represen tation of a 3 2 -bit in teger. V+ Lan gu age Referen ce Gu ide Page 5 4 Overview an d Grou pin g by Fu n ction LNGB ($ strin g, first_ ch ar) RF Retu rn th e valu e of fou r bytes of a strin g in terpreted as a sign ed 3 2 -bit bin ary in teger. $ MID (strin g, first_ ch ar, n u m_ ch ars) SF Retu rn a su bstrin g of th e specified strin g. PACK strin g_ array[in dex], first_ ch ar, n u m_ ch ars = strin g PI Replace a su bstrin g with in an array of (1 2 8 -ch aracter) strin g variables or with in a (n on array) strin g variable. POS (search _ strin g, su b_ strin g, start) RF Retu rn th e startin g ch aracter position of a su bstrin g in a strin g. STRDIF($ a, $ b) RF Compare two strin gs byte by byte for th e pu rpose of sortin g. Th is fu n ction always compares bytes exactly. It ign ores th e settin g of th e UPPE R system switch . $ SYMBOL (poin ter) SF Determin e th e u ser symbol th at is referen ced by a poin ter previou sly obtain ed with th e SYMBOL.PTR realvalu ed fu n ction . $ TRANSB (tran sformation ) SF Retu rn a 4 8 -byte strin g con tain in g th e bin ary represen tation of a tran sformation valu e. TRANSB (strin g, first_ ch ar) TF Retu rn a tran sformation valu e represen ted by a 4 8 -byte strin g. $ TRUNCATE (strin g) SF Retu rn all ch aracters in th e in pu t strin g u n til an ASCII NUL (or th e en d of th e strin g) is en cou n tered. $ UNPACK (strin g_ array[in dex], first_ ch ar, n u m_ ch ars) SF Retu rn a su bstrin g from an array of 1 2 8 -ch aracter strin g variables. ... UPPE R S Con trol wh eth er or n ot strin g comparison s are performed ign orin g th e case of each ch aracter. V+ Lan gu age Referen ce Gu ide Page 5 5 V+ Lan gu age Qu ick Referen ce PI: Program In stru ction , RF: Real-Valu ed Fu n ction , SF: Strin g Fu n ction V+ Language Quick R eference Th is Qu ick Referen ce table is arran ged alph abetically by comman d n ame, click an u n derlin ed letter to ju mp to th e first comman d th at begin s with th at letter. A B C D E F G H I J K L M N O P Q R S T U V W X Y Z ABORT (task_num) Termin ate execu tion of an execu tin g program task. ABOVE Requ est a ch an ge in th e robot con figu ration du rin g th e n ext motion so th at th e elbow is above th e lin e from th e sh ou lder to th e wrist. ABS (value) Retu rn absolu te valu e. ACCEL (profile) acceleration, deceleration Set acceleration an d deceleration for robot motion s. Option ally, specify a defin ed acceleration profile. ACCEL (select) Retu rn th e cu rren t settin g for robot acceleration or deceleration settin g or retu rn th e maximu m allowable percen tage limits set by th e SPE C u tility program (see th e In stru ction s for Adept Utility Programs for details). ...ADW Determin es wh eth er th e V+ robot-con trol system con trols th e ph ysical robot(s) (ADW disabled) or in teracts with th e Adept Digital Workcell simu lation produ ct ru n n in g on a remote compu ter (ADW en abled). V+ Lan gu age Referen ce Gu ide Page 5 6 V+ Lan gu age Qu ick Referen ce AIO.IN (channel, gain) Read a ch an n el from on e of th e an alog IO boards. AIO.INS (channel) Test wh eth er an an alog in pu t or ou tpu t ch an n el is in stalled. AIO.OUT channel = value Write to a ch an n el on on e of th e an alog IO boards. ALIGN Align th e robot tool Z axis with th e n earest world axis. ALTER (control) Dx, Dy, Dz, Rx, Ry, Rz Specify th e magn itu de of th e real-time path modification th at is to be applied to th e robot path du rin g th e n ext trajectory compu tation .Th is option is available on ly if you r Adept system is equ ipped with th e V+ E xten sion s option . ALTOF F Termin ate real-time path -modification mode (alter mode). ALTON(lun) E n able real-time path -modification mode (alter mode), an d specify th e way in wh ich ALTE R coordin ate in formation will be in terpreted. ...ALW AYS Used with certain program in stru ction s to specify a lon g-term effect. ...value AND v alue... Perform th e logical AND operation on two valu es. V+ Lan gu age Referen ce Gu ide Page 5 7 V+ Lan gu age Qu ick Referen ce ANY Sign al th e begin n in g of an altern ative grou p of in stru ction s for th e CASE stru ctu re. APPRO location, distance APPROS location, distance Start a robot motion toward a location defin ed relative to specified location . ASC (string, index) Retu rn an ASCII ch aracter valu e from with in a strin g. ATAN2 (value_1, value_2) Retu rn th e size of th e an gle (in degrees) th at h as its trigon ometric tan gen t equ al to valu e_ 1 /valu e_ 2 . ATTACH (lun, mode)$device Make a device available for u se by th e application program. AUTO type variable, ..., variable Declare temporary variables th at are au tomatically created on th e program stack wh en th e program is en tered. AUTO.POW ER.OF F Con trol wh eth er or n ot V+ disables h igh power wh en certain motion errors occu r. ...AVR Determin es wh eth er ActiveVR in stru ction s received from a h ost system are h an dled or ign ored by th e V+ operatin g system. AVR.LOG Th is system switch en ables/disables a bu ffer to store ActiveVR in stru ction s. V+ Lan gu age Referen ce Gu ide Page 5 8 V+ Lan gu age Qu ick Referen ce ...AVR.LOGSIZE Th is system parameter determin es th e size of th e log circu lar bu ffer u sed by ActiveVR. ...AVR.TRACE Th is system switch determin es wh eth er trace messages for ActiveVR in stru ction s are displayed in th e V+ mon itor win dow. ... value BAND value ... Perform th e bin ary AND operation on two valu es. BASEX_shift, Y_shift, Z_shift, Z_rotation Tran slate an d rotate th e World referen ce frame relative to th e robot. BASE Retu rn th e tran sformation valu e th at represen ts th e tran slation an d rotation set by th e last BASE comman d or in stru ction . BCD (value) Con vert a real valu e to Bin ary Coded Decimal (BCD) format. BELOW Requ est a ch an ge in th e robot con figu ration du rin g th e n ext motion so th at th e elbow is below th e lin e from th e sh ou lder to th e wrist. ...BELT Con trol th e fu n ction of th e con veyor trackin g featu res of th e V+ system. BELT (%belt_var, mode) Retu rn in formation abou t a con veyor belt bein g tracked with th e con veyor trackin g featu re. ...BELT.MODE Set ch aracteristics of th e con veyor trackin g featu re of th e V+ system. V+ Lan gu age Referen ce Gu ide Page 5 9 V+ Lan gu age Qu ick Referen ce BITS first_sig, num_sigs = value Set or clear a grou p of digital sign als based on a valu e. BITS (first_sig, num_sigs) Read mu ltiple digital sign als an d retu rn th e valu e correspon din g to th e bin ary bit pattern presen t on th e sign als. BMASK (bit, bit, ..., bit) Create a bit mask by settin g in dividu al bits. ... value BOR value ... Perform th e bin ary OR operation on two valu es. BRAKE Abort th e cu rren t robot motion . BREAK Su spen d program execu tion u n til th e cu rren t motion completes. BSTATUS Retu rn in formation abou t th e statu s of th e con veyor trackin g system. SCALE (transformation BY value) SHIFT (transformation BY value, value, value) Complete th e syn tax of th e SCALE an d SHIFT fu n ction s. CALIBRATE mode, status In itialize th e robot position in g system with th e robot's cu rren t position . CALL program (arg_list) Su spen d execu tion of th e cu rren t program an d con tin u e execu tion with a n ew program (th at V+ Lan gu age Referen ce Gu ide Page 6 0 V+ Lan gu age Qu ick Referen ce is, a su brou tin e). CALLP v ar (arg_list) Call a program given a poin ter to th e program in memory. CALLS string (arg_list) Su spen d execu tion of th e cu rren t program an d con tin u e execu tion with a n ew program (th at is, a su brou tin e) specified with a strin g valu e. CAS Compare a real variable to a test valu e, an d con dition ally sets a n ew valu e as on e in divisible operation . CASE value OF In itiate processin g of a CASE stru ctu re by defin in g th e valu e of in terest. $CHR (value) Retu rn a on e-ch aracter strin g correspon din g to a given ASCII valu e. CLEAR.EVENT task, flag, processor Clear an even t associated with th e specified task. CLOSE CLOSEI Close th e robot gripper. COARSE tolerance ALW AYS E n able a low-precision featu re of th e robot h ardware servo. CONF IG (select) Retu rn a valu e th at provides in formation abou t th e robot's geometric con figu ration , or th e V+ Lan gu age Referen ce Gu ide Page 6 1 V+ Lan gu age Qu ick Referen ce statu s of th e motion servo-con trol featu res. COS (angle) Retu rn th e trigon ometric cosin e of a given an gle. ...CP Con trol th e con tin u ou s-path featu re. CPOF F ALW AYS In stru ct th e V+ system to stop th e robot at th e completion of th e n ext motion in stru ction (or all su bsequ en t motion in stru ction s) an d n u ll position errors. CPON ALW AYS In stru ct th e V+ system to execu te th e n ext motion in stru ction (or all su bsequ en t motion in stru ction s) as part of a con tin u ou s path . CUBRT Retu rn th e cu be root of a parameter. CYCLE.END task_num, stop_flag Termin ate th e execu tin g program in th e specified task th e n ext time it execu tes a STOP program in stru ction (or its equ ivalen t). Su spen d processin g of an execu table program u n til a program ru n n in g in th e specified task completes execu tion . DBLB ($string, first_char) Retu rn th e valu e of eigh t bytes of a strin g in terpreted as an IE E E dou ble-precision floatin gpoin t n u mber. $DBLB (value) Retu rn an 8 -byte strin g con tain in g th e bin ary represen tation of a real valu e in dou ble-precision IE E E floatin g-poin t format. V+ Lan gu age Referen ce Gu ide Page 6 2 V+ Lan gu age Qu ick Referen ce DCB (value) Con vert BCD digits in to an equ ivalen t in teger valu e. $DECODE ($string_var, string_exp, mode) E xtract part of a strin g as delimited by given break ch aracters. DECOMPOSE array_name[index] = location E xtract th e (real) valu es of in dividu al compon en ts of a location valu e. $DEF AULT () Retu rn a strin g con tain in g th e cu rren t system defau lt device, u n it, an d directory path for disk file access. DEF BELT %belt_var = nom_trans, belt_num, vel_avg, scale_fact Defin e a belt variable for u se with a con veyor trackin g robot. DEF .DIO signal = address, type Assign th ird-party digital I/O boards to stan dard V+ sign al n u mbers for u se by stan dard V+ in stru ction s, fu n ction s, an d mon itor comman ds. DEF INED (var_name) Determin e wh eth er a variable h as been defin ed. DELAY time Cau se robot motion to stop for th e specified time. DELAY.IN.TOL Con trols th e timin g of COARSE or FINE n u llin g after V+ completes a motion segmen t. DELAY.POW ER.OF F E n able/disable th e E STOP timer delay featu re for servo errors. V+ Lan gu age Referen ce Gu ide Page 6 3 V+ Lan gu age Qu ick Referen ce DEPART distance DEPARTS distance Start a robot motion away from th e cu rren t location . DEST Retu rn a tran sformation valu e represen tin g th e plan n ed destin ation location for th e cu rren t robot motion . DETACH (logical_unit) Release a specified device from th e con trol of th e application program. DEVICE (type, unit, error, p1, p2, ...) out[i], in[j],out_trans, in_trans Sen d a comman d or data to an extern al device an d, option ally, retu rn data back to th e program. (Th e actu al operation performed depen ds on th e device referen ced.) DEVICE (type, unit, error, p1, p2,...) Retu rn a real valu e from a specified device. Th e valu e may be data or statu s in formation , depen din g u pon th e device an d th e parameters. DEVICES (type, unit, error, p1, p2, ...) $out, $in Sen d comman ds or data to an extern al device an d option ally retu rn data. Th e actu al operation performed depen ds on th e device referen ced. DISABLE (switch, ... switch) Tu rn off on e or more system con trol switch es. ...DISPLAY.CAMERA Set th e n u mber of camera valu es th at will be displayed wh en a PARAME TE R or SWITCH mon itor comman d is issu ed. DISTANCE (location_1, location_2) Determin e th e distan ce between th e poin ts defin ed by two location valu es. V+ Lan gu age Referen ce Gu ide Page 6 4 V+ Lan gu age Qu ick Referen ce DN.RESTART Restarts DeviceNet commu n ication if th e Can Bu s goes offlin e. ...DN.THROTTLE Th is parameter limits th e n u mber of n odes th at are polled by th e SmartCon troller DeviceNet driver every scan in terval to in crease available CPU time. DOS string, error E xecu te a program in stru ction defin ed by a strin g expression . DRIVE joint, change, speed Move an in dividu al join t of th e robot. ...DRY.RUN Con trol wh eth er or n ot V+ commu n icates with th e robot. DURATION tim e ALW AYS Set th e min imu m execu tion time for su bsequ en t robot motion s. DURATION (select) Retu rn th e cu rren t settin g of on e of th e motion DURATION specification s. DX (location) DY (location) DZ (location) Retu rn a displacemen t compon en t of a given tran sformation valu e. ELSE Separate th e altern ate grou p of statemen ts in an IF ... THE N con trol stru ctu re. V+ Lan gu age Referen ce Gu ide Page 6 5 V+ Lan gu age Qu ick Referen ce ENABLE switch, ..., switch Tu rn on on e or more system con trol switch es. $ENCODE (output_specification, output_specification, ...) Retu rn a strin g created from ou tpu t specification s. Th e strin g produ ced is similar to th e ou tpu t of a TYPE in stru ction . END Mark th e en d of a con trol stru ctu re. .END Mark th e en d of a V+ program. ERROR (source, select) Retu rn th e error n u mber of a recen t error th at cau sed program execu tion to stop or cau sed a RE ACTE reaction .$ E RROR (error_ code) Retu rn th e error message associated with th e given error code. ESTOP Assert th e emergen cy-stop sign al to stop th e robot. EXECUTE /C task_num program(param_list), cycles, step, priority[i] Begin execu tion of a con trol program. EXIT count Bran ch to th e statemen t followin g th e n th n ested loop of a con trol stru ctu re. F ALSE Retu rn th e valu e u sed by V+ to represen t a logical false resu lt. V+ Lan gu age Referen ce Gu ide Page 6 6 V+ Lan gu age Qu ick Referen ce F CLOSE (logical_unit) Close th e disk file, graph ics win dow, or graph ics icon cu rren tly open on th e specified logical u n it. F CMND (logical_unit, command_code) $out_string, $in_string Gen erate a device-specific comman d to th e in pu t/ou tpu t device specified by th e logical u n it. F DELETE (logical_unit) object Delete th e specified disk file, th e specified graph ics win dow an d all its ch ild win dows, or th e specified graph ics icon . F EMPTY (logical_unit) E mpty an y in tern al bu ffers in u se for a disk file or a graph ics win dow by writin g th e bu ffers to th e file or win dow if n ecessary. F INE tolerance ALW AYS E n able a h igh -precision featu re of th e robot h ardware servo. F LIP Requ est a ch an ge in th e robot con figu ration du rin g th e n ext motion so th at th e pitch an gle of th e robot wrist h as a n egative valu e. F LTB ($string, first_char) Retu rn th e valu e of fou r bytes of a strin g in terpreted as an IE E E sin gle-precision floatin gpoin t n u mber. $F LTB (value) Retu rn a 4 -byte strin g con tain in g th e bin ary represen tation of a real valu e in sin gle-precision IE E E floatin g-poin t format. F OPEN (logical_unit, mode) attribute_list Create an d open a n ew graph ics win dow or TCP con n ection , or open an existin g graph ics V+ Lan gu age Referen ce Gu ide Page 6 7 V+ Lan gu age Qu ick Referen ce win dow for su bsequ en t in pu t or ou tpu t. F OPEN (lun, record_len, mode) file_spec Open a disk file for read-on ly, read-write, read-write-appen d, or read-directory, as in dicated by th e last letter of th e in stru ction n ame. F OR loop_var = initial T O final ST EP increment E xecu te a grou p of program in stru ction s a certain n u mber of times. F ORCE.F RAME AdeptForce option statu s an d con trol in stru ction s. F RACT (value) Retu rn th e fraction al part of th e argu men t. F RAME (location_1, location_2, location_3, location_4) Retu rn a tran sformation valu e defin ed by fou r position s. F REE (memory, select) Retu rn th e amou n t of u n u sed free memory storage space. F SEEK (logical_unit, record_number) Position a file open for ran dom access an d in itiate a read operation on th e specified record. F SET (logical_unit) attribute_list Set or modify attribu tes of a graph ics win dow, serial lin e, or n etwork device related to AdeptNet. GAIN.SET set, motor Select a set of feedback gain parameters for on e or more motors of th e cu rren tly selected robot. V+ Lan gu age Referen ce Gu ide Page 6 8 V+ Lan gu age Qu ick Referen ce GARC (lun, mode) xc, yc, radius, ang0, angn Draw an arc or a circle in a graph ics win dow. GCHAIN (lun) x, y, points, direction[index] Draw a ch ain of poin ts in a graph ics win dow to form a complex figu re. GCLEAR (lun) Clear an en tire graph ics win dow to th e backgrou n d color. GCLIP (lun) x, y, dx, dy Set th e clippin g rectan gle for all graph ics in stru ction s (except GFLOOD), to su ppress all su bsequ en t graph ics th at fall ou tside th e rectan gle. GCOLOR (lun) foregrnd, backgrnd Set th e foregrou n d an d backgrou n d colors for su bsequ en t graph ics ou tpu t. GCOPY (lun) x, y = src_x, src_y, dx, dy Copy on e region of a win dow to an oth er region in th e same win dow. GETC(lun, mode) Retu rn th e n ext ch aracter (byte) from a device or in pu t record on th e specified logical u n it. GET.EVENT (task) Retu rn even ts th at are set for th e specified task. GETEVENT (lun, mode) ev ents[index] Retu rn in formation describin g in pu t from a graph ics win dow or in pu t from th e termin al. GF LOOD (logical_unit) x, y Flood a region in a graph ics win dow with color. V+ Lan gu age Referen ce Gu ide Page 6 9 V+ Lan gu age Qu ick Referen ce GGETLINE (logical_unit) $data[index], num.pix = x, y , nx Retu rn pixel in formation from a sin gle pixel row in a graph ics win dow. GICON (lun, mode) x, y, $name, index Draw a predefin ed graph ic symbol (icon ) in a graph ics win dow. GLINE (lun) x0, y0, xn, yn Draw a sin gle lin e segmen t in a graph ics win dow. GLINES (logical_unit, mode) points, coord[offset,index] Draw mu ltiple lin e segmen ts in a graph ics win dow. GLOBAL type variable, ..., variable Declare a variable to be global an d specify th e type of th e variable. GLOGICAL (logical_unit) code, planes Set th e logical operation to be performed between n ew graph ics ou tpu t an d graph ics data already displayed, an d select wh ich bit plan es are affected by graph ics in stru ction s. GOTO label Perform an u n con dition al bran ch to th e program step iden tified by th e given label. GPANEL (lun, mode) x, y, dx, dy Draw a rectan gu lar pan el with sh adowed or grooved edges. GPOINT (lun) x, y Draw a sin gle poin t in a graph ics win dow. GRECTANGLE (lun, mode) x, y, dx, dy Draw a rectan gle in a graph ics win dow. V+ Lan gu age Referen ce Gu ide Page 7 0 V+ Lan gu age Qu ick Referen ce GSCAN (lun) lines, data[offset,index] Draw a n u mber of h orizon tal lin es in a graph ics win dow to form a complex figu re. GSLIDE (lun, mode) id = x, y, length, max_pos, arrow_inc, handle Draw a slide bar in preparation for receivin g slide even ts. GTEXTURE (lun) mode, pattern Set th e opaqu e/tran sparen t mode an d th e textu re pattern for su bsequ en t graph ics ou tpu t. GTRANS (lun, mode) array[,] Scale, rotate, offset, an d apply perspective correction to all su bsequ en t graph ics in stru ction s. GTYPE (lun, mode) x, y, $text, font_numb Display a text strin g in a graph ics win dow. HALT Stop program execu tion an d do n ot allow th e program to be resu med. HAND Retu rn th e cu rren t h an d open in g. HERE location_var Set th e valu e of a tran sformation or precision -poin t variable equ al to th e cu rren t robot location . HERE Retu rn a tran sformation valu e th at represen ts th e cu rren t location of th e robot tool poin t. HOUR.METER Retu rn th e cu rren t valu e of th e robot h ou r meter. V+ Lan gu age Referen ce Gu ide Page 7 1 V+ Lan gu age Qu ick Referen ce ID (component, device, board) Retu rn valu es th at iden tify th e con figu ration of th e cu rren t system. $ID (select) Retu rn th e system ID strin g. IDENTICAL (location, location) Determin e wh eth er two location valu es are exactly th e same. IF logical_expr GOTO label Bran ch to th e specified step label if th e valu e of th e logical expression is TRUE (n on zero). IF logical_expr T HEN Con dition ally execu te a grou p of in stru ction s (or on e of two grou ps) depen din g on th e resu lt of a logical expression . IGNORE signal Can cel th e effect of a RE ACT or RE ACTI in stru ction . INRANGE (location) Retu rn a valu e th at in dicates wh eth er a location can be reach ed by th e robot an d, if n ot, wh y n ot. INSTALL password, op In stall or remove software option s available to Adept systems. INT (value) Retu rn th e in teger part of th e valu e. INTB ($string, first_char) Retu rn th e valu e of two bytes of a strin g in terpreted as a sign ed 1 6 -bit bin ary in teger. V+ Lan gu age Referen ce Gu ide Page 7 2 V+ Lan gu age Qu ick Referen ce $INTB (value) Retu rn a 2 -byte strin g con tain in g th e bin ary represen tation of a 1 6 -bit in teger. INT.EVENT source, level Sen d an even t (as th ou gh from a SE T.E VE NT in stru ction ) to th e cu rren t task if an in terru pt occu rs on a specified VME bu s vector or a specified digital I/O sign al tran sition s to positive. INVERSE (transformation) Retu rn th e tran sformation valu e th at is th e math ematical in verse of th e given tran sformation valu e. IOGET (address, type, cpu) Retu rn a valu e from global memory or from a device on th e VME bu s. $IOGETS (address, length, type, cpu) Retu rn a strin g valu e from a device on th e VME bu s. IOPUT address, type, cpu = value Write a valu e to global CPU memory or to a device on th e VME bu s. IOSTAT (lun, mode) Retu rn statu s in formation for th e last in pu t/ou tpu t operation for a device associated with a logical u n it. IOTAS (address, type, cpu) Con trol access to sh ared devices on th e VME bu s. SPE E D value IPS ALW AYS Specify th e u n its for a SPE E D in stru ction as in ch es per secon d. JHERE v ariable1, ..., v ariablen Records th e cu rren t robot join t position s in real or dou ble-precision variables. Th is in stru ction V+ Lan gu age Referen ce Gu ide Page 7 3 V+ Lan gu age Qu ick Referen ce su pports MicroV+. JMOVE expression1,...,expressionn Moves all robot join ts to position s described by a list of join t valu es. Th e robot performs a coordin ated motion in join t-in terpolated mode. Th is in stru ction su pports MicroV+. JOG (status) robot, mode, axis, speed Moves (" jogs" ) th e specified axis or join t of th e robot. E ach time JOG execu tes, th e specified axis or join t moves for 2 0 0 ms. ...KERMIT.RETRY E stablish th e maximu m n u mber of times th e (local) Kermit driver sh ou ld retry an operation before reportin g an error. ...KERMIT.TIMEOUT E stablish th e delay parameter th at th e V+ driver for th e Kermit protocol sen ds to th e remote server. KEYMODE first_key, last_key = mode, setting Set th e beh avior of a grou p of keys on th e man u al con trol pen dan t. KILL task_number Clear a program execu tion stack an d detach an y I/O devices th at are attach ed. LAST (array_name) Retu rn th e h igh est in dex u sed for an array (dimen sion ). LATCH (select) Retu rn a tran sformation valu e represen tin g th e location of th e robot at th e occu rren ce of th e last extern al trigger or AdeptForce gu arded-mode trigger. V+ Lan gu age Referen ce Gu ide Page 7 4 V+ Lan gu age Qu ick Referen ce LATCHED (select) Retu rn th e statu s of th e extern al trigger an d/or an AdeptForce gu arded-mode trigger. LEF TY Requ est a ch an ge in th e robot con figu ration du rin g th e n ext motion so th at th e first two lin ks of a SCARA robot resemble a h u man 's left arm. LEN (string) Retu rn th e n u mber of ch aracters in th e given strin g. LNGB ($string, first_char) Retu rn th e valu e of fou r bytes of a strin g in terpreted as a sign ed 3 2 -bit bin ary in teger. $LNGBLOCK priority Set th e program reaction lock-ou t priority to th e valu e given . MAX (value, ..., value) Retu rn th e maximu m valu e con tain ed in th e list of valu es. MC monitor_command In trodu ce a mon itor comman d with in a comman d program. MCS string In voke a mon itor comman d from an application program. ... MCS.MESSAGE E n able or disable ou tpu t to th e system termin al from mon itor comman ds execu ted with th e MCS in stru ction . ...MESSAGES E n able or disable ou tpu t to th e system termin al from TYPE in stru ction s. V+ Lan gu age Referen ce Gu ide Page 7 5 V+ Lan gu age Qu ick Referen ce $MID (string, first_char, num_chars) Retu rn a su bstrin g of th e specified strin g. MIN (value, ..., value) Retu rn th e min imu m valu e con tain ed in th e list of valu es. SPE E D value MMPS ALW AYS Specify th e u n its for a SPE E D in stru ction as millimeters per secon d. ... value MOD value ... Compu te th e modu lu s of two valu es. MOVE location MOVES location In itiate a robot motion to th e position an d orien tation described by th e given location . MOVEF location, depart_clr, appro_clr, depart_tqe, horiz_accel_tqe, horiz_ decel_tqe, appro_tqe, model MOVESF location, depart_clr, appro_clr, depart_tqe, horiz_accel_tqe, horiz_ decel_tqe, appro_tqe, model In itiate a th ree-segmen t pick-an d-place robot motion to th e specified destin ation , movin g th e robot at th e fastest allowable speed. MOVET location, hand_opening MOVEST location, hand_opening In itiate a robot motion to th e position an d orien tation described by th e given location an d simu ltan eou sly operate th e h an d. MULTIPLE ALW AYS Allow fu ll rotation s of th e robot wrist join ts. V+ Lan gu age Referen ce Gu ide Page 7 6 V+ Lan gu age Qu ick Referen ce NETW ORK (component, code) Retu rn n etwork statu s an d IP address in formation NEXT count Bran ch to th e E ND statemen t of th e n th n ested loop, perform th e loop test, an d loop if appropriate. NOF LIP Requ est a ch an ge in th e robot con figu ration du rin g th e n ext motion so th at th e pitch an gle of th e robot wrist h as a positive valu e. NONULL ALW AYS In stru ct th e V+ system n ot to wait for position errors to be n u lled at th e en d of con tin u ou spath motion s. NOOVERLAP ALW AYS Gen erate a program error if a motion is plan n ed th at cau ses selected mu ltitu rn axes to tu rn more th an arou n d) in order to avoid a limit stop. NORMAL (transformation_value) Correct a tran sformation for an y math ematical rou n d-off errors. ...NOT value ... Perform logical n egation of a valu e. ...NOT.CALIBRATED In dicate (or assert) th e calibration statu s of th e robots con n ected to th e system. NULLALW AYS In stru ct th e V+ system to wait for position errors to be n u lled at th e en d of con tin u ou s path motion s. V+ Lan gu age Referen ce Gu ide Page 7 7 V+ Lan gu age Qu ick Referen ce NULL Retu rn a n u ll tran sformation valu e-on e with all zero compon en ts. OF F Retu rn th e valu e u sed by V+ to represen t a logical false resu lt. ON Retu rn th e valu e u sed by V+ to represen t a logical tru e resu lt. OPEN OPENI Open th e robot gripper. ... value OR value ... Perform th e logical OR operation on two valu es. OUTSIDE (low, test, high) Test a valu e to see if it is ou tside a specified ran ge. OVERLAP always Disable th e NOOVE RLAP limit-error ch eckin g eith er for th e n ext motion or for all su bsequ en t motion s. PACK string_array[index], first_char, num_chars = string PACK string_var, first_char, num_chars = string Replace a su bstrin g with in an array of (1 2 8 -ch aracter) strin g variables, or with in a (n on array) strin g variable. PANIC Simu late an extern al E -stop or pan ic bu tton press; stop all robots immediately, bu t do n ot V+ Lan gu age Referen ce Gu ide Page 7 8 V+ Lan gu age Qu ick Referen ce tu rn off HIGH POWE R. PARAMETER parameter_name = value PARAMETER parameter_name[index] = value Set th e valu e of a system parameter. PARAMETER (parameter_name) PARAMETER (parameter_name[index]) Retu rn th e cu rren t settin g of th e n amed system parameter. PAUSE Stop program execu tion bu t allow th e program to be resu med. PAYLOAD value, motor Adju st th e feedforward compen sation for a specified motor by settin g a percen tage of th e maximu m payload assu med for th at motor. #PDEST Retu rn a precision -poin t valu e represen tin g th e plan n ed destin ation location for th e cu rren t robot motion . PENDANT (select) Retu rn in pu t from th e man u al con trol pen dan t. #PHERE Retu rn a precision -poin t valu e represen tin g th e cu rren t location of th e cu rren tly selected robot. PI Retu rn th e valu e of th e math ematical con stan t pi (3 .1 4 1 5 9 3 ). V+ Lan gu age Referen ce Gu ide Page 7 9 V+ Lan gu age Qu ick Referen ce #PLATCH (select) Retu rn a precision -poin t valu e represen tin g th e location of th e robot at th e occu rren ce of th e last extern al trigger or AdeptForce gu arded-mode trigger. POS (search_string, sub_string, start) Retu rn th e startin g ch aracter position of a su bstrin g in a strin g. ...POW ER Con trol or mon itor th e statu s of h igh power. #PPOINT (j1_value, j2_value, j3_value, j4_value, j5_value, j6_value, j7_ value, j8_value, j9_value, j10_value, j11_value, j11_value) Retu rn a precision -poin t valu e composed from th e given compon en ts. PRIORITY Retu rn th e cu rren t reaction lock-ou t priority for th e program. .PROGRAM program_name (argument_list) ;comment Defin e th e argu men ts th at are passed to a program wh en it is in voked. PROMPT output_string, variable_list Display a strin g on th e system termin al an d wait for operator in pu t. RANDOM Retu rn a pseu doran dom n u mber. REACT signal_num, program, priority In itiate con tin u ou s mon itorin g of a specified digital sign al an d au tomatically trigger a su brou tin e call if th e sign al properly tran sition s. REACTE program_name In itiate th e mon itorin g of errors th at occu r du rin g execu tion of th e cu rren t program task. V+ Lan gu age Referen ce Gu ide Page 8 0 V+ Lan gu age Qu ick Referen ce REACTI signal_num, program, priority In itiate con tin u ou s mon itorin g of a specified digital sign al. Au tomatically stop th e cu rren t robot motion if th e sign al tran sition s properly an d option ally trigger a su brou tin e call. READ (lun, record_num, mode) var_list Read a record from an open file or from an attach ed device th at is n ot file orien ted. For an AdeptNet device, read a strin g from an attach ed an d open TCP con n ection . READY Move th e robot to th e RE ADY location above th e workspace, wh ich forces th e robot in to a stan dard con figu ration . RELAX RELAXI Limp th e pn eu matic h an d. RELEASE task Allow th e n ext available program task to ru n . RESET Tu rn off all th e extern al ou tpu t sign als. RETURN Termin ate execu tion of th e cu rren t su brou tin e, an d resu me execu tion of th e su spen ded program at its n ext step. A program may h ave been su spen ded by issu in g a CALL, CALLP, or CALLS in stru ction , or by th e triggerin g of a RE ACT, RE ACTE , or RE ACTI con dition . RETURNE Termin ate execu tion of an error reaction su brou tin e an d resu me execu tion of th e last-su spen ded program at th e step followin g th e in stru ction th at cau sed th e su brou tin e to be in voked. V+ Lan gu age Referen ce Gu ide Page 8 1 V+ Lan gu age Qu ick Referen ce RIGHTY Requ est a ch an ge in th e robot con figu ration du rin g th e n ext motion so th at th e first two lin ks of th e robot resemble a h u man 's righ t arm. ...ROBOT [index] E n able or disable on e robot or all robots. ROBOT.OPR E xecu te operation s th at are specific to th e cu rren tly selected robot or robot modu le. ROBOT.OPR (mode, index) Retu rn s robot-specific data for th e cu rren tly selected robot. RUNSIG signal_num Tu rn on (or off) th e specified digital sign al as lon g as execu tion of th e in vokin g program task con tin u es. RX (angle) RY (angle) RZ (angle) Retu rn a tran sformation describin g a rotation . SCALE (transformation BY scale_factor) Retu rn a tran sformation valu e equ al to th e tran sformation parameter with th e position scaled by th e scale factor. ...SCALE.ACCEL [robot_num] E n able or disable th e scalin g of acceleration an d deceleration as a fu n ction of program speed, as lon g as th e program speed is below a preset th resh old. V+ Lan gu age Referen ce Gu ide Page 8 2 V+ Lan gu age Qu ick Referen ce ...SCALE.ACCEL.ROT [robot_num] Specify wh eth er or n ot th e SCALE .ACCE L switch takes in to accou n t th e Cartesian rotation al speed du rin g straigh t-lin e motion s. SCREEN.TIMEOUT E stablish th e time-ou t period for blan kin g th e screen of th e graph ics mon itor. SEE (lun) prog_spec, step In voke th e screen -orien ted program editor to allow a program to be created, viewed, or modified. SELECT device_type = unit Select a u n it of th e n amed device for access by th e cu rren t task. SELECT (device_type, mode) Retu rn th e u n it n u mber th at is cu rren tly selected by th e cu rren t task for th e device n amed. SET location_var = location_value Set th e valu e of th e location variable on th e left equ al to th e location valu e on th e righ t of th e equ al sign . SET.EVENT task, flag, processor Set an even t associated with th e specified task. #SET.POINT Retu rn th e comman ded join t-an gle position s compu ted by th e trajectory gen erator du rin g th e last trajectory-evalu ation cycle. ...SET.SPEED Con trol wh eth er or n ot th e mon itor speed can be ch an ged from th e man u al con trol pen dan t. Th e mon itor speed can n ot be ch an ged wh en th e switch is disabled. V+ Lan gu age Referen ce Gu ide Page 8 3 V+ Lan gu age Qu ick Referen ce SETBELT %belt_var = expression Set th e en coder offset of th e specified belt variable equ al to th e valu e of th e expression . SETDEVICE (ty pe, unit, error, com m and) p1, p2, ... In itialize a device or set device parameters. (Th e actu al operation performed depen ds on th e device referen ced.) SHIF T (transformation BY x_shift, y_shift, z_shift) Retu rn a tran sformation valu e resu ltin g from sh iftin g th e position of th e tran sformation parameter by th e given sh ift amou n ts. SIG (signal_num, ..., signal_num) Retu rn s th e logical AND of th e states of th e in dicated digital sign als. SIG.INS (signal_num) Retu rn an in dication of wh eth er a digital I/O sign al is in stalled in th e system, or wh eth er a software sign al is available in th e system. SIGN (value) Retu rn th e valu e 1 , with th e sign of th e valu e parameter. SIGNAL signal_num, ..., signal_num Tu rn on or off extern al digital ou tpu t sign als or in tern al software sign als. SIN (value) Retu rn th e trigon ometric sin e of a given an gle. SINGLE ALW AYS Limit rotation s of th e robot wrist join t to th e ran ge -1 8 0 degrees to +1 8 0 degrees. SOLVE.ANGLES o.jts[o.idx], o.flags, error = trans, i.jts[i.idx],i.flags Compu te th e robot join t position s (for th e cu rren t robot) th at are equ ivalen t to a specified V+ Lan gu age Referen ce Gu ide Page 8 4 V+ Lan gu age Qu ick Referen ce tran sformation . SOLVE.F LAGS (joints[index]) Retu rn bit flags represen tin g th e robot con figu ration specified by an array of join t position s. SOLVE.TRANS transform, error = joints[index] Compu te th e tran sformation equ ivalen t to a given set of join t position s for th e cu rren t robot. SPEED speed_factor, r_speed_factor units ALW AYS Set th e n omin al speed for su bsequ en t robot motion s. SPEED (select) Retu rn on e of th e system motion speed factors. SPIN speeds[index] Rotate on e or more join ts of th e selected robot at a specified speed. SQR (value) Retu rn th e squ are of th e parameter. SQRT (value) Retu rn th e squ are root of th e parameter. STATE (select) Retu rn a valu e th at provides in formation abou t th e robot system state. STATUS (program_name) Retu rn statu s in formation for an application program. V+ Lan gu age Referen ce Gu ide Page 8 5 V+ Lan gu age Qu ick Referen ce STOP Termin ate execu tion of th e cu rren t program cycle. STRDIF ($a, $b) Compare two strin gs byte by byte for th e pu rpose of sortin g. Th is fu n ction always compares bytes exactly. It ign ores th e settin g of th e UPPE R system switch . SW ITCH switch_name = value SW ITCH switch_name[index] = value E n able or disable a system switch based on a valu e. SW ITCH (switch_name) SW ITCH (switch_name[index]) Retu rn an in dication of th e settin g of a system switch . $SYMBOL (pointer) Determin e th e u ser symbol th at is referen ced by a poin ter previou sly obtain ed with th e SYMBOL.PTR real-valu ed fu n ction . SYMBOL.PTR (string, type) Determin e th e valu e of a poin ter to a u ser symbol in V+ memory. $SYS.INF O (mode, stg) Th is strin g fu n ction is in ten ded to provide gen eral system in formation . It also provides access to th e ActiveVR log data. TAS (variable, new_value) Retu rn th e cu rren t valu e of a real-valu ed variable an d assign it a n ew valu e. Th e two action s are don e in divisibly so th at n o oth er program task can modify th e variable at th e same time. V+ Lan gu age Referen ce Gu ide Page 8 6 V+ Lan gu age Qu ick Referen ce TASK (select, task_num) Retu rn in formation abou t a program execu tion task. ...TERMINAL Determin e h ow V+ will in teract with th e system termin al. TIME time_string Set th e date an d time. TIME (string, select) Retu rn an in teger valu e represen tin g eith er th e fou r-digit date or th e time specified in th e given strin g parameter. $TIME (date, time) Retu rn a strin g valu e con tain in g eith er th e cu rren t system date an d time or th e specified date an d time. $TIME4 (date, time) Retu rn a strin g valu e con tain in g eith er th e cu rren t system fou r-digit date an d time or th e specified fou r-digit date an d time. TIMER timer_number = time_value Set th e specified system timer to th e given time valu e. TIMER (timer_number) Retu rn th e cu rren t time valu e of th e specified system timer. TOOL transformation_value Set th e in tern al tran sformation u sed to represen t th e location an d orien tation of th e tool tip relative to th e tool mou n tin g flan ge of th e robot. V+ Lan gu age Referen ce Gu ide Page 8 7 V+ Lan gu age Qu ick Referen ce TOOL Retu rn th e valu e of th e tran sformation specified in th e last TOOL comman d or in stru ction . TP S Retu rn th e n u mber of ticks of th e system clock th at occu r per secon d (Ticks Per Secon d). ...TRACE Con trol th e display of program steps on th e system termin al du rin g program execu tion . TRANS (X_value, Y_value, Z_value, y_value, p_value, r_value) Retu rn a tran sformation valu e compu ted from th e given X, Y, Z position displacemen ts an d y, p, r orien tation rotation s. TRANSB (string, first_char) Retu rn a tran sformation valu e represen ted by a 4 8 -byte strin g. $TRANSB (transformation) Retu rn a 4 8 -byte strin g con tain in g th e bin ary represen tation of a tran sformation valu e. $TRUNCATE (string) Retu rn all ch aracters in th e in pu t strin g u n til an ASCII NUL (or th e en d of th e strin g) is en cou n tered. TYPE output_specification, ..., output_specification Display th e in formation described by th e ou tpu t specification s on th e system termin al. A blan k lin e is ou tpu t if n o argu men t is provided. UNIDIRECT directions[index] Specify th at a join t is tu rn in g on ly in a sin gle direction . V+ Lan gu age Referen ce Gu ide Page 8 8 V+ Lan gu age Qu ick Referen ce $UNPACK (string_array[index], first_char, num_chars) Retu rn a su bstrin g from an array of 1 2 8 -ch aracter strin g variables. UNTIL expression In dicate th e en d of a DO ... UNTIL con trol stru ctu re an d specify th e expression th at is evalu ated to determin e wh en to exit th e loop. Th e loop con tin u es to be execu ted u n til th e expression valu e is n on zero. ...UPPER Con trol wh eth er or n ot th e case of each ch aracter is ign ored wh en strin g comparison s are performed. VAL (string) Retu rn th e real valu e represen ted by th e ch aracters in th e in pu t strin g. VALUE expression_list: In dicate th e valu es th at a CASE statemen t expression mu st match in order for th e program statemen ts immediately followin g to be execu ted. W AIT condition Pu t th e program in to a wait loop for on e system cycle. If a con dition is specified, wait u n til th e con dition is TRUE . W AIT.EVENT mask, timeout Su spen d program execu tion u n til a specified even t h as occu rred, or u n til a specified amou n t of time h as elapsed. W HILE condition DO In itiate processin g of a WHILE stru ctu re if th e con dition is TRUE or skippin g of th e WHILE stru ctu re if th e con dition is in itially FALSE . W INDOW %belt_var = location, location, program, priority Set th e bou n daries of th e operatin g region of th e specified belt variable for con veyor trackin g. V+ Lan gu age Referen ce Gu ide Page 8 9 V+ Lan gu age Qu ick Referen ce W INDOW (transformation, time, mode) Retu rn a valu e th at in dicates wh ere th e location described by th e belt-relative tran sformation valu e is relative to th e predefin ed bou n daries of th e workin g ran ge on a movin g con veyor belt. W RITE (lun, record_num, mode) format_list Write a record to an open file, or to an y I/O device. For an AdeptNet device, write a strin g to an attach ed an d open TCP con n ection . ...valueXORvalue... Perform th e logical exclu sive-OR operation on two valu es. V+ Lan gu age Referen ce Gu ide Page 9 0 Keyword Description s Keyword Descriptions Descriptions of V+ Keywords V+ Lan gu age Referen ce Gu ide Page 9 1 Description s of V+ Keywords Descriptions of V+ Keywords Th is ch apter details th e keywords in th e V+ programmin g lan gu age. Th e fu n ction al grou ps of programmin g keywords are: l Program In stru ction s l Fu n ction s l System Parameters l System Switch es Th is man u al often refers to mon itor comman ds. Mon itor comman ds are part of th e V+ operatin g system. Th e V+ operatin g system comman ds are detailed in th e V+ Operatin g System Referen ce Gu ide. If you r system is equ ipped with AdeptVision , addition al program in stru ction s, fu n ction s, switch es, parameters, an d mon itor comman ds are detailed in th e AdeptVision Referen ce Gu ide. Th e keywords are presen ted in alph abetical order, with th e description for each keyword startin g on a n ew page. For details on wh at is in clu ded, see Docu men tation Con ven tion s for Keywords. V+ Lan gu age Referen ce Gu ide Page 9 2 ABORT program in stru ction ABOR T program instruction Syntax ABORT task_ n u m Function Termin ate execu tion of an execu tin g program task. Usage Considerations ABORT is ign ored if n o program is execu tin g as th e specified task. ABORT does n ot force DE TACH or FCLOSE operation s on th e disk or serial commu n ication logical u n its. If th e program h as on e or more files open an d you decide n ot to resu me execu tion of th e program, u se a KILL comman d to close all th e files an d detach th e logical u n its. Parameter task_ n u m Option al real valu e, variable, or expression (in terpreted as an in teger) th at specifies wh ich program task is to be termin ated. Th e defau lt task is 0 . Details Termin ates execu tion of th e specified active execu table program after completion of th e step cu rren tly bein g execu ted. If th e task is con trollin g a robot, robot motion termin ates at th e completion of th e cu rren t motion . (Program execu tion can be resu med with th e PROCE E D comman d.) Related Keywords ABORT mon itor comman d CYCLE .E ND mon itor comman d CYCLE .E ND program in stru ction E STOP mon itor comman d E STOP program in stru ction E XE CUTE program in stru ction KILL mon itor comman d KILL program in stru ction PANIC mon itor comman d V+ Lan gu age Referen ce Gu ide Page 9 3 ABORT program in stru ction PANIC program in stru ction PROCE E D mon itor comman d STATUS mon itor comman d STATUS real-valu ed fu n ction V+ Lan gu age Referen ce Gu ide Page 9 4 ABOVE program in stru ction ABOVE program instruction Syntax ABOVE Function Requ est a ch an ge in th e robot con figu ration du rin g th e n ext motion so th at th e elbow is above th e lin e from th e sh ou lder to th e wrist. Usage Considerations Con figu ration ch an ges can n ot be made du rin g straigh t-lin e motion s. If th e selected robot does n ot su pport an ABOVE con figu ration , th is in stru ction is ign ored by th e robot (SCARA robots, for example, can n ot h ave an ABOVE con figu ration ). Th e ABOVE in stru ction can be execu ted by an y program task as lon g as th e robot selected by th e task is n ot attach ed by an y oth er task. Th e in stru ction applies to th e robot selected by th e task. If th e V+ system is n ot con figu red to con trol a robot, execu tin g th e ABOVE in stru ction cau ses an error. Th e followin g figu re sh ows th e ABOVE an d BE LOW con figu ration s. ABOVE /BE LOW Related Keywords BE LOW program in stru ction CONFIG real-valu ed fu n ction SE LE CT program in stru ction SE LE CT real-valu ed fu n ction V+ Lan gu age Referen ce Gu ide Page 9 5 ABS real-valu ed fu n ction ABS real-valued function Syntax ABS ( valu e) Function Retu rn absolu te valu e. Parameter valu e Real-valu ed expression . Details Retu rn s th e absolu te valu e (magn itu de) of th e argu men t provided. E xamples ABS(0.123) ;Returns 0.123 ABS(-5.462) ;Returns 5.462 ABS(1.3125E-2) ;Returns 0.013125 belt.length = part.size/ABS(belt.scale) V+ Lan gu age Referen ce Gu ide Page 9 6 ACCE L program in stru ction ACCEL program instruction Syntax ACCEL (profile) acceleration , deceleration Function Set acceleration an d deceleration for robot motion s. Option ally, specify a defin ed acceleration profile. Usage Considerations Th e ACCE L in stru ction can be execu ted by an y program task as lon g as th e robot selected by th e task is n ot attach ed by an y oth er task. Th e in stru ction applies to th e robot selected by th e task. If th e V+ system is n ot con figu red to con trol a robot, execu tin g th e ACCE L in stru ction cau ses th e error * Robot n ot attach ed to th is program* . Before an acceleration /deceleration profile can be u sed, it mu st be defin ed for th e selected robot (profile 0 is always defin ed). Th e SPE C u tility program can be u sed by th e robot man u factu rer to defin e n ew or alter existin g profiles. (For details on SPE C, see In stru ction s for Adept Utility Programs. For details on defin in g profiles, refer to Gen eral Motion Specification s.) Parameters profile Option al in teger specifyin g th e acceleration profile to u se. Acceptable valu es are 0 to 8 (depen din g on th e n u mber of defin ed profiles). Th e defau lt is th e last specified profile (see Details for th e n u mber of th e start-u p profile). If a profile is specified th at h as n ot been defin ed, profile 0 is u sed. acceleration Option al real valu e, variable, or expression con sidered as a percen tage of th e maximu m possible acceleration . deceleration Option al real valu e, variable, or expression con sidered as a percen tage of th e maximu m possible deceleration . Th e valu e sh ou ld n ormally be in th e ran ge of 1 to 1 0 0 (u pper limits greater th an 1 0 0 may be establish ed by th e robot man u factu rer). If an ou t-of-ran ge valu e is specified, th e n earest extreme valu e will be u sed. If a parameter is omitted, its cu rren t settin g remain s in effect. V+ Lan gu age Referen ce Gu ide Page 9 7 ACCE L program in stru ction Details If profile 0 is u sed, a squ are wave acceleration profile is gen erated at th e begin n in g an d en d of th e motion . If a profile is specified, th at profile is in voked for su bsequ en t robot motion s. Defin ed profiles set th e maximu m rate of ch an ge of th e acceleration an d deceleration . Th e valu es set with th is in stru ction defin e th e maximu m acceleration an d deceleration magn itu des th at are ach ieved. Wh en th e V+ system is in itialized, th e profile, acceleration , an d deceleration valu es are set to in itial valu es, wh ich can be defin ed by th e SPE C u tility program. As delivered by Adept, th e in itially selected profile may be eith er 0 or 1 depen din g on th e type of robot. Th e settin gs are n ot affected wh en program execu tion starts or stops, or wh en a ZE RO comman d is processed. Normally, th e robot man u factu rer sets th e 1 0 0 % acceleration an d deceleration valu es to rates th at can be ach ieved with typical payloads an d robot lin k in ertias. However, becau se th e actu al attain able acceleration s vary greatly as a fu n ction of th e en d-effector, payload, an d th e in itial an d fin al location s of a motion , acceleration s greater th an 1 0 0 % may be permitted for you r robot. Th e limits for th e maximu m valu es are defin ed by th e robot man u factu rer an d vary from on e type of robot to th e n ext. If you specify a h igh er acceleration th an is permitted, th e limit establish ed by th e robot man u factu rer is u tilized. You can u se th e fu n ction s ACCE L(3 ) an d ACCE L(4 ) to determin e th e maximu m allowable acceleration an d deceleration settin gs. For a given motion , th e maximu m attain able acceleration may actu ally be less th an wh at you h ave requ ested. Th is occu rs wh en a profile with a n on zero acceleration ramp time is u sed an d th ere is in su fficien t time to ramp u p to th e maximu m acceleration . Th at is, for a given jerk, a specific time mu st elapse before th e acceleration can be ch an ged from zero to th e specified maximu m valu e. If th e maximu m acceleration can n ot be ach ieved, th e trapezoidal profile is redu ced to a trian gu lar sh ape. Th is occu rs u n der two circu mstan ces: 1 . Th e motion is too sh ort. In th is case, th e ch an ge in position is ach ieved before th e maximu m acceleration can be ach ieved. 2 . Th e maximu m motion speed is too low. In th is case, th e maximu m speed is ach ieved before th e maximu m acceleration . In both of th ese situ ation s, raisin g th e maximu m acceleration an d deceleration valu es does n ot affect th e time for th e motion . Hin t: If you in crease th e maximu m acceleration an d deceleration valu es bu t th e motion time does n ot ch an ge, try th e followin g: in crease th e program speed, switch to an acceleration profile th at allows faster acceleration ramp times, or switch to acceleration profile 0 , wh ich specifies a squ are-wave acceleration profile. NOTE: Th is type of acceleration limitin g can n ot occu r with acceleration profile 0 becau se a squ are-wave acceleration in stan tan eou sly ch an ges acceleration valu es with ou t rampin g. V+ Lan gu age Referen ce Gu ide Page 9 8 ACCE L program in stru ction E xamples Set th e defau lt acceleration time to 5 0 % of n ormal an d th e deceleration time to 3 0 % of n ormal: ACCEL 50, 30 Ch an ge th e deceleration time to 6 0 % of n ormal; leave acceleration alon e: ACCEL ,60 Redu ce th e acceleration an d deceleration to on e h alf of th eir cu rren t settin gs: ACCEL ACCEL(1)/2, ACCEL(2)/2 In voke defin ed profile #2 an d set th e acceleration magn itu de to 8 0 % of th e defin ed rate: ACCEL (2) 80 Related Keywords ACCE L real-valu ed fu n ction DURATION program in stru ction PAYLOAD program in stru ction SCALE .ACCE L system switch SE LE CT program in stru ction SE LE CT real-valu ed fu n ction SPE E D mon itor comman d SPE E D program in stru ction V+ Lan gu age Referen ce Gu ide Page 9 9 ACCE L real-valu ed fu n ction ACCEL real-valued function Syntax ACCEL ( select) Function Retu rn th e cu rren t settin g for robot acceleration or deceleration settin g or retu rn th e maximu m allowable percen tage limits set by th e SPE C u tility program (For details on SPE C, see In stru ction s for Adept Utility Programs). Usage Considerations Th e ACCE L fu n ction retu rn s in formation for th e robot selected by th e task execu tin g th e fu n ction . If th e V+ system is n ot con figu red to con trol a robot, u se of th e ACCE L fu n ction does n ot gen erate an error du e to th e absen ce of a robot. However, th e in formation retu rn ed by th e fu n ction may n ot be mean in gfu l. Parameter select Real-valu ed expression , th e resu lt of wh ich is rou n ded to an in teger to select th e valu e th at is retu rn ed. select Valu e retu rn ed 0 Nu mber of selected acceleration profile 1 Acceleration 2 Deceleration 3 Maximu m allowable percen tage acceleration 4 Maximu m allowable percen tage deceleration 5 Program speed below wh ich acceleration an d deceleration are scaled proportion al to a program's speed settin g wh en th e SCALE .ACCE L system switch is en abled V+ Lan gu age Referen ce Gu ide Page 1 0 0 ACCE L real-valu ed fu n ction E xamples ACCEL(1) ACCEL(2) ;Return the current acceleration setting. ;Return the current deceleration setting. Related Keywords ACCE L program in stru ction SCALE .ACCE L system switch SE LE CT real-valu ed fu n ction SE LE CT program in stru ction V+ Lan gu age Referen ce Gu ide Page 1 0 1 ADW system switch ADW system switch Syntax ... ADW Function Determin es wh eth er th e V+ robot-con trol system con trols th e ph ysical robot(s) (ADW disabled) or in teracts with th e Adept Digital Workcell simu lation produ ct ru n n in g on a remote compu ter (ADW en abled). Usage Considerations Wh en th e settin g of th e ADW switch is ch an ged, th e ch an ge does n ot take effect u n til after th e V+ system is rebooted. Th e ADW switch sh ou ld be disabled (an d th e V+ system rebooted if n ecessary) for n ormal operation of th e robot(s) con n ected to th e Adept con troller. Th e SWITCH comman d displays (an d th e SWITCH fu n ction retu rn s) th e settin g of th is switch wh en th e V+ system was in itially booted from disk. Th at is, th e in dicated settin g does n ot ch an ge after th e switch is su bsequ en tly en abled or disabled du rin g a V+ session . Th u s, th e reported settin g in dicates th e mode in wh ich th e V+ system is operatin g. Details Wh en th e V+ system is booted after th is switch h ad been disabled, th e V+ system con trols th e robot(s) an d oth er equ ipmen t con n ected to th e Adept con troller in th e n ormal man n er. Wh en th e V+ system is booted after th is switch h ad been en abled, th e V+ system does n ot con trol th e robot(s) an d oth er equ ipmen t con n ected to th e Adept con troller. In stead, all robot motion comman ds, as well as con trol sign als to oth er workcell equ ipmen t, are sen t to th e Adept Digital Workcell simu lation software ru n n in g on a PC, wh ich mu st be on th e same E th ern et n etwork as th e Adept con troller. If Adept Digital Workcell simu lation mode is already active wh en th e mon itor comman d E NABLE ADW is processed, th e process to restart th e robot servos is in itiated. Th e servos mu st be restarted if th e Adept Digital Workcell robot con figu ration is ch an ged on th e remote compu ter. Normally, th e servos are au tomatically restarted by th e remote compu ter wh en requ ired. However, th e restart can n ot be don e wh ile th ere is an y active V+ task. Th u s, a restart requ est from th e remote compu ter may fail, an d a u ser-in voked restart may be n eeded. Th is switch is in itially set to th e state stored in th e con troller NVRAM. Th at state was set wh en th e ADW switch was en abled or disabled du rin g a previou s V+ session . V+ Lan gu age Referen ce Gu ide Page 1 0 2 ADW system switch Related Keywords DISABLE mon itor comman d DISABLE program in stru ction E NABLE mon itor comman d E NABLE program in stru ction SWITCH mon itor comman d SWITCH program in stru ction SWITCH real-valu ed fu n ction V+ Lan gu age Referen ce Gu ide Page 1 0 3 AIO.IN real-valu ed fu n ction AIO.IN real-valued function Syntax AI O.I N ( ch an n el, gain ) Function Read a ch an n el from on e of th e an alog IO boards. Usage Considerations An alog IO mu st be in stalled in th e system an d correctly con figu red. Con tact Adept Application s for details on in stallin g an d con figu rin g an alog I/O boards. See How Can I Get Help? for ph on e n u mbers. For details on programmin g an alog I/O, see An alog I/O. Parameters ch an n el In teger th at specifies th e an alog IO board an d ch an n el to read. Th e valid ran ges are 0 , 1 to 3 2 , an d 1 0 0 1 to 1 2 5 6 , in clu sive (see Details). If an ou tpu t ch an n el n u mber is specified, th e last valu e written to th at ch an n el is retu rn ed. Th e special valu e 0 is u sed for testin g. gain Option al in teger th at specifies th e gain for th e ch an n el. Mu st match th e gain set by ju mpers on th e IO board. Acceptable valu es are 0 th rou gh 3 . Th e defau lt is 0 . Details E ach an alog IO board con tain s 3 2 in pu t (1 6 for differen tial in pu t) an d 4 ou tpu t ch an n els. A maximu m of 8 boards can be in stalled. Th e followin g figu re sh ows th e addressin g for each board in th e system. V+ Lan gu age Referen ce Gu ide Page 1 0 4 AIO.IN real-valu ed fu n ction An alog Ch an n el Addressin g Th e valu e retu rn ed by th is fu n ction is in th e ran ge -1 .0 to +1 .0 (if th e board is set for bipolar ou tpu t), or 0 to 1 .0 (if th e board is set for u n ipolar ou tpu t). Con tact Adept application s for details on settin g th e con figu ration ; refer to How Can I Get Help? for details. Related Keywords AIO.OUT program in stru ction AIO.INS real-valu ed fu n ction V+ Lan gu age Referen ce Gu ide Page 1 0 5 AIO.INS real-valu ed fu n ction AIO.INS real-valued function Syntax AI O.I NS ( ch an n el) Function Test wh eth er an an alog in pu t or ou tpu t ch an n el is in stalled. Parameter ch an n el In teger th at specifies th e an alog IO board an d ch an n el to test. Th e valid ran ges are 0 , 1 to 3 2 , an d 1 0 0 1 to 1 2 5 6 , in clu sive. Details E ach an alog IO board con tain s 3 2 in pu t (1 6 for differen tial in pu t) an d 4 ou tpu t ch an n els. A maximu m of 8 boards can be in stalled. An alog Ch an n el Addressin g sh ows th e addressin g for each board in th e system. TRUE is retu rn ed if th e ch an n el is in stalled or 0 is specified. FALSE is retu rn ed if th e ch an n el is n ot in stalled. Related Keywords AIO.IN real-valu ed fu n ction AIO.OUT program in stru ction V+ Lan gu age Referen ce Gu ide Page 1 0 6 AIO.OUT program in stru ction AIO.OUT program instruction Syntax AI O.OUT ch an n el = valu e Function Write to a ch an n el on on e of th e an alog IO boards. Usage Considerations An alog IO mu st be in stalled in th e system an d correctly con figu red. Con tact Adept Application s for details on in stallin g an d con figu rin g an alog I/O boards. See th e section How Can I Get Help? for ph on e n u mbers. For details on programmin g an alog IO, see th e section An alog I/O in th e V+ Lan gu age User's Gu ide. Parameters ch an n el In teger th at specifies th e an alog IO board an d ch an n el to read. Acceptable valu es are 1 to 3 2 (see th e section An alog Ch an n el Addressin g for details on ch an n el addressin g). valu e Valu e to ou tpu t to th e an alog ch an n el. Details E ach an alog IO board con tain s 3 2 in pu t (1 6 for differen tial in pu t) an d 4 ou tpu t ch an n els. A maximu m of 8 boards can be in stalled. Th e section An alog Ch an n el Addressin g sh ows th e addressin g for each board in th e system. Th e valu e parameter is assu med to be in th e ran ge -1 .0 to +1 .0 if th e board is set for bipolar ou tpu t, or 0 to 1 .0 if th e board is set for u n ipolar ou tpu t (con tact Adept application s for details). If valu e is ou tside th is ran ge, it will be clipped to be with in th e ran ge. Th e actu al voltage or cu rren t ou tpu t by th e an alog I/O board is determin ed by ju mper settin gs on th e board (con tact Adept application s for details). Related Keywords AIO.IN real-valu ed fu n ction AIO.INS real-valu ed fu n ction V+ Lan gu age Referen ce Gu ide Page 1 0 7 ALIGN program in stru ction ALIGN program instruction Syntax ALI GN Function Align th e robot tool Z-axis with th e n earest world axis. Usage Considerations Th e ALIGN in stru ction can be execu ted by an y program task as lon g as th e task h as attach ed a robot. Th e in stru ction applies to th e robot selected by th e task. If th e V+ system is n ot con figu red to con trol a robot, execu tin g th e ALIGN in stru ction cau ses an error. Details Cau ses th e tool to be rotated so th at its Z-axis is align ed parallel to th e n earest axis of th e World coordin ate system. Th is in stru ction is primarily u sefu l for lin in g u p th e tool before a series of location s is tau gh t. Th is is most easily don e by u sin g th e mon itor DO comman d. Related Keywords SE LE CT program in stru ction SE LE CT real-valu ed fu n ction V+ Lan gu age Referen ce Gu ide Page 1 0 8 ALTE R program in stru ction ALTER program instruction Syntax ALTER ( con trol) Dx, Dy, Dz, Rx, Ry, Rz Function Specify th e magn itu de of th e real-time path modification th at is to be applied to th e robot path du rin g th e n ext trajectory compu tation . Th is in stru ction can be execu ted by th e task th at is con trollin g a robot in alter mode (see th e ALTON in stru ction ), or by an y oth er task th at h as SE LE CTed th e robot. Th is option is available on ly if you r Adept system is equ ipped with th e E n h an ced Trajectory Con trol Licen se (P/N 0 9 9 6 1 -0 0 0 1 3 ). Th is in stru ction is ign ored if th e selected robot is n ot in alter mode. Wh en alter mode is en abled, th is in stru ction sh ou ld be execu ted on ce du rin g each trajectory cycle. If th is in stru ction is execu ted more often , on ly th e last set of valu es defin ed du rin g each cycle will be u sed. Parameters con trol Option al real valu e, variable, or expression specifyin g a series of con trol bits. Cu rren tly, th is parameter is n ot u tilized, an d it can be omitted. Dx Dy Dz Option al real valu es, variables, or expression s th at defin e th e tran slation s alon g, an d th e rotation s abou t, th e X, Y, an d Z axes. Rx Ry Rz In cu mu lative mode, omitted coordin ates are in terpreted as zero. In n on cu mu lative mode, omitted coordin ates defau lt to th e valu es specified in th e previou s ALTE R in stru ction . Distan ces are in terpreted as millimeters; an gles are in terpreted as degrees. Details After alter mode h as been en abled (see th e ALTON in stru ction ), th is in stru ction is execu ted on ce each trajectory-gen eration cycle to specify th e amou n t by wh ich th e path is to be modified. Th e coordin ates defin ed by th is in stru ction are in terpreted accordin g to th e modes specified by th e ALTON in stru ction th at in itiated alter mode. V+ Lan gu age Referen ce Gu ide Page 1 0 9 ALTE R program in stru ction E xample Th e followin g pair of in stru ction s can be embedded in a program loop th at u ses sen sor data to con trol th e motion of th e robot. ; ; ; ; Modify the current robot path by (0.1*sx) millimeters along the X axis and (0.2*sz) millimeters along the Z axis, where "sx" and "sz" are variables that contain current sensor input data. ALTER () 0.1*sx, , 0.2*sz ; Wait for the next system cycle to give the trajectory ; generator a chance to execute. WAIT Related Keywords ALTOFF program in stru ction ALTON program in stru ction STATE real-valu ed fu n ction V+ Lan gu age Referen ce Gu ide Page 1 1 0 ALTOFF program in stru ction ALTOFF program instruction Syntax ALTOFF Function Termin ate real-time path -modification mode (alter mode). Usage Considerations Th is option is available on ly if you r Adept system is equ ipped with th e E n h an ced Trajectory Con trol Licen se. A robot mu st be attach ed by th e program task prior to execu tin g th is in stru ction . Tu rn in g off alter mode cau ses a BRE AK in con tin u ou s-path motion . Details Th is in stru ction su spen ds program execu tion u n til an y previou s robot motion h as been completed (similarly to th e BRE AK in stru ction ), an d th en termin ates real-time path -modification mode. After alter mode termin ates, th e robot is left at a fin al location th at reflects both th e destin ation of th e last robot motion an d th e total ALTE R correction th at h as been applied. Related Keywords ALTE R program in stru ction ALTON program in stru ction STATE real-valu ed fu n ction V+ Lan gu age Referen ce Gu ide Page 1 1 1 ALTON program in stru ction ALTON program instruction Syntax ALTON (lu n ) mode Function E n able real-time path -modification mode (alter mode), an d specify th e way in wh ich ALTE R coordin ate in formation will be in terpreted. Usage Considerations Th is option is available on ly if you r Adept system is equ ipped with th e E n h an ced Trajectory Con trol Licen se. A robot mu st be attach ed by th e program task prior to execu tin g th is in stru ction . Alter mode can n ot be active at th e time th is in stru ction is execu ted. An y motion s th at are performed wh ile alter mode is en abled mu st be of th e straigh t-lin e motion type an d can n ot be specified relative to a con veyor belt. Parameters lu n Option al real valu e, variable, or expression th at specifies a commu n ication s ch an n el associated with th e ALTE R operation . Cu rren tly, th is parameter is n ot u tilized, an d it can be omitted (th e paren th eses are requ ired, h owever). mode Option al real valu e, variable, or expression th at defin es h ow path -modification data specified by su bsequ en t ALTE R in stru ction s are to be in terpreted. Th e mode valu e is in terpreted as a sequ en ce of bit flags, as detailed below. All th e bits are assu med to be clear if th e mode parameter is omitted. Bit 1 ( LS B) Accu mu late correction s ( mask valu e = 1 ) If th is bit is set, coordin ate valu es specified by su bsequ en t ALTE R in stru ction s are in terpreted as in cremen tal an d are accu mu lated. If th is bit is clear, each set of coordin ate valu es is in terpreted as th e total (n on cu mu lative) correction to be applied. Bit 2 W orld coordin ates ( mask valu e = 2 ) If th is bit is set, coordin ate valu es specified by su bsequ en t ALTE R in stru ction s are in terpreted to be in th e World coordin ate system. If th is bit is cleared, coordin ates are in terpreted to be in th e Tool coordin ate system. V+ Lan gu age Referen ce Gu ide Page 1 1 2 ALTON program in stru ction Details Th is in stru ction in itiates th e real-time path -modification (alter) facility. After th is in stru ction is execu ted, du rin g all su bsequ en t robot motion s th e coordin ate valu es specified by ALTE R in stru ction s will au tomatically be su perimposed on th e n omin al path compu ted by th e V+ trajectory gen erator. Th e correction s can be applied in all six degrees of freedom, an d th ey can be specified as cu mu lative or n on cu mu lative valu es in World or Tool coordin ates. On ce alter mode is in itiated, th e robot location is corrected du rin g all su bsequ en t motion s, an d between motion s if breaks occu r between con tin u ou s-path segmen ts. Alter mode is termin ated by an y of th e followin g: l E xecu tin g an ALTOFF in stru ction l DE TACHin g th e robot l Prematu rely termin atin g a robot motion l Stoppin g program execu tion E xample In itiate alter mode an d in terpret su bsequ en t ALTE R in stru ction s as total correction s (bit #1 is clear), World-coordin ate (bit #2 is set) correction s to th e n omin al path of th e robot: ALTON () 2 Related Keywords ALTE R program in stru ction ALTOFF program in stru ction STATE real-valu ed fu n ction V+ Lan gu age Referen ce Gu ide Page 1 1 3 ALWAYS keyword ALWAYS keyword Syntax ...ALW AYS Function Used with certain program in stru ction s to specify a lon g-term effect. Details ALWAYS can be specified with an y of th e in stru ction s listed below as related keywords. Wh en ALWAYS is specified, th e effect of th e in stru ction con tin u es u n til explicitly disabled. Oth erwise, th e effect of th e in stru ction applies on ly to th e n ext robot motion . E xamples Perman en tly set th e robot motion speed: SPEED 50 ALWAYS Perman en tly set loose-toleran ce servo mode: COARSE ALWAYS Related Keywords COARSE program in stru ction CPOFF program in stru ction CPON program in stru ction DURATION program in stru ction FINE program in stru ction MULTIPLE program in stru ction NONULL program in stru ction NOOVE RLAP program in stru ction NULL program in stru ction OVE RLAP program in stru ction SINGLE program in stru ction SPE E D program in stru ction V+ Lan gu age Referen ce Gu ide Page 1 1 4 AMOVE program in stru ction AMOVE program instruction Syntax AMOVE axis = position Function Position an extra robot axis du rin g th e n ext join t-in terpolated or straigh t-lin e motion to a tran sformation location . Usage Considerations No robot motion occu rs wh en th e AMOVE in stru ction is execu ted: Th e requ ested motion occu rs wh en th e n ext robot motion is performed. If th e n ext motion is a DRIVE , DE LAY, or motion to a precision poin t, th e AMOVE in stru ction is ign ored. Th e AMOVE in stru ction can be execu ted by an y program task as lon g as th e task h as attach ed a robot. Th e in stru ction applies to th e robot selected by th e task. If th e V+ system is n ot con figu red to con trol a robot, execu tin g th e AMOVE in stru ction will cau se an error. Th e AMOVE in stru ction u ses th e basic program speed rath er th an th e rotation al speed to compu te motion times du rin g Cartesian motion s. Note: Th e AMOVE in stru ction is on ly available if th e robot is con trolled by a kin ematic device modu le th at su pports an extra robot axis. For addition al in formation , con tact Adept Application s E n gin eerin g Services. Parameters axis Real valu e, variable, or expression (in terpreted as an in teger) th at specifies th e n u mber of th e extra robot axis to be moved. Th is valu e can be 1 , 2 , ...., n , wh ere n is th e total n u mber of extra axes th at th e robot con tain s. position Real valu e, variable, or expression th at specifies th e (absolu te) position desired for th e extra axis. Th is valu e is in terpreted in th e u n its u sed to measu re th e axis position . Th at is, th e position for a rotary axis mu st be specified in degrees, an d th e position for a lin ear axis mu st be in millimeters. V+ Lan gu age Referen ce Gu ide Page 1 1 5 AMOVE program in stru ction Details Th is in stru ction position s an extra robot axis du rin g th e n ext join t-in terpolated or straigh tlin e motion . However, th is in stru ction h as n o effect if th e n ext motion is cau sed by a DRIVE or DE LAY in stru ction or is a motion to a location specified by a precision poin t. Th at is, th is in stru ction is can celed by th ose cases. An extra axis is a redu n dan t or in depen den t axis th at is an in tegral part of a robot device. For example, if a robot h as two colin ear Z axes, on e of th e two axes is design ated as th e redu n dan t axis. Or if th e robot is mou n ted on a slide axis (for example, to allow th e robot to be position ed at differen t work station s), th e slide axis can be in clu ded as an in depen den t axis in th e geometric model for th e robot. An extra axis can be position ed directly by execu tin g a DRIVE in stru ction , bu t th en th e extra axis moves by itself. Th at is, th e oth er robot axes do n ot move wh ile th e extra axis is movin g. Th ere are two ways to make th e extra axis move alon g with all th e oth er robot axes: l l Perform a motion to a location specified by a precision poin t. E xecu te an AMOVE in stru ction to specify th e desired destin ation position for th e extra axis, an d th en execu te a motion to a destin ation specified as a tran sformation valu e. Wh en th e extra axis is moved with th e oth er robot axes, all th e axes are moved so th ey reach th eir destin ation position s at th e same time. E xamples Position th e secon d extra axis of th e robot to (absolu te) position 1 0 0 du rin g th e n ext motion of th e robot-u n less a DRIVE or DE LAY in stru ction is en cou n tered first, or th e location specified in th e n ext motion in stru ction is a precision poin t. AMOVE 2 = 100.0 Related Keywords APPRO program in stru ction APPROS program in stru ction DE LAY program in stru ction DE PART program in stru ction DE PARTS program in stru ction DRIVE program in stru ction MOVE program in stru ction MOVE S program in stru ction MOVE T program in stru ction V+ Lan gu age Referen ce Gu ide Page 1 1 6 AMOVE program in stru ction MOVE ST program in stru ction SE LE CT program in stru ction V+ Lan gu age Referen ce Gu ide Page 1 1 7 AND operator AND operator Syntax ...valu e AND valu e... Function Perform th e logical AND operation on two valu es. Details Th e AND operator operates on two valu es, resu ltin g in th eir logical AND combin ation . For example, du rin g th e AND operation c = a AND b th e followin g fou r situ ation s can occu r: a b c FALSE FALSE -> FALSE FALSE TRUE -> FALSE TRUE FALSE -> FALSE TRUE TRUE -> TRUE Th e resu lt is TRUE on ly if both of th e two operan d valu es are logically TRUE . To review th e order of evalu ation for operators with in expression s, see th e section Order of E valu ation in th e V+ Lan gu age User's Gu ide. E xample ;The instructions following the IF will be executed if ;both "ready" is TRUE (nonzero) and "count" equals 1. IF ready AND (count == 1) THEN Related Keywords BAND operator OR operator XOR operator V+ Lan gu age Referen ce Gu ide Page 1 1 8 ANY program in stru ction ANY program instruction Syntax ANY Function Sign al th e begin n in g of an altern ative grou p of in stru ction s for th e CASE stru ctu re. Usage Considerations Th e ANY in stru ction mu st be with in a CASE stru ctu re. Details See th e description of th e CASE stru ctu re. Related Keywords CASE program in stru ction VALUE program in stru ction V+ Lan gu age Referen ce Gu ide Page 1 1 9 APPRO program in stru ction APPR O program instruction Syntax APPRO location , distan ce APPROS location , distan ce Function Start a robot motion toward a location defin ed relative to specified location . Usage Considerations APPRO cau ses a join t-in terpolated motion . APPROS cau ses a straigh t-lin e motion , du rin g wh ich n o ch an ges in con figu ration are permitted. Th e APPRO an d APPROS in stru ction s can be execu ted by an y program task as lon g as th e task h as attach ed a robot. Th e in stru ction s apply to th e robot selected by th e task. If th e V+ system is n ot con figu red to con trol a robot, execu tin g th ese in stru ction s will cau se an error. Parameters location Tran sformation valu e th at defin es th e basis for th e fin al location . distan ce Real-valu ed expression th at specifies th e distan ce alon g th e robot tool Z axis between th e specified location an d th e actu al desired destin ation . A positive distan ce sets th e tool back (n egative tool-Z) from th e specified location ; a n egative distan ce offsets th e tool forward (positive toolZ). Details Th ese in stru ction s in itiate a robot motion to th e orien tation described by th e given location valu e. Th e position of th e destin ation location is offset from th e given location by th e distan ce given , measu red alon g th e tool Z axis. E xamples APPRO place,offset Moves th e tool, by join t-in terpolated motion , to a location offset millimeters from th at defin ed by th e tran sformation place. Th e offset is alon g th e resu ltan t Z axis of th e tool. V+ Lan gu age Referen ce Gu ide Page 1 2 0 APPRO program in stru ction APPROS place,-50 Moves th e tool alon g a straigh t lin e to a location 5 0 millimeters from th at defin ed by th e tran sformation place, with th e offset alon g th e resu ltan t Z axis of th e tool to a location beyon d th e location place. Related Keywords DE PART program in stru ction DE PARTS program in stru ction MOVE program in stru ction MOVE S program in stru ction MOVE F program in stru ction MOVE SF program in stru ction V+ Lan gu age Referen ce Gu ide Page 1 2 1 APPRO program in stru ction APPR O program instruction Syntax APPRO location , distan ce APPROS location , distan ce Function Start a robot motion toward a location defin ed relative to specified location . Usage Considerations APPRO cau ses a join t-in terpolated motion . APPROS cau ses a straigh t-lin e motion , du rin g wh ich n o ch an ges in con figu ration are permitted. Th e APPRO an d APPROS in stru ction s can be execu ted by an y program task as lon g as th e task h as attach ed a robot. Th e in stru ction s apply to th e robot selected by th e task. If th e V+ system is n ot con figu red to con trol a robot, execu tin g th ese in stru ction s will cau se an error. Parameters location Tran sformation valu e th at defin es th e basis for th e fin al location . distan ce Real-valu ed expression th at specifies th e distan ce alon g th e robot tool Z axis between th e specified location an d th e actu al desired destin ation . A positive distan ce sets th e tool back (n egative tool-Z) from th e specified location ; a n egative distan ce offsets th e tool forward (positive toolZ). Details Th ese in stru ction s in itiate a robot motion to th e orien tation described by th e given location valu e. Th e position of th e destin ation location is offset from th e given location by th e distan ce given , measu red alon g th e tool Z axis. E xamples APPRO place,offset Moves th e tool, by join t-in terpolated motion , to a location offset millimeters from th at defin ed by th e tran sformation place. Th e offset is alon g th e resu ltan t Z axis of th e tool. V+ Lan gu age Referen ce Gu ide Page 1 2 2 APPRO program in stru ction APPROS place,-50 Moves th e tool alon g a straigh t lin e to a location 5 0 millimeters from th at defin ed by th e tran sformation place, with th e offset alon g th e resu ltan t Z axis of th e tool to a location beyon d th e location place. Related Keywords DE PART program in stru ction DE PARTS program in stru ction MOVE program in stru ction MOVE S program in stru ction MOVE F program in stru ction MOVE SF program in stru ction V+ Lan gu age Referen ce Gu ide Page 1 2 3 ASC real-valu ed fu n ction ASC real-valued function Syntax AS C ( strin g, in dex) Function Retu rn an ASCII ch aracter valu e from with in a strin g. Parameters strin g Strin g expression from wh ich th e ch aracter is to be picked. If th e strin g is empty, th e fu n ction retu rn s th e valu e -1 . in dex Option al real-valu ed expression defin in g th e ch aracter position of in terest. Th e first ch aracter of th e strin g is selected if th e in dex is omitted or h as a valu e of 0 or 1 . If th e valu e of th e in dex is n egative, or greater th an th e len gth of th e strin g, th e fu n ction retu rn s th e valu e -1 . Details Th e ASCII valu e of th e selected ch aracter is retu rn ed as a real valu e. E xamples ;Returns the ASCII value of the letter "a". ASC("sample", 2) ;Returns the ASCII value of the first character of the ;string contained in the variable $name. ASC($name) ;Uses the value of the real variable "i" as an index to ;the character of interest in the string contained in the ;variable "$system". ASC($system, i) Related Keywords $ CHR strin g fu n ction VAL real-valu ed fu n ction V+ Lan gu age Referen ce Gu ide Page 1 2 4 ATAN2 real-valu ed fu n ction ATAN2 real-valued function Syntax ATAN2 ( valu e_ 1 , valu e_ 2 ) Function Retu rn th e size of th e an gle (in degrees) th at h as its trigon ometric tan gen t equ al to valu e_ 1 /valu e_ 2 . Usage Considerations Th e retu rn ed valu e is zero if both parameter valu es are zero. Parameters valu e_ 1 Real-valu ed expression . valu e_ 2 Real-valu ed expression . E xamples ATAN2(0.123,0.251) ATAN2(-5.462,47.2) ATAN2(1.3125E+2,-1.3) slope = ATAN2(rise, run) ;Returns ;Returns ;Returns 26.1067 -6.600926 -90.56748 NOTE: TYPE , PROMPT, an d similar in stru ction s ou tpu t th e resu lts of th e above examples as sin gle-precision valu es. However, th ey are actu ally stored an d man ipu lated as dou bleprecision valu es. Th e LISTR mon itor comman d will display real valu es to fu ll precision . V+ Lan gu age Referen ce Gu ide Page 1 2 5 ATTACH program in stru ction ATTACH program instruction Syntax ATTACH (lu n , mode) $ device Function Make a device available for u se by th e application program. Usage Considerations Th e robot is au tomatically attach ed wh en th e E XE CUTE mon itor comman d or program in stru ction is processed for task 0 (except wh en th e DRY.RUN system switch is en abled). All th e oth er logical u n its are au tomatically detach ed wh en program execu tion begin s. Th e logical u n it for th e man u al con trol pen dan t can be attach ed even wh en th e pen dan t is n ot con n ected to th e system. Th e fu n ction PE NDANT(-4 ) can be u sed (before or after attach in g) to determin e if th e pen dan t is con n ected. If th e system termin al or th e man u al con trol pen dan t was attach ed wh en a program stopped execu tin g, it is au tomatically reattach ed if execu tion of th e program is resu med with th e PROCE E D, RE TRY, SSTE P, or XSTE P comman ds. Use of th is in stru ction to attach to NFS or TCP devices requ ires th e AdeptNet option an d th e appropriate licen se(s). V+ Lan gu age Referen ce Gu ide Page 1 2 6 ATTACH program in stru ction Parameters lu n Th e logical u n it n u mber to associate with th e attach ed device. Th e in terpretation of th is parameter depen ds on th e valu e of th e mode parameter, as follows: If bit 3 of th e mode parameter is 0 , th is parameter is option al (defau ltin g to 0 , to attach th e robot); an d it can be a real valu e, variable, or expression (in terpreted as an in teger) in th e ran ge 0 to 2 4 th at specifies th e logical u n it to be attach ed. See th e Details section for th e defau lt association of logical u n its with devices. If th e logical u n it specified is n ot 0 , you can u se th e $ device parameter to override th e defau lt device for th e logical u n it. If bit 3 of th e mode parameter is 1 , th is parameter is requ ired an d mu st be a real variable. In th is case, th e V+ system attach es th e device specified by th e $ device parameter an d au tomatically assign s a logical u n it n u mber to th is parameter. If all th e logical u n its are in u se, th e parameter is set to -1 . V+ assign s a valu e to th e lu n parameter even if th e ATTACH requ est fails. mode Option al real valu e, variable, or expression (in terpreted as a bit field) th at defin es h ow th e ATTACH requ est is to be processed. Th e valu e specified is in terpreted as a sequ en ce of bit flags as detailed below. All th e bits are assu med to be clear if n o valu e is specified. Bit 1 ( mask valu e = 1 ) - ( LS B) Qu eu e ( 0 ) versu s Fail ( 1 ) Th is bit con trols h ow th e device driver respon ds to th e attach requ est from th e con trol program task. (Th e device driver is an in tern al system task th at is separate from th e con trol program task.) For most application s, th is bit sh ou ld be set. If th is bit is clear, an d th e device is already attach ed by an oth er con trol program task, th e driver qu eu es th is attach requ est an d sign als th e con trol program th at th e attach is n ot complete. Th e attach men t will complete wh en th e device becomes available. If th is bit is set, an d th e device is already attach ed by an oth er con trol program task, th e device driver immediately sign als th at th e attach requ est h as failed. Th e fu n ction IOSTAT(lu n ) can be u sed to determin e th e su ccess or failu re of th e attach men t. A positive valu e from IOSTAT in dicates su ccessfu l completion ; zero in dicates th e attach men t h as n ot completed; a n egative valu e in dicates completion with an error. Bit 2 ( mask valu e = 2 ) - W ait ( 0 ) versu s No-wait ( 1 ) V+ Lan gu age Referen ce Gu ide Page 1 2 7 ATTACH program in stru ction Th is bit con trols wh eth er or n ot th e con trol program task waits for a respon se from th e device driver. For most application s, th is bit sh ou ld n ot be set. If th is bit is clear, program execu tion waits for th e device driver to sign al th e resu lt of th e attach requ est. If th is bit is set, program execu tion does n ot wait for th e resu lt of th e attach requ est. Th e program mu st th en u se th e fu n ction IOSTAT(lu n ) to determin e if th e attach men t h as su cceeded (see earlier text). If th e program attempts to RE AD from or WRITE to th e logical u n it wh ile th e attach men t is pen din g, program execu tion th en waits for th e attach men t to complete. Bit 3 ( mask valu e = 4 ) - S pecify LUN ( 0 ) versu s Have LUN Assign ed ( 1 ) Th is bit determin es h ow th e lu n parameter is processed. If th is bit is clear, th e device correspon din g to th e valu e of lu n is attach ed. Th at is, th e valu e of th e lu n parameter specifies th e device th at is to be attach ed (accordin g to th e table in th e Details section ) except wh en a differen t device is specified with th e $ device parameter. If th is bit is set, th e device to be attach ed is specified by th e $ device parameter (wh ich sh ou ld n ot be omitted). In th is case, a logical u n it is au tomatically selected, an d th e valu e of th e lu n parameter is set by th e ATTACH in stru ction . V+ assign s a valu e to lu n even if th e ATTACH requ est fails. (Th is mode can n ot be u sed to attach th e robot or man u al con trol pen dan t.) $ device Option al strin g con stan t, variable, or expression th at iden tifies th e device to be attach ed. If bit 3 of th e mode parameter is 0 , th is parameter is u sed to override th e defau lt device associated with th e valu e of th e lu n parameter (except th at logical u n it 0 is always th e robot). Th e acceptable device n ames are sh own in th e followin g table. Acceptable Device Names to Be Attach ed Device Mean in g DDCMP:n Global serial lin e (see SE RIAL:n below) con figu red for DDCMP su pport (see Note 1 ) DISK Ph ysical drive in th e Adept con troller (disk or CompactFlash ) V+ Lan gu age Referen ce Gu ide Page 1 2 8 ATTACH program in stru ction DE VICE NE T Access devices con n ected to DeviceNet GRAPHICS Graph ics win dow KE RMIT Serial lin e th at is con figu red for Kermit su pport (see Note 2 ) LOCAL.SE RIAL:n Local serial lin e (n = 1 , 2 , 3 , or 4 for Adept CPUs; n =1 or 2 for th e Adept SmartCon troller) (see Notes 3 an d 4 ) MONITOR Th e cu rren t mon itor win dow or operator's termin al NF S NFS protocol device driver (see Note 5 ) SE RIAL:n Global serial lin e (n = 1 , 2 , 3 , or 4 for Adept SIO modu le; n = 1 or 2 for th e Adept SmartCon troller CX) (see Note 4 ) SYSTE M Disk device, cu rren tly set with th e CD or DE FAULT comman d TCP TCP protocol device driver TFTP Access th e TFTP server to read files UDP UDP protocol device driver NOT ES: 1. T he g lob al s er ial line us ed for DDCMP mus t have b een c onfig ur ed for the DDCMP p r otoc ol us ing CONFIG_C 2. T he g lob al or loc al s er ial line us ed for KERMIT mus t have b een c onfig ur ed for the KERMIT p r otoc ol us ing CONFIG_C 3. On an AW C s ys tem, the loc al s er ial lines 1, 2, and 3 ar e loc ated on the AW C b oar d . Loc al s er ial line 4 is loc ated on the Contr oller Inter fac e Panel (CIP). On a Smar tContr oller s ys tem, on l y loc al s er ial lines 1 and 2 ar e availab le on the s ys tem c ontr oller . 4. T he initial s etting s for thes e s er ial lines ar e s et with CONFIG_C. T hey may b e c hang ed with the FSET p r og r am ins tr uc tion or monitor c ommand . 5. For the NFS d evic e, when the filename extens ion is omitted fr om a file s p ec ific ation, a d efault filename extens ion is ap p lied j us t as it is for loc al DISK d evic es (for examp le, the extens ion .V2 is us ed for files r efer enc ed b y the LOAD c ommand ). V+ Lan gu age Referen ce Gu ide Page 1 2 9 ATTACH program in stru ction Details Th e robot mu st remain attach ed by a robot con trol program for th e program to comman d motion of th e robot. Wh en th e robot is detach ed (see th e DE TACH in stru ction ), h owever, you can u se th e man u al con trol pen dan t to move th e robot u n der direction s from th e application program. Th is is u sefu l, for example, for application setu p sequ en ces. (Th e belt an d vision calibration programs provided by Adept u se th is tech n iqu e.) Program task 0 au tomatically attach es robot #1 wh en th at task begin s execu tion . A robot con trol program execu ted by an y of th e oth er program tasks mu st explicitly attach th e robot. An y task can attach to an y robot, provided th at th e robot is n ot already attach ed by a differen t task. Th e robot th at is attach ed by an ATTACH in stru ction is th e on e th at was last specified by a SE LE CT in stru ction execu ted by th e cu rren t task (see th e SE LE CT in stru ction ). If n o SE LE CT in stru ction h as been execu ted, th en robot #1 is attach ed. Th e SE LE CT in stru ction can be u sed to select a differen t robot on ly if n o robot is cu rren tly attach ed to th e task. To su ccessfu lly attach th e robot, th e system mu st be in COMP mode. Oth erwise (for mode bit 1 = 0 ), program execu tion is su spen ded (with ou t n otice) u n til th e system is placed in COMP mode. Th is situ ation can be avoided in two ways: (1 ) u se th e STATE fu n ction to determin e if th e system is in COMP mode before execu tin g an ATTACH in stru ction , (2 ) set bit 1 in th e mode valu e, an d u se th e IOSTAT fu n ction to determin e th e su ccess of th e ATTACH in stru ction . Th e man u al con trol pen dan t (logical u n it 1 ) mu st be attach ed before (1 ) text can be sen t to th e display, (2 ) a KE YMODE in stru ction can be processed, or (3 ) keys can be read in keyboard mode or special mode (see KE YMODE ). Wh en th e man u al con trol pen dan t is attach ed, th e USE R ligh t on th e pen dan t is tu rn ed on . Th e ligh t will blin k if th e pen dan t is n ot in backgrou n d mode (for example, it is in DISP mode) wh ile an in pu t or ou tpu t operation is pen din g. NOTE: Th e logical u n it for th e man u al con trol pen dan t can be attach ed even wh en th e pen dan t is n ot con n ected to th e system. Th e fu n ction PE NDANT(-4 ) can be u sed (before or after attach in g) to determin e if th e pen dan t is con n ected. Wh en th e system termin al (logical u n it 4 ) is attach ed, all keyboard in pu t will be bu ffered for in pu t requ ests by th e program. NOTE: Wh en th e system termin al is attach ed, a u ser is n ot able to type ABORT to termin ate program execu tion . Th e program mu st provide a mean s for fieldin g a termin ation requ est, or you mu st u se th e man u al con trol pen dan t or emergen cy stop switch to stop program execu tion . Wh en a DISK, KE RMIT, or NFS device is attach ed, it allows a program to read an d write data from an d to files. DISK refers to th e local h ard disk, floppy disk, or CompactFlash (CF). KE RMIT refers to remote files accessed over a serial lin e u sin g th e Kermit protocol. NFS refers to remote files accessed over E th ern et u sin g th e NFS protocol. On e of th e FOPE N in stru ction s mu st be u sed to specify wh ich file to access. WRITE an d RE AD in stru ction s can th en be u sed V+ Lan gu age Referen ce Gu ide Page 1 3 0 ATTACH program in stru ction to tran sfer in formation to an d from th e file. Also, FCMND in stru ction s can be u sed to sen d comman ds to th e file system. Wh en a TFTP device is attach ed, it allows a program to read a file from an FTP site. Wh en a LOCAL.SE RIAL:n or SE RIAL:n serial commu n ication lin e is attach ed, it can be u sed to sen d an d receive in formation to an d from an oth er system. As with disk I/O, WRITE an d RE AD in stru ction s are u sed for th e in formation tran sfer. Wh en a serial commu n ication lin e is attach ed, its con figu ration is set to th at specified on th e boot disk from wh ich th e V+ system was loaded. Th at is, ATTACH can cels th e effect of an y FSE T th at h ad been u sed previou sly to modify th e ch aracteristics of th e serial lin e. For th e details on ph ysical con n ectors an d correspon din g V+ design ation s, see: Table 3 -5 . Serial Con n ectors an d V+ Design ation s in th e Adept SmartCon troller User's Gu ide; or th e section AWC Modu le Serial I/O Ports an d th e section Serial I/O Con n ectors in th e Adept MV Con troller User's Gu ide for V+ 1 3 .0 an d Later. Wh en a GRAPHICS logical u n it is attach ed, a program can access graph ics win dows on th e system mon itor. After a win dow logical u n it is attach ed, th e FOPE N in stru ction mu st be u sed to specify wh ich win dow is accessed with th e logical u n it. Th e FSE T in stru ction can th en be u sed to modify attribu tes of th e win dow, th e graph ics in stru ction s can be u sed to ou tpu t to th e win dow, an d th e GE TE VE NT in stru ction can be u sed to receive in pu t from th e win dow. Wh en mode bit 3 = 0 an d th e $ device parameter is omitted, th e logical u n it n u mber implicitly specifies th e correspon din g defau lt device from th e followin g table. Defau lt Device Nu mbers S u pplied by th e LUN Nu mber Device 0 Robot (defau lt wh en lu n is omitted) 1 Man u al con trol pen dan t 2 System termin al 3 System termin al 4 System termin al 5 Disk 6 Disk 7 Disk 8 Disk V+ Lan gu age Referen ce Gu ide Page 1 3 1 ATTACH program in stru ction 9 No defau lt device 10 Serial commu n ication lin e (Global #1 on SIO board) 11 Serial commu n ication lin e (Global #2 on SIO board) 12 Serial commu n ication lin e (Global #3 on SIO board) 13 Serial commu n ication lin e (Global #4 on SIO board) 14 Serial commu n ication lin e (Local #1 RS-4 2 2 port on system processor)1 15 Serial commu n ication lin e (Local #2 RS-2 3 2 port on system processor)1 16 No defau lt device 17 Disk 18 Disk 19 Disk 20 Graph ics win dow 21 Graph ics win dow 22 Graph ics win dow 23 Graph ics win dow 24 Graph ics win dow 25 - 31 No defau lt devices NOT E: V+ Lan gu age Referen ce Gu ide Page 1 3 2 ATTACH program in stru ction 1. T her e ar e c ur r ently no d efault LUNs as s ig ned for s er ial c ommunic ation lines Loc al #3 or Loc al #4. E xamples l Take over con trol of th e robot: ATTACH l Con n ect to global serial lin e 1 ; wait for it to become available if an oth er task h as it attach ed; retu rn th e assign ed logical u n it n u mber in lu n : ATTACH (lun, 4) "serial:1" l Th e n ext in stru ction is similar to th e previou s on e, bu t th is on e requ ires u se of th e IOSTAT fu n ction to determin e if an oth er task h as th e serial lin e attach ed: ATTACH (lun, 5) "serial:1" l Attach to th e TCP device driver with au tomatic allocation of a logical u n it n u mber: ATTACH (lun, 4) "TCP" l Attach to th e NFS device driver with au tomatic allocation of a logical u n it n u mber: ATTACH (lun, 4) "NFS" Related Keywords DE TACH program in stru ction FSE T program in stru ction IOSTAT real-valu ed fu n ction SE LE CT program in stru ction V+ Lan gu age Referen ce Gu ide Page 1 3 3 AUTO program in stru ction AUTO program instruction Syntax AUTO type variable, ..., variable Function Declare temporary variables th at are au tomatically created on th e program stack wh en th e program is en tered. Usage Considerations AUTOmatic variables h ave an u n determin ed valu e wh en a program is first en tered (bu t th ey are n ot n ecessarily u n defin ed), an d th ey h ave n o valu e after th e program exits. AUTO statemen ts mu st appear before an y execu table in stru ction in th e program-on ly th e .PROGRAM statemen t, commen ts, blan k lin es, GLOBAL an d LOCAL statemen ts, an d oth er AUTO statemen ts may precede th is in stru ction . If a variable is listed in an AUTO statemen t, an y global variables with th e same n ame can n ot be accessed directly by th e program. Th e valu es of AUTOmatic variables are n ot saved by th e STORE or restored by th e LOAD mon itor comman ds. Parameters type Option al keyword RE AL, DOUBLE , or LOC, in dicatin g th at all th e variables in th is statemen t are to be sin gle precision , dou ble precision , or location variables. (A location can be a tran sformation , precision poin t, or belt variable.) If th is keyword is omitted, th e type of each variable is determin ed by its u se with in th e program. An error is gen erated if th e type can n ot be determin ed from u sage. variable Name of a variable of an y data type available with V+ (belt, precision poin t, real-valu e, strin g, an d tran sformation ). E ach variable can be a simple variable or an array. If th e type parameter is specified (see below), all th e variables mu st match th at type. Array variables mu st h ave th eir in dexes specified explicitly, in dicatin g th e h igh est valid in dex for th e array. V+ Lan gu age Referen ce Gu ide Page 1 3 4 AUTO program in stru ction Details Th is in stru ction is u sed to declare variables to be defin ed on ly with in th e cu rren t program. Th at is, an AUTOmatic variable can be referen ced on ly by th e specific callin g in stan ce of a program. Also, th e n ames of AUTOmatic variables can be selected with ou t regard for th e n ames of variables defin ed in an y oth er programs. AUTOmatic variables are allocated each time th e program is called, an d th eir valu es are n ot preserved between su ccessive su brou tin e calls. Th ese valu es can be displayed via mon itor comman ds on ly wh en th e program task is in active bu t is on an execu tion stack. Wh en a program is first en tered, au tomatic variables h ave arbitrary, u n determin ed valu es (an d th ey are n ot n ecessarily u n defin ed). AUTOmatic variables are lost wh en th e program exits. Un like a LOCAL variable, a separate copy of an AUTOmatic variable is created each time a program is called, even if it is called simu ltan eou sly by several differen t program tasks, or called recu rsively by a sin gle task. If a program th at u ses LOCAL or global variables is called by several differen t program tasks, or recu rsively by a sin gle task, th e valu es of th ose variables can be modified by th e differen t program in stan ces an d can cau se very stran ge program errors. Th erefore, AUTOmatic variables sh ou ld be u sed for all temporary local variables to min imize th e ch an ce of su ch errors. Variables can be defin ed as GLOBAL, AUTOmatic, or LOCAL. An attempt to defin e AUTOmatic, GLOBAL, or LOCAL variables with th e same n ame will resu lt in th e error message * Attempt to redefin e variable class* . Variables can be defin ed on ly on ce with in th e same con text (AUTOmatic, LOCAL, or GLOBAL). Attemptin g to defin e a variable more th an on ce (th at is, with a differen t type) will yield th e error message *Attempt to redefine variable type* AUTOmatic array variables mu st h ave th e size of each dimen sion specified in th e AUTO statemen t. E ach in dex specified mu st represen t th e last elemen t to be referen ced in th at dimen sion . Th e first elemen t allocated always h as in dex valu e zero. For example, th e statemen t AUTO LOC points[3,5] allocates a tran sformation array with 2 4 elemen ts. Th e left-h an d in dex ran ges from 0 to 3 , an d th e righ t-h an d in dex ran ges from 0 to 5 . Th e storage space for AUTOmatic variables is allocated on th e program execu tion stack. If th e stack is too small for th e n u mber of AUTOmatic variables declared, th e task execu tion will stop with th e error message *Too many subroutine calls* If th is h appen s, u se th e STATUS mon itor comman d to determin e h ow mu ch addition al stack space is requ ired. Th en , u se th e STACK mon itor comman d to in crease th e stack size an d th en issu e th e RE TRY mon itor comman d to con tin u e program execu tion . AUTOmatic variables can n ot be deleted with th e DE LE TE _ comman ds. V+ Lan gu age Referen ce Gu ide Page 1 3 5 AUTO program in stru ction AUTOmatic variables can be referen ced with mon itor comman ds su ch as BPT, DE LE TE _ , DO, HE RE , LIST_ , POINT, TE ACH, TOOL, an d WATCH by u sin g th e option al con text specifier @. Th e gen eral syn tax is: command @task:program command_arguments E xamples l Declare th e variables loc.a, $ an s, an d i to be AUTOmatic in th e cu rren t program (th e variable types for loc.a an d i mu st be clear from th eir u se in th e program): AUTO loc.a, $ans, i l Declare th e variables i, j, an d tmp[ ] to be AUTOmatic, real variables in th e cu rren t program (array elemen ts tmp[ 0 ] th rou gh tmp[ 1 0 ] are defin ed): AUTO REAL i, j, tmp[10] l Declare th e variable loc to be an AUTOmatic variable in th e cu rren t program. Th e variable type of loc mu st be determin ed by its u se in th e program. Note th at sin ce LOC appears by itself, it is n ot in terpreted as th e type-specifyin g keyword.) AUTO loc Related Keywords GLOBAL program in stru ction LOCAL program in stru ction STACK mon itor comman d V+ Lan gu age Referen ce Gu ide Page 1 3 6 AUTO.POWE R.OFF system switch AUTO.POWER .OFF system switch Syntax AUTO.POW ER.OFF Function Con trol wh eth er or n ot V+ disables h igh power wh en certain motion errors occu r. Usage Considerations Th is switch h as effect du rin g au tomatic mode bu t n ot du rin g man u al mode. It is especially u sefu l in redu cin g operator in terven tion du rin g common n u llin g-timeou t an d en velope errors. Details Becau se th e HIGH POWE R ON/OFF h igh power on /off bu tton can n ot be u sed by itself to en able h igh power as in earlier version s of V+, Adept h as sou gh t to redu ce th e n u mber of in stan ces th at h igh power is disabled du rin g n ormal program execu tion . Makin g th is improvemen t allows programs to con tin u e to recover au tomatically from errors with ou t man u al in terven tion , th at is, with ou t requ irin g you to press th e HIGH POWE R ON/OFF bu tton . Th is system switch can cels th e effect of th is ch an ge. By defau lt th is switch is disabled. E n ablin g it restores fu n ction ality as it was in V+ version 1 1 .x an d earlier. Adept reviewed all au tomatic-mode errors th at disabled h igh power in V+ version 1 2 .0 an d determin ed wh ich can be ch an ged simply to decelerate th e robot an d gen erate an error with ou t compromisin g th e safe operation of th e system. E xamples of particu lar importan ce are errors su ch as n u llin g-timeou t an d en velope errors th at often occu r du rin g th e n ormal operation of th e system. In some cases, Adept h as modified in tern al software to en su re th e con tin u ed safe operation of you r system. Th e settin g of th is switch h as n o effect du rin g man u al mode. If th is switch is en abled, V+ disables h igh power for all motion related errors in clu din g n u llin g-timeou t an d soft en velope errors. E xample Th e followin g program segmen t in stru cts V+ to disable h igh power wh en an y motion error occu rs: ENABLE AUTO.POWER.OFF ;Disable high power when any ;motion error occurs Related Keywords DISABLE mon itor comman d V+ Lan gu age Referen ce Gu ide Page 1 3 7 AUTO.POWE R.OFF system switch DISABLE program in stru ction E NABLE mon itor comman d E NABLE program in stru ction SWITCH mon itor comman d SWITCH program in stru ction SWITCH real-valu ed fu n ction V+ Lan gu age Referen ce Gu ide Page 1 3 8 AVR system switch AVR system switch Syntax ... AVR Function Determin es wh eth er ActiveVR in stru ction s received from a h ost system are h an dled or ign ored by th e V+ operatin g system. Details To execu te ActiveVR in stru ction s from a h ost system, th is switch mu st be en abled. If it disabled (th e defau lt settin g) all ActiveVR in stru ction s received from th e h ost system are ign ored an d th e error code (-5 4 2 ) * Network n ot en abled* is sen t to th e h ost system. Th e remote h ost may still con n ect to th e con troller. Th is switch h as n o effect if ActiveVR is n ot bein g u sed. Related Keywords AVR.LOG system switch AVR.LOGSIZE system parameter AVR.TRACE system switch V+ Lan gu age Referen ce Gu ide Page 1 3 9 AVR.LOG system switch AVR .LOG system switch Syntax AVR.LOG Function E n ables/disables a bu ffer to store ActiveVR in stru ction s. Details If th is switch is en abled, all ActiveVR in stru ction s are stored in an in tern al circu lar bu ffer. Th e bu ffer size is determin ed by th e AVR.LOGSIZE parameter. E n ablin g th is switch clears th e bu ffer, bu t does n ot deallocate it. Th is switch h as n o effect if ActiveVR is n ot in u se. To access th e in formation in th e ActiveVR log, u se th e $ SYS.INFO fu n ction . Th e AVR.LOG switch mu st be disabled before you can access th e log in formation . Related Keywords AVR.LOGSIZE system parameter $ SYS.INFO real-valu ed fu n ction V+ Lan gu age Referen ce Gu ide Page 1 4 0 AVR.LOGSIZE system parameter AVR .LOGSIZE system parameter Syntax ...AVR.LOGS I ZE Function Determin es th e size of th e log circu lar bu ffer u sed by ActiveVR. Details Set th is parameter to th e n u mber of en tries to be allowed in th e log circu lar bu ffer. E ach en try in th e ActiveVR log u ses abou t 2 8 0 bytes. To avoid fillin g u p th e V+ free memory, do n ot set th is parameter to an excessively large n u mber. For V+ version 1 6 .0 , th e maximu m valu e for th is parameter is 3 2 7 6 7 bytes. For V+ 1 6 .1 an d later, th is parameter h as n o limit. To free th e bu ffer, set AVR.LOGSIZE to zero. Related Keywords AVR system switch AVR.TRACE system switch AVR.LOG system switch V+ Lan gu age Referen ce Gu ide Page 1 4 1 AVR.TRACE system switch AVR .TR ACE system switch Syntax ...AVR.TRACE Function Determin es wh eth er trace messages for ActiveVR in stru ction s are displayed in th e V+ mon itor win dow. Details If th is switch is en abled, a trace message is displayed on th e V+ mon itor win dow for every ActiveVR in stru ction th at is received. See th e ActiveVR docu men tation for more in formation abou t trace messages. Th e rate of in stru ction execu tion is slowed to accommodate th e trace ou tpu t. Th is switch h as n o effect if ActiveVR is n ot bein g u sed. Related Keywords AVR system switch AVR.LOG system switch AVR.LOGSIZE system parameter V+ Lan gu age Referen ce Gu ide Page 1 4 2 BAND operator BAND operator Syntax ...valu e BAND valu e... Function Perform th e bin ary AND operation on two valu es. Usage Considerations Th e BAND operation is mean in gfu l on ly wh en performed on in teger valu es. On ly th e in teger parts of real valu es are u sed. An y fraction al parts are ign ored. Details Th e BAND operator can be u sed to perform a bin ary AND operation on two valu es on a bit-bybit basis, resu ltin g in a real valu e. Specifically, th e BAND operation con sists of th e followin g steps: 1 . Con vert th e operan ds to sign -exten ded 3 2 -bit in tegers, tru n catin g an y fraction al part. 2 . Perform a bin ary AND operation (see below). 3 . Con vert th e resu lt back to a real valu e. Du rin g th e bin ary AND operation , c = a BAND b th e bits in th e resu ltan t C are determin ed by comparin g th e correspon din g bits in th e operan ds A an d B as in dicated in th e followin g table. For each bit in : a b c 0 0 -> 0 0 1 -> 0 1 0 -> 0 1 1 -> 1 Th at is, a bit in th e resu lt will be 1 if th e correspon din g bit in both of th e operan ds is 1 . V+ Lan gu age Referen ce Gu ide Page 1 4 3 BAND operator To review th e order of evalu ation for operators with in expression s, see th e section Order of E valu ation in th e V+ Lan gu age User's Gu ide. E xamples Con sider th e followin g (bin ary valu es are sh own to make th e operation more eviden t): ^B1 0 1 0 0 0 BAND ^B1 0 0 0 0 1 yields ^B1 0 0 0 0 0 (3 2 ) Note th at a very differen t resu lt is obtain ed with th e logical AND operation : ^B1 0 1 0 0 0 AND ^B1 0 0 0 0 1 yields -1 (TRUE ) In th is case, ^B1 0 1 0 0 0 an d ^B1 0 0 0 0 1 are each in terpreted as logically TRUE sin ce th ey are n on zero. Related Keywords AND operator BOR operator BXOR operator V+ Lan gu age Referen ce Gu ide Page 1 4 4 BASE program in stru ction BASE program instruction Syntax BAS E X_ sh ift, Y_ sh ift, Z_ sh ift, Z_ rotation Function Tran slate an d rotate th e World referen ce frame relative to th e robot. Usage Considerations Th e BASE program in stru ction cau ses a BRE AK in con tin u ou s-path motion . Th e BASE mon itor comman d applies to th e robot selected by th e V+ mon itor (with th e SE LE CT comman d). Th e comman d can be u sed wh ile programs are execu tin g. However, an error will resu lt if th e robot is attach ed by an y execu tin g program. Th e BASE in stru ction can be execu ted by an y program task as lon g as th e robot selected by th e task is n ot attach ed by an y oth er task. Th e in stru ction applies to th e robot selected by th e task. If th e V+ system is n ot con figu red to con trol a robot, u se of th e BASE comman d or in stru ction will cau se an error. Parameters X_ sh ift Option al real-valu ed expression describin g th e X compon en t (in th e n ormal World coordin ate system) of th e origin poin t for th e n ew coordin ate system. (Zero is assu med if n o valu e is provided.) Y_ sh ift Similar to X_ sh ift, bu t for th e Y direction . Z_ sh ift Similar to X_ sh ift, bu t for th e Z direction . Z_ rotation Similar to X_ sh ift, bu t for a rotation abou t th e Z axis. Details Wh en th e V+ system is in itialized, th e origin of th e referen ce frame of th e robot is assu med to be fixed in space su ch th at th e X-Y plan e is at th e robot mou n tin g su rface, th e X axis is in th e direction defin ed by join t 1 equ al to zero, an d th e Z axis coin cides with th e join t-1 axis. Th e BASE in stru ction offsets an d rotates th e referen ce frame as specified above. Th is is u sefu l if th e robot is moved after location s h ave been defin ed for an application . V+ Lan gu age Referen ce Gu ide Page 1 4 5 BASE program in stru ction If, after robot location s h ave been defin ed by tran sformation s relative to th e robot referen ce frame, th e robot is moved relative to th ose location s-to a poin t tran slated by dX, dY, dZ an d rotated by Z rotation degrees abou t th e Z axis—a BASE comman d or in stru ction can be u sed to compen sate so th at motion s to th e previou sly defin ed location s will still be as desired. An oth er con ven ien t u se for th e BASE comman d or in stru ction is to realign th e X an d Y coordin ate axes so th at SHIFT fu n ction s cau se displacemen ts in desired, n on stan dard direction s. NOTE: Th e BASE in stru ction h as n o effect on location s defin ed as precision poin ts. Th e argu men ts for th e BASE in stru ction describe th e displacemen t of th e robot relative to its n ormal location . Th e BASE fu n ction can be u sed with th e LISTL comman d to display th e cu rren t BASE settin g. E xamples BASE xbase,, -50.5, 30 Redefin es th e World referen ce frame becau se th e robot h as been sh ifted xbase millimeters in th e positive X direction an d 5 0 .5 millimeters in th e n egative Z direction , an d h as been rotated 3 0 degrees abou t th e Z axis. BASE 100,, -50 Redefin es th e World referen ce frame to effectively sh ift all location s 1 0 0 millimeters in th e n egative X direction an d 5 0 millimeters in th e positive Z direction from th eir n omin al location . Note th at th e argu men ts for th is in stru ction describe movemen t of th e robot referen ce frame relative to th e robot, an d th u s h ave an opposite effect on location s relative to th e robot. Related Keywords BASE tran sformation fu n ction SE LE CT mon itor comman d SE LE CT program in stru ction SE LE CT real-valu ed fu n ction V+ Lan gu age Referen ce Gu ide Page 1 4 6 BASE tran sformation fu n ction BASE transformation function Syntax BAS E Function Retu rn th e tran sformation valu e th at represen ts th e tran slation an d rotation set by th e last BASE comman d or in stru ction . Usage Considerations Th e BASE fu n ction retu rn s in formation for th e robot selected by th e task execu tin g th e fu n ction . Th e comman d LISTL BASE can be u sed to display th e cu rren t base settin g. If th e V+ system is n ot con figu red to con trol a robot, u se of th e BASE fu n ction will n ot gen erate an error du e to th e absen ce of a robot. However, th e in formation retu rn ed by th e fu n ction may n ot be mean in gfu l. Related Keywords BASE mon itor comman d BASE program in stru ction SE LE CT program in stru ction SE LE CT real-valu ed fu n ction V+ Lan gu age Referen ce Gu ide Page 1 4 7 BCD real-valu ed fu n ction BCD real-valued function Syntax BCD ( valu e) Function Con vert a real valu e to Bin ary Coded Decimal (BCD) format. Usage Considerations Th e BCD fu n ction is most u sefu l wh en u sed in con ju n ction with th e BITS comman d, in stru ction , an d fu n ction (see below). Parameter valu e Real-valu ed expression defin in g th e valu e to be con verted. Details Th e BCD fu n ction con verts an in teger valu e in th e ran ge 0 to 9 9 9 9 in to its BCD represen tation . Th is can be u sed to set a BCD valu e on a set of extern al ou tpu t sign als. E xample If you wan t to u se digital sign als 4 to 8 to ou tpu t a BCD digit: Th e in stru ction BITS 4,4 = BCD(digit) con verts th e valu e of th e real variable digit to BCD an d impresses it on extern al ou tpu t sign als 4 -8 . Related Keyword DCB real-valu ed fu n ction V+ Lan gu age Referen ce Gu ide Page 1 4 8 BE LOW program in stru ction BELOW program instruction Syntax BELOW Function Requ est a ch an ge in th e robot con figu ration du rin g th e n ext motion so th at th e elbow is below th e lin e from th e sh ou lder to th e wrist. Usage Considerations Con figu ration ch an ges can n ot be made du rin g straigh t-lin e motion s. If th e selected robot does n ot su pport a below con figu ration , th is in stru ction is ign ored by th e robot. (SCARA robots, for example, can n ot be in an ABOVE /BE LOW con figu ration .) Th e BE LOW in stru ction can be execu ted by an y program task as lon g as th e robot selected by th e task is n ot attach ed by an y oth er task. Th e in stru ction applies to th e robot selected by th e task. If th e V+ system is n ot con figu red to con trol a robot, execu tin g th e BE LOW in stru ction will cau se an error. Th e followin g figu re sh ows th e ABOVE an d BE LOW con figu ration s. ABOVE /BE LOW Related Keywords ABOVE program in stru ction CONFIG real-valu ed fu n ction SE LE CT program in stru ction SE LE CT real-valu ed fu n ction V+ Lan gu age Referen ce Gu ide Page 1 4 9 BE LT real-valu ed fu n ction BELT real-valued function Syntax BELT ( %belt_ var, mode) Function Retu rn in formation abou t a con veyor belt bein g tracked with th e con veyor trackin g featu re. Usage Considerations Th is option is available on ly if you r Adept system is equ ipped with th e V+ E xten sion s option . Th e BE LT system switch mu st be en abled before th is fu n ction can be u sed. Th e SE TBE LT in stru ction is gen erally u sed in con ju n ction with th e BE LT real-valu ed fu n ction to set th e effective belt position to zero. Th is mu st be don e each time th e robot will perform a sequ en ce of motion s relative to th e belt, an d mu st be don e sh ortly before th e first motion of su ch a sequ en ce. W ARNI NG: It is importan t to execu te SE TBE LT each time th e robot is goin g to track th e belt, to make su re th e differen ce between th e cu rren t belt position (as retu rn ed by th e BE LT fu n ction ) an d th e belt position of th e specified belt variable does n ot exceed 8 ,3 8 8 ,6 0 7 (^H7 FFFFF) du rin g active belt trackin g. Un predictable robot motion may resu lt if th e differen ce does exceed th is valu e wh ile trackin g th e belt. Parameters %belt_ var Th e n ame of th e belt variable u sed to referen ce th e con veyor belt. As with all belt variables, th e n ame mu st begin with a percen t symbol (%). mode Con trol valu e th at determin es th e in formation th at will be retu rn ed. If th e mode is omitted or its valu e is less th an or equ al to zero, th e BE LT fu n ction retu rn s th e en coder readin g of th e belt specified by th e belt variable. If th e valu e of th e expression is greater th an zero, th e en coder velocity is retu rn ed in u n its of en coder cou n ts per V+ cycle (1 6 ms). V+ Lan gu age Referen ce Gu ide Page 1 5 0 BE LT real-valu ed fu n ction E xamples Set th e poin t of in terest on th e referen ced con veyor to be th at correspon din g to th e cu rren t readin g of th e belt en coder: SETBELT %main.belt = BELT(%main.belt) Save th e cu rren t speed of th e belt associated with th e belt variable %b: belt.speed = BELT(%b, 1) Related Keywords BE LT system switch SE TBE LT program in stru ction V+ Lan gu age Referen ce Gu ide Page 1 5 1 BE LT system switch BELT system switch Syntax ...BELT Function Con trol th e fu n ction of th e con veyor trackin g featu res of th e V+ system. Usage Considerations Th is option is available on ly if you r Adept system is equ ipped with th e V+ E xten sion s option . If th e V+ system is n ot con figu red to con trol a robot, an attempt to en able th e BE LT system switch will cau se an error. (Th e DE VICE real-valu ed fu n ction an d th e SE TDE VICE program in stru ction mu st be u sed to access extern al en coders from a n on robot system. For more in formation , see th e section E xtern al E n coder Device in th e V+ Lan gu age User's Gu ide.) Details Th is switch mu st be en abled before an y of th e special con veyor trackin g in stru ction s can be execu ted. Wh en BE LT is disabled, th e con veyor trackin g software h as a min imal impact on th e overall performan ce of th e system. Wh en th e BE LT switch is en abled, error ch eckin g is in itiated for th e en coders associated with an y belt variables th at are defin ed. Th e switch is disabled wh en th e V+ system is in itialized. Related Keywords BE LT real-valu ed fu n ction BE LT.MODE system parameter BSTATUS real-valu ed fu n ction DE FBE LT program in stru ction DISABLE mon itor comman d DISABLE program in stru ction E NABLE mon itor comman d E NABLE program in stru ction SE TBE LT program in stru ction SWITCH mon itor comman d SWITCH program in stru ction SWITCH real-valu ed fu n ction V+ Lan gu age Referen ce Gu ide Page 1 5 2 BE LT system switch WINDOW program in stru ction WINDOW real-valu ed fu n ction V+ Lan gu age Referen ce Gu ide Page 1 5 3 BE LT.MODE system parameter BELT.MODE system parameter Syntax ...BELT.MODE Function Set ch aracteristics of th e con veyor trackin g featu re of th e V+ system. Usage Considerations Th is option is available on ly if you r Adept system is equ ipped with th e V+ E xten sion s option . Th e cu rren t valu e of th e BE LT.MODE parameter can be determin ed with th e PARAME TE R mon itor comman d or real-valu ed fu n ction . Th e valu e of th e BE LT.MODE parameter can be modified on ly with th e PARAME TE R mon itor comman d or program in stru ction . Details Th is parameter is in terpreted as a bit-flag word. Th e in itial settin g of th is parameter is 0 . Th at is, all th e bits are zero. Bits can be set by assign in g th e valu e resu ltin g from addin g togeth er th e desired bit mask valu es (see th e example below). Th e bit flags h ave th e followin g in terpretation s: Bit 1 (LSB) Upstream/down stream defin ition (mask valu e = 1 ) Wh en th is bit is set to on e, th e in stan tan eou s direction of travel of th e belt is u sed to defin e u pstream an d down stream for th e win dow testin g rou tin es (both in th e in tern al motion plan n er an d th e WINDOW real-valu ed fu n ction ). Wh en th is bit is set to zero, goin g from u pstream to down stream always correspon ds to travelin g in th e direction of th e positive X axis of th e n omin al tran sformation . Bit 2 Stopped-belt processin g (mask valu e = 2 ) Wh en th is bit is set to on e, a program error will be gen erated du rin g motion plan n in g if th e destin ation is ou tside of th e belt win dow an d th e belt is stopped. Wh en th is bit is set to zero, if th e belt is stopped du rin g motion plan n in g, th e direction of th e positive X axis of th e n omin al tran sformation is u sed to defin e th e down stream direction . Th e n ormal win dow-error criteria are th en applied (see below). V+ Lan gu age Referen ce Gu ide Page 1 5 4 BE LT.MODE system parameter Bit 3 Win dow error defin ition (mask valu e = 4 ) Wh en th is bit is set to on e, destin ation location s th at are down stream or u pstream of th e belt win dow cau se motion in stru ction s to fail du rin g plan n in g. Wh en th is bit is set to zero, u pstream win dow violation s cau se plan n in g to wait u n til th e location comes in to th e win dow. Destin ation location s th at are down stream of th e belt win dow cau se win dow errors. Bit 4 E ffect of win dow errors (mask valu e = 8 ) Wh en th is bit is set to on e, motion in stru ction s th at fail du rin g plan n in g du e to a win dow error are ign ored (skipped) an d program execu tion con tin u es as u su al. Wh en th is option is selected, each beltrelative motion in stru ction sh ou ld be followed by an explicit test for plan n in g errors u sin g th e BSTATUS fu n ction . Wh en th is bit is zero, win dow errors du rin g motion plan n in g gen erate a program step execu tion error, wh ich eith er h alts program execu tion or triggers th e RE ACTE rou tin e. Regardless of th e settin g of th is bit, win dow errors th at occu r wh ile th e robot is actu ally trackin g th e belt cau se th e program specified in th e latest WINDOW in stru ction to be execu ted. If n o su ch program h as been specified, program execu tion is h alted. E xample Set th e parameter to h ave bits 1 an d 3 set to on e (mask valu es 1 + 4 ): PARAMETER BELT.MODE = 5 Related Keywords BE LT system switch BE LT real-valu ed fu n ction BSTATUS real-valu ed fu n ction PARAME TE R mon itor comman d PARAME TE R program in stru ction PARAME TE R real-valu ed fu n ction WINDOW program in stru ction WINDOW real-valu ed fu n ction V+ Lan gu age Referen ce Gu ide Page 1 5 5 BITS program in stru ction BITS program instruction Syntax BI TS first_ sig, n u m_ sigs = valu e Function Set or clear a grou p of digital sign als based on a valu e. Usage Considerations Both extern al digital ou tpu t sign als an d in tern al software sign als can be referen ced. In pu t sign als mu st n ot be referen ced. (In pu t sign als are displayed by th e mon itor comman d IO 1 .) No more th an eigh t sign als can be set at on e time. An y grou p of u p to eigh t sign als can be set, providin g th at all th e sign als in th e grou p are con figu red for u se by th e system. Parameters first_ sig Real-valu ed expression defin in g th e lowest-n u mbered sign al to be affected. n u m_ sigs Option al real-valu ed expression specifyin g th e n u mber of sign als to be affected. A valu e of 1 is assu med if n on e is specified. Th e maximu m valid valu e is 8 . valu e Real-valu ed expression defin in g th e valu e to be set on th e specified sign als. If th e bin ary represen tation of th e valu e h as more bits th an n u m_ sigs, on ly th e lowest n u m_ sigs sign als will be affected. Details Sets or clears on e or more extern al ou tpu t sign als or in tern al software sign als based on th e valu e to th e righ t of th e equ al sign . Th e effect of th is in stru ction is to rou n d valu e to an in teger, an d th en set or clear a n u mber of sign als based on th e in dividu al bits of th e bin ary represen tation of th e in teger. All V+ digital ou tpu t in stru ction s do n ot wait for a 1 6 millisecon d V+ cycle, th ey are tu rn ed on immediately. However, digital in pu ts are ch ecked every 1 6 millisecon ds by th e V+ operatin g system. V+ Lan gu age Referen ce Gu ide Page 1 5 6 BITS program in stru ction E xamples Set extern al ou tpu t sign als 1 -8 (8 bits) to th e bin ary represen tation of th e cu rren t mon itor speed settin g: BITS 1,8 = SPEED(1) If th e mon itor speed were cu rren tly set to 5 0 % (0 0 1 1 0 0 1 0 bin ary), th en sign als 1 -8 are set as follows after th is in stru ction : sign al 1 -> 0 (off) sign al 5 -> 1 (on ) sign al 2 -> 1 (on ) sign al 6 -> 1 (on ) sign al 3 -> 0 (off) sign al 7 -> 0 (off) sign al 4 -> 0 (off) sign al 8 -> 0 (off) Set extern al ou tpu t sign als 5 -9 (4 bits) to th e bin ary represen tation of th e BCD digit 7 : BITS 5,4 = BCD(7) Set extern al ou tpu t sign als 1 -8 (8 bits) to th e bin ary represen tation of th e con stan t 2 5 5 , wh ich is 1 1 1 1 1 1 1 1 (bin ary). Th u s, sign als 1 -8 will all be tu rn ed on : BITS 1,8 = 255 Related Keywords BITS real-valu ed fu n ction IO mon itor comman d RE SE T mon itor comman d SIG real-valu ed fu n ction SIG.INS real-valu ed fu n ction SIGNAL mon itor comman d SIGNAL program in stru ction V+ Lan gu age Referen ce Gu ide Page 1 5 7 BITS real-valu ed fu n ction BITS real-valued function Syntax BI TS ( first_ sig, n u m_ sigs) Function Read mu ltiple digital sign als an d retu rn th e valu e correspon din g to th e bin ary bit pattern presen t on th e sign als. Usage Considerations E xtern al digital in pu t or ou tpu t sign als, or in tern al software sign als can be referen ced. A maximu m of 8 sign als can be read at on e time. An y grou p of u p to eigh t sign als can be read, providin g th at all th e sign als in th e grou p are con figu red for u se by th e system. Parameters first_ sig Real-valu ed expression defin in g th e lowest-n u mbered sign al to be read. n u m_ sigs Option al real-valu ed expression specifyin g th e n u mber of sign als to be affected. A valu e of 1 is assu med if n on e is specified. Th e maximu m valid valu e is 8 . Details Th is fu n ction retu rn s a valu e th at correspon ds to th e bin ary bit pattern presen t on on e to eigh t digital sign als. Th e bin ary represen tation of th e valu e retu rn ed by th e fu n ction h as its least-sign ifican t bit determin ed by sign al n u mbered first_ sig, an d its h igh er-order bits determin ed by th e n ext n u m_ sigs -1 sign als. E xample Assu me th at th e followin g in pu t sign al states are presen t: Signal: State: 1008 1 1007 1 1006 0 1005 1 1004 0 Th e program step: x = BITS(1003, 4) V+ Lan gu age Referen ce Gu ide Page 1 5 8 1003 1 1002 1001 1 0 BITS real-valu ed fu n ction will yield a valu e of 5 for x sin ce th e fou r sign als startin g at 1 0 0 3 (th at is, sign als 1 0 0 3 th rou gh 1 0 0 6 ) can be in terpreted as a bin ary represen tation of th at valu e. Related Keywords BITS mon itor comman d BITS program in stru ction IO mon itor comman d RE SE T mon itor comman d SIG real-valu ed fu n ction SIG.INS real-valu ed fu n ction SIGNAL mon itor comman d SIGNAL program in stru ction V+ Lan gu age Referen ce Gu ide Page 1 5 9 BMASK real-valu ed fu n ction BMASK real-valued function Syntax BMAS K ( bit, bit, ..., bit) Function Create a bit mask by settin g in dividu al bits. Parameter bit In teger valu e from 1 to 3 2 specifyin g a bit to tu rn on . Th e least-sign ifican t bit is n u mber 1 . Details Th is in stru ction creates a bit mask by tu rn in g on (bit = 1 ) th e specified bits an d leavin g all oth er bits off (bit = 0 ). Bit 3 2 is th e sign bit an d yields a n egative n u mber wh en set. E xamples Create th e bit mask ^B1 0 0 0 1 : bm = BMASK(1, 5) Attach to a disk LUN with mode bit 2 tu rn ed on : mode = BMASK(2) ATTACH (lun, mode) "DISK" V+ Lan gu age Referen ce Gu ide Page 1 6 0 BOR operator BOR operator Syntax ... valu e BOR valu e ... Function Perform th e bin ary OR operation on two valu es. Usage Considerations Th e BOR operation is mean in gfu l on ly wh en performed on in teger valu es. On ly th e in teger parts of real valu es are u sed. An y fraction al parts are ign ored. Details Th e BOR operator can be u sed to perform a bin ary OR operation on two valu es on a bit-by-bit basis, resu ltin g in a real valu e. Specifically, th e BOR operation con sists of th e followin g steps: 1 . Con vert th e operan ds to sign -exten ded 3 2 -bit in tegers, tru n catin g an y fraction al part. 2 . Perform a bin ary OR operation (see below). 3 . Con vert th e resu lt back to a real valu e. Du rin g th e bin ary OR operation , c = a BOR b th e bits in th e resu ltan t C statemen t are determin ed by comparin g th e correspon din g bits in th e operan ds A an d B, as in dicated in th e followin g table. For each bit in : a b c 0 0 -> 0 0 1 -> 1 1 0 -> 1 1 1 -> 1 Th at is, a bit in th e resu lt will be 1 if th e correspon din g bit in eith er of th e operan ds is 1 . V+ Lan gu age Referen ce Gu ide Page 1 6 1 BOR operator To review th e order of evalu ation for operators with in expression s, see th e section Order of E valu ation in th e V+ Lan gu age User's Gu ide. E xamples Con sider th e followin g (bin ary valu es are sh own on ly to make th e operation more eviden t): ^B1 0 1 0 0 0 BOR ^B1 0 0 0 0 1 yields ^B1 0 1 0 0 1 (4 1 ) Note th at a very differen t resu lt is obtain ed with th e logical OR operation : ^B1 0 1 0 0 0 OR ^B1 0 0 0 0 1 yields -1 (TRUE ) In th is case, ^B1 0 1 0 0 0 an d ^B1 0 0 0 0 1 are each in terpreted as logically TRUE sin ce th ey are n on zero. Related Keywords BAND operator BXOR operator OR operator V+ Lan gu age Referen ce Gu ide Page 1 6 2 BRAKE program in stru ction BR AKE program instruction Syntax BRAKE Function Abort th e cu rren t robot motion . Usage Considerations Th e BRAKE in stru ction can be execu ted by an y program task, in clu din g a task th at is n ot actively con trollin g th e robot. Th is in stru ction does n ot cau se a BRE AK to occu r (see Details below). If more th an on e robot is con n ected to th e con troller, th is in stru ction applies to th e robot cu rren tly selected (see th e SE LE CT in stru ction ). If th e V+ system is n ot con figu red to con trol a robot, th e BRAKE in stru ction will n ot gen erate an error du e to th e absen ce of a robot. Details BRAKE cau ses th e cu rren t robot motion to be aborted immediately. In respon se to th is in stru ction , th e robot will decelerate to a stop an d th en (with ou t waitin g for position errors to n u ll) begin th e n ext motion . NOTE: Program execu tion is n ot su spen ded u n til th e robot motion stops. E xample Th e followin g program segmen t in itiates a robot motion an d simu ltan eou sly tests for a con dition to be met. If th e con dition is met, th e motion is stopped with a BRAKE in stru ction . Oth erwise, th e motion is completed n ormally. MOVES step[1] DO IF SIG(1023) THEN BRAKE EXIT END UNTIL STATE(2) == 2 MOVES step[2] ;Initiate motion to next location ;Loop continuously... ;If input signal 1023 becomes set, ;stop the motion immediately ;and continue elsewhere ;...until location reached ;Move to next location Related Keyword BRE AK program in stru ction V+ Lan gu age Referen ce Gu ide Page 1 6 3 BRE AK program in stru ction BR EAK program instruction Syntax BREAK Function Su spen d program execu tion u n til th e cu rren t motion completes. Usage Considerations Th e BRE AK in stru ction is on ly u sed to wait for motion by th e robot attach ed to th e cu rren t task. If th e V+ system is n ot con figu red to con trol a robot, execu tin g th e BRE AK in stru ction will cau se an error. Details Th is in stru ction h as two effects: 1 . Program execu tion is su spen ded u n til th e robot reach es its cu rren t destin ation . NOTE: BRE AK can n ot be u sed to h ave on e task wait u n til a motion is completed by an oth er task. 2 . Th e con tin u ou s-path tran sition between th e cu rren t motion an d th at comman ded by th e n ext motion in stru ction is broken . Th at is, th e two motion s are preven ted from bein g merged in to a sin gle con tin u ou s path . Th e BRE AK in stru ction cau ses con tin u ou s-path processin g to termin ate by blockin g V+ program execu tion u n til th e motion en ds. CPOFF cau ses th e trajectory gen erator to termin ate con tin u ou s path with ou t affectin g th e forward processin g of th e V+ program. Related Keywords BRAKE program in stru ction CP system switch SE LE CT program in stru ction SE LE CT real-valu ed fu n ction V+ Lan gu age Referen ce Gu ide Page 1 6 4 BSTATUS real-valu ed fu n ction BSTATUS real-valued function Syntax BS TATUS Function Retu rn in formation abou t th e statu s of th e con veyor trackin g system. Usage Considerations Th is option is available on ly if you r Adept system is equ ipped with th e V+ E xten sion s option . Th e BSTATUS fu n ction retu rn s in formation for th e robot selected by th e task execu tin g th e fu n ction . Th e word " bstatu s" can n ot be u sed as a program n ame or variable n ame. Details Th is fu n ction is n ormally u sed wh en BE LT.MODE bit 4 is set. Th is fu n ction retu rn s a valu e th at is equ ivalen t to th e bin ary valu e represen ted by a set of bit flags, wh ich in dicate th e followin g con dition s of th e con veyor trackin g software: Bit 1 (LSB) Trackin g belt (mask valu e = 1 ) Wh en th is bit is set, th e robot is cu rren tly trackin g a belt. Bit 2 Destin ation u pstream (mask valu e = 2 ) Wh en th is bit is set, th e destin ation location was fou n d to be u pstream of th e belt win dow du rin g th e plan n in g of th e last motion . Bit 3 Destin ation down stream (mask valu e = 4 ) Wh en th is bit is set, th e destin ation location was fou n d to be down stream of th e belt win dow du rin g th e plan n in g of th e last motion . Bit 4 Win dow violation (mask valu e = 8 ) Wh en th is bit is set, a win dow violation occu rred wh ile th e robot was trackin g a belt du rin g th e last belt-relative motion . (Th is flag is cleared at th e start of each belt-relative motion .) Related Keywords BE LT real-valu ed fu n ction BE LT system switch V+ Lan gu age Referen ce Gu ide Page 1 6 5 BSTATUS real-valu ed fu n ction BE LT.MODE system parameter DE FBE LT program in stru ction SE LE CT program in stru ction SE LE CT real-valu ed fu n ction WINDOW program in stru ction WINDOW real-valu ed fu n ction V+ Lan gu age Referen ce Gu ide Page 1 6 6 BXOR operator BXOR operator Syntax ... valu e BXOR valu e ... Function Perform th e bin ary exclu sive-OR operation on two valu es. Usage Considerations Th e BXOR operation is mean in gfu l on ly wh en performed on in teger valu es. On ly th e in teger parts of real valu es are u sed. An y fraction al parts are ign ored. Details Th e BXOR operator can be u sed to perform a bin ary exclu sive-OR operation on two valu es on a bit-by-bit basis, resu ltin g in a real valu e. NOTE: Th is operation is mean in gfu l on ly wh en performed on in teger valu es. Specifically, th e BXOR operation con sists of th e followin g steps: 1 . Con vert th e operan ds to sign -exten ded 3 2 -bit in tegers, tru n catin g an y fraction al part. 2 . Perform a bin ary exclu sive-OR operation (see below). 3 . Con vert th e resu lt back to a real valu e. Du rin g th e bin ary exclu sive-OR operation , c = a BXOR b th e bits in th e resu ltan t C are determin ed by comparin g th e correspon din g bits in th e operan ds A an d B, as in dicated in th e followin g table. For each bit in : a b c 0 0 -> 0 0 1 -> 1 1 0 -> 1 V+ Lan gu age Referen ce Gu ide Page 1 6 7 BXOR operator 1 1 -> 0 Th at is, a bit in th e resu lt is 1 if th e correspon din g bit in on e (an d on ly on e) of th e operan ds is 1 . To review th e order of evalu ation for operators with in expression s, see th e section Order of E valu ation in th e V+ Lan gu age User's Gu ide. E xamples Con sider th e followin g (bin ary valu es are sh own on ly to make th e operation more eviden t): ^B1 0 1 0 0 0 BXOR ^B1 0 0 0 0 1 yields ^B0 0 1 0 0 1 (9 ) Note th at a very differen t resu lt is obtain ed with th e logical XOR operation : ^B1 0 1 0 0 0 XOR ^B1 0 0 0 0 1 yields 0 (FALSE ) In th is case, ^B1 0 1 0 0 0 an d ^B1 0 0 0 0 1 are each in terpreted as logically TRUE sin ce th ey are n on zero. Related Keywords BAND operator BOR operator XOR operator V+ Lan gu age Referen ce Gu ide Page 1 6 8 BY keyword BY keyword Syntax S CALE( tran sformation BY valu e) S HI FT( tran sformation BY valu e, valu e, valu e) Function Complete th e syn tax of th e SCALE an d SHIFT fu n ction s. E xamples SET new.trans = SCALE(old.trans BY scale.factor) SET new.trans = SHIFT(old.trans BY x,y,z) Related Keywords SCALE tran sformation fu n ction SHIFT tran sformation fu n ction V+ Lan gu age Referen ce Gu ide Page 1 6 9 CALIBRATE program in stru ction CALIBR ATE program instruction Syntax CALI BRATE mode, statu s Function In itialize th e robot position in g system with th e robot's cu rren t position . Usage Considerations Normally, th e in stru ction is issu ed with mode equ al to zero. Th e in stru ction h as n o effect if th e DRY.RUN system switch is en abled. If th e robot is to be moved u n der program con trol, th e CALIBRATE in stru ction (or comman d) mu st be processed every time system power is tu rn ed on an d th e V+ system is booted from disk. Th e robot can n ot be moved u n der program con trol or with th e man u al con trol pen dan t u n til a CALIBRATE in stru ction (or CALIBRATE mon itor comman d) h as been processed. NOTE: Some robots can be moved in join t mode with th e con trol pen dan t even wh en th ey h ave n ot been calibrated. If mu ltiple robots are con n ected to th e system con troller, th is in stru ction attempts to calibrate all robots u n less th ey are disabled with th e ROBOT switch . All of th e en abled robots mu st be calibrated before an y of th em can be moved u n der program con trol. Th e CALIBRATE in stru ction may operate differen tly for each type of robot. For Adept robots, th is in stru ction cau ses th e robot to move. Th e robot mu st be far en ou gh from th e limits of th e workin g ran ge th at it will n ot move ou t of ran ge du rin g th e calibration process. (See th e description of th e CALIBRATE mon itor comman d for details of th e robot motion .) If th e V+ system is n ot con figu red to con trol a robot, execu tin g th e CALIBRATE in stru ction cau ses an error. V+ Lan gu age Referen ce Gu ide Page 1 7 0 CALIBRATE program in stru ction Parameters mode A real expression th at in dicates wh at part of calibration is to be performed: Valu e of mode 0 (or omitted) I n terpretation Perform a n ormal calibration of all th e robots con trolled by th e system. In detail, th e followin g operation s are performed: (a) Load th e main calibration program if it is n ot already in memory. (b) E xecu te th e main calibration program with th e load, execu te, an d delete flags set. Th at cau ses th e robot-specific calibration rou tin es to be loaded, th e robots to be calibrated, an d th e robot rou tin es to be deleted. (Note th at th e main calibration program is left in memory.) 1 2 E xecu te th e main calibration program (wh ich mu st already be in memory) with th e execu te flag set. Th at cau ses th e system robot(s) to be calibrated, an d all th e calibration programs to be left in memory. 3 statu s Load th e main calibration program if it is n ot already in memory, an d execu te th e main calibration program with th e load flag set. Th at cau ses th e calibration program to load th e applicable robot-specific calibration rou tin es. Note, h owever, th at th e calibration process is n ot performed. E xecu te th e main calibration program (wh ich mu st already be in memory) with th e delete flag set. Th at cau ses th e calibration program to delete th e robotspecific calibration rou tin es from memory. Note, h owever, th at th e actu al calibration process is n ot performed, an d th e main calibration program is left in memory. Real-valu ed variable th at receives th e exit statu s retu rn ed by th e cal- V+ Lan gu age Referen ce Gu ide Page 1 7 1 CALIBRATE program in stru ction ibration program, or (in mode -1 ) from V+ wh en tryin g to en ter in to th e special " calibrate" mode. Details Wh en started, V+ assu mes th at th e robot is n ot calibrated an d restricts you r ability to move th e robot with th e man u al con trol pen dan t (MCP) or an application program. NOTE: Th e COMP mode ligh t on th e MCP does n ot come on wh en th e robot is n ot calibrated. Th e robot loses start-u p calibration wh en ever system power is switch ed off. As a safety measu re, Adept robots also lose start-u p calibration wh en ever an * E n coder qu adratu re error* occu rs for on e of th e robot join ts. Oth er servo errors th at can cau se th e robot to lose calibration are * Un expected zero in dex* , * No zero in dex* , an d * RSC Commu n ication s Failu re* . l l For Adept robots, th is in stru ction cau ses all th e robot join ts with in cremen tal en coders to be driven . For devices con trolled by th e AdeptMotion VME option , th e robot action depen ds u pon th e particu lar robot device modu le th at is bein g u sed. If th is program in stru ction attempts to load th e main calibration program, th e same program, modu le, an d file n ame, an d search algorith m, are employed as for th e CALIBRATE mon itor comman d. Th is in stru ction execu tes th e main calibration program in th e same task as th e in vokin g CALIBRATE program in stru ction . An operation equ ivalen t to th e followin g in stru ction is u sed to in voke th e calibration program: CALL a.cal_util(flags, status) NOTE: Th e " flags" are u sed with in th e Adept calibration u tility program as described in th e mode area of th e Parameters section (above). If you wish to carry ou t a CALIBRATE in stru ction in task 0 , on e way to do so is from a program ru n u sin g th e /C qu alifier on th e E XE CUTE in stru ction . With th at qu alifier specified, a program to calibrate th e robot can ru n in task 0 even wh en DRY.RUN is disabled. A program ru n n in g in an y task oth er th an 0 can execu te th e CALIBRATE in stru ction with ou t special con dition s. E xample Th e followin g in stru ction sequ en ce can be u sed by an y program task to perform start-u p calibration on th e robot (if task #0 is u sed, th e DRY.RUN switch mu st be en abled before th e V+ Lan gu age Referen ce Gu ide Page 1 7 2 CALIBRATE program in stru ction program is execu ted): DETACH() DISABLE DRY.RUN CALIBRATE ATTACH() ;Detach the robot ;Ensure DRY.RUN is disabled ;Calibrate the robot ;Reattach the robot Related Keywords CALIBRATE mon itor comman d NOT.CALIBRATE D system parameter SE LE CT program in stru ction SE LE CT real-valu ed fu n ction V+ Lan gu age Referen ce Gu ide Page 1 7 3 CALL program in stru ction CALL program instruction Syntax CALL program( arg_ list) Function Su spen d execu tion of th e cu rren t program an d con tin u e execu tion with a n ew program (th at is, a su brou tin e). Parameters program Name of th e n ew program to be execu ted. arg_ list Option al list of su brou tin e argu men ts (separated by commas) to be passed between th e cu rren t program an d th e n ew program. (If n o argu men t list is specified, th e paren th eses after th e program parameter can be omitted.) Argu men ts can be u sed to pass data to th e called program, to receive resu lts back, or a combin ation of both . (How argu men ts are passed is described below.) E ach argu men t can be an y on e of th e data types su pported by V+ (th at is, belt, precision poin t, real-valu e, strin g, an d tran sformation ), an d can be specified as a con stan t, a variable, or an expression .1 Th e type of each argu men t mu st match th e type of its cou n terpart in th e argu men t list of th e called program. An argu men t specified as a variable can be a simple variable, an array elemen t, or an array with on e or more of its in dexes left blan k. (See below for more in formation .) NOTE: If a valu e is bein g passed back to th e callin g program, th e parameter mu st be specified as a variable. An y argu men t can be omitted, with th e resu lt th at th e correspon din g argu men t in th e called program will be u n defin ed. If an argu men t is omitted with in th e argu men t list, th e separatin g comma mu st still be in clu ded. If an argu men t is omitted at th e en d of th e list, th e comma precedin g th e argu men t can also be omitted. (See th e description of .PROGRAM for more in formation on th e effect of omittin g an argu men t.) Details Th e CALL in stru ction cau ses execu tion of th e cu rren t program to be su spen ded temporarily. E xecu tion con tin u es at th e first step of th e in dicated n ew program, wh ich is th en con sidered V+ Lan gu age Referen ce Gu ide Page 1 7 4 CALL program in stru ction a su brou tin e. E xecu tion au tomatically retu rn s to th e cu rren t program wh en a RE TURN in stru ction is execu ted in th e su brou tin e. E xecu tion con tin u es with th e in stru ction immediately followin g th e CALL in stru ction . Su brou tin e argu men ts can be passed by valu e or by referen ce. Wh en an argu men t is passed by valu e, a copy of th e argu men t valu e is passed to th e su brou tin e. An y ch an ges to th e correspon din g su brou tin e argu men t in th e su brou tin e will n ot be passed back to th e callin g rou tin e. An y argu men t th at is specified as an expression (or compou n d tran sformation ) will be passed by valu e. Wh en an argu men t is a (scalar or array) variable, it is passed by referen ce. Th at mean s a poin ter to th e variable is passed to th e su brou tin e, wh ich th en works with exactly th e same variable as th e callin g rou tin e. If th e called rou tin e ch an ges th e valu e of th e variable, th e valu e is also ch an ged for th e callin g rou tin e. Th is can be especially sign ifican t, for example, if th e same variable is passed as two argu men ts of a su brou tin e call. Th en , an y ch an ge to eith er of th e correspon din g su brou tin e argu men ts in th e su brou tin e au tomatically ch an ges th e oth er correspon din g su brou tin e argu men t. Note th at an argu men t th at is passed by referen ce (becau se it is a variable) can gen erally be forced to passage by valu e. Th e way th at is don e depen ds on th e type of th e variable, as follows: l For a real variable, passage by valu e can be forced by en closin g th e variable in paren th eses: CALL prog_a((count)) l For a strin g variable, an empty strin g (" " ) can be added to th e variable: CALL prog_b($str.var+"") l For a tran sformation variable (for example, start), an equ ivalen t tran sformation valu e can be specified by a compou n d tran sformation con sistin g of th e variable an d th e NULL tran sformation : CALL prog_c(start:NULL) As stated above, th e items in th e arg_ list mu st match th eir correspon din g items in th e called program. In addition to straigh tforward match es of scalar to scalar, an d arrays of equ al n u mbers of dimen sion s, th ere are several situ ation s in wh ich h igh er dimen sion arrays can be passed in place of lower dimen sion arrays. For example, all th e followin g cases are valid: l Array elemen t passed to a scalar: CALL example(a[1]) CALL example(a[1,2]) CALL example(a[1,2,3]) l ---> ---> ---> .PROGRAM example(b) .PROGRAM example(b) .PROGRAM example(b) On e dimen sion of an array passed to a on e-dimen sion al array: V+ Lan gu age Referen ce Gu ide Page 1 7 5 CALL program in stru ction CALL example(a) CALL example(a[1,]) CALL example(a[1,2,]) l .PROGRAM example(b) .PROGRAM example(b) .PROGRAM example(b) Two dimen sion s of an array passed to a two-dimen sion al array: CALL example(a[,]) CALL example(a[1,,]) l ---> ---> ---> ---> ---> .PROGRAM example(b[,]) .PROGRAM example(b[,]) Th ree dimen sion s of an array passed to a th ree-dimen sion al array: CALL example(a[,,]) ---> .PROGRAM example(b[,,]) E xamples CALL pallet(count) Bran ch es to th e program n amed pallet, passin g to it a poin ter to th e variable cou n t. Wh en a RE TURN in stru ction is execu ted, con trol retu rn s to th e program con tain in g th e CALL in stru ction an d cou n t will con tain th e cu rren t valu e of th e correspon din g su brou tin e argu men t. CALL cycle(1, , n+3) Bran ch es to th e program n amed cycle. Th e valu e 1 is passed to th e first parameter of cycle, its secon d parameter is u n defin ed, an d its th ird parameter receives th e valu e of th e expression n +3 . (If cycle h as more th an th ree parameters, th e remain in g parameters are all u n defin ed.) Becau se n on e of th e argu men ts in th e CALL are variables, n o data will be retu rn ed by th e program cycle. Related Keywords CALLP program in stru ction CALLS program in stru ction .PROGRAM program in stru ction RE TURN program in stru ction V+ Lan gu age Referen ce Gu ide Page 1 7 6 CALLP program in stru ction CALLP program instruction Syntax CALLP var ( arg_ list) Function Call a program given a poin ter to th e program in memory. Usage Considerations Usin g SYMBOL.PTR an d CALLP is an altern ative to u sin g CALLS to in voke a V+ su brou tin e given its n ame as strin g data. For some application s, th e SYMBOL.PTR-CALLP combin ation is mu ch faster th an CALLS. Parameters var A real variable (n ot an expression ) th at con tain s a poin ter to a program symbol. arg_ list A list of argu men ts to be passed between th e cu rren t program an d th e n ew program. Details In situ ation s wh ere th e same program is called mu ltiple times, th e CALLP in stru ction can be sign ifican tly more efficien t th an th e CALLS in stru ction . Th is is especially tru e in systems th at h ave man y programs loaded. (In situ ation s wh ere a program is called on ly on ce, th e CALLS in stru ction is faster.) Wh en a CALLS in stru ction is u sed, th e followin g steps are performed each time th e CALLS in stru ction is en cou n tered: 1 . Th e u ser strin g is evalu ated. 2 . Th e V+ program symbol with th at n ame is fou n d in th e V+ symbol table. 3 . Th e proper V+ program is called. As an altern ative, th e SYMBOL.PTR fu n ction can be u sed to perform th e first two steps. Typically, th at is don e on e time, du rin g th e in itialization portion of th e application software. Th en , in place of th e CALLS in stru ction , a CALLP in stru ction can be u sed to perform th e th ird step above. (Th e CALLP in stru ction is ju st sligh tly slower th an a CALL in stru ction .) In situ ation s wh ere th e same program is called mu ltiple times, avoidin g th e first two steps of CALLS can be sign ifican t, especially in systems th at h ave man y programs loaded. V+ Lan gu age Referen ce Gu ide Page 1 7 7 CALLP program in stru ction Th e CALLP in stru ction calls th e program poin ted to by th e real variable var. Th is variable sh ou ld h ave been obtain ed by u sin g th e SYMBOL.PTR fu n ction . If th e valu e of var is zero, n o program is called, an d n o error is reported. If var does n ot con tain a valid poin ter, program execu tion stops with error -4 0 6 (* Un defin ed program or variable n ame* ). E xample In stru ction s su ch as th e followin g are execu ted in th e in itialization section of th e application program: my.pgm.ptr[1] = SYMBOL.PTR("my.program.1") my.pgm.ptr[2] = SYMBOL.PTR("my.program.2") Th en , in th e repetitive section of th e application program, th e followin g is execu ted: CALLP my.pgm.ptr[index](parm1, parm2) Related Keywords CALL program in stru ction CALLS program in stru ction $ SYMBOL strin g fu n ction SYMBOL.PTR real-valu ed fu n ction V+ Lan gu age Referen ce Gu ide Page 1 7 8 CALLS program in stru ction CALLS program instruction Syntax CALLS strin g( arg_ list) Function Su spen d execu tion of th e cu rren t program an d con tin u e execu tion with a n ew program (th at is, a su brou tin e) specified with a strin g valu e. Usage Considerations CALLS takes mu ch lon ger to execu te th an th e n ormal CALL in stru ction . Th u s, CALLS sh ou ld be u sed on ly wh en n ecessary. Parameters strin g Strin g valu e, variable, or expression defin in g th e (1 - to 1 5 -ch aracter) n ame of th e n ew program to be execu ted. (Th e letters in th e n ame can be lowercase or u ppercase.) arg_ list Option al list of argu men ts to be passed between th e cu rren t program an d th e n ew program. Th e paren th eses can be omitted if n o argu men t list is specified. (See th e CALL in stru ction for fu rth er in formation on su brou tin e argu men ts.) NOTE: Sin ce th e argu men t list is n ot specified as part of th e strin g parameter, all th e su brou tin es called by a specific CALLS in stru ction mu st h ave equ ivalen t argu men t lists. Details Th e CALLS in stru ction beh aves exactly as th e CALL in stru ction does. Th e on ly differen ce between th e two in stru ction s is th e way th e su brou tin e n ame is specified. CALL requ ires th at th e n ame be explicitly en tered in th e in stru ction step. CALLS permits th e n ame to be specified by a strin g variable or expression , wh ich can h ave its valu e defin ed wh en th e program is execu ted. Th at allows th e program to call differen t su brou tin es depen din g on th e circu mstan ces. As with th e CALL in stru ction , execu tion au tomatically retu rn s to th e cu rren t program wh en a RE TURN in stru ction is execu ted in th e su brou tin e. E xecu tion con tin u es with th e in stru ction immediately followin g th e CALLS in stru ction . For some application s, th e CALLP in stru ction is mu ch more efficien t th an CALLS. See th e CALLP in stru ction for details. V+ Lan gu age Referen ce Gu ide Page 1 7 9 CALLS program in stru ction E xamples Th e program segmen t below demon strates h ow th e CALLS in stru ction can be u sed to bran ch to a su brou tin e wh ose n ame is determin ed wh en th e program is execu ted. First th e program reads a set of fou r digital in pu t lin es (1 0 0 1 to 1 0 0 4 ) to determin e wh ich of sixteen differen t part types it is dealin g with . Th e part type is con sidered to be a h exadecimal n u mber, wh ich is con verted to th e correspon din g ASCII ch aracter. On ce th e ch aracter is defin ed, th e appropriate su brou tin e (th at is, part.0 , part.1 , ..., part.f) is called to process th e part. (Th e part-type valu e is also u sed to select th e portion of th e two-dimen sion al array argu men t th at is passed to th e su brou tin e.) type = BITS(1001,4) $type = $ENCODE(/H0, type) CALLS "part."+$type(arguments[type,], status) ;Convert to ASCII character Th is example can be made more robu st by u sin g th e STATUS real-valu ed fu n ction to make su re th e proposed su brou tin e exists before it is called. Usin g th is fu n ction avoids possible errors from u n defin ed program n ames. Related Keywords CALL program in stru ction CALLP program in stru ction .PROGRAM program in stru ction RE TURN program in stru ction V+ Lan gu age Referen ce Gu ide Page 1 8 0 CAS real-valu ed fu n ction CAS real-valued function Syntax CAS ( variable, test_ valu e, n ew_ valu e) Function Th is fu n ction compares a real variable to a test valu e, an d con dition ally sets a n ew valu e as on e in divisible operation . Usage Considerations Th e V+ system does n ot en force an y protection sch eme for global variables th at are sh ared by mu ltiple program tasks. It is th e programmer's respon sibility to keep track of th e u sage of su ch global variables. Th e CAS real-valu ed fu n ction (or th e similar TAS fu n ction ) can be u sed to implemen t logical in terlocks on access to sh ared variables. Th is fu n ction can also be u sed to work arou n d a restriction on th e simu ltan eou s access of global arrays by mu ltiple program tasks — program execu tion can fail if two or more tasks attempt to in crease th e size of an array at th e same time. For a detailed description of th is, see th e " Global Array Access Restriction " section of th e in formation abou t Arrays in th e V+ Lan gu age User's Gu ide. Parameters variable Name of th e real-valu ed variable to be tested an d assign ed th e n ew valu e given . test_ valu e Real valu e, variable, or expression th at defin es th e comparison valu e. n ew_ valu e Real valu e, variable, or expression th at defin es th e n ew valu e to be assign ed to th e specified variable. Details If th e variable is equ al to th e test valu e, th e n ew valu e is stored in th e variable. Oth erwise th e variable is n ot modified. Th e origin al valu e of th e variable is retu rn ed as th e fu n ction valu e. Th e compare an d set-n ew-valu e operation s occu r with in terru pts locked so th at th e operation is in divisible. Th is fu n ction provides a way for settin g semaph ores between tasks, similar to th e TAS real-valu ed fu n ction . See th e description of th at fu n ction for more in formation — u se of th e CAS fu n ction is similar. V+ Lan gu age Referen ce Gu ide Page 1 8 1 CAS real-valu ed fu n ction If th e variable is u n defin ed wh en th e fu n ction is execu ted, it is treated as h avin g th e valu e zero. Related Keywords IOTAS real-valu ed fu n ction TAS real-valu ed fu n ction V+ Lan gu age Referen ce Gu ide Page 1 8 2 CASE program in stru ction CASE program instruction Syntax CAS E valu e OF Function In itiate processin g of a CASE stru ctu re by defin in g th e valu e of in terest. Usage Considerations Th is in stru ction mu st be part of a complete CASE stru ctu re. Parameter valu e Real valu e, variable, or expression th at defin es th e valu e to be match ed in th e CASE stru ctu re to determin e wh ich in stru ction s are execu ted. Details Th is is perh aps th e most powerfu l stru ctu re available with V+. It provides a mean s for execu tin g on e grou p of in stru ction s from amon g an y n u mber of grou ps. Th e complete syn tax is as follows (th e blan k lin es are n ot requ ired): CASE value OF VALUE value_1,...: group_of_steps VALUE value_2,...: group_of_steps . . . ANY group_of_steps END Th e th ree vertical dots in dicate th at an y n u mber of VALUE steps can be u sed to set off addition al grou ps of in stru ction s. Th e ANY step an d th e grou p of steps followin g it are option al. Th ere can be on ly on e ANY step in a CASE stru ctu re, an d it mu st mark th e last grou p in th e stru ctu re (as sh own above). Note th at th e ANY an d E ND steps mu st be on lin es by th emselves as sh own . (However, as with all in stru ction s, th ose lin es can h ave commen ts.) Th e CASE stru ctu re is processed as follows: Th e expression followin g th e CASE keyword is evalu ated. V+ Lan gu age Referen ce Gu ide Page 1 8 3 CASE program in stru ction All th e VALUE steps are scan n ed u n til th e first on e is fou n d th at h as th e same valu e. Th e grou p of in stru ction s followin g th at VALUE step is execu ted. E xecu tion con tin u es at th e first in stru ction after th e E ND step. If n o VALUE step is fou n d th at con tain s th e same valu e as th at in th e CASE in stru ction , an d th ere is an ANY step in th e stru ctu re, th en th e grou p of in stru ction s followin g th e ANY step will be execu ted. If n o VALUE match is fou n d in th e stru ctu re, an d th ere is n o ANY step, n on e of th e in stru ction s in th e en tire CASE stru ctu re are execu ted. E xamples Th e followin g example sh ows th e basic fu n ction of a CASE statemen t: CASE number OF VALUE 1: TYPE "one" VALUE 2: TYPE "two" ANY TYPE "Not one or two" END Th e followin g sample program asks you to en ter a test valu e. If th e valu e is n egative, th e program exits after displayin g a message. Oth erwise, a CASE stru ctu re is u sed to classify th e in pu t valu e as a member of on e of th ree grou ps. Th e grou ps are (1 ) even in tegers from zero to ten , (2 ) odd in tegers from on e to n in e, an d (3 ) all oth er positive n u mbers. PROMPT "Enter CASE x OF VALUE 0, 2, TYPE "The VALUE 1, 3, TYPE "The ANY TYPE x, " END a value from 1 to 10: ", x 4, 6, 8, 10: number", x, " is EVEN" 5, 7, 9: number", x, " is ODD" is not an integer from 0 to 10" Th e followin g example sh ows a special u se of th e CASE stru ctu re to test Boolean con dition s: PROMPT "Enter a number", CASE TRUE OF VALUE (x > 0): TYPE "The number was VALUE (x == 0): TYPE "The number was VALUE (x < 0): TYPE "The number was x greater than 0." equal to 0." less than 0." V+ Lan gu age Referen ce Gu ide Page 1 8 4 CASE program in stru ction END Related Keywords ANY program in stru ction E ND program in stru ction VALUE program in stru ction V+ Lan gu age Referen ce Gu ide Page 1 8 5 $ CHR strin g fu n ction $CHR string function Syntax $ CHR ( valu e) Function Retu rn a on e-ch aracter strin g correspon din g to a given ASCII valu e. Parameter valu e Real-valu ed expression defin in g th e valu e to be tran slated in to a ch aracter. Th e valu e mu st be in th e ran ge of 0 to 2 5 5 (decimal). If th e valu e is in th e ran ge 0 to 1 2 7 (decimal), th e correspon din g ASCII ch aracter will be retu rn ed. E xample $CHR(65) ;Returns the character A, since its ASCII value is 65. Related Keywords ASC real-valu ed fu n ction $ DBLB strin g fu n ction $ FLTB strin g fu n ction $ INTB strin g fu n ction $ LNGB strin g fu n ction V+ Lan gu age Referen ce Gu ide Page 1 8 6 CLE AR.E VE NT program in stru ction CLEAR .EVENT program instruction Syntax CLEAR.EVENT task, flag, processor Function Clear an even t associated with th e specified task. Parameters task Option al real valu e, variable, or expression (in terpreted as an in teger) th at specifies th e task for wh ich th e even t is to be cleared. Th e valid ran ge is 0 to 6 or 0 to 2 7 , in clu sive. If th is parameter is omitted, th e n u mber of th e cu rren t task is u sed. NOTE: Th e basic system allows 7 tasks (0 - 6 ). Th e V+ E xten sion s option allows 2 8 tasks (0 - 2 7 ). flag Not u sed, defau lts to 1 . processor Option al real valu e, variable, or expression th at specifies th e V+ processor ru n n in g th e task to be sign aled. Th e defau lt valu e is 0 wh ich in dicates th e local processor. Th e first CPU in th e system is processor 1 . You r con troller may h ave addition al processors wh ich are n u mbered 2 th rou gh 4 . Details Th is in stru ction clears th e even t associated with th e specified task. Th e defau lt even t cleared is th e in pu t/ou tpu t completion even t for wh ich th e in stru ction WAIT.E VE NT 1 waits. Th is even t is also cleared by th e execu tion (n ot th e completion ) of an in pu t/ou tpu t in stru ction . Related Keywords GE T.E VE NT real-valu ed fu n ction INT.E VE NT program in stru ction SE T.E VE NT program in stru ction WAIT.E VE NT program in stru ction V+ Lan gu age Referen ce Gu ide Page 1 8 7 CLOSE an d CLOSE I program in stru ction CLOSE and CLOSEI program instruction Syntax CLOS E CLOS EI Function Close th e robot gripper. Usage Considerations CLOSE cau ses th e h an d to close du rin g th e n ext robot motion . CLOSE I cau ses a BRE AK in th e cu rren t con tin u ou s-path motion an d cau ses th e h an d to close immediately after th e cu rren t motion completes. Th e CLOSE in stru ction can be execu ted by an y program task as lon g as th e robot selected by th e task is n ot attach ed by an y oth er task. Th e in stru ction applies to th e robot selected by th e task. Th e CLOSE I in stru ction can be execu ted by an y program task as lon g as th e task h as attach ed a robot. Th e in stru ction applies to th e robot selected by th e task. If th e V+ system is n ot con figu red to con trol a robot, execu tin g th ese in stru ction s cau ses an error. Details Th ese in stru ction s sen d a sign al to th e con trol valves for th e pn eu matic h an d to close. If th e CLOSE in stru ction is u sed, th e sign al is n ot sen t u n til th e n ext robot motion begin s. NOTE: You can u se th e SPE C u tility program to set wh ich digital sign als con trol th e pn eu matic h an d. See th e In stru ction s for Adept Utility Programs for in formation on u se of th e program. Th e CLOSE I in stru ction differs from CLOSE in th e followin g ways: l l l A BRE AK occu rs if a con tin u ou s-path robot motion is in progress. Th e sign al is sen t to th e con trol valves at th e con clu sion of th e cu rren t motion , or immediately if n o motion is in progress. Robot motion s are delayed for a brief time to allow th e h an d actu ation to complete. Th e len gth of th e delay (in secon ds) is th e cu rren t settin g of th e HAND.TIME system parameter. V+ Lan gu age Referen ce Gu ide Page 1 8 8 CLOSE an d CLOSE I program in stru ction E xamples Du rin g th e n ext robot motion , cau se th e pn eu matic con trol valves to assu me th e closed state: CLOSE Cau se th e pn eu matic con trol valves to assu me th e closed state as soon as th e cu rren t motion stops: CLOSEI Related Keywords HAND.TIME system parameter OPE N program in stru ction OPE NI program in stru ction RE LAX program in stru ction RE LAXI program in stru ction SE LE CT program in stru ction SE LE CT real-valu ed fu n ction V+ Lan gu age Referen ce Gu ide Page 1 8 9 CLOSE an d CLOSE I program in stru ction CLOSE and CLOSEI program instruction Syntax CLOS E CLOS EI Function Close th e robot gripper. Usage Considerations CLOSE cau ses th e h an d to close du rin g th e n ext robot motion . CLOSE I cau ses a BRE AK in th e cu rren t con tin u ou s-path motion an d cau ses th e h an d to close immediately after th e cu rren t motion completes. Th e CLOSE in stru ction can be execu ted by an y program task as lon g as th e robot selected by th e task is n ot attach ed by an y oth er task. Th e in stru ction applies to th e robot selected by th e task. Th e CLOSE I in stru ction can be execu ted by an y program task as lon g as th e task h as attach ed a robot. Th e in stru ction applies to th e robot selected by th e task. If th e V+ system is n ot con figu red to con trol a robot, execu tin g th ese in stru ction s cau ses an error. Details Th ese in stru ction s sen d a sign al to th e con trol valves for th e pn eu matic h an d to close. If th e CLOSE in stru ction is u sed, th e sign al is n ot sen t u n til th e n ext robot motion begin s. NOTE: You can u se th e SPE C u tility program to set wh ich digital sign als con trol th e pn eu matic h an d. See th e In stru ction s for Adept Utility Programs for in formation on u se of th e program. Th e CLOSE I in stru ction differs from CLOSE in th e followin g ways: l l l A BRE AK occu rs if a con tin u ou s-path robot motion is in progress. Th e sign al is sen t to th e con trol valves at th e con clu sion of th e cu rren t motion , or immediately if n o motion is in progress. Robot motion s are delayed for a brief time to allow th e h an d actu ation to complete. Th e len gth of th e delay (in secon ds) is th e cu rren t settin g of th e HAND.TIME system parameter. V+ Lan gu age Referen ce Gu ide Page 1 9 0 CLOSE an d CLOSE I program in stru ction E xamples Du rin g th e n ext robot motion , cau se th e pn eu matic con trol valves to assu me th e closed state: CLOSE Cau se th e pn eu matic con trol valves to assu me th e closed state as soon as th e cu rren t motion stops: CLOSEI Related Keywords HAND.TIME system parameter OPE N program in stru ction OPE NI program in stru ction RE LAX program in stru ction RE LAXI program in stru ction SE LE CT program in stru ction SE LE CT real-valu ed fu n ction V+ Lan gu age Referen ce Gu ide Page 1 9 1 COARSE program in stru ction COAR SE program instruction Syntax COARS E toleran ce ALWAYS Function E n able a low-precision featu re of th e robot h ardware servo. Usage Considerations On ly th e n ext robot motion will be affected u n less th e ALWAYS parameter is specified. If th e toleran ce parameter is specified, its valu e becomes th e defau lt for an y su bsequ en t COARSE in stru ction execu ted du rin g th e cu rren t execu tion cycle (regardless of wh eth er ALWAYS is specified). FINE 1 0 0 ALWAYS is assu med wh en ever program execu tion is in itiated an d wh en a n ew execu tion cycle begin s. Th e COARSE in stru ction can be execu ted by an y program task as lon g as th e robot selected by th e task is n ot attach ed by an y oth er task. Th e in stru ction applies to th e robot selected by th e task. If th e V+ system is n ot con figu red to con trol a robot, execu tin g th e COARSE in stru ction cau ses an error. Parameters toleran ce Option al real valu e, variable, or expression th at specifies th e percen tage of th e stan dard coarse toleran ces th at are to be u sed for each join t of th e robot attach ed by th e cu rren t execu tion task. See th e Details section for defau lt valu es. ALWAYS Option al qu alifier th at establish es COARSE as th e defau lt con dition . Th at is, COARSE will remain in effect u n til disabled by a FINE in stru ction . If ALWAYS is n ot specified, th e COARSE in stru ction will apply on ly to th e n ext robot motion . Details Th is in stru ction en ables a low-precision featu re in th e robot motion servo so th at larger errors in th e fin al position s of th e robot join ts are permitted at th e en ds of motion s. Th is allows faster motion execu tion wh en h igh accu racy is n ot requ ired. Lower precision is sometimes requ ired in belt trackin g application s wh en th e con stan t motion of th e robot preven ts th e servos from settlin g to h igh precision . V+ Lan gu age Referen ce Gu ide Page 1 9 2 COARSE program in stru ction If th e toleran ce parameter is specified, th e n ew settin g takes effect at th e start of th e n ext motion . Also, th e valu e becomes th e defau lt for an y su bsequ en t COARSE in stru ction execu ted du rin g th e cu rren t execu tion cycle (regardless of wh eth er ALWAYS is specified). Ch an gin g th e COARSE toleran ce does n ot affect th e FINE toleran ce. If th e toleran ce parameter is omitted, th e most recen t settin g (for th e attach ed robot) is u sed. Th e defau lt settin g is restored to 1 0 0 percen t wh en program execu tion begin s, or a n ew execu tion cycle starts (assu min g th at th e robot is attach ed to th e program). E xamples E n able th e low-precision featu re on ly for th e n ext motion : COARSE E n able th e low-precision featu re for th e n ext motion , with th e toleran ce settin gs ch an ged to 1 5 0 % of th e stan dard toleran ce for each join t (th at is, a looser toleran ce): COARSE 150 E n able th e low-precision featu re u n til it is explicitly disabled: COARSE ALWAYS Related Keywords CONFIG real-valu ed fu n ction DE LAY.IN.TOL program in stru ction FINE program in stru ction NONULL program in stru ction NULL program in stru ction SE LE CT program in stru ction SE LE CT real-valu ed fu n ction V+ Lan gu age Referen ce Gu ide Page 1 9 3 COM operator COM operator Syntax ... COM valu e ... Function Perform th e bin ary complemen t operation on a valu e. Usage Considerations Th e word " com" can n ot be u sed as a program n ame or variable n ame. Th e COM operation is mean in gfu l on ly wh en performed on an in teger valu e. On ly th e in teger parts of real valu es are u sed. An y fraction al parts are ign ored. Parameter valu e Real-valu ed expression defin in g th e valu e to be complemen ted. Details Th e COM operator performs th e bin ary complemen t operation on a bit-by-bit basis, resu ltin g in a real valu e. Specifically, th e COM operation con sists of th e followin g steps: 1 . Con vert th e operan d to a sign -exten ded 3 2 -bit in teger, tru n catin g an y fraction al part. 2 . Perform a bin ary complemen t operation . 3 . Con vert th e resu lt back to a real valu e. To review th e order of evalu ation for operators with in expression s, see th e section Order of E valu ation in th e V+ Lan gu age User's Gu ide. E xamples For example: COM 40 yields -41 Note th at a very differen t resu lt is obtain ed with th e logical complemen t operation (NOT): NOT 40 yields 0.0 (FALSE) In th is case, 4 0 is in terpreted as logically TRUE sin ce it is n on zero. V+ Lan gu age Referen ce Gu ide Page 1 9 4 CONFIG real-valu ed fu n ction CONFIG real-valued function Syntax CONFI G ( select) Function Retu rn a valu e th at provides in formation abou t th e robot's geometric con figu ration , or th e statu s of th e motion servo-con trol featu res. Usage Considerations Th e CONFIG fu n ction retu rn s in formation for th e robot selected by th e task execu tin g th e fu n ction . If th e V+ system is n ot con figu red to con trol a robot, u se of th e CONFIG fu n ction cau ses an error. Parameter select Option al real valu e, variable, or expression (in terpreted as an in teger) th at h as a valu e from 0 to 1 3 an d selects th e category of th e con figu ration in formation to be retu rn ed. (See below for details.) Details Th is fu n ction retu rn s a valu e th at is in terpreted as a series of bit flags. Th e in terpretation of th e valu e retu rn ed by th is fu n ction depen ds on th e select parameter. Wh en th e select parameter is omitted, or h as th e valu e 0 , 1 , or 2 , th e CONFIG fu n ction retu rn s a valu e th at can be in terpreted as bit flags in dicatin g a geometric con figu ration of th e robot. Th at is, each bit in th e valu e represen ts on e ch aracteristic of a robot con figu ration . Th e parameter valu es in th is grou p determin e wh ich robot con figu ration is retu rn ed by th e fu n ction : S elect Con figu ration in formation retu rn ed 0 Th e robot's cu rren t (in stan tan eou s) con figu ration . (Th e defau lt valu e is 0 .) 1 Th e con figu ration th e robot will ach ieve at th e completion of th e cu rren t motion , or th e cu rren t con figu ration if n o motion is in progress (an d th e NOTE: Th e resu lt retu rn ed is n ot mean in gfu l if th e robot is n ot attach ed. V+ Lan gu age Referen ce Gu ide Page 1 9 5 CONFIG real-valu ed fu n ction 2 Th e con figu ration th e robot ach ieves at th e completion of th e n ext motion (assu min g th at it is a join t-in terpolated [n ot straigh t-lin e] motion ). Th e in terpretation s of th e bit flags retu rn ed by th ese selection s are as follows: Bit # Bit Mask I n dication if bit S ET 1 1 Robot h as righ ty con figu ration 2 2 Robot h as below con figu ration 3 4 Robot h as flipped con figu ration Wh en th e select parameter is 3 , 4 , or 5 , th e CONFIG fu n ction retu rn s a valu e th at can be in terpreted as bit flags in dicatin g th e settin gs of several robot motion servo-con trol featu res. Th at is, each bit in th e valu e represen ts th e state of on e motion servo-con trol featu re. Th e differen t parameter valu es in th is grou p select wh ich motion (s) will be affected by th e featu res settin gs reported by th e fu n ction , as follows: S elect Con figu ration in formation retu rn ed 3 Th e perman en t settin gs of th e robot motion servo-con trol featu res. Th at is, th e settin gs defin ed by in stru ction s th at specify th e ALWAYS qu alifier. 4 Th e temporary settin gs for th e motion cu rren tly execu tin g, or th e last motion completed if n o motion is in progress. 5 Th e temporary settin gs th at will apply to th e n ext motion performed. Th e in terpretation s of th e bit flags retu rn ed by selection s 3 , 4 , an d 5 are as follows: I n dication if bit CLEAR Bit# Bit Mask Bit S ET 1 1 (Non e) (Non e) 2 2 FINE asserted COARSE asserted 3 4 NU L L asserted NONULL asserted V+ Lan gu age Referen ce Gu ide Page 1 9 6 CONFIG real-valu ed fu n ction 4 8 MULTIPLE asserted SINGLE asserted 5 ^H1 0 CPON asserted CPOFF asserted 6 ^H2 0 OVE RLAP asserted NOOVE RLAP asserted Wh en th e select parameter is 6 , 7 , or 8 , th e CONFIG fu n ction retu rn s a valu e th at represen ts th e settin g of th e FINE toleran ce. S elect FI NE toleran ce retu rn ed 6 Th e perman en t settin g, as a percen tage of th e stan dard toleran ce. 7 Th e settin g u sed for th e previou s or cu rren t motion , as a percen tage of th e stan dard toleran ce. 8 Th e settin g to be u sed for th e n ext motion , as a percen tage of th e stan dard toleran ce. Wh en th e select parameter is 9 , 1 0 , or 1 1 , th e CONFIG fu n ction retu rn s a valu e th at represen ts th e settin g of th e COARSE toleran ce. S elect COARS E toleran ce retu rn ed 9 Th e perman en t settin g, as a percen tage of th e stan dard toleran ce. 10 Th e settin g u sed for th e previou s or cu rren t motion , as a percen tage of th e stan dard toleran ce. 11 Th e settin g to be u sed for th e V+ Lan gu age Referen ce Gu ide Page 1 9 7 CONFIG real-valu ed fu n ction n ext motion , as a percen tage of th e stan dard toleran ce. Wh en th e select parameter is 1 2 , th e available join t con figu ration option s for th e selected robot are retu rn ed as sh own below. I n dication if bit set Bit # Bit Mask 1 1 Robot can h ave lefty or righ ty con figu ration . 2 2 Robot can h ave above or below con figu ration . 3 4 Robot can h ave flipped or n oflip con figu ration . 18 ^H2 0 0 0 0 Robot su pports th e OVE RLAP an d NOOVE RLAP in stru ction s. 22 ^H2 0 0 0 0 0 Robot's last rotary join t can be limited to ± 1 8 0 degrees (SINGLE or MULTIPLE ). Wh en th e select parameter is 1 3 , th e type of robot motion is retu rn ed. Th e bit valu es retu rn ed are sh own below. Bit # Bit Mask 1 1 Description Th is bit is set if th e motion is join t in terpolated; it is cleared for V+ Lan gu age Referen ce Gu ide Page 1 9 8 CONFIG real-valu ed fu n ction straigh t-lin e motion . 2 2 Th is bit is set if th e robot is performin g a SPIN motion . Related Keywords ABOVE program in stru ction BE LOW program in stru ction COARSE program in stru ction CPOFF program in stru ction CPON program in stru ction FINE program in stru ction FLIP program in stru ction LE FTY program in stru ction MULTIPLE program in stru ction NOFLIP program in stru ction NONULL program in stru ction NOOVE RLAP program in stru ction NULL program in stru ction OVE RLAP program in stru ction RIGHTY program in stru ction SE LE CT program in stru ction SE LE CT real-valu ed fu n ction SINGLE program in stru ction STATE real-valu ed fu n ction V+ Lan gu age Referen ce Gu ide Page 1 9 9 COS real-valu ed fu n ction COS real-valued function Syntax COS ( an gle) Function Retu rn th e trigon ometric cosin e of a given an gle. Usage Considerations Th e an gle parameter mu st be measu red in degrees. Th e parameter is in terpreted as modu lo 3 6 0 degrees, bu t excessively large valu es may cau se a loss of accu racy in th e retu rn ed valu e. Parameter an gle Real-valu ed expression th at defin es th e an gu lar valu e (in degrees) to be con sidered. Details Retu rn s th e trigon ometric cosin e of th e argu men t, wh ich is assu med to be in degrees. Th e resu ltin g valu e is always in th e ran ge of -1 .0 to +1 .0 , in clu sive. E xamples COS(0.5) COS(-5.462) COS(60) COS(1.3125E+2) ;Returns ;Returns ;Returns ;Returns 0.999962 0.9954596 0.4999999 -0.6593457 NOTE: TYPE , PROMPT, an d similar in stru ction s ou tpu t th e resu lts of th e above examples as sin gle-precision valu es. However, th ey are actu ally stored an d man ipu lated as dou bleprecision valu es. Th e LISTR mon itor comman d will display real valu es to fu ll precision . V+ Lan gu age Referen ce Gu ide Page 2 0 0 CP system switch CP system switch Syntax ... CP Function Con trol th e con tin u ou s-path featu re. Details Th e CP switch can be u sed to tu rn off con tin u ou s-path motion processin g. For more in formation on con tin u ou s path motion , see th e section Con tin u ou s Path Trajectories in th e V+ Lan gu age User's Gu ide. Th is switch is en abled wh en th e V+ system is in itialized. E xample DISABLE CP ;Turn off continuous-path motion processing. Related Keywords BRE AK program in stru ction CPOFF program in stru ction CPON program in stru ction DISABLE mon itor comman d DISABLE program in stru ction E NABLE mon itor comman d E NABLE program in stru ction SWITCH mon itor comman d SWITCH program in stru ction SWITCH real-valu ed fu n ction V+ Lan gu age Referen ce Gu ide Page 2 0 1 CPOFF program in stru ction CPOFF program instruction Syntax CPOFF ALWAYS Function In stru ct th e V+ system to stop th e robot at th e completion of th e n ext motion in stru ction (or all su bsequ en t motion in stru ction s) an d n u ll position errors. Usage Considerations On ly th e n ext robot motion will be affected if th e ALWAYS parameter is n ot specified. CPON ALWAYS is assu med wh en ever program execu tion is in itiated an d wh en a n ew execu tion cycle begin s. Th e CPOFF in stru ction can be execu ted by an y program task as lon g as th e robot selected by th e task is n ot attach ed by an y oth er task. Th e in stru ction applies on ly to th e robot selected by th e task. If th e V+ system is n ot con figu red to con trol a robot, execu tin g th e CPOFF in stru ction cau ses an error. Parameter ALWAYS Option al qu alifier th at establish es CPOFF as th e defau lt con dition . Th at is, wh en ALWAYS is in clu ded in a CPOFF in stru ction , CPOFF will remain in effect con tin u ou sly u n til disabled by a CPON in stru ction . If ALWAYS is n ot specified, th e CPOFF in stru ction applies on ly to th e n ext robot motion . Details Wh en CPOFF is in effect, th e robot will be brou gh t to a stop at th e completion of th e n ext robot motion , an d an y fin al position errors will be n u lled (if requ ired). Un like th e BRE AK in stru ction , wh ich is execu ted after a motion to cau se con tin u ou s-path processin g to termin ate, CPON an d CPOFF are execu ted before a motion in stru ction to affect th e con tin u ou s-path processin g of th e n ext motion in stru ction . Also, wh ile BRE AK applies to on ly on e motion in stru ction , CPOFF can apply to all th e motion in stru ction s th at follow. NOTE: Th e BRE AK in stru ction cau ses con tin u ou s-path processin g to termin ate by blockin g V+ program execu tion u n til th e motion en ds. CPOFF cau ses th e trajectory gen erator to termin ate con tin u ou s path with ou t affectin g th e forward processin g of th e V+ program. V+ Lan gu age Referen ce Gu ide Page 2 0 2 CPOFF program in stru ction If th e CP system switch is disabled, con tin u ou s-path processin g n ever occu rs regardless of an y CPON or CPOFF in stru ction s. Related Keywords BRE AK program in stru ction CP system switch CPON program in stru ction SE LE CT program in stru ction SE LE CT real-valu ed fu n ction V+ Lan gu age Referen ce Gu ide Page 2 0 3 CPON program in stru ction CPON program instruction Syntax CPON ALWAYS Function In stru ct th e V+ system to execu te th e n ext motion in stru ction (or all su bsequ en t motion in stru ction s) as part of a con tin u ou s path . Usage Considerations On ly th e n ext robot motion will be affected if th e ALWAYS parameter is n ot specified. Th is is th e defau lt state of th e V+ system. CPON ALWAYS is assu med wh en ever program execu tion is in itiated an d wh en a n ew execu tion cycle begin s. Th e CPON in stru ction can be execu ted by an y program task as lon g as th e robot selected by th e task is n ot attach ed by an y oth er task. Th e in stru ction applies on ly to th e robot selected by th e task. If th e V+ system is n ot con figu red to con trol a robot, execu tin g th e CPON in stru ction cau ses an error. Parameter ALWAYS Option al qu alifier th at establish es CPON as th e defau lt con dition . Th at is, if ALWAYS is specified, CPON will remain in effect con tin u ou sly u n til disabled by a CPOFF in stru ction . If ALWAYS is n ot specified, th e CPON in stru ction applies on ly to th e n ext robot motion . Details Wh en CPON is in effect, it is possible to execu te a series of motion in stru ction s th at are blen ded in to a sin gle con tin u ou s path . Th at is, each motion will be performed in su ccession with ou t stoppin g th e robot at specified location s. Un like th e BRE AK in stru ction , wh ich is execu ted after a motion to cau se con tin u ou s-path processin g to termin ate, CPON an d CPOFF are execu ted before a motion in stru ction to affect th e con tin u ou s-path processin g of th e n ext motion in stru ction . NOTE: Th e BRE AK in stru ction cau ses con tin u ou s-path processin g to termin ate by blockin g V+ program execu tion u n til th e motion en ds. CPOFF cau ses th e trajectory gen erator to termin ate con tin u ou s path with ou t affectin g th e forward processin g of th e V+ program. V+ Lan gu age Referen ce Gu ide Page 2 0 4 CPON program in stru ction Wh ile assertin g CPON permits con tin u ou s-path processin g to occu r, an y of th e followin g con dition s will break a con tin u ou s path an d override CPON: l l No su bsequ en t motion in stru ction is execu ted before completion of th e n ext motion in stru ction . CP system switch is disabled. (If th e CP system switch is disabled, con tin u ou s-path processin g n ever occu rs, regardless of an y CPON or CPOFF in stru ction s.) l Th e n ext motion in stru ction is followed by an in stru ction th at explicitly or implicitly cau ses motion termin ation (for example, BRE AK, OPE NI). Related Keywords BRE AK program in stru ction CP system switch CPOFF program in stru ction SE LE CT program in stru ction SE LE CT real-valu ed fu n ction V+ Lan gu age Referen ce Gu ide Page 2 0 5 CUBRT real-valu ed fu n ction CUBR T real-valued function Syntax CUBRT ( expression ) Function Th is fu n ction retu rn s th e cu be root of a valu e. Parameters expression Real-valu ed expression defin in g th e valu e wh ose cu be root is to be compu ted. Details Retu rn s th e cu be root of th e argu men t. Th e cu be root of a n u mber is defin ed to be th e n u mber th at, wh en mu ltiplied by itself twice, yields th e origin al n u mber. E xamples CUBRT(0.123) CUBRT(8) CUBRT(-5.462) CUBRT(1.3125E+2) ;Returns ;Returns ;Returns ;Returns 0.497319 2.0 -1.7611 5.081982 NOTE: TYPE , PROMPT, an d similar in stru ction s ou tpu t th e resu lts of th e above examples as sin gle-precision valu es. However, th ey are actu ally stored an d man ipu lated as dou bleprecision valu es. Th e LIST an d LISTR mon itor comman ds display real valu es to fu ll precision . V+ Lan gu age Referen ce Gu ide Page 2 0 6 CYCLE .E ND program in stru ction CYCLE.END program instruction Syntax CYCLE.END task_ n u m, stop_ flag Function Termin ate th e execu tin g program in th e specified task th e n ext time it execu tes a STOP program in stru ction (or its equ ivalen t). Su spen d processin g of an execu table program u n til a program ru n n in g in th e specified task completes execu tion . Usage Considerations Th e CYCLE .E ND in stru ction h as n o effect if th e specified program task is n ot active. Th e CYCLE .E ND in stru ction su spen ds execu tion of th e program con tain in g th e in stru ction u n til th e specified program task completes execu tion . If a program is aborted wh ile its execu tion is su spen ded by a CYCLE .E ND in stru ction , th e program task specified by th e CYCLE .E ND in stru ction will still be termin ated (if th e stop_ flag is TRUE ). Parameters task_ n u m Option al real valu e, variable, or expression (in terpreted as an in teger) th at specifies wh ich program task is to be mon itored or termin ated. If th e task n u mber is n ot specified, th e CYCLE .E ND in stru ction always accesses task #0 . stop_ flag Option al real valu e, variable, or expression in terpreted as a logical (TRUE or FALSE ) valu e. If th e parameter is omitted or h as th e valu e 0 , th e specified task is n ot stopped-bu t th e CYCLE .E ND h as all its oth er effects (see below). If th e parameter h as a n on zero valu e, th e selected task stops at th e en d of its cu rren t cycle. Details If th e stop_ flag parameter h as a TRUE valu e, th e specified program task will termin ate th e n ext time it execu tes a STOP program in stru ction (or its equ ivalen t), regardless of h ow man y program cycles are left to be execu ted. NOTE: CYCLE .E ND will n ot termin ate a program with con tin u ou s in tern al loops. Su ch a program mu st be termin ated with th e ABORT comman d or in stru ction . V+ Lan gu age Referen ce Gu ide Page 2 0 7 CYCLE .E ND program in stru ction Regardless of th e stop_ flag parameter, th is in stru ction will wait u n til th e program actu ally is termin ated. If th e program bein g termin ated loops in tern ally so th at th e cu rren t execu tion cycle n ever en ds, th e CYCLE .E ND in stru ction will wait forever. To proceed from a CYCLE .E ND th at is waitin g for a program to termin ate, abort th e program th at is waitin g for a CYCLE .E ND by typin g an ABORT comman d for th e program task th at execu ted th e CYCLE .E ND in stru ction . E xample Th e followin g program segmen t sh ows h ow a program task can be in itiated from an oth er program task (th e ABORT an d CYCLE .E ND program in stru ction s are u sed to make su re th e specified program task is n ot already active): ABORT 3 CYCLE.END 3 EXECUTE 3 new.program ;Abort any program already active ;Wait for execution to abort ;Start up the new program Related Keywords ABORT mon itor comman d ABORT program in stru ction CYCLE .E ND mon itor comman d E XE CUTE mon itor comman d E XE CUTE program in stru ction KILL mon itor comman d KILL program in stru ction STATUS mon itor comman d STATUS real-valu ed fu n ction STOP program in stru ction V+ Lan gu age Referen ce Gu ide Page 2 0 8 DBLB real-valu ed fu n ction DBLB real-valued function Syntax DBLB ( $ strin g, first_ ch ar) Function Retu rn th e valu e of eigh t bytes of a strin g in terpreted as an IE E E dou ble-precision floatin gpoin t n u mber. Parameters $ strin g Strin g expression th at con tain s th e eigh t bytes to be con verted. first_ ch ar Option al real-valu ed expression th at specifies th e position of th e first of th e eigh t bytes in th e strin g. If first_ ch ar is omitted or h as a valu e of 0 or 1 , th e first eigh t bytes of th e strin g are extracted. If first_ ch ar is greater th an 1 , it is in terpreted as th e ch aracter position for th e first byte. For example, a valu e of 2 mean s th at th e secon d th rou gh n in th bytes are extracted. If first_ ch ar specifies eigh t bytes th at are beyon d th e en d of th e in pu t strin g, an error is gen erated . Details E igh t sequ en tial bytes of th e given strin g are in terpreted as bein g a dou ble-precision (6 4 -bit) floatin g-poin t n u mber in th e IE E E stan dard format. Th is 6 4 -bit field is in terpreted as follows: wh ere s is th e sign bit, s = 0 for positive, s = 1 for n egative. exp is th e bin ary expon en t, biased by -1 0 2 3 . fraction is a bin ary fraction with an implied 1 to th e left of th e bin ary poin t. V+ Lan gu age Referen ce Gu ide Page 2 0 9 DBLB real-valu ed fu n ction For 0 < exp < 2 0 4 7 , th e valu e of a floatin g poin t n u mber is: - 1 s * ( 1 . f r a c t i o n ) * 2 exp -1023 Dou ble-precision real valu es h ave th e followin g special valu es: exp fraction Description 0 Zero Zero valu e 0 Non zero Den ormalized n u mber 2047 Zero Sign ed in fin ity 2047 Non zero Not-a-n u mber Th e ran ge for n ormalized n u mbers is approximately 2 .2 x 1 0 - 308 to 1 .8 x 1 0 307 Th e main u se of th is fu n ction is to con vert a bin ary floatin g-poin t n u mber from an in pu t data record to a valu e th at can be u sed in tern ally by V+. E xample DBLB($CHR(^H3F)+$CHR(^HF0)+$CHR(0)+$CHR(0) +$CHR(0)+$CHR(0)+$CHR(0)+$CHR(0)) ;Returns 1.0 Related Keywords ASC real-valu ed fu n ction $ DBLB strin g fu n ction DOUBLE (type keyword for AUTO, GLOBAL, an d LOCAL) FLTB real-valu ed fu n ction $ FLTB strin g fu n ction INTB real-valu ed fu n ction TRANSB tran sformation fu n ction VAL real-valu ed fu n ction V+ Lan gu age Referen ce Gu ide Page 2 1 0 $ DBLB strin g fu n ction $DBLB string function Syntax $ DBLB ( valu e) Function Retu rn an 8 -byte strin g con tain in g th e bin ary represen tation of a real valu e in dou ble-precision IE E E floatin g-poin t format. Parameter valu e Real-valu ed expression , th e valu e of wh ich is con verted to its IE E E floatin g-poin t bin ary represen tation . Details A real valu e is con verted to its bin ary represen tation u sin g th e IE E E dou ble-precision stan dard floatin g-poin t format. Th is 6 4 -bit valu e is packed as eigh t su ccessive 8 -bit ch aracters in a strin g. See th e DBLB real-valu ed fu n ction for a more detailed description of IE E E floatin gpoin t format. Th e main u se of th is fu n ction is to con vert a dou ble-precision real valu e to its bin ary represen tation in an ou tpu t record of a data file. E xample $DBLB(1.215) Retu rn s a ch aracter strin g equ ivalen t to: $CHR(^H3F)+$CHR(^H3F)+$CHR(^H70)+ $CHR(^HA3)+$CHR(^HD7)+$CHR(^H0A)+$CHR(^H3D)+$CHR(^H71) Related Keywords $ CHR strin g fu n ction DOUBLE (type keyword for AUTO, GLOBAL, an d LOCAL) $ FLTB strin g fu n ction FLTB real-valu ed fu n ction $ INTB strin g fu n ction $ TRANSB strin g fu n ction V+ Lan gu age Referen ce Gu ide Page 2 1 1 DCB real-valu ed fu n ction DCB real-valued function Syntax DCB ( valu e) Function Con vert BCD digits in to an equ ivalen t in teger valu e. Usage Considerations No more th an fou r BCD digits can be con verted. Th e DCB fu n ction is most often u sed with th e BITS real-valu ed fu n ction to decode in pu t from th e digital in pu t sign al lin es. Parameter valu e Real valu e in terpreted as a bin ary bit pattern represen tin g u p to fou r BCD digits. NOTE: An error is reported if an y digit is n ot a valid BCD digit. Th at is, if a digit is greater th an 9 . E xample If extern al in pu t sign als 1 0 0 1 -1 0 0 8 (8 bits of in pu t) receive two BCD digits from an extern al device, th en th e in stru ction input = DCB(BITS(1001, 8)) sets th e real variable in pu t equ al to th e in teger equ ivalen t of th e BCD in pu t on th e specified sign als. Related Keyword BCD real-valu ed fu n ction V+ Lan gu age Referen ce Gu ide Page 2 1 2 DE CE L.1 0 0 system switch DECEL.100 system switch Syntax ... DECEL.1 0 0 [robot_ n u m] Function E n able or disable th e u se of 1 0 0 percen t as th e maximu m deceleration for th e ACCE L program in stru ction . Parameter robot_ n u m Option al real valu e, variable, or expression (in terpreted as an in teger) th at in dicates th e n u mber of th e robot affected. If th e in dex is omitted or zero in an E NABLE or DISABLE comman d or in stru ction , th e settin gs for all robots are altered. Oth erwise, on ly th e settin g for th e specified robot is affected. Details Wh en DE CE L.1 0 0 is en abled for th e selected robot, th e maximu m deceleration percen tage defin ed by th e SPE C u tility program is ign ored, an d a maximu m deceleration of 1 0 0 % is u sed in stead. Th is maximu m is u sed to limit th e valu e specified by th e ACCE L program in stru ction . By defau lt, DE CE L.1 0 0 is disabled for all robots. E xample DECEL.100[2] ;Cause ACCEL to use 100% for maximum ;deceleration for robot #2 Related Keywords ACCE L program in stru ction ACCE L real-valu ed fu n ction SPE E D mon itor comman d SPE E D program in stru ction V+ Lan gu age Referen ce Gu ide Page 2 1 3 $ DE CODE strin g fu n ction $DECODE string function Syntax $ DECODE ( $ strin g_ var, strin g_ exp, mode) Function E xtract part of a strin g as delimited by given break ch aracters. Usage Considerations $ DE CODE modifies th e in pu t $ strin g_ var variable as well as retu rn in g a strin g valu e. Th e test for break ch aracters is always performed with ou t regard for th e case of th e ch aracters in th e in pu t strin g. Th e break ch aracters are treated as in dividu al ch aracters, in depen den t of th e oth er ch aracters in th e strin g th at defin es th em. V+ Lan gu age Referen ce Gu ide Page 2 1 4 $ DE CODE strin g fu n ction Parameters $ strin g_ var Strin g variable th at con tain s th e strin g to be scan n ed. After th e fu n ction is processed, th is variable will con tain th e portion of th e origin al strin g th at was n ot retu rn ed as th e fu n ction valu e. NOTE: Th is parameter is modified by th e fu n ction an d can n ot be specified as a strin g con stan t or expression . If th e program cau ses th e same variable to receive th e fu n ction valu e, th e variable will en d u p con tain in g th e valu e retu rn ed by th e fu n ction . strin g_ exp Strin g con stan t, variable, or expression th at defin es th e in dividu al break ch aracters, wh ich are to be con sidered as separatin g th e su bstrin gs of in terest in th e in pu t strin g valu e. (Th e order of th e ch aracters in th is strin g h as n o effect on th e fu n ction operation .) mode Option al real valu e, variable, or expression th at con trols th e operation performed by th e fu n ction . Mode valu es are -3 , -2 , 0 , an d 1 . If th e mode is n egative or zero, or is omitted, ch aracters u p to th e first break ch aracter are removed from th e in pu t strin g an d retu rn ed as th e ou tpu t of th e fu n ction . If th e mode is greater th an zero, ch aracters u p to th e first n on break ch aracter are removed from th e in pu t strin g an d retu rn ed as th e ou tpu t of th e fu n ction . Th at is, th is case retu rn s all th e leadin g break ch aracters in th e in pu t strin g. Details Th is fu n ction is u sed to scan an in pu t strin g an d retu rn th e in itial su bstrin g, as delimited by an y of a grou p of break ch aracters. After th e su bstrin g is retu rn ed by th e fu n ction , it is deleted from th e in pu t strin g. Th e strin g retu rn ed (an d deleted) can eith er con tain n o break ch aracters (mode 0 ), or n oth in g bu t break ch aracters (mode 1 ). Th at is, $ DE CODE can retu rn (an d delete) all th e ch aracters u p to th e first break ch aracter-u su ally some desired su bstrin g; or th e fu n ction can retu rn (an d delete) all th e leadin g break ch aracters-wh ich are u su ally discarded. By altern atin g th e modes, grou ps of desired ch aracters can be picked from th e in pu t strin g (see th e first example below). Th e modes -2 an d -3 copy all n on break ch aracters u p to th e first break ch aracters plu s th e first break ch aracter. Mode -2 is equ ivalen t to th e followin g in stru ction s: V+ Lan gu age Referen ce Gu ide Page 2 1 5 $ DE CODE strin g fu n ction $s = $DECODE($i,$break,0) $s = $s+$MID($i,1,1) $i = $MID($i,2,127) ;Extract up to 1st break character ;Add on 1st break character ;Remove the break character Th e followin g in stru ction can perform th ese operation s: $s = $DECODE($i,$break,-2) ;Extract through 1st break character Mode -3 is equ ivalen t to mode -2 if a break ch aracter is presen t. However, if n o break ch aracter is con tain ed in th e in pu t strin g, mode -3 retu rn s an empty strin g an d leaves th e in pu t strin g u n ch an ged. E xamples Th e in stru ction s below pick off con secu tive n u mbers from th e strin g $ in pu t, assu min g th at th e n u mbers are separated by some combin ation of spaces an d commas. Th e first in stru ction with in th e DO stru ctu re sets th e variable $ temp to th e su bstrin g from $ in pu t th at con tain s th e first n u mber (an d removes th at su bstrin g from $ in pu t). Th e VAL fu n ction is u sed to con vert th e n u meric strin g in to its correspon din g real valu e, wh ich is assign ed to th e n ext elemen t of th e real array valu e. Th e $ DE CODE fu n ction is u sed a secon d time to extract th e ch aracters th at separate th e n u mbers (th e ch aracters fou n d are ign ored). i=0 DO $temp = $DECODE($string_var," ,",0) value[i] = VAL($temp) $temp = $DECODE($string_var," ,",1) i = i+1 UNTIL $string_var == "" ;Set array index ;Pick off a number string ;Convert to real value ;Discard spaces and commas ;Advance the array index ;Stop when input is empty In a case wh ere $ strin g_ var con tain s a sequ en ce of n u meric valu es (as strin gs) separated by spaces, commas, or an y combin ation of spaces an d commas, su ch as $stri ng_var = "1234. 93465.2, .4358,3458103" execu tin g th e above in stru ction s resu lts in th e first fou r elemen ts of th e valu e array h avin g th e followin g valu es: value[0] value[1] value[2] value[3] = = = = 1234.0 93465.2 0.4358 3458103.0 Th e strin g variable in pu t ($ strin g_ var) also con tain s an empty strin g (" " ). As sh own above, u se of th e $ DE CODE fu n ction n ormally in volves two strin g variables: th e in pu t variable an d th e ou tpu t variable. If you are in terested on ly in th e ch aracters u p to th e first break ch aracter, an d wan t to discard all th e ch aracters th at follow, th e same variable can be u sed for both in pu t an d ou tpu t. In th e followin g in stru ction , for example, th e same V+ Lan gu age Referen ce Gu ide Page 2 1 6 $ DE CODE strin g fu n ction variable is u sed on both sides of th e equ al sign becau se th e programmer wan ts to discard all th e wh ite space (th at is, space an d tab) ch aracters at th e en d of th e in pu t strin g. NOTE: Th e break ch aracters are specified by a strin g expression con sistin g of a space ch aracter an d a tab ch aracter. $line = $DECODE($line," "+$CHR(9),0) ;Discard trailing blanks Related Keywords $ TRUNCATE strin g fu n ction $ MID strin g fu n ction V+ Lan gu age Referen ce Gu ide Page 2 1 7 DE COMPOSE program in stru ction DECOMPOSE program instruction Syntax DECOMPOS E array_ n ame[ in dex] = location Function E xtract th e (real) valu es of in dividu al compon en ts of a location valu e. Parameters array_ n ame Name of th e real-valu ed array th at h as its elemen ts defin ed. in dex Option al in teger valu e(s) th at iden tifies th e first array elemen t to be defin ed. Zero will be assu med for an y omitted in dex. If a mu ltiple-dimen sion array is specified, on ly th e righ t-most in dex is in cremen ted as th e valu es are assign ed. location Location valu e th at is decomposed in to its compon en t valu es. Th is can be a tran sformation valu e or a precision -poin t valu e, an d can be defin ed by a variable or a location -valu ed fu n ction . Details Th is in stru ction assign s valu es to con secu tive elemen ts of th e n amed array, correspon din g to th e compon en ts of th e specified location . If th e location is represen ted as a tran sformation valu e, six elemen ts are defin ed, correspon din g to X, Y, Z, yaw, pitch , an d roll. If th e location is represen ted as a precision -poin t valu e, th en from on e to twelve elemen ts are defin ed (depen din g on th e n u mber of robot join ts), th at correspon d to th e in dividu al join t position s. E xamples Th e followin g code assign s th e compon en ts of tran sformation part to elemen ts 0 to 5 of array x: DECOMPOSE x = part Th e followin g code assign s th e compon en ts of precision poin t #pick to array elemen t an gles[4 ] an d th ose th at follow it: DECOMPOSE angles[4] = #pick V+ Lan gu age Referen ce Gu ide Page 2 1 8 DE COMPOSE program in stru ction Related Keywords #PPOINT precision -poin t fu n ction TRANS tran sformation fu n ction V+ Lan gu age Referen ce Gu ide Page 2 1 9 DE F.DIO program in stru ction DEF.DIO program instruction Syntax DEF.DI O sign al = address, type Function Assign th ird-party digital I/O boards to stan dard V+ sign al n u mbers for u se by stan dard V+ in stru ction s, fu n ction s, an d mon itor comman ds. Usage Considerations Th is in stru ction requ ires th e Th ird-Party Board Su pport licen se. Parameters sign al An in teger or real-valu ed expression represen tin g a V+ sign al n u mber from 1 7 to 5 0 5 for ou tpu t or from 1 0 1 7 to 1 5 0 5 for in pu t. Th is is th e first sign al n u mber of a block of 8 con tigu ou s sign als th at is located in a byte at an address on th e VME bu s. Th e sign al n u mbers mu st be on an 8 -bit bou n dary (1 7 , 2 5 , 3 3 ,...). Th e least-sign ifican t bit in th e byte at th e address correspon ds to th e lowest sign al n u mber. address An in teger or real-valu ed expression represen tin g th e VME bu s address in th e ran ges described in Details. (Th ese are th e same ran ges as allowed for th e IOGE T_ an d IOPUT_ keywords.) type An option al in teger or real-valu ed expression represen tin g th e VME bu s address type, like th at specified for th e IOGE T_ an d IOPUT_ keywords: 1 VME bu s stan dard address space (defau lt) 2 VME bu s sh ort address space Details Th e VME bu s specification defin es th ree in depen den t address spaces: sh ort, stan dard, an d exten ded. Adept does n ot su pport th e exten ded address space. Th e DE F.DIO in stru ction can access addresses in th e followin g ran ges: Stan dard 0 to ^H3 FFFFF (0 to ^H7 FFFFF on n on vision systems). With a du al vision system, n o u ser memory is available in th e stan dard space. Sh ort 0 to ^H7 FFF V+ Lan gu age Referen ce Gu ide Page 2 2 0 DE F.DIO program in stru ction CAUTI ON: Adept mu st first approve all th ird-party boards u sed in Adept con trollers. Con tact Adept Application s su pport for details. Not all boards su pport th e fu ll ran ge of addresses listed above. After a DE F.DIO in stru ction h as execu ted su ccessfu lly, an y operation th at referen ces an y of th e eigh t sign als defin ed by th e in stru ction accesses th e th ird-party board. E xample Defin e in pu t sign als 1 0 3 3 th rou gh 1 0 4 0 to be associated with th e th ird-party board th at is con figu red to respon d to th e address ^H3 0 0 0 in th e sh ort address space: DEF.DIO 1033 = ^H3000, 2 Related Keywords BITS real-valu ed fu n ction IO mon itor comman d IOGE T real-valu ed fu n ction $ IOGE TS strin g fu n ction IOPUT program in stru ction RE SE T program in stru ction RUNSIG program in stru ction SIG real-valu ed fu n ction SIG.INS real-valu ed fu n ction SIGNAL program in stru ction V+ Lan gu age Referen ce Gu ide Page 2 2 1 $ DE FAULT strin g fu n ction $DEFAULT string function Syntax $ DEFAULT ( mode) Function Retu rn a strin g con tain in g th e cu rren t or in itial system defau lt device, u n it, an d directory path for disk file access. Usage Considerations Paren th eses mu st be in clu ded even wh en th e fu n ction is omitted. Parameter mode Option al real valu e, variable, or expression (in terpreted as an in teger) th at specifies th e defau lt path to be retu rn ed, as follows: l l If th e parameter is omitted, or h as th e valu e zero, th e cu rren t system defau lt path is retu rn ed. If th e parameter h as th e valu e on e, th e defau lt path retu rn ed is th e on e th at was in effect immediately after th e V+ system was booted from disk. (Th is parameter applies on ly to V+ version 1 3 .2 an d later.) Details Th e system defau lt device, u n it, an d directory path can be set by th e CD or DE FAULT mon itor comman d. Th e $ DE FAULT fu n ction retu rn s th e cu rren t or in itial defau lt valu es as a strin g. Th e strin g con tain s th e portion s of th e followin g in formation th at h ave been set: device>disk_unit:directory_path wh ere V+ Lan gu age Referen ce Gu ide Page 2 2 2 $ DE FAULT strin g fu n ction device is on e of th e followin g: DISK a local disk SYSTE M a disk device, drive, an d su bdirectory path cu rren tly set with th e DE FAULT comman d NF S an NFS protocol device driver KE RMIT a serial lin e u sin g th e Kermit protocol For more details on valid devices, see th e ATTACH program in stru ction on page 1 2 6 . disk_ u n it is th e disk u n it specified to th e DE FAULT mon itor comman d. Th e colon (:) is omitted if n o u n it was specified. directory_ path is an y in pu t to th e DE FAULT comman d th at followed th e device an d u n it. Th e directory path is omitted if n o addition al in pu t was specified. E xample Th e followin g comman ds set th e defau lt drive specification to DISK>A:\TE ST\, an d th en display it on th e termin al for con firmation : DEFAULT = D>A:\TEST\ LISTS $DEFAULT() Related Keywords CD mon itor comman d DE FAULT mon itor comman d V+ Lan gu age Referen ce Gu ide Page 2 2 3 DE FBE LT program in stru ction DEFBELT program instruction Syntax DEFBELT %belt_ var = n om_ tran s, belt_ n u m, vel_ avg, scale_ fact Function Defin e a belt variable for u se with a con veyor trackin g robot. Usage Considerations Th is option is available on ly if you r Adept system is equ ipped with th e V+ E xten sion s option . Th e DE FBE LT program in stru ction su pports u p to six belt en coders, depen din g on th e h ardware con figu ration . Th e BE LT switch mu st be en abled for th is in stru ction to be execu ted. Th e DE FBE LT program in stru ction can n ot be execu ted wh ile th e robot is movin g relative to th e specified belt variable. Wh en a belt variable is in itialized u sin g th is in stru ction , its win dow parameters are set to allow an y location in th e workin g volu me of th e robot. Th at is, n o belt win dow is set. (See th e WINDOW program in stru ction .) Wh en a belt variable is in itialized with th e DE FBE LT program in stru ction , error ch eckin g is in itiated for th e associated belt en coder. Th is error ch eckin g can be tu rn ed off by disablin g th e BE LT system switch or by u sin g th e ZE RO comman d to rein itialize th e V+ system. V+ Lan gu age Referen ce Gu ide Page 2 2 4 DE FBE LT program in stru ction Parameters %belt_ var Name of th e belt variable to be defin ed. (All appearan ces of belt variables mu st be prefixed with th e percen t ch aracter [%].) n om_ tran s Tran sformation valu e th at defin es th e position an d orien tation of th e con veyor belt. Th is can be provided by a tran sformation variable, a tran sformation -valu ed fu n ction , or a compou n d tran sformation . Th e X axis of th e n omin al tran sformation defin es th e direction of travel of th e belt. Normally, th e belt moves alon g th e direction of +X. Th e X-Y plan e defin ed by th is tran sformation is parallel to th e su rface of th e belt. Th e (X, Y, Z) position defin ed by th e n omin al tran sformation defin es th e approximate cen ter of th e belt with respect to th e robot. belt_ n u m Th e n u mber of th e en coder u sed for readin g th e in stan tan eou s location of th e belt. Belts n u mbered from 1 to 6 can be specified. Th is can be specified with a con stan t, a variable, or an expression . vel_ avg (Th is parameter is cu rren tly ign ored, bu t some valu e mu st be provided.) scale_ fact Th e calibration con stan t th at relates motion of th e con veyor belt with cou n ts of th e en coder mou n ted on th e con veyor. Th is valu e (wh ich can be su pplied as a con stan t, a real variable, or an expression ) is in terpreted as h avin g th e u n its in millimeters of belt travel per en coder cou n t. Details A con veyor belt is modeled by a belt variable. In addition to th e parameters for th e DE FBE LT program in stru ction , a belt variable con tain s th e followin g in formation : l l Win dow parameters, wh ich defin e th e workin g ran ge of th e robot alon g th e belt. (Set with th e WINDOW in stru ction .) An en coder offset, wh ich is u sed to adju st th e origin of th e belt frame of referen ce. (Set with th e SE TBE LT in stru ction .) Belt variables h ave th e followin g ch aracteristics: l l Belt variable n ames mu st always be preceded by th e percen t ch aracter (%), for example, %main .belt. Oth erwise, th e n ormal ru les for variable n ames apply. Belt variable arrays are allowed, for example, %b[x]. V+ Lan gu age Referen ce Gu ide Page 2 2 5 DE FBE LT program in stru ction l l Belt variables can be passed as su brou tin e parameters ju st like oth er variables. Belt variables can be defin ed on ly with th e DE FBE LT in stru ction -th ere is n o assign men t in stru ction for th em. Th u s, th e followin g are n ot valid in stru ction s: %new_belt = %old_belt SET %new_belt = %old_belt l Belt variables can n ot be stored on a mass-storage device. (Variables u sed to defin e th e parameters in a DE FBE LT in stru ction can be stored, h owever.) E xample Th e followin g in stru ction defin es th e belt variable %belt.var. Th e valu e of b.n u m mu st be th e n u mber of th e en coder to be associated with th is belt variable. Th e variable b.n u m is also u sed as an in dex for arrays of data describin g th e position an d orien tation of th e belt, its velocity smooth in g, an d th e en coder scale factor. DEFBELT %belt.var = belt.nom[b.num], b.num, v.avg[b.num], belt.sf[b.num] Related Keywords BE LT system switch BE LT system switch BE LT.MODE system parameter BSTATUS real-valu ed fu n ction SE TBE LT program in stru ction WINDOW program in stru ction WINDOW real-valu ed fu n ction V+ Lan gu age Referen ce Gu ide Page 2 2 6 DE FINE D real-valu ed fu n ction DEFINED real-valued function Syntax DEFI NED ( var_ n ame) Function Determin e wh eth er a variable h as been defin ed. Parameter var_ n ame Th e n ame of a location , strin g, or real variable. Both scalar variables an d array variables are permitted. A location variable can be a tran sformation , a precision poin t, or a belt variable. Details Th e valu e of th e specified variable is tested. If th e valu e is defin ed, th e fu n ction retu rn s th e valu e TRUE . Oth erwise, th e valu e FALSE is retu rn ed. For array variables, if a specific array elemen t is specified, th e sin gle array elemen t is tested. If n o array elemen t is specified, th is fu n ction retu rn s a TRUE valu e if an y elemen t of th e array is defin ed. NOTE: For n on real argu men ts (i.e., strin gs, location s, tran sformation s) th at are passed in th e argu men t list of a CALL statemen t, you can test to see if th e variable is defin ed or n ot. However, you can n ot assign a valu e to u n defin ed n on real argu men ts with in th e CALLed program. If you attempt to assign a valu e to an u n defin ed n on real argu men t, you receive an u n defin ed valu e error message. Th erefore, wh en u sin g DE FINE D to test for u ser in pu t, be su re to assign a defau lt valu e to th e variable before testin g it. See th e example below. E xamples .PROGRAM test($s) AUTO $tmp $tmp = "default" IF DEFINED($s) THEN $tmp = $s END TYPE /C3 "The string is: ", $tmp Wh en th e example above is execu ted with a valu e: ex test("ABCD") V+ Lan gu age Referen ce Gu ide Page 2 2 7 DE FINE D real-valu ed fu n ction th e rou tin e retu rn s: The string is: ABCD Wh en th e example above is execu ted with ou t a valu e: ex test() th e rou tin e retu rn s: The string is: default Th e in stru ction : DEFINED(base_part) retu rn s a valu e of TRUE if th e variable base_ part is defin ed. Th e in stru ction : DEFINED(corner) retu rn s a valu e of TRUE if an y elemen t of th e array corn er h as been defin ed. Related Keywords STATUS real-valu ed fu n ction TE STP mon itor comman d V+ Lan gu age Referen ce Gu ide Page 2 2 8 DE LAY program in stru ction DELAY program instruction Syntax DELAY time Function Cau se robot motion to stop for th e specified time. Usage Considerations Th e robot stops du rin g th e delay, bu t th e wait an d n u llin g n ormally associated with a motion BRE AK do n ot occu r. Program execu tion con tin u es du rin g th e delay, u p to th e n ext motion in stru ction in th e program. (V+ system timers can be u sed to con trol th e timin g of program execu tion . Th e DE LAY in stru ction sh ou ld n ot be u sed for th at pu rpose.) Th e DE LAY in stru ction is in terpreted as a straigh t-lin e move-to-h ere motion in stru ction . (See below for th e con sequ en ces of th at in terpretation .) Th e DE LAY in stru ction can be execu ted by an y program task as lon g as th e task h as attach ed a robot. Th e in stru ction applies to th e robot selected by th e task. If th e V+ system is n ot con figu red to con trol a robot, execu tin g th e DE LAY in stru ction cau ses an error. If th e AMOVE in stru ction h as been execu ted to prepare for motion of an extra axis, execu tion of th e DE LAY in stru ction can cels th e effect of th e AMOVE in stru ction . Parameter time Real valu e, variable, or expression th at specifies th e len gth of time, in secon ds, th at th e robot is to pau se. A time valu e less th an 0 .0 1 6 (1 6 millisecon ds) resu lts in a 1 6 -millisecon d delay. Details Th e DE LAY in stru ction is processed as a robot motion . As a resu lt, th e followin g con sequ en ces occu r wh en a DE LAY is execu ted: 1 . An y pen din g h an d actu ation takes place du rin g th e execu tion of th e DE LAY in stru ction . 2 . An y temporary trajectory switch es th at h ave been specified are cleared after th e V+ Lan gu age Referen ce Gu ide Page 2 2 9 DE LAY program in stru ction con clu sion of th e delay. 3 . An y pen din g con figu ration ch an ge is can celed. NOTE: Wh en DRY.RUN mode is in effect, DE LAY in stru ction s do n ot cau se an y delay. E xamples DELAY 2.5 Cau ses all robot motion to stop for 2 .5 secon ds an d an y pen din g h an d operation to occu r. Clears an y temporary trajectory switch es th at may be set, an d can cels an y pen din g requ ests for con figu ration ch an ge. DELAY pause.1 Stops all robot motion for pau se.1 secon ds. Related Keywords DURATION program in stru ction SE LE CT program in stru ction SE LE CT real-valu ed fu n ction V+ Lan gu age Referen ce Gu ide Page 2 3 0 DE LAY.IN.TOL system switch DELAY.IN.TOL system switch Syntax ... DELAY.I N.TOL [robot_ n u m] Function Con trols th e timin g of COARSE or FINE n u llin g after V+ completes a motion segmen t. Parameter robot_ num Option al real valu e, variable, or expression (in terpreted as an in teger) th at in dicates th e n u mber of th e robot affected. If th e in dex is omitted or zero in an E NABLE or DISABLE comman d or in stru ction , th e settin gs for all robots are altered. Oth erwise, on ly th e settin g for th e specified robot is affected. Details Th e DE LAY.IN.TOL system switch is disabled by defau lt for all robot device modu les, except th e Delta robot device modu le. If th e switch is disabled, COARSE or FINE n u llin g completes wh en ever V+ h as completed a motion segmen t an d th e robot is trackin g th e trajectory to with in th e coarse or fin e toleran ce. Th e actu al robot location migh t n ot be with in th e toleran ce of th e en dpoin t. If th e switch is en abled, COARSE or FINE n u llin g completes wh en ever V+ h as completed a motion segmen t an d th e actu al robot location is with in th e specified coarse or fin e toleran ce of th e en dpoin tof th at motion segmen t. Usage Considerations For man y application s, en ablin g th is switch produ ces th e best n u llin g beh avior. However, th e switch sh ou ld be disabled for backward compatibility with previou s V+ systems. Th e followin g table in dicates th e level of h ardware su pport for th e DE LAY.IN.TOL system switch in th e differen t version s of th e V+ system. V+ version V+ version s 1 3 .2 (edit C8 an d later) S u pported Produ cts All AWC-based robots. an d 1 4 .0 (edit F2 an d later) V+ Lan gu age Referen ce Gu ide Page 2 3 1 DE LAY.IN.TOL system switch V+ version 1 5 .0 V+ version 1 5 .2 V+ version 1 6 .0 All AWC-based robots. V+ version 1 6 .1 All robots Revision History V+ Release Modification version 1 6 .1 Th e switch was en h an ced to su pport 1 3 9 4 -based servo produ cts. Th is switch was n ot docu men ted in previou s V+ docu men tation . version 1 3 .x version 1 4 .x In 1 3 .2 C8 , 1 4 .0 F2 an d later, th e switch is disabled at startu p for all robots except th e Delta robot, wh ich h as it en abled. In previou s V+ systems, all robots beh ave as if th e switch were disabled. Related Keywords COARSE program in stru ction FINE program in stru ction NULL program in stru ction NONULL program in stru ction V+ Lan gu age Referen ce Gu ide Page 2 3 2 DE LAY.POWE R.OFF system switch DELAY.POWER .OFF system switch Syntax ... DELAY.POW ER.OFF Function E n able/disable th e E STOP timer delay featu re for servo errors. Usage Considerations Th is switch is on ly operation al for systems equ ipped with an AWC-II board as th e main CPU. For program compatibility, th e DE LAY.POWE R.OFF system switch is recogn ized by V+ systems for both AWC-II-based con trollers an d SmartCon troller systems, bu t th e switch h as n o effect on th e latter. Details Wh en DE LAY.POWE R.OFF is disabled (defau lt), servo errors will cau se th e robot power to be disabled immediately, with ou t an E STOP timer delay. Wh en DE LAY.POWE R.OFF is en abled, servo errors will u se th e E STOP timer delay fu n ction ju st as if th e E STOP bu tton h ad been pressed. NOTE: For addition al details on th e E STOP timer delay fu n ction , see th e SPE C u tility. V+ Lan gu age Referen ce Gu ide Page 2 3 3 DE PART an d DE PARTS program in stru ction DEPAR T and DEPAR TS program instruction Syntax DEPART distan ce DEPARTS distan ce Function Start a robot motion away from th e cu rren t location . Usage Considerations DE PART cau ses a join t-in terpolated motion . DE PARTS cau ses a straigh t-lin e motion , du rin g wh ich n o ch an ges in con figu ration are permitted. Th ese in stru ction s can be execu ted by an y program task as lon g as th e task h as attach ed a robot. Th e in stru ction s apply to th e robot selected by th e task. If th e V+ system is n ot con figu red to con trol a robot, execu tin g th ese in stru ction s cau ses an error. Parameter distan ce Real-valu ed expression th at specifies th e distan ce (in millimeters) alon g th e robot tool Z axis between th e cu rren t robot location an d th e desired destin ation . A positive distan ce moves th e tool back (toward n egative tool Z) from th e cu rren t location ; a n egative distan ce moves th e tool forward (toward positive tool Z). Details Th ese in stru ction s in itiate a robot motion to a n ew location , wh ich is offset from th e cu rren t location by th e distan ce given , measu red alon g th e cu rren t tool Z axis. E xamples DEPART 80 Moves th e robot tool 8 0 millimeters back from its cu rren t location u sin g a join t-in terpolated motion . DEPARTS 2*offset V+ Lan gu age Referen ce Gu ide Page 2 3 4 DE PART an d DE PARTS program in stru ction With draws th e robot tool (2 * offset) millimeters alon g a straigh t-lin e path from its cu rren t location . Related Keywords APPRO program in stru ction APPROS program in stru ction MOVE program in stru ction MOVE S program in stru ction MOVE F program in stru ction MOVE SF program in stru ction SE LE CT program in stru ction SE LE CT real-valu ed fu n ction V+ Lan gu age Referen ce Gu ide Page 2 3 5 DE PART an d DE PARTS program in stru ction DEPAR T and DEPAR TS program instruction Syntax DEPART distan ce DEPARTS distan ce Function Start a robot motion away from th e cu rren t location . Usage Considerations DE PART cau ses a join t-in terpolated motion . DE PARTS cau ses a straigh t-lin e motion , du rin g wh ich n o ch an ges in con figu ration are permitted. Th ese in stru ction s can be execu ted by an y program task as lon g as th e task h as attach ed a robot. Th e in stru ction s apply to th e robot selected by th e task. If th e V+ system is n ot con figu red to con trol a robot, execu tin g th ese in stru ction s cau ses an error. Parameter distan ce Real-valu ed expression th at specifies th e distan ce (in millimeters) alon g th e robot tool Z axis between th e cu rren t robot location an d th e desired destin ation . A positive distan ce moves th e tool back (toward n egative tool Z) from th e cu rren t location ; a n egative distan ce moves th e tool forward (toward positive tool Z). Details Th ese in stru ction s in itiate a robot motion to a n ew location , wh ich is offset from th e cu rren t location by th e distan ce given , measu red alon g th e cu rren t tool Z axis. E xamples DEPART 80 Moves th e robot tool 8 0 millimeters back from its cu rren t location u sin g a join t-in terpolated motion . DEPARTS 2*offset V+ Lan gu age Referen ce Gu ide Page 2 3 6 DE PART an d DE PARTS program in stru ction With draws th e robot tool (2 * offset) millimeters alon g a straigh t-lin e path from its cu rren t location . Related Keywords APPRO program in stru ction APPROS program in stru ction MOVE program in stru ction MOVE S program in stru ction MOVE F program in stru ction MOVE SF program in stru ction SE LE CT program in stru ction SE LE CT real-valu ed fu n ction V+ Lan gu age Referen ce Gu ide Page 2 3 7 DE ST tran sformation fu n ction DEST transformation function Syntax DES T Function Retu rn a tran sformation valu e represen tin g th e plan n ed destin ation location for th e cu rren t robot motion . Usage Considerations Th e DE ST fu n ction retu rn s in formation for th e robot selected by th e task execu tin g th e fu n ction . If th e V+ system is n ot con figu red to con trol a robot, u se of th e DE ST fu n ction does n ot gen erate an error du e to th e absen ce of a robot. However, th e in formation retu rn ed by th e fu n ction may n ot be mean in gfu l. Th e word " dest" can n ot be u sed as a program n ame or variable n ame. Details DE ST retu rn s th e location to wh ich a robot was movin g wh en its motion was in terru pted. Th is applies for all motion in stru ction s, in clu din g: 1 . Motion s to n amed location s, su ch as MOVE start MOVES #part[10] Note th at even th ou gh th e secon d in stru ction referen ces a precision -poin t location variable, th e DE ST fu n ction retu rn s a tran sformation valu e du rin g th at motion . 2 . Motion s to location s defin ed relative to n amed location s or defin ed relative to th e cu rren t robot location APPROS drop, 50.00 DEPART 30.00 MOVE SHIFT(HERE BY 50,0,10) 3 . Motion s to special location s su ch as READY Th e location valu e retu rn ed by th e DE ST fu n ction may n ot be th e same as th e location at wh ich th e robot stops if th e motion of th e robot is in terru pted for some reason . For example, if th e RUN/HOLD bu tton on th e man u al con trol pen dan t is pressed, th e robot stops immediately, bu t DE ST still retu rn s th e location to wh ich th e robot was movin g. V+ Lan gu age Referen ce Gu ide Page 2 3 8 DE ST tran sformation fu n ction If a motion is n ot begu n becau se V+ realizes th e destin ation location can n ot be reach ed (for example, it is too far from th e robot), th en DE ST is n ot set to th e goal location . E xample Th e DE ST fu n ction is u sefu l, for example, for con tin u in g a motion th at h as been in terru pted by a reaction in itiated by a RE ACTI in stru ction . Th e su brou tin e au tomatically in voked can con tain steps su ch as th e followin g to process th e in terru ption an d resu me th e origin al motion . SET save = HERE SET old.dest = DEST old.speed = SPEED(3) DEPART 50.0 . . . APPRO save, 50.0 MOVES save SPEED old.speed MOVES old.dest ;Record where the robot is ;Record where the robot was going ;Record the current motion speed ;Back away a safe distance ;Return to the original motion path ;...back to where we left ;Restore the original motion speed ;Continue toward original destination Related Keywords HE RE tran sformation fu n ction #PDE ST precision -poin t fu n ction SE LE CT program in stru ction SE LE CT real-valu ed fu n ction V+ Lan gu age Referen ce Gu ide Page 2 3 9 DE TACH program in stru ction DETACH program instruction Syntax DETACH ( logical_ u n it) Function Release a specified device from th e con trol of th e application program. Usage Considerations Detach in g th e robot cau ses a BRE AK in con tin u ou s-path motion . DE TACH au tomatically forces an FCLOSE if a disk file or graph ics win dow is open on th e specified device. Th e robot is au tomatically attach ed to task 0 wh en th e E XE CUTE mon itor comman d or program in stru ction is processed to in itiate th at task an d th e DRY.RUN system switch is disabled. All th e oth er logical u n its are au tomatically detach ed wh en program execu tion begin s. (Oth er even ts th at cau se au tomatic detach men t are listed below.) Parameter logical_ u n it Option al real valu e, variable, or expression (in terpreted as an in teger) th at iden tifies th e device to be detach ed. (See th e ATTACH in stru ction for a description of logical u n it n u mbers.) Th e paren th eses can be omitted if th e logical u n it n u mber is omitted (cau sin g th e robot to be detach ed). Details Th is in stru ction releases th e specified device from con trol by th e application program. (No error is gen erated if th e device was n ot attach ed.) Con trol of th e specified device can be retu rn ed to th e program with th e ATTACH in stru ction . Wh en logical_ u n it is 0 (or is omitted), th e program releases con trol of th e robot. Wh ile th e robot is detach ed, robot power can be tu rn ed off an d on , th e man u al con trol pen dan t can be u sed to move th e robot, an d a differen t robot can be selected (if more th an on e robot is con n ected to th e system con troller). A delay of on e system cycle (1 6 ms) occu rs wh en a robot is detach ed. Th is is u sefu l for application s th at requ ire you to defin e wh ere th e robot sh ou ld be located for certain operation s. For su ch tasks a teach in g program can DE TACH th e robot an d th en ou tpu t direction s to you on th e system termin al or th e man u al con trol pen dan t. You can th en u se th e man u al con trol pen dan t to move th e robot to th e desired location s. Th e system V+ Lan gu age Referen ce Gu ide Page 2 4 0 DE TACH program in stru ction termin al or th e man u al con trol pen dan t can be u sed for acceptin g in pu t from you (th e latter can be read by u sin g th e PE NDANT fu n ction ). Wh en a disk logical u n it is detach ed, an y device th at was specified by th e correspon din g ATTACH in stru ction is forgotten . Th u s, a su bsequ en t ATTACH in stru ction mu st specify th e device again if th e defau lt device is n ot desired. Th e followin g even ts au tomatically DE TACH all th e logical u n its (except th e robot) from th e affected program task: l Processin g of th e E XE CUTE comman d an d in stru ction l Processin g of th e KILL comman d an d in stru ction l Processin g of th e ZE RO comman d l Normal completion of program execu tion Note, h owever, th at if a program termin ates execu tion " abn ormally" , all of its devices remain attach ed, except th at th e termin al an d th e man u al con trol pen dan t are detach ed. (Abn ormal termin ation of program execu tion refers to an y cau se oth er th an HALT or STOP in stru ction s.) If th e task is su bsequ en tly resu med, th e program au tomatically reattach es th e termin al an d man u al con trol pen dan t if th ey were attach ed before th e termin ation . NOTE: It is possible th at an oth er program task attach ed th e termin al or man u al con trol pen dan t in th e mean time. Th is resu lts in an error message wh en th e stopped task is restarted. DETACH DETACH (1) ;Release program control of the robot. ;Discontinue program control of the ;manual control pendant. Related Keyword ATTACH program in stru ction V+ Lan gu age Referen ce Gu ide Page 2 4 1 DE VICE program in stru ction DEVICE program instruction Syntax DEVI CE ( type, u n it, error, p1 , p2 , ...) ou t[i], in [j], ou t_ tran s, in _ tran s Function Sen d a comman d or data to an extern al device an d, option ally, retu rn data back to th e program. (Th e actu al operation performed depen ds on th e device referen ced.) Usage Considerations Th e syn tax con tain s option al parameters th at apply on ly to specific device types an d comman ds. V+ Lan gu age Referen ce Gu ide Page 2 4 2 DE VICE program in stru ction Parameters type Real valu e, variable, or expression (in terpreted as an in teger) th at in dicates th e type of device bein g referen ced. Th e followin g types are cu rren tly available: 0 = Belt en coder 1 = (Not u sed) 2 = Force Processor Board (for Adept u se on ly) 3 = Robot device (i.e., servo, for Adept u se on ly) 4 = Vision 5 = 1 3 9 4 bu s (for Adept u se on ly) u n it Real valu e, variable, or expression (in terpreted as an in teger) th at in dicates th e device u n it n u mber. Th e valu e mu st be in th e ran ge 0 to (max -1 ), wh ere max is th e maximu m n u mber of devices of th e specified type. Th e valu e sh ou ld be 0 if th ere is on ly on e device of th e given type. error Option al real variable th at receives a stan dard system error n u mber if th is in stru ction failed. If th is parameter is omitted, an y device error stops program execu tion . If th e error parameter is specified, th e program mu st explicitly ch eck it to detect errors. p1 , p2 , ... Option al real valu es, variables, or expression s, th e valu es of wh ich are sen t to th e device as part of th e comman d. Th e n u mber of parameters specified, an d th eir mean in gs, depen d u pon th e particu lar device type bein g accessed. ou t Option al real array th at con tain s data valu es th at are sen t to th e device as part of a comman d. Th e actu al data sen t depen ds u pon th e device type an d comman d bein g sen t to th e device. i Option al real valu e, variable, or expression (in terpreted as an in teger) th at in dicates th e first array elemen t to be con sidered in th e array ou t. E lemen t 0 is accessed first if n o in dex is specified. in Option al real array th at receives an y data valu es retu rn ed from th e device as th e resu lt of th e comman d. Th e actu al data retu rn ed depen ds u pon th e device type an d th e comman d. j Option al real valu e, variable, or expression (in terpreted as an in teger) th at in dicates th e first array elemen t to be filled in th e array in . E lemen t 0 is accessed first if n o in dex is specified. V+ Lan gu age Referen ce Gu ide Page 2 4 3 DE VICE program in stru ction ou t_ tran s Option al tran sformation variable, fu n ction , or compou n d tran sformation th at defin es a tran sformation valu e to be sen t to th e device as part of th e comman d. Th e actu al data sen t depen ds on th e device type an d th e comman d. in _ tran s Option al tran sformation variable th at receives a data valu e retu rn ed from th e device as th e resu lt of a comman d. Th e actu al data retu rn ed depen ds u pon th e device type an d th e comman d. Details DE VICE is a gen eral-pu rpose in stru ction for accessin g extern al devices. For more in formation an d examples, see th e section E xtern al E n coder Device in th e V+ Lan gu age User's Gu ide.) Related Keywords DE VICE real-valu ed fu n ction DE VICE S program in stru ction SE TDE VICE program in stru ction V+ Lan gu age Referen ce Gu ide Page 2 4 4 DE VICE real-valu ed fu n ction DEVICE real-valued function Syntax DEVI CE ( type, u n it,error, p1 , p2 ,...) Function Retu rn a real valu e from a specified device. Th e valu e may be data or statu s in formation , depen din g u pon th e device an d th e parameters. Usage Considerations Th e syn tax con tain s option al parameters th at may be u sefu l on ly for specific device types an d in formation requ ests. Parameters type Real valu e, variable, or expression (in terpreted as an in teger) th at in dicates th e type of device bein g referen ced. Th e followin g types are cu rren tly available: 0 = Belt en coder 1 = (Not u sed) 2 = Force Processor Board (for Adept u se on ly) 3 = Robot device (i.e., servo, for Adept u se on ly) 4 = Vision 5 = 1 3 9 4 bu s (for Adept u se on ly) u n it Real valu e th at in dicates th e device u n it n u mber. Th e valu e mu st be in th e ran ge 0 to (max -1 ), wh ere max is th e maximu m n u mber of devices of th e specified type. Th e valu e sh ou ld be 0 if th ere is on ly on e device of th e given type. error Option al real variable th at receives a stan dard system error n u mber, wh ich in dicates if th is fu n ction su cceeded or failed. If th is parameter is omitted, an y device error stops program execu tion . If error is specified, th e program mu st ch eck it to detect errors. p1 , p2 , ... Option al real valu es th at are sen t to th e device as part of th e requ est. Th e n u mber of valu es specified an d th e mean in gs of th e valu es depen d u pon th e particu lar device type. V+ Lan gu age Referen ce Gu ide Page 2 4 5 DE VICE real-valu ed fu n ction Details DE VICE is a gen eral-pu rpose fu n ction for retu rn in g data an d statu s in formation from extern al devices. For details an d examples see th e su pplemen tary docu men tation for specific devices. For in formation on u se of th e DE VICE fu n ction to access extern al en coders, see th e section E xtern al E n coder Device in th e V+ Lan gu age User's Gu ide. For systems equ ipped with AdeptVision , th e DE VICE in stru ction is u sed to con figu re vision system memory allocation an d frame bu ffer con figu ration . For details, see th e section Usin g Device with Vision in th e AdeptVision User's Gu ide. Related Keywords DE VICE program in stru ction DE VICE S program in stru ction SE TDE VICE program in stru ction V+ Lan gu age Referen ce Gu ide Page 2 4 6 DE VICE S program in stru ction DEVICES program instruction Syntax DEVI CES ( type, u n it, error, p1 , p2 , ...) $ ou t, $ in Function Sen d a comman d or data to an extern al device an d option ally retu rn data. Th e actu al operation performed depen ds on th e device referen ced. Usage Considerations Th e syn tax con tain s option al parameters th at may be u sefu l on ly for specific device types an d comman ds. V+ Lan gu age Referen ce Gu ide Page 2 4 7 DE VICE S program in stru ction Parameters type Real valu e, variable, or expression (in terpreted as an in teger) th at in dicates th e type of device bein g referen ced. Th e followin g types are cu rren tly available: 0 = Belt en coder 1 = (Not u sed) 2 = Force Processor Board (for Adept u se on ly) 3 = Robot device (i.e., servo, for Adept u se on ly) 4 = Vision 5 = 1 3 9 4 bu s (for Adept u se on ly) u n it Real valu e th at in dicates th e device u n it n u mber. Th e valu e mu st be in th e ran ge 0 to (max -1 ), wh ere max is th e maximu m n u mber of devices of th e specified type. Th e valu e sh ou ld be 0 if th ere is on ly on e device of th e given type. error Option al real variable th at receives a stan dard system error n u mber if th is in stru ction failed. If th is parameter is omitted, an y device error stops program execu tion . If th e error parameter is specified, th e program mu st ch eck it to detect errors. Th e valu e is n egative if th ere was an error. Oth erwise, th e positive valu e in dicates th e n u mber of data bytes th at were retu rn ed in th e $ in parameter. p1 , p2 , ... Option al real valu es th at are sen t to th e device as part of a comman d. Th e n u mber of valu es specified an d th e mean in gs of th e valu es depen d u pon th e particu lar device type. $ ou t Option al strin g expression , variable, or array th at defin es a strin g valu e to be sen t to th e device as part of th e comman d. Th e actu al data th at sh ou ld be sen t depen ds u pon th e device type an d th e comman d. Wh en th e $ ou t parameter is specified as an array, th e total len gth of th e strin g valu e mu st be less th an or equ al to 5 2 0 bytes. If an array is specified, an d n o in dex is specified, elemen t 0 is accessed first. $ in Option al strin g variable or array th at receives an y data valu es retu rn ed from a device as th e resu lt of th e comman d. Th e actu al data retu rn ed depen ds u pon th e device type an d th e comman d. Th e error variable receives th e n u mber of in pu t bytes retu rn ed. Wh en th e $ in parameter is specified as an array, u p to 5 1 2 bytes may be retu rn ed, packed in u p to fou r su ccessive strin g array elemen ts. V+ Lan gu age Referen ce Gu ide Page 2 4 8 DE VICE S program in stru ction If an array is specified, an d n o in dex is specified, elemen t 0 is accessed first. Details DE VICE S is a gen eral-pu rpose in stru ction for accessin g extern al devices. It is similar to th e DE VICE program in stru ction except th at data items are sen t an d received as strin gs rath er th an real valu es. NOTE: Similar to th e CALL an d CALLS in stru ction pair, th is in stru ction is a strin g-based version of th e DE VICE in stru ction . Th u s, th e n ame DE VICE S can be th ou gh t of as " device s" , rath er th an th e plu ral of " device" . For details an d examples see th e su pplemen tary docu men tation for specific devices. Related Keywords DE VICE program in stru ction DE VICE real-valu ed fu n ction SE TDE VICE program in stru ction V+ Lan gu age Referen ce Gu ide Page 2 4 9 DISABLE program in stru ction DISABLE program instruction Syntax DI S ABLE switch , ... , switch Function Tu rn off on e or more system con trol switch es. Usage Considerations If a specified switch accepts an in dex qu alifier an d th e in dex is zero or omitted (with or with ou t th e brackets), all th e elemen ts of th e switch array are en abled. Parameter switch Name of a system switch to be tu rn ed off. Th e n ame can be abbreviated to th e min imu m len gth th at u n iqu ely iden tifies th e switch . Th at is, for example, th e ME SSAGE S switch can be referred to with ME sin ce th ere is n o oth er switch with a n ame begin n in g with th e letters ME . Details System switch es con trol variou s aspects of th e operation of th e V+ system, in clu din g some option al su bsystems su ch as vision . Th e Switch en try in th e in dex for th is docu men t directs you to th e detailed description s of th ese switch es. Oth er system switch es are available wh en option s are in stalled. Refer to th e option docu men tation for details. For example, th e switch es associated with th e AdeptVision option s are described in th e AdeptVision docu men tation . Wh en a switch is disabled, or tu rn ed off, th e featu re it con trols is n o lon ger fu n ction al or available for u se. Tu rn in g a switch on with th e E NABLE mon itor comman d or program in stru ction makes th e associated featu re fu n ction al or available for u se. NOTE: Th e system switch es are sh ared by all th e program tasks. Th u s, care sh ou ld be exercised wh en mu ltiple tasks are disablin g an d en ablin g switch es-oth erwise, th e switch es may n ot be set correctly for on e or more of th e tasks. Disablin g th e DRY.RUN switch does n ot h ave an effect u n til th e n ext E XE CUTE comman d or in stru ction is processed for task #0 , an ATTACH in stru ction is execu ted for th e robot, or a CALIBRATE comman d or in stru ction is processed. V+ Lan gu age Referen ce Gu ide Page 2 5 0 DISABLE program in stru ction Th e SWITCH mon itor comman d or th e SWITCH real-valu ed fu n ction can be u sed to determin e th e statu s of a switch at an y time. Th e SWITCH program in stru ction can be u sed, like th e DISABLE in stru ction , to disable a switch . E xample DISABLE MESSAGES ;Turns off the MESSAGES switch. Related Keywords E NABLE mon itor comman d E NABLE program in stru ction SWITCH mon itor comman d SWITCH program in stru ction SWITCH real-valu ed fu n ction V+ Lan gu age Referen ce Gu ide Page 2 5 1 DISPLAY.CAME RA system parameter DISPLAY.CAMER A system parameter Syntax ... DI S PLAY.CAMERA Function Sets th e n u mber of camera valu es th at will be displayed wh en a PARAME TE R or SWITCH comman d is issu ed. Usage Considerations Th is parameter is available on ly if you r system is equ ipped with AdeptVision E VI, AdeptVision AVI, or AdeptVision sAVI. Details In AdeptVision you can h ave u p to 3 2 virtu al cameras. Con sequ en tly, most vision parameters an d switch es are arrays of 3 2 settin gs, wh ich can resu lt in u n desirable ou tpu t from PARAME TE R an d SWITCH comman ds wh en on ly a few virtu al cameras are bein g u sed. As a con ven ien ce to address th at, th e DISPLAY.CAME RA system parameter can be u sed to limit th e display to th e settin gs for on ly th e cameras of in terest. Th e DISPLAY.CAME RA system parameter sets th e n u mber of cameras (i.e., 1 th rou gh N) for wh ich parameter valu es an d switch settin gs will be displayed wh en a su bsequ en t PARAME TE R or SWITCH mon itor comman d is u sed to display th e settin gs of on e or more vision parameters or switch es, respectively. E xample Th e followin g mon itor comman d or in stru ction specifies th at su bsequ en t PARAME TE R an d SWITCH comman ds will display valu es for on ly virtu al cameras 1 th rou gh 4 . PARAMETER DISPLAY.CAMERA = 4 Related Keywords PARAME TE R mon itor comman d SWITCH mon itor comman d V+ Lan gu age Referen ce Gu ide Page 2 5 2 DISTANCE real-valu ed fu n ction DISTANCE real-valued function Syntax DI S TANCE ( location _ 1 , location _ 2 ) Function Determin e th e distan ce between th e poin ts defin ed by two location valu es. Parameter location _ 1 Tran sformation valu e th at defin es th e first poin t of in terest. Th is can be a fu n ction , a variable, or a compou n d tran sformation . location _ 2 Tran sformation valu e th at defin es th e secon d poin t of in terest. Th is can be a fu n ction , a variable, or a compou n d tran sformation . Details Retu rn s th e distan ce in millimeters between th e poin ts defin ed by th e two specified location s. Th e order in wh ich th e location s are specified does n ot matter. Also, th e orien tation s defin ed by th e location s h ave n o effect on th e valu e retu rn ed. E xample Th e statemen t x = DISTANCE(HERE, part) sets th e valu e of th e real variable x to be th e distan ce between wh ere th e robot tool poin t is cu rren tly located an d th e poin t defin ed by th e tran sformation part. Related Keyword IDE NTICAL real-valu ed fu n ction V+ Lan gu age Referen ce Gu ide Page 2 5 3 DN.RE START program in stru ction DN.R ESTAR T program instruction Syntax DN.RES TART Function Restarts DeviceNet commu n ication if th e Can Bu s goes offlin e. Details Th e V+ DeviceNet in terface goes offlin e if you discon n ect it from th e actu al n etwork or if too man y errors occu r du rin g operation . DN.RE START forces V+ to rein itialize th e DeviceNet in terface as if you rebooted you r system. Related Keywords DE VICE NE T mon itor comman d DN.RE START mon itor comman d V+ Lan gu age Referen ce Gu ide Page 2 5 4 DN.THROTTLE system parameter DN.THR OTTLE system parameter Syntax ... DN.THROTTLE Function Th is parameter limits th e n u mber of n odes th at are polled by th e SmartCon troller DeviceNet driver du rin g each scan in terval. NOTE: Th is parameter h as n o effect on AWC-based systems. Parameters poll_ cou n t Th e maximu m n u mber of DeviceNet n odes th at are polled du rin g each 8 -millisecon d scan in terval. Defau lt valu e: 3 2 Min imu m: 1 Maximu m: 64 Details If you set th e poll_ cou n t greater th an or equ al to th e n u mber of DeviceNet n odes on you r n etwork, V+ will attempt to sen d a poll requ est to all th e n odes every scan in terval. Th is pollin g may u se more CPU time th an desired. To in crease th e available CPU time, specify a lower valu e wh ich forces th e pollin g to be spread over mu ltiple 8 -millisecon d cycles. Revision History V+ Release Modification version 1 6 .1 Added th e DN.THROTTLE system parameter. V+ Lan gu age Referen ce Gu ide Page 2 5 5 DO program in stru ction DO program instruction Syntax DO Function In trodu ce a DO program stru ctu re. Usage Considerations Th e DO program stru ctu re mu st be con clu ded with an UNTIL in stru ction . Details Th e DO stru ctu re provides a way to con trol th e execu tion of a grou p of in stru ction s based on a con trol expression . Th e syn tax for th e DO stru ctu re is as follows: DO group_of_steps UNTIL logical_expression Processin g of th e DO stru ctu re can be described as follows: 1 . Th e grou p of in stru ction steps is execu ted. 2 . Th e logical expression is evalu ated. If th e resu lt is FALSE , retu rn to item 1 . Oth erwise, proceed to item 3 . 3 . Program execu tion con tin u es at th e first in stru ction after th e UNTIL step. Wh en th is stru ctu re is u sed, it is assu med th at some action occu rs with in th e grou p of en closed in stru ction s th at ch an ges th e resu lt of th e logical expression from TRUE to FALSE wh en th e stru ctu re sh ou ld be exited. Altern ately, logical_ expression can be replaced with an expression th at evalu ates th e state of a digital I/O sign al (see example). Note th at th e grou p of in stru ction s with in th e DO stru ctu re is always execu ted at least on e time. (Th e WHILE stru ctu re differs in th at respect.) Th ere do n ot n eed to be an y in stru ction s between th e DO an d UNTIL in stru ction s. Wh en th ere are n o su ch in stru ction s, th e UNTIL criterion is con tin u ou sly evalu ated u n til it is satisfied, at wh ich time program execu tion con tin u es with th e in stru ction s followin g th e UNTIL in stru ction . E xample Th e followin g example u ses a DO stru ctu re to con trol a task th at in volves movin g parts from on e place to an oth er. Th e sequ en ce assu mes th at th e digital sign al lin e bu ffer.fu ll ch an ges to V+ Lan gu age Referen ce Gu ide Page 2 5 6 DO program in stru ction th e on state wh en th e parts bu ffer becomes fu ll. (Th e robot sh ou ld th en perform a differen t sequ en ce of motion s.) . . DO CALL get.part() CALL put.part() UNTIL SIG(buffer.full) . . Related Keywords DO mon itor comman d E XIT program in stru ction NE XT program in stru ction UNTIL program in stru ction WHILE program in stru ction V+ Lan gu age Referen ce Gu ide Page 2 5 7 DOS program in stru ction DOS program instruction Syntax DOS strin g, error Function E xecu te a program in stru ction defin ed by a strin g expression . Usage Considerations Before th e in stru ction is execu ted, th e strin g mu st be tran slated from ASCII in to th e in tern al represen tation u sed by V+. Th u s, th e in stru ction execu tes mu ch more slowly th an a n ormal program in stru ction . Th e strin g can n ot defin e a declaration statemen t or most of th e con trol stru ctu re statemen ts. Th e DOS in stru ction is ign ored if th e strin g defin es a commen t lin e or a blan k lin e. Parameters strin g Strin g con stan t, variable, or expression th at defin es th e program in stru ction to be execu ted. Th e in stru ction may con tain a label field (wh ich is ign ored) an d may be followed by a stan dard commen t field. Leadin g an d trailin g spaces an d tabs are ign ored. error Option al real variable th at receives an y parsin g or execu tion error gen erated by th e in stru ction . Th e valu e is set to 1 if th e in stru ction su cceeds. If th e in stru ction fails, a stan dard V+ error n u mber is retu rn ed. If th is parameter is omitted an d an error occu rs, execu tion of th e program stops an d th e appropriate error message is displayed. Details Th e DOS (DO Strin g) in stru ction provides a mean s for modifyin g a program on th e fly. Th at is, th e embedded program in stru ction , wh ich is defin ed by a strin g expression , is execu ted as th ou gh it h ad been en tered in th e program as a n ormal in stru ction . Th e in stru ction execu tes in th e con text of th e cu rren t program. Th u s, an y su brou tin e argu men t, au tomatic variable, or local variable can be accessed. If a variable referen ced in th e in stru ction is n ot fou n d in th e cu rren t program con text, th e variable is assu med to be global. An y n ew variables th at are created by th e in stru ction (for V+ Lan gu age Referen ce Gu ide Page 2 5 8 DOS program in stru ction example, in an assign men t statemen t) are created as globals. Normal variable type ch eckin g is performed, an d errors are gen erated if th ere are type con flicts. Th e sin gle-lin e con trol statemen ts GOTO, IF ... GOTO, CALL, an d CALLS are allowed an d execu te n ormally. Th e mu ltilin e con trol stru ctu res (for example, CASE ... E ND, IF ... E LSE ... E ND) can n ot be execu ted by th e DOS in stru ction . E xamples DOS "var = 123" Cau ses th e variable var to be assign ed th e valu e 1 2 3 . If var is u n defin ed, a n ew global variable n amed var is created. An y errors cau se th e program to stop execu tin g. DOS $ins, status Cau ses th e in stru ction con tain ed in th e strin g variable $ in s to be execu ted. If an error occu rs, a V+ error code is placed in th e real variable statu s an d execu tion con tin u es. Related Keywords DO mon itor comman d MCS program in stru ction V+ Lan gu age Referen ce Gu ide Page 2 5 9 DRIVE program in stru ction DR IVE program instruction Syntax DRI VE join t, ch an ge, speed Function Move an in dividu al join t of th e robot. Usage Considerations Th e DRIVE in stru ction can be execu ted by an y program task as lon g as th e task h as attach ed a robot. Th e in stru ction applies to th e robot selected by th e task. If th e V+ system is n ot con figu red to con trol a robot, execu tin g th e DRIVE in stru ction cau ses an error. If th e AMOVE in stru ction h as been execu ted to prepare for motion of an extra axis, execu tion of th e DRIVE in stru ction can cels th e effect of th e AMOVE in stru ction . Parameters join t Nu mber of th e robot join t to be moved. Th is can be specified by a con stan t, a variable, or an expression . ch an ge Th e ch an ge desired in th e join t position . Th is can be specified by a con stan t, a variable, or an expression . Th e valu e can be positive or n egative. Th e valu e is in terpreted in th e u n its u sed to measu re th e join t position . Th at is, a ch an ge for a rotary join t mu st be th e n u mber of degrees th e join t is to move; a ch an ge for a lin ear join t mu st specify th e n u mber of millimeters to move. speed Th e temporary program speed to be u sed for th e motion , con sidered as a percen tage of th e cu rren t mon itor speed settin g. Again , th is can be specified by a con stan t, a variable, or an expression . Details Operates th e sin gle specified robot join t, ch an gin g its position by ch an ge amou n t (in degrees or millimeters). Th e join t n u mber, join t, can be 1 , 2 , ..., n , wh ere n is th e n u mber of join ts th e robot h as. Th e speed of th e motion is govern ed by a combin ation of th e speed given in th is in stru ction an d th e mon itor SPE E D settin g. Th at is, th e regu lar program speed settin g is n ot u sed. (See V+ Lan gu age Referen ce Gu ide Page 2 6 0 DRIVE program in stru ction th e SPE E D mon itor comman d an d th e SPE E D program in stru ction for explan ation s of motion speeds.) Th e du ration settin g establish ed by th e DURATION in stru ction also affects th e execu tion time of th e motion . E xample Ch an ge th e an gle of join t 2 by drivin g th e join t 6 2 .4 degrees in th e n egative direction at a speed of 7 5 % of th e mon itor speed: DRIVE 2,-62.4,75 Related Keywords SE LE CT program in stru ction SE LE CT real-valu ed fu n ction V+ Lan gu age Referen ce Gu ide Page 2 6 1 DRY.RUN system switch DR Y.R UN system switch Syntax ... DRY.RUN Function Con trol wh eth er or n ot V+ commu n icates with th e robot. Usage Considerations Th e DRY.RUN switch can be en abled or disabled by an application program, bu t th e n ew settin g of th e switch does n ot take effect u n til th e n ext time an y of th e followin g even ts occu r: 1 . An E XE CUTE comman d or in stru ction is processed for task #0 2 . Th e robot is attach ed with an ATTACH in stru ction 3 . A CALIBRATE comman d or in stru ction is processed Before an application program ch an ges th e settin g of th e DRY.RUN switch , th e program mu st h ave th e robot detach ed. Oth erwise, an error resu lts wh en th e attempt is made to ch an ge th e switch settin g. Details Th is system switch can be u sed to stop V+ from sen din g motion comman ds to th e robot an d expectin g position in formation back from th e robot. Th u s, wh en th e system is in DRY.RUN mode, application programs can be execu ted to test for su ch th in gs as proper logical flow an d correct extern al commu n ication with ou t h avin g to worry abou t th e robot ru n n in g in to someth in g. (Also see th e TRACE system switch .) Th e man u al con trol pen dan t can still be u sed to con trol th e robot wh ile th e system is in DRY.RUN mode. Th e DRY.RUN switch is sampled wh en ever a robot is attach ed. (Note th at task #0 attempts to attach th e robot wh en program execu tion begin s or is resu med.) Th e DRY.RUN settin g for a task can be ch an ged du rin g execu tion by DE TACHin g th e robot, ch an gin g DRY.RUN, an d th en ATTACHin g th e robot. NOTE: Do n ot allow mu ltiple tasks to ch an ge DRY.RUN simu ltan eou sly, sin ce th e DRY.RUN state can th en be differen t from th at expected. You r programs sh ou ld u se a software in terlock in th is case. Th e DRY.RUN switch is in itially disabled. W ARNI NG: Digital an d an alog I/O is n ot affected by DRY.RUN, so extern al devices driven by an alog or digital ou tpu t in stru ction s still operate. V+ Lan gu age Referen ce Gu ide Page 2 6 2 DRY.RUN system switch Related Keywords DISABLE mon itor comman d E NABLE mon itor comman d SWITCH mon itor comman d SWITCH program in stru ction SWITCH real-valu ed fu n ction V+ Lan gu age Referen ce Gu ide Page 2 6 3 DURATION program in stru ction DUR ATION program instruction Syntax DURATI ON time ALWAYS Function Set th e min imu m execu tion time for su bsequ en t robot motion s. Usage Considerations Un less th e ALWAYS parameter is specified, on ly th e n ext robot motion is affected. DURATION 0 ALWAYS is assu med wh en ever program execu tion is in itiated an d wh en a n ew execu tion cycle begin s. Th e DURATION in stru ction affects th e DRIVE in stru ction bu t n ot th e DE LAY in stru ction . Th e settin g of th e mon itor SPE E D comman d affects th e resu lts of th e DURATION settin g. Th e DURATION in stru ction can be execu ted by an y program task as lon g as th e robot selected by th e task is n ot attach ed by an y oth er task. Th e in stru ction applies to th e robot selected by th e task. If th e V+ system is n ot con figu red to con trol a robot, execu tin g th e DURATION in stru ction cau ses an error. Parameters time Real-valu ed expression th at specifies th e min imu m len gth of time (in secon ds) th at su bsequ en t robot motion s take to perform (see below). If th e valu e is zero, robot motion s are performed with ou t con sideration of th eir time du ration an d u se on ly th e applicable valu es for SPE E D an d ACCE L. ALWAYS Option al keyword th at determin es h ow lon g th e n ew du ration will h ave an effect. If ALWAYS is in clu ded, th e specified du ration time applies to all su bsequ en t robot motion s (u n til th e du ration settin g is ch an ged by an oth er DURATION in stru ction ). Th e specified du ration applies on ly to th e n ext robot motion if ALWAYS is n ot in clu ded. V+ Lan gu age Referen ce Gu ide Page 2 6 4 DURATION program in stru ction Details Th is in stru ction sets th e min imu m execu tion time for su bsequ en t robot motion s. For an y motion , th e time specified by th e DURATION in stru ction h as n o effect if th e du ration settin g is less th an th e time compu ted by th e V+ robot-motion trajectory gen erator (con siderin g th e cu rren t motion speed an d acceleration settin gs). However, if th e du ration is lon ger th an th e time compu ted by th e trajectory gen erator, th e motion is slowed so th at its elapsed time correspon ds approximately to th e specified du ration . NOTE: Actu al motion times may differ sligh tly from th e du ration settin g du e to qu an tization effects an d du e to acceleration an d deceleration profilin g. Th e du ration in stru ction does n ot specify th e du ration of an en tire motion bu t in stead specifies th e min imu m time of th e con stan t-velocity segmen t plu s on e-h alf th e acceleration an d deceleration segmen ts. In th is way, con tin u ou s-path motion s (in wh ich in dividu al motion s are blen ded togeth er) get th e correct du ration , bu t a sin gle motion takes lon ger th an th e specified du ration . In oth er words, th e time of motion is primarily defin ed eith er by th e valu e of DURATION or SPE E D, u sin g wh ich ever valu e gives th e lon ger time. Th is in stru ction is very u sefu l. Con sider, for example, a situ ation wh ere th e valu e of a periodic, extern al sign al is employed to con tin u ou sly correct th e path of th e robot wh ile th e robot is movin g. Th e DURATION in stru ction can be u sed to match th e motion execu tion time to th e sen sor samplin g rate an d processin g time. Th is en su res th at th e robot is kept in motion wh ile n ew in formation is bein g processed. A sample program of th is type is sh own later. E xample Th e followin g example reads an extern al sen sor an d moves to th e compu ted robot location . Th is sequ en ce is repeated 2 0 times at in tervals of 9 6 millisecon ds (6 /TPS secon ds). Th is assu mes th e defau lt period (tick) of 1 6 millisecon ds for th e V+ trajectory gen erator. Note th at th e motion speed is set to a very large valu e to make su re th e motion is paced by th e du ration settin g. DURATION 6/TPS ALWAYS SPEED 200 ALWAYS FOR i = 1 TO 20 CALL read.signal(loc) MOVE loc END ;Each motion to be 6 ticks long ;Motion time determined primarily ;by DURATION, not SPEED ;Repeat 20 times... ;Get new step from sensor ;Move to the location Related Keywords ACCE L program in stru ction DE LAY program in stru ction DURATION real-valu ed fu n ction V+ Lan gu age Referen ce Gu ide Page 2 6 5 DURATION program in stru ction SE LE CT program in stru ction SE LE CT real-valu ed fu n ction SPE E D mon itor comman d SPE E D program in stru ction V+ Lan gu age Referen ce Gu ide Page 2 6 6 DURATION real-valu ed fu n ction DUR ATION real-valued function Syntax DURATI ON ( select) Function Retu rn th e cu rren t settin g of on e of th e motion DURATION specification s. Usage Considerations Th e DURATION fu n ction retu rn s in formation for th e robot selected by th e task execu tin g th e fu n ction . If th e V+ system is n ot con figu red to con trol a robot, th e DURATION fu n ction does n ot gen erate an error du e to th e absen ce of a robot. However, th e in formation retu rn ed by th e fu n ction may n ot be mean in gfu l. Parameter select Real-valu ed expression wh ose valu e determin es wh ich du ration valu e sh ou ld be retu rn ed (see below). Details Th is fu n ction retu rn s th e u ser-specified min imu m robot motion du ration (in secon ds) correspon din g to th e select parameter valu e. (See th e description of th e DURATION program in stru ction for an explan ation of th e specification of motion du ration times.) Differen t select valu es determin e wh en th e du ration time retu rn ed applies, as listed below. (All oth er valu es for th e select parameter are con sidered in valid.) select DURATI ON valu e retu rn ed 2 Perman en t min imu m robot motion du ration (set by a DURATION ... ALWAYS program in stru ction ) 3 Temporary motion du ration for th e cu rren t or last motion 4 Temporary motion du ration to be u sed for th e n ext motion V+ Lan gu age Referen ce Gu ide Page 2 6 7 DURATION real-valu ed fu n ction Related Keywords CONFIG real-valu ed fu n ction DURATION program in stru ction SE LE CT program in stru ction SE LE CT real-valu ed fu n ction V+ Lan gu age Referen ce Gu ide Page 2 6 8 DX, DY, DZ real-valu ed fu n ction DX, DY, DZ real-valued function Syntax DX ( location ) DY ( location ) DZ ( location ) Function Retu rn a displacemen t compon en t of a given tran sformation valu e. Parameter location Tran sformation valu e from wh ich a compon en t is desired. Th is can be a fu n ction , a variable, or a compou n d tran sformation . Details Th ese th ree fu n ction s retu rn th e respective displacemen t compon en ts of th e specified tran sformation valu e. NOTE: Th e DE COMPOSE in stru ction can also be u sed to obtain th e displacemen t compon en ts of a tran sformation valu e. If th e rotation compon en ts are desired, th at in stru ction mu st be u sed. DE COMPOSE is more efficien t if more th an on e elemen t is n eeded an d th e location is a compou n d tran sformation . E xample Con sider a tran sformation start with th e followin g compon en ts: 125, 250, -50, 135, 50, 75 Th e followin g fu n ction referen ces will th en yield th e in dicated valu es: DX(start) DY(start) DZ(start) ;Returns 125.00 ;Returns 250.00 ;Returns -50.00 Related Keywords DE COMPOSE program in stru ction RX tran sformation fu n ction RY tran sformation fu n ction V+ Lan gu age Referen ce Gu ide Page 2 6 9 DX, DY, DZ real-valu ed fu n ction RZ tran sformation fu n ction V+ Lan gu age Referen ce Gu ide Page 2 7 0 DX, DY, DZ real-valu ed fu n ction DX, DY, DZ real-valued function Syntax DX ( location ) DY ( location ) DZ ( location ) Function Retu rn a displacemen t compon en t of a given tran sformation valu e. Parameter location Tran sformation valu e from wh ich a compon en t is desired. Th is can be a fu n ction , a variable, or a compou n d tran sformation . Details Th ese th ree fu n ction s retu rn th e respective displacemen t compon en ts of th e specified tran sformation valu e. NOTE: Th e DE COMPOSE in stru ction can also be u sed to obtain th e displacemen t compon en ts of a tran sformation valu e. If th e rotation compon en ts are desired, th at in stru ction mu st be u sed. DE COMPOSE is more efficien t if more th an on e elemen t is n eeded an d th e location is a compou n d tran sformation . E xample Con sider a tran sformation start with th e followin g compon en ts: 125, 250, -50, 135, 50, 75 Th e followin g fu n ction referen ces will th en yield th e in dicated valu es: DX(start) DY(start) DZ(start) ;Returns 125.00 ;Returns 250.00 ;Returns -50.00 Related Keywords DE COMPOSE program in stru ction RX tran sformation fu n ction RY tran sformation fu n ction V+ Lan gu age Referen ce Gu ide Page 2 7 1 DX, DY, DZ real-valu ed fu n ction RZ tran sformation fu n ction V+ Lan gu age Referen ce Gu ide Page 2 7 2 DX, DY, DZ real-valu ed fu n ction DX, DY, DZ real-valued function Syntax DX ( location ) DY ( location ) DZ ( location ) Function Retu rn a displacemen t compon en t of a given tran sformation valu e. Parameter location Tran sformation valu e from wh ich a compon en t is desired. Th is can be a fu n ction , a variable, or a compou n d tran sformation . Details Th ese th ree fu n ction s retu rn th e respective displacemen t compon en ts of th e specified tran sformation valu e. NOTE: Th e DE COMPOSE in stru ction can also be u sed to obtain th e displacemen t compon en ts of a tran sformation valu e. If th e rotation compon en ts are desired, th at in stru ction mu st be u sed. DE COMPOSE is more efficien t if more th an on e elemen t is n eeded an d th e location is a compou n d tran sformation . E xample Con sider a tran sformation start with th e followin g compon en ts: 125, 250, -50, 135, 50, 75 Th e followin g fu n ction referen ces will th en yield th e in dicated valu es: DX(start) DY(start) DZ(start) ;Returns 125.00 ;Returns 250.00 ;Returns -50.00 Related Keywords DE COMPOSE program in stru ction RX tran sformation fu n ction RY tran sformation fu n ction V+ Lan gu age Referen ce Gu ide Page 2 7 3 DX, DY, DZ real-valu ed fu n ction RZ tran sformation fu n ction V+ Lan gu age Referen ce Gu ide Page 2 7 4 E LSE program in stru ction ELSE program instruction Syntax ELS E Function Separate th e altern ate grou p of statemen ts in an IF ... THE N con trol stru ctu re. Usage Considerations E LSE can be u sed on ly with in an IF ... THE N ... E LSE ... E ND con trol stru ctu re. Details Marks th e en d of a grou p of statemen ts to be execu ted if th e valu e of th e logical expression in an IF logical_ expr THE N con trol stru ctu re is n on zero, an d th e start of th e grou p of statemen ts to be execu ted if th e valu e is zero. Related Keyword IF ... THE N program in stru ction V+ Lan gu age Referen ce Gu ide Page 2 7 5 E NABLE program in stru ction ENABLE program instruction Syntax ENABLE switch , ..., switch Function Tu rn on on e or more system con trol switch es. Usage Considerations Th e E NABLE mon itor comman d can be u sed wh en a program is execu tin g. If a specified switch accepts an in dex qu alifier an d th e in dex is zero or omitted (with or with ou t th e brackets), all th e elemen ts of th e switch array are en abled. Parameter switch Name of a system switch to be tu rn ed on . Th e n ame can be abbreviated to th e min imu m len gth th at u n iqu ely iden tifies th e switch . Th at is, for example, th e ME SSAGE S switch can be referred to with ME , sin ce th ere is n o oth er switch with a n ame begin n in g with th e letters ME . Details System switch es con trol variou s aspects of th e operation of th e V+ system, in clu din g some option al su bsystems su ch as vision . Th e Switch en try in th e in dex for th is docu men t directs you to th e detailed description s of th ese switch es. Oth er system switch es are available wh en option s are in stalled. Refer to th e option docu men tation for details. For example, th e switch es associated with th e AdeptVision option s are described in th e AdeptVision User's Gu ide. Wh en a switch is en abled, or tu rn ed on , th e featu re it con trols is fu n ction al an d available for u se. Tu rn in g a switch off with th e DISABLE mon itor comman d or program in stru ction makes th e associated featu re n ot fu n ction al or available for u se. NOTE: Th e system switch es are sh ared by all th e program tasks. Th u s, care sh ou ld be exercised wh en mu ltiple tasks are disablin g an d en ablin g switch es. Oth erwise, th e switch es may n ot be set correctly for on e or more of th e tasks. Disablin g th e DRY.RUN switch does n ot h ave an effect u n til th e n ext E XE CUTE comman d or in stru ction is processed for task #0 , an ATTACH in stru ction is execu ted for th e robot, or a CALIBRATE comman d or in stru ction is processed. V+ Lan gu age Referen ce Gu ide Page 2 7 6 E NABLE program in stru ction Th e SWITCH mon itor comman d or th e SWITCH real-valu ed fu n ction can be u sed to determin e th e statu s of a switch at an y time. Th e SWITCH program in stru ction can be u sed, like th e E NABLE in stru ction , to set a switch . E xample ENABLE MESSAGES ;Turns on the MESSAGES switch. Related Keywords DISABLE mon itor comman d DISABLE program in stru ction SWITCH mon itor comman d SWITCH program in stru ction SWITCH real-valu ed fu n ction V+ Lan gu age Referen ce Gu ide Page 2 7 7 $ E NCODE strin g fu n ction $ENCODE string function Syntax $ ENCODE ( ou tpu t_ specification , ou tpu t_ specification , ...) Function Retu rn a strin g created from ou tpu t specification s. Th e strin g produ ced is similar to th e ou tpu t of a TYPE in stru ction . Parameter An ou tpu t specification can con sist of an y of th e followin g compon en ts (in an y order) separated by commas: 1 . A strin g expression . 2 . A real-valu ed expression , wh ich is evalu ated to determin e a valu e to be displayed. 3 . Format-con trol in formation , wh ich determin es th e format of th e ou tpu t message. Details Th is fu n ction makes strin gs n ormally produ ced by th e TYPE in stru ction available with in a program. Th at is, $ E NCODE does n ot gen erate an y ou tpu t bu t, rath er, creates a strin g valu e. Th e followin g format specifiers can be u sed to con trol th e display of n u meric valu es. Th ese settin gs remain in effect for th e remain der of th e fu n ction parameter list u n less an oth er specifier is u sed. For all th ese specifiers, if a valu e is too large to be displayed in th e given field width , th e field is filled with asterisk ch aracters (* ). /D Use th e defau lt format, wh ich is equ ivalen t to /G1 5 .8 (see below), except trailin g zeros an d all bu t on e leadin g space are omitted. Th e followin g format specification s accept a zero as th e width field. Th is cau ses th e actu al field size to vary to fit th e valu e an d all leadin g spaces to be su ppressed. Th is is u sefu l wh en a valu e is displayed with in a lin e of text or at th e en d of a lin e. /E n .m Format valu es in scien tific n otation (for example, 1 .2 3 4 E +2 ) in fields n spaces wide with m digits in th e fraction al parts. (If n is n ot 0 , its valu e mu st be at least five larger th an th e valu e of m.) V+ Lan gu age Referen ce Gu ide Page 2 7 8 $ E NCODE strin g fu n ction /Fn .m Format valu es in fixed-poin t n otation (for example, 1 2 3 .4 ) in fields n spaces wide, with m digits in th e fraction al parts. /Gn .m Format valu es in F format with m digits in th e fraction al parts if th at can be don e in fields n spaces wide. Oth erwise u se /E n .m format. /Hn Format valu es as h exadecimal in tegers in fields n spaces wide. /In Format valu es as decimal in tegers in fields n spaces wide. /On Format valu es as octal in tegers in fields n spaces wide. Th e followin g specifiers can be u sed to in sert special ch aracters in th e strin g: /Cn In clu de th e ch aracters carriage retu rn (CR) an d lin e feed (LF) n times. If th e strin g resu ltin g from th e $ E NCODE fu n ction is ou tpu t to th e termin al, th is resu lts in n blan k lin es if th e con trol specifier is at th e begin n in g or en d of th e fu n ction parameter list; oth erwise, n -1 blan k lin es resu lt. /Un In clu de th e ch aracters n ecessary to move th e cu rsor u p n lin es if th e resu ltin g strin g is ou tpu t to th e termin al. (Th is works correctly on ly if th e TE RMINAL parameter is correctly set for th e termin al bein g u sed.) /Xn In clu de n spaces. /B In clu de a ch aracter th at beeps th e termin al if th e resu ltin g strin g is ou tpu t to th e termin al. E xample Th e program statemen t: $output = $output+$ENCODE(/F6.2, count) adds a formatted represen tation of th e valu e of cou n t to th e strin g con tain ed in $ ou tpu t. V+ Lan gu age Referen ce Gu ide Page 2 7 9 $ E NCODE strin g fu n ction Th e $ E NCODE fu n ction provides a way of addin g format con trol to th e ou tpu t from PROMPT in stru ction s. Th is is sh own by th e followin g example, in wh ich th e valu e of motor is displayed as part of th e prompt message to you . PROMPT $ENCODE(/B,"Start motor #",/I0,motor," (Y/N)? "), $answer Th is PROMPT in stru ction beeps th e termin al (/B), an d displays th e followin g u ser prompt wh en th e valu e of motor is 3 : Start motor #3 (Y/N)? Related Keyword TYPE program in stru ction V+ Lan gu age Referen ce Gu ide Page 2 8 0 E ND program in stru ction END program instruction Syntax END Function Mark th e en d of a con trol stru ctu re. Usage Considerations E very E ND in stru ction mu st be part of a CASE , FOR, IF, or WHILE con trol stru ctu re. Details E very CASE , FOR, IF, an d WHILE con trol stru ctu re mu st h ave its en d marked by an E ND in stru ction . Th e V+ editor displays an error message wh en program editin g is exited if th e correct n u mber of E ND in stru ction s do n ot exist in a program (th at is, if th ere are too few or too man y). Related Keywords CASE program in stru ction FOR program in stru ction IF ... THE N program in stru ction WHILE program in stru ction V+ Lan gu age Referen ce Gu ide Page 2 8 1 .E ND keyword .END keyword Syntax .END Function Mark th e en d of a V+ program. Usage Considerations Th e V+ editors au tomatically add th is lin e to th e en d of every program. Details Normally, you will n ot n eed to con cern you rself with th e .E ND step of programs-it is created au tomatically by th e V+ editors. Th e on ly time you will see th is step wh ile workin g with th e V+ system is wh en you issu e a LISTP mon itor comman d. Th en you will see an .E ND step as th e last step of each program. Th e .E ND is importan t, h owever, wh en a program is created on an oth er compu ter for tran sfer to a V+ system. In th at case, th e programmer mu st be su re to in clu de a lin e startin g with .E ND at th e en d of each program (th e remain der of th e lin e is ign ored by V+). Programs missin g th e .E ND in stru ction do n ot load correctly in to th e V+ system. Related Keyword .PROGRAM program in stru ction V+ Lan gu age Referen ce Gu ide Page 2 8 2 E RROR real-valu ed fu n ction ER R OR real-valued function Syntax ERROR ( sou rce, select) Function Retu rn th e error n u mber of a recen t error th at cau sed program execu tion to stop or cau sed a RE ACTE reaction . Usage Considerations E xecu tin g a RE ACTE statemen t clears an y errors for th e cu rren t task an d preven ts th e E RROR fu n ction from retu rn in g errors as expected. A FIFO bu ffer is available th at receives all asyn ch ron ou s errors th at occu r from th e time an en able power requ est is issu ed (u sin g E NABLE POWE R or th e MCP) u n til power is disabled for an y reason . Th e FIFO is accessed u sin g th e E RROR( ) real-valu ed fu n ction . Th e asyn ch ron ou s FIFO is n ot valid wh ile th e robot is in th e power-down in itialization state. User programs sh ou ld wait u n til STATE (1 ) <> 0 before callin g E RROR( ) with a sou rce parameter > 1 0 0 0 . V+ Lan gu age Referen ce Gu ide Page 2 8 3 E RROR real-valu ed fu n ction Parameters sou rce Real valu e, variable, or expression (in terpreted as an in teger) wh ose valu e selects th e sou rce of th e error code as follows: -2 Retu rn addition al error code for cu rren t robot. E RROR(-2 , 0 ) retu rn s th e stan dard V+ error n u mber. E RROR(-2 , 1 ) retu rn s th e motor mask for th e cu rren t robot. Th is bit mask in dicates th e motor(s) referen ced for th e error n u mber retu rn ed by th e in stru ction E RROR(-2 ,0 ). Th e LSB in dicates motor 1 , etcetera. If th e E RROR(-2 , 1 )=0 , th e error is n ot associated with a specific motor. -1 Retu rn th e n u mber of th e most recen t error from th e program in wh ich th e E RROR fu n ction is execu ted. 0 Retu rn th e n u mber of th e most recen t error from th e program execu tin g as task #0 . 0 < sou rce ≤ 2 7 Retu rn th e n u mber of th e most recen t error from th e program execu tin g as th e correspon din g task n u mber. 1 0 0 1 < sou rce < 1 0 2 1 Asyn ch ron ou s FIFO elemen t n -1 0 0 0 , wh ere n equ als 1 Most recen t item 2 Next older item, etc. Retu rn s 0 if n o more FIFO elemen ts exist. Valid select parameter valu es for th e FIFO are 0 , 1 , an d 3 . Th e asyn ch ron ou s FIFO is n ot valid wh ile th e robot is in power-down in itialization state. User programs sh ou ld wait u n til STATE (1 ) retu rn s a n on zero valu e before u sin g E RROR() with sou rce > 1 0 0 0 . select Option al real valu e, variable, or expression (in terpreted as an in teger) th at selects th e error in formation to be retu rn ed. (Th e valu e 0 is assu med if th is parameter is omitted.) 0 Retu rn th e error n u mber of th e most recen t program execu tion error (exclu din g I/O errors-see IOSTAT) for th e V+ Lan gu age Referen ce Gu ide Page 2 8 4 E RROR real-valu ed fu n ction specified program task. specified program task. specified program task. 1 If th e most recen t error (for th e specified program task) h ad an error code in th e ran ge -1 1 0 0 to -1 1 9 9 , retu rn th e variable part of th e correspon din g error message as a n u meric valu e. If th e most recen t error h ad an error code in th e ran ge -1 0 0 0 to -1 0 9 9 , retu rn th e variable portion of th e correspon din g error message as a bit mask in dicatin g th e join ts or motors to wh ich th e error applies. Zero is retu rn ed if th e error did n ot h ave a variable portion in its message. (Also see select = 3 below.) 2 Retu rn th e error n u mber of th e most recen t error from an MCS in stru ction execu ted by th e specified program task. 3 Retu rn th e n u mber of th e robot associated with th e most recen t error for th e specified program task. Zero is retu rn ed if th e error was n ot associated with a specific robot. (Also see select = 1 .) 4 Retu rn th e error code correspon din g to an y pen din g RSC errors for th e robot selected by th e specified u ser task. RSC errors may n ot be valid u n til 0 .1 secon ds after a RE ACTE rou tin e receives an * E -STOP from robot* (-6 4 0 ) error. Th e RE ACTE rou tin e can take an y time-critical action , wait 0 .1 secon ds, an d th en u se E RROR(task,4 ) to get a more defin itive error n u mber. If n o RSC errors are pen din g, th is fu n ction retu rn s zero. Details A V+ task can access an y errors th at resu lt in robot power bein g disabled. Th ese errors in clu de th e asyn ch ron ou s messages th at previou sly were ou tpu t on ly to th e mon itor win dow. Th is fu n ction is especially u sefu l in a RE ACTE su brou tin e program to determin e wh y th e RE ACTE was triggered. NOTE: Th e E RROR fu n ction does n ot report errors reported by th e IOSTAT fu n ction . See System Messagesfor a list of all th e V+ error messages an d th eir error n u mbers. V+ Lan gu age Referen ce Gu ide Page 2 8 5 E RROR real-valu ed fu n ction As n oted above, wh en th e select parameter is 1 , th e valu e retu rn ed by th is fu n ction sh ou ld be in terpreted as a 6 -bit n u meric valu e. Th e followin g program illu strates h ow th e valu e sh ou ld be in terpreted. Example Program: Retu rn error message correspon din g to an error code .PROGRAM error.string(code, vcode, robot, $msg) ; ABSTRACT: Return error message corresponding to error code(s). ; ; INPUTS: code Basic error code e.g., from ; [e.g., from ERROR(n) or IOSTAT(lun)] ; vcode Variable part of the error code ; [e.g., from ERROR(n,1)]. ; robot Number of the robot associated with the error ; [i.e., from ERROR(n,3)]. ; ; OUTPUTS: $msg Corresponding error message may be null ; AUTO i, n $msg = "" ;Assume no error IF code < 0 THEN ;If there was an error... $msg = $ERROR(code) ;Get base message string ; Add bit numbers if applicable. IF (-1100 < code) AND (code <= -1000) THEN n=1 ;Initialize bit mask FOR i = 1 TO 7 ;For each of 7 bits IF vcode BAND n THEN ;If this bit is set, $msg = $msg+$ENCODE(i) ;add it to message END n = 2*n ;Shift the mask 1 bit END END ; Add numeric variable if applicable. IF (-1200 < code) AND (code <= -1100) THEN $msg = $msg+$ENCODE(vcode) ;Add number END ; Add robot number if applicable. IF robot AND (SELECT(ROBOT,-1) > 1) THEN $msg = $msg+" (Robot"+$ENCODE(robot)+")" END END RETURN .END V+ Lan gu age Referen ce Gu ide Page 2 8 6 E RROR real-valu ed fu n ction Revision History V+ Release version 1 6 .0 Modification E n h an ced E RROR fu n ction to retu rn addition al errors for th e cu rren t robot wh en sou rce = -2 . For details, see th e sou rceparameter. Related Keywords $ E RROR strin g fu n ction IOSTAT real-valu ed fu n ction RE ACTE program in stru ction V+ Lan gu age Referen ce Gu ide Page 2 8 7 $ E RROR strin g fu n ction $ER R OR string function Syntax $ ERROR ( error_ code) Function Retu rn th e error message associated with th e given error code. Parameter error_ code Real-valu ed expression , with a n egative valu e, th at iden tifies an error con dition . Details All th e error codes retu rn ed by th e IOSTAT fu n ction an d by th e E RROR real-valu ed fu n ction can be con verted in to th eir correspon din g V+ error message strin gs with th is fu n ction . (Th e E RROR real-valu ed fu n ction mu st be u sed to determin e th e variable portion of th e error message for an error code less th an or equ al to -1 0 0 0 .) See System Messages on page 8 1 0 for a list of all th e V+ error messages an d th eir error codes. E xample Th e followin g program segmen t displays an error message if an I/O error occu rs: READ (5) $input IF IOSTAT(5) < 0 THEN TYPE "I/O error during read: ", $ERROR(IOSTAT(5)) HALT END Related Keywords E RROR real-valu ed fu n ction IOSTAT real-valu ed fu n ction RE ACTE program in stru ction V+ Lan gu age Referen ce Gu ide Page 2 8 8 E STOP program in stru ction ESTOP program instruction Syntax ES TOP Function Assert th e emergen cy-stop sign al to stop th e robot. Details Th is in stru ction immediately asserts th e backplan e emergen cy-stop sign al u sin g th e AWC board an d th en proceeds with a n ormal power-down sequ en ce. It is fu n ction ally iden tical to pressin g th e E -STOP bu tton on th e MCP or CIP. Related Keywords BRAKE program in stru ction E STOP mon itor comman d PANIC mon itor comman d PANIC program in stru ction STATE real-valu ed fu n ction V+ Lan gu age Referen ce Gu ide Page 2 8 9 E XE CUTE program in stru ction EXECUTE program instruction Syntax EXECUTE /C task_ n u m program( param_ list) , cycles, step, priority[i] Function Begin execu tion of a con trol program. Usage Considerations A program can n ot already be active as th e specified program task. V+ Lan gu age Referen ce Gu ide Page 2 9 0 E XE CUTE program in stru ction Parameters /C Option al qu alifier th at con dition ally attach es th e selected robot. Th e qu alifier h as an effect on ly wh en startin g th e execu tion of task 0 . task_ n u m Real valu e or expression specifyin g wh ich program task is to be activated. (For more in formation on program tasks, see th e section E xecu tin g Programs in th e V+ Lan gu age User's Gu ide.) program Name of th e program to be execu ted. param_ list Option al list of con stan ts, variables, or expression s separated by commas, th at mu st correspon d in type an d n u mber to th e argu men ts in th e .PROGRAM statemen t for th e program specified. If n o argu men ts are requ ired by th e program, th e list is blan k, bu t th e paren th eses mu st be en tered. Program parameters may be omitted as desired, u sin g commas to skip omitted parameters. No commas are requ ired if parameters are omitted at th e en d of th e list. Omitted parameters are passed to th e called program as u n defin ed an d can be detected with th e DE FINE D real-valu ed fu n ction . Au tomatic variables (an d su brou tin e argu men ts) can n ot be passed by referen ce in an E XE CUTE in stru ction . Th ey mu st be passed by valu e (see th e description of CALL). Th e parameters are evalu ated in th e con text of th e n ew task th at is started (see below). cycles Option al real valu e, variable, or expression (in terpreted as an in teger) th at specifies th e n u mber of program execu tion cycles to be performed. If omitted, th e cycle cou n t is assu med to be 1 . For u n limited cycles, specify an y n egative valu e. Th e maximu m loop cou n t valu e allowed is 3 2 ,7 6 7 . step Option al real valu e, variable, or expression (in terpreted as an in teger) th at specifies th e step at wh ich program execu tion is to begin . If omitted, program execu tion begin s at th e first execu table statemen t in th e program (th at is, after th e in itial blan k an d commen t lin es an d all th e AUTO an d LOCAL in stru ction s). priority Option al array of real valu es (in terpreted as in tegers) th at are u sed by V+ to override th e defau lt execu tion priority with in th e task. Th e array con tain s 1 6 elemen ts, wh ich specify th e program priority in each of 1 6 on e-millisecon d time slices. If specified, th e elemen ts V+ Lan gu age Referen ce Gu ide Page 2 9 1 E XE CUTE program in stru ction mu st be in th e ran ge -1 to 6 4 , in clu sive. (For more in formation , see th e section Task Sch edu lin g in th e V+ Lan gu age User's Gu ide.) i Option al real valu e, variable, or expression (in terpreted as an in teger) th at specifies th e in dex valu e of th e first elemen t. Details Th is comman d in itiates execu tion of th e specified con trol program. Th e program is execu ted cycles times, startin g at th e specified program step. After a program in itiates execu tion of an oth er program, th e in itiatin g program can u se th e STATUS an d E RROR real-valu ed fu n ction s to mon itor th e statu s of th e oth er program. Th e option al /C qu alifier h as an effect on ly wh en startin g execu tion of task 0 . Wh en /C is n ot specified, an E XE CUTE in stru ction for task 0 fails if th e robot can n ot be attach ed; attach men t requ ires th at th e robot be calibrated an d th at arm power be en abled (or th at th e DRY.RUN switch is en abled). Wh en /C is specified, an execu te in stru ction for task 0 attempts to attach th e robot, bu t allows execu tion of task 0 to con tin u e with ou t an y in dication of error if th e robot can n ot be attach ed. Certain defau lt con dition s are assu med wh en ever program execu tion is in itiated. Th ey are equ ivalen t to th e followin g program in stru ction s: CPON ALWAYS DURATION 0 ALWAYS FINE 100 ALWAYS LOCK 0 MULTIPLE ALWAYS NULL ALWAYS OVERLAP ALWAYS SPEED 100,100 ALWAYS SELECT ROBOT = 1 Also, th e robot con figu ration is saved for su bsequ en t motion s. An execu tion cycle is termin ated wh en a STOP in stru ction is execu ted, a RE TURN in stru ction is execu ted in th e top-level program, or th e last defin ed step of th e program is en cou n tered. Th e valu e of cycles can ran ge from -3 2 ,7 6 8 to 3 2 ,7 6 7 . Th e program is execu ted on e time if cycles is omitted or h as th e valu e 0 or 1 . An y n egative valu e for cycles cau ses th e program to be execu ted con tin u ou sly u n til a HALT in stru ction is execu ted, an error occu rs, or you (or an oth er program) aborts execu tion of th e program. NOTE: E ach time an execu tion cycle is in itiated, th e execu tion parameters are reset to th eir defau lt valu es. Th is in clu des motion speed, robot con figu ration , an d servo modes. However, th e robot cu rren tly selected is n ot ch an ged. V+ Lan gu age Referen ce Gu ide Page 2 9 2 E XE CUTE program in stru ction If step is specified, th e program begin s execu tion at th at step for th e first pass. Su ccessive cycles always begin at th e first execu table step of th e program. Th e priority valu es override th e defau lt execu tion con figu ration for th e specified program task. Th e specified priorities remain in effect on ly u n til th e n ext time an E XE CUTE in stru ction is issu ed for th e program task. Th e acceptable valu es are: -1 do n ot ru n in th is slice even if n o oth er task is ready to ru n 0 ru n in th is task on ly wh en n o oth er task is ready to ru n 1 -6 4 ru n in th is task accordin g to th e specified priority (6 4 is th e h igh est priority; h igh er priority tasks may lock ou t lower priority tasks for th e du ration of th e time slice) Wh en settin g priorities, remember: 1 -3 1 are n ormal u ser task priorities 3 2 -6 2 are u sed by V+ device drivers an d system tasks 63 is u sed by th e trajectory gen erator. Do n ot u se 6 3 or 6 4 u n less you h ave very sh ort task execu tion times or jerky robot motion s may resu lt. Th e priority valu es can h ave a very sign ifican t in flu en ce on th e performan ce of th e system. Th erefore, th ey sh ou ld be specified very carefu lly. Normally, th ese parameters are u sed on ly wh en experimen tin g with execu tion con figu ration s in preparation for ch an gin g th e defau lt con figu ration recorded on th e V+ system file. (For a discu ssion of task execu tion con figu ration , an d for in formation on h ow to ch an ge th e defau lt con figu ration perman en tly, see th e section Defau lt Task Con figu ration in th e V+ Lan gu age User's Gu ide.) All th e in stru ction parameters are evalu ated in th e con text of th e n ew task th at is started. Th is can lead to u n expected resu lts wh en th e E XE CUTE program in stru ction is u sed, an d an attempt is made to pass a task-depen den t valu e (for example, th e TASK real-valu ed fu n ction ). In su ch a case, if you wan t th e task-depen den t valu e to reflect th e in vokin g task, you mu st assign th e task-depen den t valu e to a variable an d pass th at variable. E xamples In itiate execu tion (as task #0 ) of th e program n amed assembly, with execu tion to con tin u e in defin itely (th at is, u n til execu tion is aborted, a HALT in stru ction is execu ted, or a ru n -time error occu rs): EXECUTE 0 assembly, -1 In itiate execu tion , with program task #2 , of th e program n amed test. Th e parameter valu es 1 an d 2 are passed to th e program. V+ Lan gu age Referen ce Gu ide Page 2 9 3 E XE CUTE program in stru ction EXECUTE 2 test(1,2) Th e followin g program segmen t sh ows h ow an application program can be in itiated from an oth er application program (th e ABORT an d CYCLE .E ND program in stru ction s are u sed to make su re th e specified program task is n ot already active): ABORT 3 CYCLE.END 3 EXECUTE 3 new.program ;Abort any program already active ;Wait for execution to abort ;Start up the new program Related Keywords ABORT mon itor comman d ABORT program in stru ction CALL program in stru ction CYCLE .E ND mon itor comman d CYCLE .E ND program in stru ction E XE CUTE mon itor comman d KILL mon itor comman d KILL program in stru ction PRIME mon itor comman d PROCE E D mon itor comman d RE TRY mon itor comman d SSTE P mon itor comman d STATUS mon itor comman d STATUS real-valu ed fu n ction XSTE P mon itorcomman d V+ Lan gu age Referen ce Gu ide Page 2 9 4 E XIT program in stru ction EXIT program instruction Syntax EXI T cou n t Function Bran ch to th e statemen t followin g th e n th n ested loop of a con trol stru ctu re. Usage Considerations Th is in stru ction works with th e FOR, WHILE , an d DO con trol stru ctu res. Parameter cou n t Option al in teger valu e (expression s an d variables are n ot acceptable) specifyin g h ow man y n ested stru ctu res to exit. Th e defau lt valu e is 1 . Details Wh en an E XIT in stru ction is reach ed, th e con trol stru ctu re is termin ated an d execu tion con tin u es at th e first in stru ction followin g th e ou termost con trol stru ctu re exited. E xample If in pu t sign al 1 0 0 1 is set, exit on e con trol stru ctu re; if 1 0 0 2 is set, exit th ree con trol stru ctu res: 27 FOR i = 1 TO 40 28 WHILE ctrl.var DO 29 DO 30 IF SIG(1002) THEN 31 EXIT 3 32 END 33 IF SIG(1001) THEN 34 EXIT 35 END 36 UNTIL FALSE 37 count = count+1 38 END 39 END ; Jump to step 40 ; Jump to step 37 Related Keywords DO program in stru ction FOR program in stru ction NE XT program in stru ction V+ Lan gu age Referen ce Gu ide Page 2 9 5 E XIT program in stru ction WHILE program in stru ction V+ Lan gu age Referen ce Gu ide Page 2 9 6 FALSE real-valu ed fu n ction FALSE real-valued function Syntax FALS E Function Retu rn th e valu e u sed by V+ to represen t a logical false resu lt. Usage Considerations Th e word " false" can n ot be u sed as a program n ame or variable n ame. Details Th is n amed con stan t is u sefu l for situ ation s wh ere tru e an d false con dition s n eed to be specified. Th e valu e retu rn ed is zero. E xample Th e followin g program loop will execu te con tin u ou sly u n til th e su brou tin e cycle retu rn s a FALSE valu e for th e real variable con tin u e: DO CALL cycle(continue) UNTIL continue == FALSE Related Keywords OFF real-valu ed fu n ction TRUE real-valu ed fu n ction V+ Lan gu age Referen ce Gu ide Page 2 9 7 FCLOSE program in stru ction FCLOSE program instruction Syntax FCLOS E ( logical_ u n it) Function Close th e disk file, graph ics win dow, or graph ics icon cu rren tly open on th e specified logical u n it. Usage Considerations No error is gen erated if a file or graph ics win dow is n ot open on th e logical u n it, alth ou gh th e IOSTAT real-valu ed fu n ction retu rn s an error code. Wh en a graph ics win dow is closed, th e win dow is n ot deleted from graph ics memory an d its stackin g an d display statu s are n ot ch an ged. Parameter logical_ u n it Real valu e, variable, or expression (in terpreted as an in teger) th at iden tifies th e device to be accessed. (See th e ATTACH in stru ction for a description of logical u n it n u mbers.) Details After a program h as fin ish ed accessin g a file th at h as been open ed via an FOPE N in stru ction , th e program mu st close th e file by execu tin g an FCLOSE in stru ction . FCLOSE frees th e file for access by th e V+ mon itor an d oth er programs. In addition , for files th at h ave been open ed for writin g, FCLOSE writes ou t an y data still bu ffered by V+ an d u pdates th e file directory in formation . Th u s, if th is operation is n ot performed, th e disk file may n ot actu ally con tain all of th e in formation written to it. If a program is fin ish ed accessin g a graph ics win dow, or n eeds to reu se its logical u n it n u mber, th e win dow can be closed with th is in stru ction . After a win dow is closed, it can be deleted with an FDE LE TE in stru ction or it can be open ed again later with an FOPE N in stru ction . NOTE: Reopen in g a win dow resets all its text an d graph ics attribu tes (for example, color, fon t ID, ch aracter path an d orien tation , textu re, logical operation , an d en abled even ts), wh ich mu st be explicitly reset by th e program before attemptin g ou tpu t to th e win dow. An FCLOSE operation is au tomatically performed on a logical u n it wh en th e u n it is detach ed, wh en th e program th at issu ed th e FOPE N completes execu tion , or wh en a KILL of th e program task is performed. V+ Lan gu age Referen ce Gu ide Page 2 9 8 FCLOSE program in stru ction Th e IOSTAT real-valu ed fu n ction sh ou ld be u sed to ch eck for su ccessfu l completion of a close operation . (Th e error code for File n ot open ed will be retu rn ed if th ere was n o file or win dow cu rren tly open on th e specified logical u n it.) Related Keywords ATTACH program in stru ction DE TACH program in stru ction FOPE N program in stru ction FOPE NR program in stru ction IOSTAT real-valu ed fu n ction KILL mon itor comman d KILL program in stru ction V+ Lan gu age Referen ce Gu ide Page 2 9 9 FCMND program in stru ction FCMND program instruction Syntax FCMND ( logical_ u n it, comman d_ code) $ ou t_ strin g, $ in _ strin g Function Gen erate a device-specific comman d to th e in pu t/ou tpu t device specified by th e logical u n it. Usage Considerations Th e logical u n it referen ced mu st h ave been previou sly attach ed. As appropriate, th e cu rren t defau lt device, u n it, an d directory path are con sidered for an y disk file specification (see th e DE FAULT comman d). Parameters logical_ u n it Real-valu ed expression th at iden tifies th e device to be accessed. (See th e ATTACH in stru ction for a description of logical u n it n u mbers.) comman d_ code Real-valu ed expression th at specifies th e comman d to be execu ted. (See th e explan ation of comman d codes below.) $ ou t_ strin g Strin g con stan t, variable, or expression th at is tran smitted to th e device alon g with th e comman d code to specify th e operation to be performed. $ in _ strin g Option al strin g variable. Th is variable receives an y in formation retu rn ed from th e device as a resu lt of th e comman d. Details Th is in stru ction allows a program to gen erate device-specific comman d sequ en ces. For example, th is in stru ction can be u sed to sen d a comman d to th e disk to delete a file or to ren ame a file. Sin ce th ese are main ten an ce operation s, wh ich are n ot gen erally performed by V+ programs, n o special-pu rpose V+ program in stru ction s exist for performin g th ese operation s. An y error in th e specification of th is in stru ction (su ch as attemptin g to access an in valid u n it) will cau se a program error an d will h alt program execu tion . However, errors associated with performin g th e actu al operation s (su ch as device n ot ready) do n ot h alt program execu tion sin ce th ese errors can occu r in th e n ormal operation of a program. Th ese n ormal errors can V+ Lan gu age Referen ce Gu ide Page 3 0 0 FCMND program in stru ction be detected by u sin g th e IOSTAT fu n ction after performin g th e FCMND. In gen eral, it is good practice always to test wh eth er each FCMND operation completed su ccessfu lly u sin g IOSTAT. File Command Codes With th e exception of th e CLOSE comman d, a file can n ot be open on th e logical u n it wh en th e FCMND is execu ted. 6 Ren ame a file. Th e $ ou t_ strin g parameter mu st con tain th e n ew n ame of th e file (in clu din g an y requ ired disk u n it an d directory path specification ), followed by a space, followed by th e old file n ame (wh ich can n ot in clu de a disk or directory specification ). Note th at th e data con tain ed in $ ou t_ strin g is n ot th e same as th at of th e argu men t list of th e FRE NAME mon itor comman d. No data is retu rn ed in th e $ in _ strin g variable. 7 Compress th e disk. Th is comman d is in valid for local disks. 8 Format th e disk. Th e $ ou t_ strin g parameter mu st con tain th e n ame of th e disk u n it to format, followed by an y requ ired qu alifiers. Th e data con tain ed in $ ou t_ strin g mu st be iden tical to th at of th e argu men t list of a FORMAT mon itor comman d. On completion , th e $ in _ strin g variable will con tain text in dicatin g h ow man y bad blocks were located. CAUTI ON: Formattin g a disk erases all th e in formation on th e disk. 14 Create a su bdirectory. Th e $ ou t_ strin g parameter mu st con tain th e specification of th e su bdirectory, in clu din g an option al u n it n ame if th e cu rren t defau lt disk u n it is n ot to be accessed. (Refer to th e V+ Operatin g System User's Gu ide for a description of su bdirectory specification s.) NOTE: On ly th e fin al su bdirectory in th e specified directory path is created by th is operation . Th at is, all th e in termediate su bdirectories mu st already exist, an d th ey are n ot created. 15 Delete a su bdirectory. Th e $ ou t_ strin g parameter mu st con tain th e specification of th e su bdirectory, in clu din g an option al u n it n ame if th e cu r- NOTE: On ly th e fin al su bdirectory in th e specified directory path is deleted by th is operation . Th at is, all th e in termediate su bdirectories mu st already exist, an d th ey are n ot deleted. V+ Lan gu age Referen ce Gu ide Page 3 0 1 FCMND program in stru ction for a description of su bdirectory specification s.) NOTE: On ly th e fin al su bdirectory in th e specified directory path is deleted by th is operation . Th at is, all th e in termediate su bdirectories mu st already exist, an d th ey are n ot deleted. 19 Assert th e creation date/time for th e file cu rren tly open on th e specified logical u n it. Th is comman d can be issu ed at an y time a disk file is open ed. On ce asserted, wh en th e file is closed, th e file's creation date an d time are set equ al to th e specified valu es rath er th an th e cu rren t date an d time. Also, if th is comman d is issu ed wh en th e file is closed, V+ does n ot au tomatically assert th e n ot arch ived bit. Th e in pu t strin g mu st con tain date an d time, wh ere: date is a 1 6 -bit in teger word represen tin g th e date in th e stan dard compressed format u sed by th e TIME an d $ TIME fu n ction s. time is a 1 6 -bit in teger word represen tin g th e time in th e stan dard compressed format. Th is comman d code applies on ly to local disk drives. Th u s, it can n ot be u sed for files th at are accessed via th e NFS device. 20 Retu rn th e n u mber of u n u sed an d total n u mber of sectors on a local disk. Th e retu rn ed strin g is in th e form u u u u u /ttttt wh ere u u u u u is th e n u mber of u n u sed sectors an d ttttt is th e total n u mber of sectors. A file mu st be open on th e drive (with prereads disabled). Th e open file iden tifies th e disk u n it. 21 Read th e creation date/time for th e file cu rren tly open on th e specified logical u n it. Th is comman d can be issu ed an y time after a file h as been open ed. Normally, th is comman d retu rn s th e valu es th at are read from th e disk directory at th e time th e file was open ed. However, if an FCMND 1 9 in stru ction h as been issu ed to assert file creation date an d time, FCMND 2 1 retu rn s th e valu e set by FCMND 1 9 . Th e strin g retu rn ed by th is comman d con tain s date an d time (u se INTB to extract th e valu es), wh ere date is a 1 6 -bit in teger word represen tin g th e date in th e stan dard compressed format u sed by th e TIME an d $ TIME fu n ction s. time is a 1 6 -bit in teger word represen tin g th e time in th e stan dard compressed format. Th is comman d code applies on ly to local disk drives. Th u s, it can n ot be u sed for files th at are accessed via th e NFS device. V+ Lan gu age Referen ce Gu ide Page 3 0 2 FCMND program in stru ction Serial Line Command Codes 102 Clear th e type-ah ead bu ffer for a serial lin e, or clear th e even t qu eu e for a graph ics win dow. Th is comman d, wh ich is recogn ized on ly by th e serial commu n ication lin es an d th e graph ics logical u n its, does n ot process an y argu men ts. 106 Read modem con trol flags. Modem con trol flags are retu rn ed in th e first byte of a on e-byte strin g. Bits with in th at byte sh ow th e cu rren t state of th e modem con trol lin es for th e serial port attach ed to th e lu n specified in th e FCMND in stru ction . Th e bits are in terpreted as follows (LSB is 1 ): Bit Mask S tate of: 1 ^H0 1 Requ est to Sen d (RTS) 2 ^H0 2 Data Termin al Ready (DTR) 5 ^H1 0 In pu t Clear to Sen d (CTS) 6 ^H2 0 In pu t Data Carrier Detect (DCD) V+ Lan gu age Referen ce Gu ide Page 3 0 3 FCMND program in stru ction DDCMP Command Codes 500 Retu rn in formation abou t DDCMP statu s. (Th is FCMND is presen t in all V+ systems th at su pport DDCMP.) Th e FCMND reply strin g may be parsed u sin g INTB an d LNGB fu n ction s to extract th e bin ary data, as described in th e followin g code. Wh en th e in stru ction FCM ND (lun, 500) "", $reply is execu ted, th e strin g variable $ reply receives packed bin ary data regardin g th e DDCMP lin e attach ed on th e specified logical u n it. Th en th e fu n ction s sh own in th e followin g table can be u sed to extract th e data. DDCMP S tatu s Format Fu n ction Notes INTB($ reply,1 ) DDCMP n etwork state (0 , 1 , or 2 ) 0 = Lin e is closed 1 = Lin e is open bu t waitin g for remote 2 = Lin e is active INTB($ reply,3 ) Not u sed LNGB($ reply,5 ) Local media error cou n t LNGB($ reply,9 ) Local timin g error cou n t LNGB($ reply,1 3 ) Local format error cou n t LNGB($ reply,1 7 ) Remote media error cou n t LNGB($ reply,2 1 ) Remote timin g error cou n t LNGB($ reply,2 5 ) Remote format error cou n t LNGB($ reply,2 9 ) Cou n t of blocks sen t LNGB($ reply,3 3 ) Cou n t of blocks received V+ Lan gu age Referen ce Gu ide Page 3 0 4 FCMND program in stru ction 501 Set DDCMP commu n ication parameters. Th is comman d is recogn ized on ly by serial commu n ication lin es con figu red for u se with th e DDCMP protocol. See th e V+ Lan gu age User's Gu ide for th e details of th is comman d. T CP Command Codes 600 In itiate a close con n ection from th e TCP server side for th e clien t iden tified by th e h an dle n u mber h an dle in th e in stru ction FCMND (lu n , 6 0 0 ) $ INTB(h an dle). Note, h owever, th at close-con n ection requ ests are more common ly in itiated by th e clien t side. 601 In itiate a PING comman d (see th e V+ Operatin g System Referen ce Gu ide for details on th e PING mon itor comman d). Th e resu ltin g IOSTAT valu e is eith er 1 , in dicatin g th e clien t was fou n d on th e n etwork, or 5 6 2 , in dicatin g a n etwork timeou t. V+ Lan gu age Referen ce Gu ide Page 3 0 5 FCMND program in stru ction DeviceNet Command Codes 761 Used for readin g Can Bu s statu s. Th e Can Bu s is th e bu s th at DeviceNet ru n s on . Wh en th e in stru ction FCMND (lun,761) "", $input is execu ted, th e strin g variable $ in pu t retu rn s th e statu s sh own in th e followin g table. DeviceNet S tatu s Format Fu n ction Notes INTB($ in pu t, 1 ) Can Bu s statu s valu e (see below) INTB($ in pu t, 3 ) Nu mber of bytes tran smitted INTB($ in pu t, 5 ) Nu mber of ackn owledges received INTB($ in pu t, 7 ) Nu mber of bytes received INTB($ in pu t, 9 ) Nu mber of errors INTB($ in pu t, 1 1 ) Nu mber of bytes lost INTB($ in pu t, 1 3 ) Nu mber of overru n s V+ Lan gu age Referen ce Gu ide Page 3 0 6 FCMND program in stru ction Can Bu s statu s valu e is a bitmask con tain in g th e followin g bits: Bit Mean in g W h en Bit is Non zero 1 2 Bu s warn in g 3 Bu s off 4 Activity detected 5 (reserved) 6 Tran smit timeou t 7 Receive bu ffer overru n 8 (reserved) 9 (reserved) 10 (reserved) 11 (reserved) 12 (reserved) 13 On lin e at 1 2 5 KBau d 14 On lin e at 2 5 0 KBau d 15 On lin e at 5 0 0 KBau d 16 762 On lin e Scan n er active Used for gen eric I/O to th e DeviceNet scan n er. Th is FCMND reads from th e scan n er in pu t area. Wh en th e in stru ction FCMND(lun, 762) $INTB(macid)+$INTB(offset)+$INTB(count), $input is execu ted, macid> is th e MAC ID to read from, offset is th e read offset in to th e in pu t area (it is device-depen den t), an d cou n t is th e n u mber of bytes to read. Th e in pu t is retu rn ed V+ Lan gu age Referen ce Gu ide Page 3 0 7 FCMND program in stru ction by th e strin g variable $ in pu t. See th e Adept MV Con troller User's Gu ide for details on th e MACID statemen t in DeviceNet con figu ration . 763 Used for gen eric I/O to th e DeviceNet scan n er. Th is FCMND writes to th e scan n er ou tpu t area. Wh en th e in stru ction FCMND(lun, 763) $INTB(macid)+$INTB(offset)+$INTB(count)+$output is execu ted, macid is th e MAC ID to write to, offset is th e write offset in to th e ou tpu t area (it is device-depen den t), an d cou n t is th e n u mber of bytes to write. Th e ou tpu t bytes are con tain ed in th e strin g variable $ ou tpu t. See th e Adept MV Con troller User's Gu ide for details on th e MACID statemen t in DeviceNet con figu ration . 764 Th is comman d code provides th e same su pport as comman d 7 6 1 except th at it retu rn s a 3 2 -bit cou n ter in stead of a 1 6 -bit cou n ter. If FCMND 7 6 4 is u sed for an AWC con troller, a 3 2 -bit cou n ter is retu rn ed, bu t th e cou n ter still rolls over at 1 6 bits. Th e syn tax for th is comman d is as follows: FCMND(lun, 764) "", $input Th is is u sed for readin g th e Can Bu s statu s. Th e Can Bu s is th e bu s u pon wh ich DeviceNet ru n s. Th e statu s is retu rn ed in $ in pu t. NOTE: FCMND 7 6 4 is on ly available in V+ version 1 5 .0 or later V+ Lan gu age Referen ce Gu ide Page 3 0 8 FCMND program in stru ction 768 Used for determin in g th e DeviceNet statu s with th e followin g V+ code: AUTO lun, macid, status, $error[25], $input macid = 1 ;MacID for this example ; Define the status messages. $error[0] $error[1] $error[2] $error[3] $error[4] $error[5] $error[6] $error[7] $error[8] $error[9] $error[10] $error[11] $error[12] $error[13] $error[14] $error[15] $error[16] $error[17] $error[18] $error[19] $error[20] $error[21] $error[22] $error[23] = = = = = = = = = = = = = = = = = = = = = = = = "Device not in device list" "Device idle (not being scanned)" "Device being scanned" "Device timed-out" "UCMM connection error" "Master/Slave connection set is busy" "Error allocating Master/Slave connection set" "Invalid vendor id" "Error reading vendor id" "Invalid device type" "Error reading device type" "Invalid product code" "Error reading product code" "Invalid I/O input size for connection 1" "Error reading I/O input size for connection 1" "Invalid I/O output size for connection 1" "Error reading I/O output size for connection 1" "Invalid I/O input size for connection 2" "Error reading I/O input size for connection 2" "Invalid I/O output size for connection 2" "Error reading I/O output size for connection 2" "Error setting I/O packet rate for connection 1" "Error setting I/O packet rate for connection 2" "M/S connection set sync fault" ; Report the status of DeviceNet. ATTACH (lun, 4) "DEVICENET" ;Attach the device IF IOSTAT(lun) < 0 GOTO 100 FCMND (lun, 760) $INTB(macid), $input ;Get the status IF IOSTAT(lun) < 0 THEN TYPE "No node with MacId", macid ELSE status = ASC($input) TYPE "MacID", macid, " status: ", $error[status] END DETACH (lun) ;Release the device E xamples Retu rn modem con trol bit flags for th e serial port attach ed to logical u n it 1 0 : V+ Lan gu age Referen ce Gu ide Page 3 0 9 FCMND program in stru ction FCMND (10,106), $temp flags = ASC($temp) Format th e disk loaded in drive A in dou ble-sided, dou ble-den sity format an d retu rn th e strin g con tain in g th e bad-block cou n t in $ bad: FCMND (5, 8) "A:/Q", $bad Specifya DDCMP time-ou t in terval of 2 secon ds, with maximu ms of 2 0 time-ou ts an d 8 NAK retries. FCMND (lun, 501) $CHR(2)+$CHR(20)+$CHR(8) Ch eck to see if a clien t is on th e n etwork. FCMND (lun, 601) "node_address", $str Related Keywords ATTACH program in stru ction DE TACH program in stru ction FDE LE TE mon itor comman d FDE LE TE program in stru ction FDIRE CTORY mon itor comman d FOPE N program in stru ction FORMAT mon itor comman d FRE NAME mon itor comman d IOSTAT real-valu ed fu n ction MCS program in stru ction V+ Lan gu age Referen ce Gu ide Page 3 1 0 FDE LE TE program in stru ction FDELETE program instruction Syntax FDELETE ( logical_ u n it) object Function Delete th e specified disk file, th e specified graph ics win dow an d all its ch ild win dows, or th e specified graph ics icon . Usage Considerations Th e logical u n it n u mber mu st be attach ed, bu t n o file or win dow can be cu rren tly open on th at logical u n it. Th e win dow can n ot be deleted if it (or an y of its ch ild win dows) is open as an y oth er logical u n it or by an y oth er program task. Parameters logical_ u n it Real valu e, variable, or expression (in terpreted as an in teger) th at correspon ds to a disk or win dow logical u n it. (See th e ATTACH in stru ction for a description of logical u n it n u mbers.) object Strin g con stan t, variable, or expression specifyin g th e disk file, graph ics win dow, or graph ics icon to delete. Th e error * Non existen t file* will be reported (via IOSTAT) if th e specified object does n ot exist. For disk files, th e strin g may con tain an option al disk u n it an d an option al directory path , an d mu st con tain a file n ame, a period (.), an d a file exten sion . Th e cu rren t defau lt disk u n it an d directory path are con sidered as appropriate (see th e DE FAULT comman d). For graph ics win dows, th e strin g mu st fu lly specify th e position in th e win dow tree of th e win dow to be deleted. For graph ics icon s, th e strin g mu st specify th e n ame of th e icon , followed by /ICON. Details If a disk logical u n it n u mber is specified, th e object parameter is in terpreted as th e specification of a disk file to be deleted. If th e deletion fails for an y reason (for example, th e file does n ot exist or th e disk is protected), an error will be retu rn ed via th e IOSTAT real-valu ed fu n ction . V+ Lan gu age Referen ce Gu ide Page 3 1 1 FDE LE TE program in stru ction NOTE: In order to delete a file from a 3 .5 in ch diskette, th e write-protect slider mu st be in th e position th at covers th e h ole. If th e logical u n it n u mber specified is for a graph ics win dow, th e object parameter is in terpreted as th e specification of a graph ics win dow or icon to be deleted. Wh en a win dow is specified, th at win dow an d all of its ch ild win dows are deleted. If an y of th e win dow's ch ildren can n ot be deleted, th e specified win dow is n ot affected an d an error is retu rn ed (via th e IOSTAT real-valu ed fu n ction ). Wh en a win dow is deleted, it is erased from th e display. (A win dow mu st be FCLOSE d before it can be FDE LE TE d.) Wh en a graph ics logical u n it is accessed, a * Protection error* message is reported (via IOSTAT) if a system win dow or icon is specified. NOTE: Th e DISKCOPY u tility may provide a more con ven ien t way to delete mu ltiple files. For details, see th e In stru ction s for Adept Utility Programs. E xamples Delete th e disk file defin ed by th e file specification in th e strin g variable $ file: FDELETE (5) $file Delete th e top-level win dow n amed TE ST an d all of its ch ild win dows. Th e logical u n it defin ed by main mu st be a graph ics logical u n it: FDELETE (main) "TEST" Delete th e graph ics win dow n amed E RROR, wh ich is a ch ild of th e top-level win dow n amed VISION: FDELETE (21) "VISION\ERROR" Delete th e graph ics icon n amed BUTTON: FDELETE (20) "BUTTON/ICON" Related Keywords ATTACH program in stru ction FCLOSE program in stru ction FDE LE TE program in stru ction FOPE N program in stru ction IOSTAT real-valu ed fu n ction V+ Lan gu age Referen ce Gu ide Page 3 1 2 FE MPTY program in stru ction FEMPTY program instruction Syntax FEMPTY ( logical_ u n it) Function E mpty an y in tern al bu ffers in u se for a disk file or a graph ics win dow by writin g th e bu ffers to th e file or win dow if n ecessary. Usage Considerations Wh en accessin g a file, th e file mu st be open for ran dom access on th e specified logical u n it (see th e FOPE N_ in stru ction s). Wh en accessin g a graph ics win dow, th is in stru ction is u sefu l on ly for a win dow th at is open ed in bu ffered mode. (Th at is, th e /BUFFE RE D attribu te was specified in th e FOPE N in stru ction th at open ed th e win dow.) Parameter logical_ u n it Real valu e, variable, or expression (in terpreted as an in teger) th at iden tifies th e device to be accessed. (See th e ATTACH in stru ction for a description of logical u n it n u mbers.) Details Du rin g ran dom-access I/O of a disk file, V+ writes data to th e disk in blocks of 5 1 2 bytes (ch aracters). For efficien cy, wh en a record with a len gth of less th an 5 1 2 bytes is written u sin g a WRITE in stru ction , th at data is stored in an in tern al bu ffer an d migh t n ot actu ally be written to th e disk u n til a later time. Wh en a disk logical u n it is referen ced, th e FE MPTY in stru ction directs V+ to write its in tern al bu ffer con ten ts immediately to th e disk file. Th at is u sefu l, for example, in application s wh ere data in tegrity is especially critical (see FOPE N for details on defeatin g bu fferin g). Wh en a win dow logical u n it is referen ced, th e FE MPTY in stru ction forces all bu ffered graph ics ou tpu t to be immediately written to th e win dow. Th e IOSTAT real-valu ed fu n ction can be u sed to determin e if an y error resu lts from an FE MPTY operation . E xamples E mpty th e in tern al ou tpu t bu ffer for logical u n it 5 an d write it to th e disk immediately: FEMPTY (5) V+ Lan gu age Referen ce Gu ide Page 3 1 3 FE MPTY program in stru ction E mpty th e in tern al bu ffer for graph ics logical u n it 2 0 by writin g it to th e win dow immediately: FEMPTY (20) Related Keywords ATTACH program in stru ction FOPE N program in stru ction FOPE N_ program in stru ction IOSTAT real-valu ed fu n ction WRITE program in stru ction V+ Lan gu age Referen ce Gu ide Page 3 1 4 FINE program in stru ction FINE program instruction Syntax FI NE toleran ce ALWAYS Function E n able a h igh -precision featu re of th e robot h ardware servo. Usage Considerations On ly th e n ext robot motion will be affected if th e ALWAYS parameter is n ot specified. If th e toleran ce parameter is specified, its valu e becomes th e defau lt for an y su bsequ en t FINE in stru ction execu ted du rin g th e cu rren t execu tion cycle (regardless of wh eth er ALWAYS is specified). Th is is th e defau lt state of th e V+ system. FINE 1 0 0 ALWAYS is assu med wh en ever program execu tion is in itiated an d wh en a n ew execu tion cycle begin s. Th e FINE in stru ction can be execu ted by an y program task as lon g as th e robot selected by th e task is n ot attach ed by an y oth er task. Th e in stru ction applies to th e robot selected by th e task. If th e V+ system is n ot con figu red to con trol a robot, execu tin g th e FINE in stru ction cau ses an error. Parameters toleran ce Option al real valu e, variable, or expression th at specifies th e percen tage of th e stan dard fin e toleran ces th at are u sed for each join t of th e robot attach ed by th e cu rren t execu tion task. ALWAYS Option al qu alifier th at establish es FINE as th e defau lt con dition . Th at is, FINE will remain in effect con tin u ou sly u n til disabled by a COARSE in stru ction . If ALWAYS is n ot specified, th e FINE in stru ction will apply on ly to th e n ext robot motion . Details E n ables th e h igh -precision featu re in th e robot motion servo system so th at on ly small errors in th e fin al position s of th e robot join ts are permitted at th e en ds of motion s. Th is produ ces h igh -accu racy motion s bu t in creases cycle times sin ce th e settlin g time at th e en d of each motion is in creased. If th e toleran ce parameter is specified, th e n ew settin g takes effect at th e start of th e n ext motion . Also, th e valu e becomes th e defau lt for an y su bsequ en t FINE in stru ction execu ted V+ Lan gu age Referen ce Gu ide Page 3 1 5 FINE program in stru ction du rin g th e cu rren t execu tion cycle (regardless of wh eth er or n ot ALWAYS is specified). Ch an gin g th e FINE toleran ce does n ot affect th e COARSE toleran ce. If th e toleran ce parameter is omitted, th e most recen t settin g (for th e attach ed robot) is u sed. Th e defau lt settin g is restored to 1 0 0 percen t wh en program execu tion begin s, or a n ew execu tion cycle starts (assu min g th at th e robot is attach ed to th e program). Th e actu al toleran ce ach ieved wh en FINE is in effect for an AdeptMotion VME device is set with th e SPE C u tility program. E xamples E n able th e h igh -precision featu re on ly for th e n ext motion : FINE E n able th e h igh -toleran ce featu re for th e n ext motion , with th e toleran ce settin gs ch an ged to 5 0 % of th e stan dard toleran ce for each join t (th at is, a tigh ter toleran ce): FINE 50 E n able th e h igh -toleran ce featu re u n til it is explicitly disabled: FINE ALWAYS Related Keywords COARSE program in stru ction CONFIG real-valu ed fu n ction DE LAY.IN.TOL program in stru ction NONULL program in stru ction NULL program in stru ction SE LE CT program in stru ction SE LE CT real-valu ed fu n ction V+ Lan gu age Referen ce Gu ide Page 3 1 6 FLIP program in stru ction FLIP program instruction Syntax FL I P Function Requ est a ch an ge in th e robot con figu ration du rin g th e n ext motion so th at th e pitch an gle of th e robot wrist h as a n egative valu e. Usage Considerations Con figu ration ch an ges can n ot be made du rin g straigh t-lin e motion s. If th e selected robot does n ot su pport a flip con figu ration , th is in stru ction is ign ored by th e robot. Th e FLIP in stru ction can be execu ted by an y program task as lon g as th e robot selected by th e task is n ot attach ed by an y oth er task. Th e in stru ction applies to th e robot selected by th e task. If th e V+ system is n ot con figu red to con trol a robot, execu tin g th e FLIP in stru ction cau ses an error. Details Assertin g a FLIP con figu ration forces th e wrist join t to h ave a n egative rotation (top robot in FLIP/NOFLIP). Assertin g a NOFLIP con figu ration forces a wrist join t to h ave a positive rotation (bottom robot in FLIP/NOFLIP). Wrist join t an gles are expressed as ±1 8 0 ° . NOTE: Robots can ch an ge con figu ration on ly du rin g join t-in terpolated moves. Th e ALWAYS keyword can be u sed with FLIP an d NOFLIP. V+ Lan gu age Referen ce Gu ide Page 3 1 7 FLIP program in stru ction FLIP/NOFLIP Th e followin g figu res illu strate FLIP versu s NOFLIP con figu ration s of a Viper s6 5 0 robot. FLIP / NOFLIP E xample on Viper s6 5 0 Robot V+ Lan gu age Referen ce Gu ide Page 3 1 8 FLIP program in stru ction E xample Th e followin g V+ code sn ippet demon strates th e u se of th e FLIP an d NOFLIP program in stru ction s: FLIP MOVE loc_a ;Request change in robot configuration during next motion ;Move to loc_a transformation with FLIP configuration NOFLIP MOVE loc_a ;Request change in robot configuration during next motion ;Move to loc_a transformation with NOFLIP configuration Related Keywords CONFIG real-valu ed fu n ction NOFLIP program in stru ction SE LE CT program in stru ction SE LE CT real-valu ed fu n ction V+ Lan gu age Referen ce Gu ide Page 3 1 9 FLTB real-valu ed fu n ction FLTB real-valued function Syntax FLTB ( $ strin g, first_ ch ar) Function Retu rn th e valu e of fou r bytes of a strin g in terpreted as an IE E E sin gle-precision floatin gpoin t n u mber. Parameters $ strin g Strin g expression th at con tain s th e fou r bytes to be con verted. first_ ch ar Option al real-valu ed expression th at specifies th e position of th e first of th e fou r bytes in th e strin g. If first_ ch ar is omitted or h as a valu e of 0 or 1 , th e first fou r bytes of th e strin g are extracted. If first_ ch ar is greater th an 1 , it is in terpreted as th e ch aracter position for th e first byte. For example, a valu e of 2 mean s th at th e secon d, th ird, fou rth , an d fifth bytes are extracted. An error is gen erated if first_ ch ar specifies fou r bytes th at are beyon d th e en d of th e in pu t strin g. Details Fou r sequ en tial bytes of th e given strin g are in terpreted as bein g a sin gle-precision (3 2 -bit) floatin g-poin t n u mber in th e IE E E stan dard format. Th is 3 2 -bit field is in terpreted as follows: wh ere s is th e sign bit, s = 0 for positive, s = 1 for n egative. exp is th e bin ary expon en t, biased by -1 2 7 . fraction is a bin ary fraction with an implied 1 to th e left of th e bin ary poin t. For 0 < exp < 2 5 5 , th e valu e of a floatin g-poin t n u mber is: - 1 s * ( 1 . f r a c t i o n ) * 2 exp -127 For exp = 0 , th e valu e is zero; for exp = 2 5 5 , an overflow error exists. V+ Lan gu age Referen ce Gu ide Page 3 2 0 FLTB real-valu ed fu n ction Th e main u se of th is fu n ction is to con vert a bin ary floatin g-poin t n u mber from an in pu t data record to a valu e th at can be u sed in tern ally by V+. E xamples FLTB($CHR(^H3F)+$CHR(^H80)+$CHR(0)+$CHR(0)) FLTB($CHR(^HC0)+$CHR(^H40)+$CHR(0)+$CHR(0)) Related Keywords ASC real-valu ed fu n ction DBLB real-valu ed fu n ction $ DBLB strin g fu n ction $ FLTB strin g fu n ction INTB real-valu ed fu n ction LNGB real-valu ed fu n ction $ LNGB strin g fu n ction TRANSB tran sformation fu n ction VAL real-valu ed fu n ction V+ Lan gu age Referen ce Gu ide Page 3 2 1 ;Returns 1.0 ;Returns -3.0 $ FLTB strin g fu n ction $FLTB string function Syntax $ FLTB ( valu e) Function Retu rn a 4 -byte strin g con tain in g th e bin ary represen tation of a real valu e in sin gle-precision IE E E floatin g-poin t format. Parameter valu e Real-valu ed expression , th e valu e of wh ich is con verted to its IE E E floatin g-poin t bin ary represen tation . Details A real valu e is con verted to its bin ary represen tation u sin g th e IE E E sin gle-precision stan dard floatin g-poin t format. Th is 3 2 -bit valu e is packed as fou r su ccessive 8 -bit ch aracters in a strin g. See th e FLTB real-valu ed fu n ction for a more detailed description of IE E E floatin gpoin t format. Th e main u se of th is fu n ction is to con vert a real valu e to its bin ary represen tation in an ou tpu t record of a data file. E xample $FLTB(1.215) ;Returns a character string equivalent to: $CHR(^H3F)+$CHR(^H9B)+$CHR(^H85)+$CHR(^H1F) Related Keywords $ CHR strin g fu n ction DBLB real-valu ed fu n ction $ DBLB strin g fu n ction FLTB real-valu ed fu n ction $ INTB strin g fu n ction LNGB real-valu ed fu n ction $ LNGB strin g fu n ction $ TRANSB strin g fu n ction V+ Lan gu age Referen ce Gu ide Page 3 2 2 FOPE N program in stru ction FOPEN program instruction Syntax FOPEN ( logical_ u n it, mode) attribu te_ list Function Create an d open a n ew graph ics win dow or TCP con n ection , or open an existin g graph ics win dow for su bsequ en t in pu t or ou tpu t. Open a graph ics icon for defin ition . Usage Considerations Th e logical u n it mu st be attach ed before an open operation will su cceed. Wh en th is in stru ction is execu ted, an y previou s settin gs (for th e specified logical u n it) from th e followin g in stru ction s are reset to th eir defau lt con dition s: GCLIP, GCOLOR, GLOGICAL, an d GTE XTURE . Closin g or u n displayin g a win dow does n ot release th e graph ics memory u sed by th at win dow. Th e win dow mu st be deleted to release th at memory. (See th e FDE LE TE in stru ction .) Th e TCP mode of operation of th e FOPE N in stru ction applies on ly to Adept con trollers with th e AdeptNet option an d th e licen se for th e AdeptTCP/IP Protocol Access. V+ Lan gu age Referen ce Gu ide Page 3 2 3 FOPE N program in stru ction Parameters logical_ u n it Real valu e, variable, or expression (in terpreted as an in teger) th at defin es th e logical u n it n u mber assign ed to th e win dow or TCP device. (See th e ATTACH in stru ction for a description of u n it n u mbers.) mode Option al expression th at applies on ly to TCP logical u n its an d selects th e type of TCP con n ection : 0 = Clien t mode, 1 6 = Server mode. attribu te_ list List of strin g con stan ts, variables, an d expression s; real valu es, variables, an d expression s; an d format specifiers u sed to assign a n ame to th e win dow an d to defin e some of th e ch aracteristics of th e win dow. Wh en open in g a TCP con n ection in server mode, th is strin g defin es th e ch aracteristics of th e server. Wh en open in g a con n ection in clien t mode, th e strin g defin es th e n ame of th e server in addition to ch aracteristics of th e con n ection . Th e attribu te list (wh ich is processed like an ou tpu t specification for th e TYPE in stru ction ) is u sed to compose a sin gle strin g th at is passed to th e win dow man ager or TCP driver. Th e strin g mu st begin with th e n ame of th e win dow an d can option ally con tain keyword attribu tes th at defin e ch aracteristics of th e win dow. Th e strin g mu st n ot exceed 5 1 2 ch aracters. NOTE: A V+ strin g literal or strin g variable can n ot exceed 1 2 8 ch aracters. In order to create an attribu te list lon ger th an 1 2 8 ch aracters you mu st con caten ate mu ltiple strin gs. Th e attribu te list can con sist of on e or more compon en ts separated by commas. E ach compon en t can be expressed in an y of th e followin g ways: 1 . A strin g con stan t, variable, or expression . 2 . A real-valu ed con stan t, variable, or expression , wh ich is evalu ated to determin e a valu e to be u sed in th e con trol strin g. 3 . A format-con trol specifier, wh ich determin es th e format of in formation in th e con trol strin g. V+ Lan gu age Referen ce Gu ide Page 3 2 4 FOPE N program in stru ction Details Th ere are th ree basic u ses of th e FOPE N program in stru ction : l Usin g FOPE N With Win dows l Graph ics Memory Allocation l Usin g FOPE N With TCP Th e followin g section s describe each of th ese situ ation s. Usin g FOPEN W ith W in dows Th e primary u se of th is in stru ction is to create a n ew graph ics win dow or to establish a lin k to a win dow th at already exists. Th e in formation in th e in stru ction attribu te list iden tifies th e win dow an d defin es its ch aracteristics. After a win dow is open ed, it may be written to by an y of th e V+ graph ics in stru ction s. In fact, in stru ction s can ou tpu t to a win dow even if th e win dow is n ot displayed. In th at case th e ou tpu t will be seen th e n ext time th e win dow is displayed. Th is in stru ction can also be u sed to open a graph ics icon for defin ition in graph ics memory. After an icon is open ed, data can be written to it with th e WRITE in stru ction (see th e GICON in stru ction for details). Th e /ICON an d /ARRAY attribu tes, described below, apply to icon s. However, th is in stru ction n ormally is n ot u sed to defin e icon s. Icon s u su ally is defin ed by u sin g th e Adept Icon E ditin g Utility to create icon images an d store th em in data files on disk. At ru n time you r application program calls th e program load.icon to read th e data files an d defin es th e icon s in graph ics memory. NOTE:Th e icon editin g u tility is available with AIM software packages or with th e Adept Application Disk (con tact Adept to requ est th is disk). Graph ics Memory Allocation Th e V+ system h as th ese basic limitation s on th e n u mber of win dows an d icon s th at may be created: l Graph ics memory space l Th e n u mber of open win dows allowed by th e system l Th e n u mber of open icon s allowed by th e system Graph ics memory space is u sed by all graph ics items in clu din g win dows, fon ts, an d icon s. Th e portion of graph ics memory space th at is cu rren tly available can be determin ed with th e FRE E mon itor comman d or real-valu ed fu n ction . Th e error * Ou t of graph ics memory* in dicates th at graph ics memory space is filled. V+ Lan gu age Referen ce Gu ide Page 3 2 5 FOPE N program in stru ction Th e FRE E mon itor comman d an d real-valu ed fu n ction can be u sed to tell h ow man y win dows are available. Th e error * Too man y win dows* in dicates th at all th e allocated win dows are in u se. Th e maximu m n u mber of win dows is 2 5 0 . Th e maximu m n u mber of icon s is 2 5 5 . Th e error * Too man y icon s* in dicates th at all th e allocated icon bu ffers are in u se. W in dow Name - Gen eral I n formation Th e first compon en t in th e FOPE N argu men t strin g mu st be th e win dow n ame specifier. Th is compon en t determin es th e n ame of a n ew or existin g win dow to open . Win dow n ames follow a con ven tion similar to th at u sed for disk su bdirectories. Like su bdirectories, win dows can be logically related in tree stru ctu res. Th e backslash ch aracter (\) is u sed to separate n ames in th e tree stru ctu re. Th e first n ame in a win dow-n ame specification is for th e top-level win dow. Th at n ame mu st n ot be preceded by a backslash , bu t each su ccessive n ame in th e win dow-n ame specification mu st be preceded by a backslash . For example, th e n ame Graph can specify a top-level win dow n amed Graph . Th en , th e n ame Graph \Dialog specifies a win dow n amed Dialog th at is a ch ild of th e top-level win dow Graph . Th e same n ame can be u sed for more th an on e win dow in th e tree, except th at n o two ch ildren of on e win dow can h ave th e same n ame. (Wh en ch eckin g for u n iqu en ess, th e case of letters in th e n ame is ign ored.) Win dow n ames follow th e same ru les as program an d variable n ames. Th at is, each n ame mu st start with a letter an d can con tain on ly letters, n u mbers, periods, an d u n derlin e ch aracters. Letters u sed in win dow n ames can be en tered in eith er lowercase or u ppercase. Win dow n ames can h ave u p to 1 5 ch aracters. Note th at th e n ame for a top-level, closeable win dow (see th e /CLOSE ABLE attribu te) is u sed verbatim in th e Adept pu ll-down men u . Un less a title is explicitly specified for a win dow (see th e /TITLE attribu te for th e FSE T in stru ction ), th e n ame specified in th e FOPE N in stru ction is also u sed verbatim for th e title of th e win dow. W in dow Name - Reserved Names Th ere are a few win dow n ames th at are restricted. Th e stan dard win dows listed below are defin ed by th e V+ system. Th ese win dows can n ot be deleted by you , an d programs can n ot create top-level win dows with th e same n ames. Name Description Mon itor V+ mon itor win dow Mon itor_ n Mon itor win dows for addition al V+ systems (n = 2 to th e n u mber of V+ systems) V+ Lan gu age Referen ce Gu ide Page 3 2 6 FOPE N program in stru ction Statu s Wh ite bar at th e top of th e screen Vision Vision video an d graph ics win dow (* ) * Th e vision win dow appears on ly if th e vision option is in stalled. If a win dow h as associated con trol bars, th ey are accessed as su bwin dows with th e predefin ed n ames listed below. Name Description Horz_ scroll_ bar Horizon tal scroll bar Men u _ bar Pu ll-down men u bar Title_ bar Title bar Vert_ scroll_ bar Vertical scroll bar Attribu tes - Gen eral I n formation In addition to th e win dow-n ame specification , th e attribu te_ list parameter can con tain a n u mber of keyword attribu tes th at defin e ch aracteristics of th e win dow. Th ese attribu tes fall in to two grou ps. Th e first grou p, wh ich can appear on ly in an FOPE N in stru ction , is docu men ted below. Th e secon d grou p of attribu tes can be specified with an FOPE N in stru ction or with an FSE T in stru ction -th ese attribu tes are docu men ted with th e FSE T in stru ction . Win dow attribu tes can be specified in an y order in th e attribu te list. If an attribu te appears more th an on ce in th e same list, th e last in stan ce of th at attribu te su persedes all previou s in stan ces. E ach attribu te is specified by a strin g with th e followin g gen eral form: /keyword argument_1 ... argument_n All th e attribu tes con sist of a forward slash (/) an d a keyword, wh ich is option ally followed by an argu men t list. Argu men ts for an attribu te are separated by spaces (n ot by commas). Attribu te keywords may be specified in lowercase or u ppercase letters, an d th ey can be abbreviated as lon g as th e abbreviation can n ot be con fu sed with an oth er attribu te's. NOTE: To en su re th at programs will be compatible with fu tu re releases of V+, do n ot abbreviate keywords. Keywords an d n u meric argu men ts are en tered directly in th e attribu te list. Strin g argu men ts mu st be delimited with a pair of sin gle-qu ote ch aracters ('...'). E ach delimited strin g argu men t mu st be separated from th e n ext on e by at least on e space. A sin gle-qu ote ch aracter V+ Lan gu age Referen ce Gu ide Page 3 2 7 FOPE N program in stru ction may be specified with in a delimited strin g by in clu din g two con secu tive sin gle-qu ote ch aracters. Th e followin g examples sh ow h ow th e differen t types of attribu tes can be expressed. " /POSITION 4 0 0 2 0 0 " Keyword an d two explicit n u meric argu men ts " /BACKGROUND" , bg.color Keyword an d on e n u meric argu men t " /SHOW_ SCROLL" Keyword with n o argu men ts " /TITLE _ BAR 'E rase' 'E xit'" Keyword an d two strin g argu men ts Remember, th e argu men t list for th e FOPE N in stru ction is processed as a sin gle lon g strin g. E xtra spaces in th e strin g are ign ored, bu t tab ch aracters are n ot allowed. Wh en creatin g th e argu men t list for an FOPE N in stru ction , it may be h elpfu l to th in k in terms of composin g an ou tpu t lin e with th e TYPE or WRITE in stru ction . Attribu tes - Defau lt S ettin gs Wh en a n ew win dow is created, th e maximu m-size attribu te mu st be specified. (Th at attribu te is ign ored if it is specified wh en an existin g win dow is reopen ed.) However, most of th e win dow attribu tes do n ot n eed to be specified-defau lt settin gs are assu med for attribu tes th at are n ot men tion ed in th e attribu te list. Note th at th e min imu m win dow size for win dows with a title bar is 8 x 8 . Un less oth erwise specified, th e win dow is created if it does n ot already exist, an d th e win dow is open ed for read-write access. Th e /NE W an d /WRITE ONLY attribu tes specify open in g modes oth er th an th e defau lts. A n ew win dow h as th e followin g defau lt ch aracteristics: l It h as a title bar. l It h as a men u bar. l It h as h orizon tal an d vertical scroll bars. l If it is a top-level win dow, it can be closed with th e Close icon . Wh en a (n ew or existin g) win dow is open ed, it h as th e followin g defau lt graph ics state u n less th e FOPE N in stru ction in clu des an overridin g attribu te specification . Ch aracteristic S ettin g V+ Lan gu age Referen ce Gu ide Page 3 2 8 FOPE N program in stru ction Fon t 1 Ch aracter path 0 Ch aracter rotation 0 Foregrou n d color Black Backgrou n d color Ligh t blu e Textu re Tran sparen t Textu re pattern Solid Logical operation Sou rce Bit-plan e mask All bit plan es Attribu tes - Description s Th e win dow attribu tes th at can be specified with th e FOPE N in stru ction are described in th e table FOPE N Win dow Attribu tes. Th e followin g in formation is provided for each attribu te: l Keyword th at iden tifies th e attribu te Some attribu tes can be eith er on or off. For each su ch attribu te th ere are two correspon din g keywords. Th e on keyword directly relates to th e attribu te (for example, /CLOSE ABLE ); th e off keyword h as a NO prefix (for example, /NOCLOSE ABLE ). l Description of th e effect of th e attribu te For attribu tes with an on /off ch aracter, th e on con dition is described. Note th at some attribu tes can n ot be ch an ged after a win dow is created. Th e keywords for th ose attribu tes are ign ored wh en an existin g win dow is open ed. l Description of an y argu men ts requ ired for th e attribu te l Defau lt settin g assu med if th e attribu te is n ot specified NOTE:Th e win dow attribu tes sh own in FOPE N Win dow Attribu tes can be specified on ly with an FOPE N in stru ction . Th ere are addition al attribu tes th at can be specified eith er with an FOPE N or with an FSE T in stru ction . Th ose attribu tes are docu men ted with th e FSE T in stru ction . V+ Lan gu age Referen ce Gu ide Page 3 2 9 FOPE N program in stru ction FOPEN W in dow Attribu tes Attribu te: /ARRAY Explan ation : Th is keyword is mean in gfu l on ly wh en th e /ICON or /DE FFONT keyword is also presen t (see below). Th is keyword specifies th e maximu m in dex for th e icon bein g open ed for defin ition on th e specified logical u n it or th e maximu m ch aracters in th e fon t. Argu men t: In teger maximu m in dex for th e icon or fon t to be defin ed (0 - 2 5 5 ; 0 mean s on ly on e elemen t is available) Defau lt: /ARRAY 0 Attribu te: /BACKGROUND Explan ation : Specifies th e win dow backgrou n d color for a n ew win dow. Th is keyword h as n o effect if th e win dow already exists. Argu men t: Color n u mber (0 to 1 5 for 1 6 -color win dow; 0 or 1 for 2 -color win dow) Defau lt: Defau lt: /BACKGROUND 5 (for 1 6 -color win dow) an d /BACKGROUND 0 (for 2 -color win dow) Attribu te: /BUFFE RE D Explan ation : In dicates th at graph ics comman ds are to be bu ffered u p to 5 1 2 bytes rath er th an bein g sen t in dividu ally. Th e bu ffer con ten ts are sen t to th e win dow wh en ever th e bu ffer is filled or wh en an FE MPTY in stru ction is execu ted. Bu ffered mode is mu ch more efficien t wh en man y graph ics comman ds are sen t. Comman ds with in a sin gle bu ffer are execu ted in divisibly, wh ich is u sefu l for an imation (erasin g old an d drawin g n ew). Argu men t: Non e Defau lt: Ou tpu t is n ot bu ffered V+ Lan gu age Referen ce Gu ide Page 3 3 0 FOPE N program in stru ction Attribu te: /CLOSE ABLE an d /NOCLOSE ABLE Explan ation : In dicates th at th e win dow can be closed with th e close icon if it is a top-level win dow. Also, if it is a top-level win dow, th e win dow n ame (n ot title) appears in th e Adept pu ll-down men u at th e top of th e screen . (After th e pu ll-down becomes fu ll, all su bsequ en t win dows created will be forced to be n on closeable.) Argu men t: Non e Defau lt: /CLOSE ABLE Attribu te: /COLORS Explan ation : Th is attribu te is ign ored by AdeptWin dows. Specifies th e n u mber of colors (an d th erefore th e n u mber of bits per pixel) for a n ew win dow. Twocolor win dows take on ly on e fou rth as mu ch memory as 1 6 -color win dows. Win dows with 2 colors are always black an d ligh t blu e. Th is keyword h as n o effect if th e win dow already exists. Argu men t: Nu mber of colors (2 or 1 6 [valu es 3 th rou gh 1 5 are con sidered to be 1 6 ; valu es less th an 2 or greater th an 1 6 are in valid]) Defau lt: /COLORS 1 6 Attribu te: /DE FFONT n Explan ation : Th is attribu te is ign ored by AdeptWin dows. In dicates th at th e logical u n it is to be open ed for defin in g a fon t rath er th an for accessin g a win dow. (After h avin g been open ed for defin in g a fon t, th e logical u n it mu st be closed [with an FCLOSE in stru ction ] before it can be reopen ed for accessin g a win dow.) If th e fon t already exists an d is n on -deletable (e.g., all stan dard fon ts), a * Protection error* is retu rn ed. If th e fon t already exists an d is dele- V+ Lan gu age Referen ce Gu ide Page 3 3 1 FOPE N program in stru ction table, it is deleted an d replaced by th e n ew fon t. Th e maximu m size of ch aracters is 2 5 5 pixels (/SIZE 2 5 5 2 5 5 ). If th e /POSITION keyword is specified, its argu men ts specify th e position of th e referen ce poin t of th e icon relative to th e top left corn er of th e icon . Th e argu men ts mu st be in th e ran ge 0 to 2 5 5 ; th eir defau lt valu es are both zero. If th e /ARRAY keyword is specified, its argu men t specifies th e maximu m in dex to be u sed for an array of ch aracters. Th e valu e mu st be in th e ran ge 0 to 2 5 5 . Argu men t: In teger in dicatin g wh ich fon t is to be defin ed Defau lt: Open a win dow Attribu te: /ICON Explan ation : In dicates th at th e logical u n it is to be open ed for defin in g an icon rath er th an for accessin g a win dow. (After h avin g been open ed for defin in g an icon , th e logical u n it mu st be closed [with an FCLOSE in stru ction ] before it can be reopen ed for accessin g a win dow.) Wh en a logical u n it is open ed for defin in g an icon , th e n ame specified with th e FOPE N in stru ction is u sed for th e n ame of th e icon . If th e icon already exists, th e icon size an d maximu m in dex specified in th e FOPE N in stru ction mu st match th e old icon size an d maximu m in dex (see below). System icon s may n ot be redefin ed. Th e /SIZE keyword mu st be specified if /ICON is specified. Th e argu men ts specified with th e /SIZE keyword in dicate th e size of th e icon . Th eir valu es mu st be in th e ran ge 1 to 2 5 5 (an d th ey are n ot rou n ded). If th e /POSITION keyword is specified, its argu men ts specify th e position of th e referen ce poin t of th e icon relative to th e top left corn er of th e icon . Th e argu men ts mu st be in th e ran ge 0 to 2 5 5 ; th eir defau lt valu es are both zero. V+ Lan gu age Referen ce Gu ide Page 3 3 2 FOPE N program in stru ction If th e /ARRAY keyword is specified, its argu men t specifies th e maximu m in dex to be u sed for an icon array. Th e valu e mu st be in th e ran ge 0 to 2 5 5 ; th e defau lt is zero, in dicatin g on ly a sin gle icon . See th e GICON in stru ction for in formation on h ow to defin e th e image of an icon . Argu men t: Non e Defau lt: Open a win dow Attribu te: /MAXSIZE Explan ation : Specifies th e size of th e win dow wh en it is created; also specifies th e maximu m size th e win dow can be dragged to with th e mou se. Th is keyword h as n o effect if th e win dow already exists. Th e X valu e is always rou n ded u p to be an even n u mber. For win dows with a title bar, X an d Y valu es less th an 6 4 are set to 6 4 . For win dows with ou t a title bar, X an d Y valu es less th an 8 are set to 8 . Argu men t: 1 . X dimen sion in pixels (if th e valu e is odd, it is rou n ded u p to an even n u mber) 2 . Y dimen sion in pixels Defau lt: Non e-both argu men ts mu st be given Attribu te: /NE W Explan ation : Forces creation of a n ew win dow. An error is retu rn ed (via IOSTAT) if th e win dow already exists. Argu men t: Non e Defau lt: New or existin g win dow is open ed Attribu te: /SCROLL_ BAR an d /NOSCROLL_ BAR V+ Lan gu age Referen ce Gu ide Page 3 3 3 FOPE N program in stru ction Explan ation : In dicates th at th e win dow is to be created with vertical an d h orizon tal scroll bars. Th is keyword h as n o effect if th e win dow already exists. (Also see /SHOW_ SCROLL.) Argu men t: Non e Defau lt: /SCROLL_ BAR Attribu te: /SHOW_ SCROLL an d /NOSHOW_ SCROLL Explan ation : Th is attribu te is ign ored by AdeptWin dows. In dicates th at th e win dow is to be in itially displayed with its scroll bars sh owin g. Th is keyword h as n o effect if th e win dow already exists. (Also see /SCROLL_ BAR.) Argu men t: Non e Defau lt: /NOSHOW_ SCROLL Attribu te: /TITLE _ BAR an d /NOTITLE _ BAR Explan ation : In dicates th at th e win dow is to be created with a title bar. Th is keyword h as n o effect if th e win dow already exists. Argu men t: Non e Defau lt: /TITLE _ BAR Attribu te: /WRITE ONLY Explan ation : In dicates th at th e win dow is to be open on ly for writin g (th u s, th e win dow will n ot h ave an even t qu eu e). A win dow can be simu ltan eou sly open ed for write-on ly access by more th an on e program task. On ly on e win dow can h ave read access at an y on e time. Argu men t: Non e V+ Lan gu age Referen ce Gu ide Page 3 3 4 FOPE N program in stru ction Defau lt: Win dow h as read access Usin g FOPEN W ith TCP A TCP/IP con n ection can be open ed in eith er server mode or clien t mode. In server mode, on e or more clien ts (depen din g on th e valu e assign ed to /CLIE NTS) are allowed to con n ect to th e server for su bsequ en t commu n ication . To establish a clien t-server con n ection , th e clien t mu st kn ow th e port n u mber for th e server. For th is reason , wh en u sin g th e FOPE N in stru ction for open in g a server con n ection , th e port is explicitly defin ed u sin g th e /LOCAL_ PORT attribu te. Note th at th e server does n ot n eed to kn ow th e port n u mber u sed by th e clien t. Port n u mbers 0 th rou gh 2 5 5 are u sed by stan dard TCP application packages. For example, FTP u ses ports 2 0 an d 2 1 . By con ven tion , if you are writin g you r own cu stom protocol, u se a port n u mber greater th an 2 5 5 . Th e followin g table sh ows valid TCP attribu tes for th e FOPE N in stru ction . FOPEN TCP Attribu tes Attribu te: Explan ation : /BUFFE R_ SIZE Defin es th e size of th e bu ffer. If omitted, th e bu ffer size defau lts to 1 0 2 4 bytes. NOTE: Wh en u sin g th e FOPE N program in stru ction for a UDP Server, th e /BUFFE R_ SIZE attribu te sh ou ld n ot be specified. Attribu te: /CLIE NTS Explan ation : Defin es th e n u mber of clien t con n ection s allowable on a server. If omitted, a sin gle clien t con n ection is assu med. Th e maximu m n u mber of clien t con n ection s was in creased from 1 5 to 3 1 for V+ system version 1 6 .4 edit C2 an d later. Attribu te: /LOCAL_ PORT xplan ation : Defin es th e local port n u mber for th e con n ection . If omitted, a local port n u mber is au tomatically assign ed. Attribu te: /RE MOTE _ PORT V+ Lan gu age Referen ce Gu ide Page 3 3 5 FOPE N program in stru ction Explan ation : Defin es th e port n u mber of a server to wh ich a clien t con n ection is to be made. Th is mu st be provided wh en establish in g a clien t con n ection . E xamples Th e example below open s a n ew or existin g win dow n amed My_ Graph on th e logical u n it iden tified by th e valu e of lu n . If th e win dow is bein g created, th e size of th e win dow is specified by th e variables x.size an d y.size; th e in itial position is fixed at X=4 0 0 , Y=2 0 0 ; th e backgrou n d color is defin ed by th e valu e of bckgrn d.col; an d th e scrollbars are to be displayed. Ou tpu t to th e win dow is to be bu ffered. Th e win dow will be accessible in read-write mode. (In addition , th ere are several oth er attribu tes th at will h ave defau lt settin gs-see th e FSE T in stru ction .) NOTE: Th e FOPE N in stru ction is sh own on mu ltiple lin es becau se of th e limited page width . In a V+ program th e in stru ction mu st be fu lly con tain ed on a sin gle lin e. FOPEN (lun) "My_Graph", "/MAXSIZE", x.size, y.size, "/POSITION 400 200 /BACKGROUND", bckgrnd.col, "/SHOW_SCROLL/BUFFER" Assu min g th at x.size is 1 0 0 , y.size is 1 5 0 , an d bckgrn d.col is 4 , th e strin g below resu lts wh en th e argu men t list is processed. (Note th at spaces between attribu tes are option al, bu t th e spaces between keywords an d parameters or th ose between parameters are n ot.) "My_Graph/MAXSIZE 100 150/POSITION 400 200 /BACKGROUND 4 /SHOW_SCROLL/BUFFER" In th is case, th e followin g attribu te settin gs are u sed by defau lt: "/COLORS 16 /CLOSEABLE /SCROLL_BAR /TITLE_BAR" Th e followin g example sh ows a u tility su brou tin e th at is passed th e logical u n it n u mber, th e win dow n ame, a list in dex, an d th e desired backgrou n d color. Strin g variables are u sed to refer to altern ative lists of win dow attribu tes. Th e statu s of th e FOPE N operation is retu rn ed in th e variable error. .PROGRAM open.window(lun, $name, type, color, error) AUTO $list[2] ; Define sets of common attributes $list[1] = "/MAXSIZE 100 100 /NOSCROLL_BAR /BUFFER" $list[2] = "/MAXSIZE 300 200 /SCROLL_BAR /SHOW_SCROLL /BUFFER" ; Open the window ATTACH (lun, 4) "GRAPHICS" FOPEN (lun) $name, $list[type], "/BACKGROUND", color error = IOSTAT(lun) ;Return error status RETURN V+ Lan gu age Referen ce Gu ide Page 3 3 6 FOPE N program in stru ction Set u p a TCP server with local port #2 6 0 to accept 5 clien t con n ection s, with a bu ffer size of 1 0 2 4 bytes: FOPEN (lun, 16) "/LOCAL_PORT 260 /CLIENTS 5 /BUFFER_SIZE 1024" Set u p a TCP clien t con n ection th at con n ects to port n u mber 2 6 0 on th e server called server1 , an d allocate a bu ffer size of 1 0 2 4 bytes: FOPEN (lun, 0) "server1 /REMOTE_PORT 260 /BUFFER_SIZE 1024" Related Keywords ATTACH program in stru ction DE TACH program in stru ction FCLOSE program in stru ction FDE LE TE program in stru ction FE MPTY program in stru ction FSE T program in stru ction IOSTAT real-valu ed fu n ction V+ Lan gu age Referen ce Gu ide Page 3 3 7 FOPE N_ program in stru ction FOPEN_ program instruction Syntax FOPEN_ ( lu n , record_ len , mode) file_ spec Function Open a disk file for read-on ly, read-write, read-write-appen d, or read-directory, as in dicated by th e last letter of th e in stru ction n ame. Th e forms of FOPE N_ are: l FOPE NA l FOPE ND l FOPE NR l FOPE NW See th e Details section for description s of each in stru ction . Usage Considerations A logical u n it mu st be attach ed before an open operation will su cceed. No more th an 6 0 disk files an d 1 6 0 n etwork files can be open by th e en tire system at an y time. Th at in clu des files open ed by all of th e program tasks an d by th e system mon itor (for example, for an FCOPY comman d). Defau lt file n ame exten sion s are applied to files on th e NFS device ju st like th ey are for th e local DISK devices (e.g., th e exten sion .V2 is appen ded to files referen ced by th e LOAD comman d). V+ Lan gu age Referen ce Gu ide Page 3 3 8 FOPE N_ program in stru ction Parameters lu n Real-valu ed expression defin in g th e logical u n it n u mber of th e disk device to be accessed. (See th e ATTACH in stru ction for a description of u n it n u mbers.) record_ len Option al real-valu ed expression defin in g th e len gth of records to be read an d written . If th e record len gth is omitted or is zero, variable-len gth records are processed. In th is case, ran dom access of records can n ot be don e. If th e record len gth is n on zero, it specifies th e len gth (in ch aracters) of fixed-len gth records to be processed. Ran dom access is allowed with fixed-len gth records. mode Option al real-valu ed expression defin in g h ow read access is to be don e. Th e valu e specified is in terpreted as a sequ en ce of bit flags as detailed below. (All bits are assu med to be clear if n o mode valu e is specified.) Bit 1 ( LS B) Disable prereads ( mask valu e = 1 ) If th is bit is clear, V+ will read a record as soon as th e file is open ed (a preread) an d after each RE AD in stru ction in an ticipation of su bsequ en t RE AD requ ests. If th is bit is set, n o su ch prereads are performed. Bit 2 En able ran dom access ( mask valu e = 2 ) If th is bit is clear, th e file will be accessed sequ en tially. Th at is, records are read or written in th e order th ey occu r in th e file. If th is bit is set, th e file is accessed u sin g ran dom access (wh ich is allowed on ly for disk files with fixed-len gth records). In ran dom-access mode, th e record-n u mber parameter in th e RE AD or WRITE in stru ction specifies wh ich record is accessed. Bit 4 Force disk write ( mask valu e = 8 ) If set for a disk file bein g open ed for write access, th e ph ysical disk is written every time a record is written . In addition , th e directory or file allocation in formation is u pdated with each write. Th is mode is equ ivalen t to (bu t faster th an ) closin g th e file after every write. It is mu ch slower th an n ormal bu ffered mode, bu t it gu aran tees th at in formation th at is written will n ot be lost du e to a system crash or power failu re. Th is mode is in ten ded primarily for u se with log files th at are left open ed over an exten ded period of time an d in termitten tly u pdated. For th ese types of files, th e addition al (sign ifican t) overh ead of th is mode is n ot as importan t as th e ben efit. V+ Lan gu age Referen ce Gu ide Page 3 3 9 FOPE N_ program in stru ction file_ spec Strin g con stan t, variable, or expression specifyin g th e file to be open ed. Th e strin g may con tain an option al disk u n it an d an option al directory path , an d mu st con tain a file n ame, a period (.), an d a file exten sion . (For FOPE ND, th e file n ame an d exten sion are option al, an d both can con tain wildcard ch aracters-see below.) Th e cu rren t defau lt disk u n it an d directory path are con sidered as appropriate (see Usin g Directories for addition al in formation on disk u n its an d directory path s.) Th e file specification may n ot in clu de a ph ysical device (for example, KE RMIT). If th at compon en t is n eeded, it mu st be specified wh en th e logical u n it is attach ed. Details Th is in stru ction open s a disk file so th at in pu t/ou tpu t (I/O) operation s can be performed. Wh en th e I/O operation s are complete, th e file sh ou ld be closed u sin g an FCLOSE or DE TACH in stru ction . FOPE NA Open s a file for read-write-appen d access. If th e specified file does n ot already exist, th e file is created. If th e file already exists, n o error occu rs, an d th e file position is set to th e en d of th e file. Write operation s th en appen d to th e existin g file. FOPE ND Open s a disk directory for readin g. Th e file n ame an d exten sion in th e file_ spec parameter are u sed to prepare a file n ame template for u se wh en read operation s are later performed. Th ose read operation s retu rn on ly records from th e disk directory file th at match th e file n ame template. An y attempt to write to th e directory file cau ses an error. (For in formation on th e format of directory records, see th e section Accessin g th e Disk Directories in th e V+ Lan gu age User's Gu ide.) Th e file n ame an d exten sion can in clu de wildcard ch aracters (asterisks, * ). A wildcard ch aracter with in a file n ame or exten sion in dicates th at an y ch aracter sh ou ld be accepted in th at position . A wildcard ch aracter at th e en d of a file n ame or exten sion in dicates th at an y trailin g ch aracters are acceptable. A wildcard ch aracter in place of a file n ame (or exten sion ) in dicates th at an y n ame (or exten sion ) is acceptable. Omission of th e file n ame, th e period, an d th e file exten sion is equ ivalen t to specifyin g * .* . Omission of th e period an d file exten sion is equ ivalen t to specifyin g a wildcard exten sion . Th e FOPE ND in stru ction can n ot access th e KE RMIT device. V+ Lan gu age Referen ce Gu ide Page 3 4 0 FOPE N_ program in stru ction FOPE NR Open s a file for read-on ly access. If th e file does n ot already exist, an error occu rs. An y attempt to write to th e file cau ses an error. FOPE NW Open s a file for read-write access. If th e file already exists, an error occu rs. An y error in th e specification of th is in stru ction (su ch as attemptin g to access an in valid u n it) will cau se a program error an d will h alt program execu tion . However, errors associated with performin g th e actu al operation s (su ch as device n ot ready) do n ot h alt program execu tion sin ce th ese errors can occu r in th e n ormal operation of a program. Th ese n ormal errors can be detected by u sin g th e IOSTAT fu n ction . E xample FOPENR (5) "data.dat" Open th e file n amed data.dat on th e defau lt device for read-on ly access with variable-len gth records (record len gth omitted). Sin ce th e mode parameter is omitted, prereads will occu r an d th e records will be accessed sequ en tially (wh ich is requ ired for variable-len gth records). FOPENW (5, 32, 3) "A:x.d" Open th e file n amed x.d on th e device A for read-write access u sin g fixed-len gth records of 3 2 ch aracters each . Th e mode valu e 3 h as both bits 1 an d 2 set; th u s, prereads are to be disabled an d ran dom access is to be u sed. FOPEND (5) "*.dat" Open th e cu rren t defau lt directory to fin d all th e files with th e exten sion DAT. Related Keywords ATTACH program in stru ction DE TACH program in stru ction FCLOSE program in stru ction FOPE N_ program in stru ction IOSTAT real-valu ed fu n ction V+ Lan gu age Referen ce Gu ide Page 3 4 1 FOR program in stru ction FOR program instruction Syntax FOR loop_ var = in itial TO fin al S TEP in cremen t Function E xecu te a grou p of program in stru ction s a certain n u mber of times. Usage Considerations An E ND in stru ction mu st be in clu ded in a program to match every FOR. Parameters loop_ var Real valu ed variable th at is in itialized wh en th e FOR in stru ction is execu ted an d is in cremen ted each time th e loop is execu ted (can n ot be a specified valu e or expression ). in itial Real valu e th at determin es th e valu e of th e loop variable th e first time th e loop is execu ted. fin al Real valu e th at establish es th e valu e to be compared to th e loop variable to determin e wh en th e loop sh ou ld be termin ated. in cremen t Option al real-valu e th at establish es th e valu e to be added to th e loop variable every time th e loop is execu ted. If omitted, th e in cremen t defau lts to on e, an d th e keyword STE P may also be omitted. Details Th e in stru ction s between th e FOR statemen t an d th e match in g E ND statemen t are execu ted repeatedly, an d loop_ var is ch an ged each time by th e valu e of in cremen t. Th e processin g of th is stru ctu re is as follows: 1 . Wh en th e FOR statemen t is first en tered, set loop_ var to th e in itial valu e. 2 . Determin e th e valu es of th e in cremen t an d fin al parameters. 3 . Compare th e valu e of fin al to th e valu e of loop_ var: l If in cremen t is positive an d loop_ var is greater th an fin al, skip to item 7 below. V+ Lan gu age Referen ce Gu ide Page 3 4 2 FOR program in stru ction l If in cremen t is n egative an d loop_ var is less th an (th at is, more n egative th an ) fin al, skip to item 7 below. 4 . E xecu te th e grou p of in stru ction s followin g th e FOR statemen t. 5 . Wh en th e E ND step is reach ed, add th e valu e of in cremen t to th e loop variable. 6 . Go back to item 3 above. 7 . Con tin u e program execu tion at th e first in stru ction after th e E ND statemen t. loop_ var retain s th e valu e it h ad at th e time of th e test in item 3 above. Note th at th e grou p of in stru ction s in th e FOR stru ctu re may n ot be execu ted at all if th e test in item 3 fails th e first time. Th e valu es of in itial, in cremen t, an d fin al wh en th e FOR statemen t is first execu ted determin e h ow man y times th e grou p of in stru ction s are execu ted. An y ch an ges to th e valu es of th ese parameters with in th e FOR loop h ave n o effect on th e processin g of th e FOR stru ctu re. Ch an ges to th e loop variable with in th e loop affect th e operation of th e loop an d sh ou ld n ormally n ot be don e. NOTE: If in itial, fin al, or in cremen t are n ot in teger valu es, rou n din g in th e floatin g poin t compu tation s may cau se th e loop to be execu ted more or fewer timer th an expected. E xample Th e followin g example sets all elemen ts of a 1 0 x1 0 array to 0 : FOR i = 1 TO 10 FOR j = 1 TO 10 array[i,j] = 0 END END Related Keywords DO program in stru ction E XIT program in stru ction NE XT program in stru ction WHILE program in stru ction V+ Lan gu age Referen ce Gu ide Page 3 4 3 FORCE ._ program in stru ction FOR CE._ program instruction Syntax FORCE._ Function AdeptForce option statu s an d con trol in stru ction s. Usage Considerations Th e forms of FORCE ._ are: FORCE .FRAME Set tran sformation for force referen ce frame FORCE .MODE Set an d con trol force operatin g modes FORCE .OFFSE T Set temporary or perman en t force offset FORCE .RE AD Retu rn cu rren t force readin g Details Th ese in stru ction s are part of th e AdeptForce VME option . See th e AdeptForce VME User's Gu ide for fu ll syn tax an d details. S top on Digital S ign al ( V+ 1 6 .3 edit D an d later) A " stop-on -digital-sign al" fu n ction ality is available. With th is featu re, an y Adept robot system can be programmed to stop rapidly on a digital-in pu t latch even t. For example, th is featu re cou ld be u sed du rin g h igh -speed assembly search es. Th is featu re, wh ich operates like an AdeptForce (stop-on -force) gu arded move, is en abled an d disabled with th e program in stru ction s " FORCE .MODE (2 )" an d " FORCE .MODE (-2 )" , respectively. For more details on th e AdeptForce (stop-on -force) gu arded move, see th e AdeptForce VME User's Gu ide. To u se th is featu re, do th e followin g: NOTE: Ch an ges to th e system con figu ration do n ot take effect u n til th e system is rebooted. 1 . Usin g th e CONFIG_ C system con figu ration u tility, ch an ge th e TRAJ_ RATE system parameter to th e valu e 5 0 0 Hz. (See th e description of th e CONFIG_ C u tility, in th e V+ Lan gu age Referen ce Gu ide Page 3 4 4 FORCE ._ program in stru ction In stru ction s for Adept Utility Programs, for details on ch an gin g th e trajectory rate.) Th is will in crease th e speed of respon se. 2 . Usin g th e CONFIG_ C system con figu ration u tility, add a POS_ LATCH clau se to th e robot statemen t. For example, th e clau se " /POS_ LATCH 1 0 0 1 " will cau se a position latch to occu r on th e leadin g edge of a ch an ge in in pu t sign al 1 0 0 1 . (See th e description of th e CONFIG_ C u tility, in th e In stru ction s for Adept Utility Programs, for details an d restriction s on th e POS_ LATCH clau se.) An example of th is clau se is sh own in th e followin g code: ROBOT 1 = "/MODULE -1 /OUTPUT_BLOCK 1 /OUTPUT_BYTE 2 /IO_OPTIONAL YES /POS_LATCH 1001 /LATCH_BUFFER 1" 3 . In you r V+ program, in itiate stop-on -digital-sign al u sin g a FORCE .MODE (2 ) program in stru ction . You can detect a stop by pollin g th e LATCHE D(1 ) fu n ction or th e STATE (2 ) fu n ction . You can disable stop-on -digital-sign al with a FORCE .MODE (-2 ) program in stru ction . An example of u sin g th e " stop-on -digital-sign al" capability is sh own below: MOVE goal FORCE.MODE (2) WAIT STATE(2) <> 1 FORCE.MODE (-2) trigger = LATCHED(1) ;Start motion ;Enable "stop-on-digital-signal" mode ;Wait until the move terminates ;Disable "stop-on-digital-signal" mode ;Determine if trigger occurred After a " stop-on -digital-sign al" occu rs, th e LATCHE D(1 ) fu n ction retu rn s th e valu e -1 (TRUE ) to in dicate th at th e even t h ad occu rred, an d th e tran sformation fu n ction LATCH(1 ) an d th e precision -poin t fu n ction #PLATCH(1 ) retu rn th e position of th e robot at th e time of th e even t. Th e real-valu ed fu n ction STATE (2 ) can be u sed to determin e th e state of th e stopped motion . STATE (2 ) h as th e valu e 1 0 after a stop-on -digital-sign al even t h as occu rred. Th e stop-on -digital-sign al featu re mu st be re-en abled with an oth er FORCE .MODE (2 ) in stru ction before an oth er trigger can occu r. NOTE: Th e " stop-on -digital-sign al" fu n ction ality requ ires th e E n h an ced Trajectory Gen erator licen se, wh ich mu st be pu rch ased from Adept an d in stalled on th e Adept con troller. Related Keywords LATCH tran sformation fu n ction LATCHE D real-valu ed fu n ction #PLATCH precision -poin t fu n ction SE LE CT real-valu ed fu n ction STATE real-valu ed fu n ction V+ Lan gu age Referen ce Gu ide Page 3 4 5 FRACT real-valu ed fu n ction FR ACT real-valued function Syntax FRACT ( valu e) Function Retu rn th e fraction al part of th e argu men t. Parameter valu e Real-valu ed expression wh ose fraction al part is retu rn ed by th is fu n ction . Details Th e fraction al part of a real valu e is th e portion to th e righ t of th e decimal poin t (wh en th e valu e is written with ou t th e u se of scien tific n otation ). Th e valu e retu rn ed h as th e same sign as th e fu n ction argu men t. E xamples FRACT(0.123) FRACT(-5.462) FRACT(1.3125E+2) ;Returns 0.123 ;Returns -0.462 ;Returns 0.25 (1.3125E+2 = 131.25) Related Keyword INT real-valu ed fu n ction V+ Lan gu age Referen ce Gu ide Page 3 4 6 FRAME tran sformation fu n ction FR AME transformation function Syntax FRAME ( location _ 1 , location _ 2 , location _ 3 , location _ 4 ) Function Retu rn a tran sformation valu e defin ed by fou r position s. Parameters location _ 1 Tran sformation , compou n d tran sformation , or a tran sformation valu ed fu n ction wh ose position is u sed to defin e th e X axis of th e compu ted frame. location _ 2 Tran sformation , compou n d tran sformation , or a tran sformation valu ed fu n ction wh ose position is u sed to defin e th e X axis of th e compu ted frame. location _ 3 Tran sformation , compou n d tran sformation , or a tran sformation valu ed fu n ction wh ose position is u sed to defin e th e Y axis of th e compu ted frame. location _ 4 Tran sformation , compou n d tran sformation , or a tran sformation valu ed fu n ction wh ose position is retu rn ed as th e position of th e compu ted frame tran sformation . Details Wh ile th e robot can be u sed to defin e an X, Y, Z position very accu rately, it is often difficu lt to defin e precisely an orien tation . For application s su ch as palletizin g, th e FRAME fu n ction is very u sefu l for accu rately defin in g a base tran sformation wh ose position an d orien tation are determin ed by fou r position s. Th is fu n ction retu rn s a tran sformation valu e th at is compu ted as follows: 1 . Its origin is at th e poin t defin ed by location _ 4 . 2 . Its positive X axis is parallel to th e lin e passin g th rou gh th e poin ts defin ed by location _ 1 an d location _ 2 , in th e direction from location _ 1 to location _ 2 . 3 . Its X-Y plan e is parallel to th e plan e th at con tain s th e poin ts defin ed by location _ 1 , location _ 2 , an d location _ 3 . 4 . Its positive Y direction is from th e compu ted X axes (as defin ed above), toward th e poin t defin ed by location _ 3 . V+ Lan gu age Referen ce Gu ide Page 3 4 7 FRAME tran sformation fu n ction E xample Th e followin g in stru ction defin es th e tran sformation base.frame to h ave th e same X, Y, Z position as origin , its X axis parallel to th e lin e from cen ter to x, an d its Y axis approximately in th e same direction as th e lin e from cen ter to y. SET base.frame = FRAME(center, x, y, origin) Related Keyword TRANS tran sformation fu n ction V+ Lan gu age Referen ce Gu ide Page 3 4 8 FRE E real-valu ed fu n ction FR EE real-valued function Syntax FREE ( memory, select) Function Retu rn th e amou n t of u n u sed free memory storage space. Parameters memory Option al real valu e, variable, or expression (in terpreted as an in teger) th at specifies wh ich portion of system memory is to be examin ed, as sh own below. Th e valu e zero is assu med if th e parameter is omitted. memory Memory examin ed 0 1 Graph ics memory 2 select Program memory Vision memory Option al real valu e, variable, or expression (in terpreted as an in teger) th at specifies wh at in formation abou t th e memory is to be retu rn ed, as sh own below. Th e valu e zero is assu med if th e parameter is omitted. select I n formation retu rn ed 0 Percen tage of memory available 1 Available memory, in kilobytes (1 0 2 4 bytes) 2 Nu mber of segmen ts in program memory (memory = 0) Nu mber of free win dows (memory = 1 ) % of vision memory u sed for models (memory = 2 ) NOTE: If both parameters are omitted, th e paren th eses mu st still be in clu ded. V+ Lan gu age Referen ce Gu ide Page 3 4 9 FRE E real-valu ed fu n ction Details Th is fu n ction retu rn s th e in formation displayed by th e FRE E comman d. Un like th e FRE E comman d, h owever, th is fu n ction retu rn s on ly on e valu e, determin ed by th e valu es specified for th e memory an d select parameters. As sh own above, th e memory parameter specifies wh ich portion of system memory is to be examin ed. Th e select parameter specifies wh ich item of in formation is to be retu rn ed for th at portion of memory. If th e con troller does n ot h ave a graph ics system processor, th is fu n ction always retu rn s zero wh en th e memory parameter is 1 . If th e con troller does n ot in clu de th e option al AdeptVision system, th e fu n ction always retu rn s zero wh en th e memory parameter is 2 . Related Keyword FRE E mon itor comman d V+ Lan gu age Referen ce Gu ide Page 3 5 0 FSE E K program in stru ction FSEEK program instruction Syntax FS EEK ( logical_ u n it, record_ n u mber) Function Position a file open for ran dom access an d in itiate a read operation on th e specified record. Usage Considerations A file mu st be open for ran dom access on th e specified logical u n it (see th e FOPE N_ in stru ction ). For efficien cy in most application s, th e file sh ou ld be open ed in n o preread mode. Parameters logical_ u n it Real-valu ed expression th at iden tifies th e device to be accessed. (See th e ATTACH in stru ction for a description of u n it n u mbers.) record_ n u mber Option al real-valu ed expression th at specifies th e record to read for file-orien ted devices open ed in ran dom-access mode. If omitted, th e record followin g th e on e last read is assu med. Details Wh en a file is open for ran dom access, system performan ce can be improved by overlappin g th e time requ ired for disk file access with processin g of th e cu rren t data. By u sin g th e FSE E K in stru ction , an application program can in itiate a disk seek an d possible read operation immediately after a RE AD in stru ction is processed bu t before processin g th e data. An y error in th e specification of th is in stru ction (su ch as referen cin g an in valid u n it) cau ses a program error an d h alts program execu tion . However, errors associated with performin g th e actu al seek operation (su ch as en d of file or device n ot ready) do n ot h alt program execu tion sin ce th ese errors may occu r in th e n ormal operation of a program. Th ese n ormal errors can be detected by u sin g th e IOSTAT fu n ction after performin g th e su bsequ en t RE AD operation . In gen eral, it is good practice always to test wh eth er each file operation completed su ccessfu lly by testin g th e valu e from IOSTAT. E xample ; Seek record number 130 in the file open on logical unit 5: FSEEK (5, 130) V+ Lan gu age Referen ce Gu ide Page 3 5 1 FSE E K program in stru ction Related Keywords ATTACH program in stru ction FOPE N program in stru ction IOSTAT real-valu ed fu n ction RE AD program in stru ction V+ Lan gu age Referen ce Gu ide Page 3 5 2 FSE T program in stru ction FSET program instruction Syntax FS ET ( logical_ u n it) attribu te_ list Function Set or modify attribu tes of a graph ics win dow, serial lin e, or n etwork device related to AdeptNet. Usage Considerations If a win dow h as been referen ced, it mu st h ave been open ed already with an FOPE N in stru ction . If a serial lin e is referen ced, it mu st h ave been attach ed already with an ATTACH in stru ction . Th e u se of th is in stru ction with NFS or TCP n etwork devices applies on ly to systems fitted with th e AdeptNet option an d with th e appropriate licen se(s). As with all V+ I/O in stru ction s, th e IOSTAT real-valu ed fu n ction sh ou ld be u sed after each FSE T in stru ction to determin e th e su ccess of th e FSE T requ est. Parameters logical_ u n it Real valu e, variable, or expression (in terpreted as an in teger) th at defin es th e logical u n it n u mber of th e win dow to be accessed. (See th e ATTACH in stru ction for a description of u n it n u mbers.) attribu te_ list List of strin g con stan ts, variables, an d expression s; real valu es, variables, an d expression s; an d format specifiers u sed to defin e th e ch aracteristics of th e win dow. See th e description of th e FOPE N in stru ction for detailed in formation on th is parameter. Details Usin g FS ET W ith W in dows Th is in stru ction sets attribu tes for a win dow th at already exists an d is already open for access. NOTE: No in terlocks exist to preven t mu ltiple program tasks from ch an gin g th e attribu tes of a win dow. V+ Lan gu age Referen ce Gu ide Page 3 5 3 FSE T program in stru ction Th e argu men t list for th is in stru ction h as exactly th e same format as th at for th e FOPE N in stru ction , except th at n o win dow n ame is in clu ded for th is in stru ction . Refer to th e description of th e FOPE N in stru ction for in formation on h ow win dow attribu tes are specified. Th e win dow attribu tes described below can be specified with eith er th e FSE T or FOPE N in stru ction s (u n less n oted oth erwise). For some attribu tes, after th e attribu te h as been specified, its effect may be modified later in on e of th e followin g ways: l Th e followin g keywords set attribu tes th at can be ch an ged on ly by an oth er FSE T in stru ction . /BORDE R /SPE CIAL /CURSOR /LUT /TE RMINAL /E VE NT /MARGINS /UPDATE /FONT /ME NU /V_ ARROWINC /FONT_ HDR /NOUPDATE /V_ RANGE /H_ ARROWINC l /H_ RANGE /POINTE R Th e followin g keywords set attribu tes th at can be ch an ged by an oth er FSE T in stru ction or by poin ter device activity. /ABS_ POSITION /SIZE /DISPLAY /POSITION /STACK /H_ HANDLE /SE LE CT /V_ HANDLE /H_ SCROLL l /NODISPLAY /SHOW /V_ SCROLL Th e followin g keywords are related to th e pu ll-down men u an d do n ot actu ally remain as attribu tes of th e win dow. /IGNORE /PULLDOWN V+ Lan gu age Referen ce Gu ide Page 3 5 4 FSE T program in stru ction Th e followin g in formation is provided for each attribu te described in th e table FSE T Graph ics Win dow Attribu tes: l Keyword th at iden tifies th e attribu te Some attribu tes can be eith er on or off. For each su ch attribu te th ere are two correspon din g keywords. Th e on keyword directly relates to th e attribu te (for example, /DISPLAY); th e off keyword h as a NO prefix (for example, /NODISPLAY). l Description of th e effect of th e attribu te For attribu tes with an on /off ch aracter, th e on con dition is described. l Description of an y argu men ts requ ired for th e attribu te. l Defau lt attribu te settin g. FS ET Graph ics W in dow Attribu tes Attribu te: /ABS _ POS I TI ON Explan ation : Position th e win dow at an absolu te location on th e screen rath er th an at a location relative to th e paren t win dow. Argu men ts: Th e X an d Y offsets from th e u pper left corn er of th e mon itor. Defau lt: Non e Attribu te: /BORDER Explan ation : E n able a border arou n d all or part of th e win dow. Th e border is a lin e (on e pixel wide) in side th e win dow bou n dary, an d it will obscu re an yth in g in th at area. Th e border is always drawn with color 1 (black). Argu men ts: On e or more of th e followin g keywords. l l l l l l l l l l Defau lt: ALL = Display all borders NONE = Display n o borders TOP = Display top border NOTOP = Su ppress top border BOTTOM = Display bottom border NOBOTTOM = Su ppress bottom border LE FT = Display left border NOLE FT = Su ppress left border RIGHT = Display righ t border NORIGHT = Su ppress righ t border /BORDE R ALL V+ Lan gu age Referen ce Gu ide Page 3 5 5 FSE T program in stru ction Attribu te: /CURS OR Explan ation : Set th e mou se cu rsor to a loaded icon . Argu men ts: Th e in dex of th e icon elemen t to u se, followed by th e n ame of th e icon (in sin gle qu otes) Defau lt: Non e Attribu te: /DI S PLAY an d /NODI S PLAY Explan ation : Display th e win dow. Top-level win dows th at are n ot displayed may be displayed by selectin g th eir n ames from th e Adept pu lldown men u at th e top of th e screen . Argu men ts: Non e Defau lt: /DISPLAY Attribu te: /EVENT Explan ation : E n ables or disables even t processin g for th e win dow. If you wan t to receive even ts, you mu st explicitly u se th is attribu te with FSE T or FOPE N each time you open a win dow. Th e details of even t processin g, an d description s of th e even ts th at can be specified with th is keyword, are described with th e GE TE VE NT in stru ction . If th e win dow is open ed for write-on ly access (see th e /WRITE ONLY attribu te), th is keyword cau ses th e error File already open ed. Argu men ts: On e or more keywords (see GE TE VE NT) Defau lt: /E VE NT NONE Attribu te: /FONT Explan ation : Selects a ch aracter fon t to be u sed for all text ou tpu t in th e win dow, except for ou tpu t from th e GTYPE in stru ction . Th e n ew fon t takes effect immediately, with th e followin g effect on th e placemen t of th e n ext ch aracter ou tpu t to th e win dow: (1 ) Th e n ew ch aracter cell's left edge is position ed at th e same pixel colu mn as before th e fon t ch an ge. (2 ) Its baselin e remain s at th e same pixel row. (3 ) If th e top of th e ch aracter cell exten ds V+ Lan gu age Referen ce Gu ide Page 3 5 6 FSE T program in stru ction above th e text top margin , th e ch aracter position is bu mped down so th at n o part of th e cell is ou tside th e text margin s. (4 ) A similar ru le applies if th e righ t edge of th e ch aracter cell exten ds beyon d th e text righ t margin . Fon t n u mber 1 is th e stan dard fon t-it h as ch aracter cells 8 pixels wide an d 1 5 pixels h igh ; th ere are 3 pixels below th e baselin e; an d u ppercase letters are 9 pixels h igh . Argu men ts: Fon t n u mber (th e valu e mu st be greater th an or equ al to on e) Defau lt: /FONT 1 Attribu te: /FONT_ HDR Explan ation : Th is attribu te is ign ored by th e AdeptWin dows PC in terface. Specify th e fon t n u mber to u se for th e title, men u bars, an d pu ll-down men u s of th e win dow. (Ch an ges th e title bar immediately, ch an ges th e men u bars at th e n ext FSE T /ME NU... in stru ction .) Argu men ts: Fon t n u mber Defau lt: /FONT 1 Attribu te: /H_ ARROW I NC Explan ation : Sets th e ch an ge in th e position of th e scroll h an dle in th e h orizon tal scroll bar th at is cau sed by clickin g on th e arrow bu tton s in th e h orizon tal scroll bar. (Th is keyword is valid on ly wh en th e even t GRAB_ H_ SCROLL is en abled [see th e GE TE VE NT in stru ction ].) Argu men ts: Nu mber of u n its (see /H_ RANGE ) to move th e h an dle for each click on an arrow bu tton (th e valu e mu st be greater th an or equ al to zero) Defau lt: Pixel width of th e cu rren t fon t cell Attribu te: /H_ HANDLE Explan ation : Sets th e displayed position of th e scroll h an dle in th e h orizon tal scroll bar. (Th is keyword is valid on ly wh en th e even t GRAB_ H_ SCROLL is en abled [see GE TE VE NT].) V+ Lan gu age Referen ce Gu ide Page 3 5 7 FSE T program in stru ction Argu men ts: Relative position alon g bar (n ote th at th is is n ot a pixel cou n t; 0 = leftmost en d; righ tmost en d may be set with /H_ RANGE ) Defau lt: Cu rren t scroll position Attribu te: /H_ RANGE Explan ation : Sets th e valu e of th e righ tmost position of th e scroll h an dle in th e h orizon tal scroll bar. (Th is keyword is valid on ly wh en th e even t GRAB_ H_ SCROLL is en abled [see GE TE VE NT].) Argu men ts: Valu e associated with th e righ tmost position of th e scroll h an dle (valu e mu st be greater th an or equ al to zero; if n h an dle position s are desired, u se th e valu e n -1 ) Defau lt: Total n u mber of pixels th at th e win dow can be scrolled (n ot th e width of th e win dow) Attribu te: /H_ S CROLL Explan ation : Sets th e h orizon tal scroll position of th e displayed con ten ts of th e win dow. (Th is keyword is ign ored if it is specified with FOPE N an d th e win dow already exists.) Argu men ts: Horizon tal offset (in pixels) in th e bitmap to th e first colu mn to display (th e valu e mu st be greater th an or equ al to zero) Defau lt: /H_ SCROLL 0 Attribu te: /I GNORE Explan ation : Specifies pu ll-down men u items th at can n ot be selected. Th ese items are dimmed in th e pu ll-down men u display. Th is keyword mu st be specified in th e same FSE T in stru ction as th e /PULLDOWN keyword. Argu men ts: List of n u mbers in th e ran ge 1 to 3 0 , wh ich correspon d to rows in th e pu ll-down men u . Nu mbers greater th an th e n u mber of pu ll-down items are ign ored. Defau lt: No pu ll-down items are ign ored Attribu te: /LUT V+ Lan gu age Referen ce Gu ide Page 3 5 8 FSE T program in stru ction Explan ation : Th is attribu te is ign ored by th e AdeptWin dows PC in terface. Sets th e red, green , an d blu e (RGB) valu es of a color. Th e specified color is actu ally altered for th e en tire graph ics system. Th u s, th is keyword mu st be u sed with care. Note, for example, th at ch an gin g color valu es may cau se all th e color description s in th is man u al to become in valid. Argu men ts: Th e color to be ch an ged (in th e ran ge 0 to 1 5 ), followed by th e red, green , an d blu e valu es for th e color (each in th e ran ge 0 to 2 5 5 ). A valu e of -1 may be specified for th e red, green , or blu e valu e to retu rn th at valu e to its defau lt. For in stan ce, specifyin g /LUT 1 5 1 2 7 1 2 7 1 2 7 ch an ges th e defau lt wh ite (color #1 5 ) in th e system to a gray, an d specifyin g /LUT 1 5 -1 -1 -1 restores th e system to its defau lt color. Defau lt: System defau lt colors (see GCOLOR) Attribu te: /MARGI NS Explan ation : Sets th e text margin s for th e win dow. Th is keyword also sets th e text cu rsor position to th e top left corn er of th e text win dow defin ed by th e n ew margin s. Th e text scrollin g win dow is reset to its maximu m size. Argu men ts: Coordin ates of th e left, top, righ t, an d bottom edges of th e text win dow (if a valu e is n egative, th e correspon din g margin is n ot modified) Defau lt: l l l l X coordin ate of left margin = 8 Y coordin ate of top margin = 8 X coordin ate of righ t margin = (righ t_ edge_ of_ win dow 8) Y coordin ate of bottom margin = (left_ edge_ of_ win dow 8) Attribu te: /MENU Explan ation : Specifies u p to 2 0 items to appear in th e men u bar of th e win dow. E ach men u strin g is displayed in a box in th e men u bar, left to righ t in th e order specified. A space is added to each side of each strin g. If th e strin gs are too lon g, th e excess falls off th e en d of th e men u bar with ou t an y error in dication . Th e strin gs are written in th e cu rren t fon t defin ed for th e men u bar. (Th is keyword is ign ored if th e win dow does n ot h ave a men u bar.) V+ Lan gu age Referen ce Gu ide Page 3 5 9 FSE T program in stru ction Argu men ts: List of u p to 2 0 strin gs, each on e en closed in sin gle qu otes. E ach strin g delimited by sin gle-qu ote ch aracters mu st be separated from th e n ext strin g by at least on e space. Th e correct way to clear th e men u bar is to specify n o strin gs, n ot a n u ll strin g (th at is, with /ME NU, n ot with /ME NU ' '). Defau lt: /ME NU (n o items) Attribu te: /POI NTER Explan ation : Specifies th e poin t of referen ce for position in formation obtain ed from th e mou se cu rsor. Th is keyword takes effect with th e n ext even t th at occu rs-it does n ot ch an ge an y even ts th at h ave already occu rred bu t are waitin g to be read. Argu men ts: l l l DISPLAY = Retu rn poin ter device position s relative to th e u pper left-h an d corn er of th e win dow region displayed on th e screen . SCRE E N = Retu rn poin ter device position s relative to th e u pper left-h an d corn er of th e en tire screen . WINDOW = Retu rn poin ter device position s relative to th e u pper left-h an d corn er of th e allocated win dow, even if th e corn er is scrolled ou t of th e displayed region . Defau lt: /POINTE R WINDOW Attribu te: /POS I TI ON Explan ation : Sets th e displayed position of th e win dow relative to its paren t. Th e argu men ts defin e th e position of th is win dow's u pper lefth an d corn er relative to th e u pper left-h an d corn er of th e paren t's allocated win dow. If th is is a top-level win dow, th e position is relative to th e u pper left-h an d corn er of th e screen . (Th is keyword may n ot be specified for con trol-bar win dows.) Th is keyword is ign ored if it is specified with FOPE N an d th e win dow already exists. If th is keyword is u sed with FSE T, th e valu e specified overrides an y mou se drag th at may h ave been don e by you . Th is keyword may also specify th e position of th e referen ce poin t of an icon relative to th e top left corn er of th e icon (see th e /ICON keyword for FOPE N). Argu men ts: X position (in pixels) relative to paren t (always rou n ded u p to be an even n u mber) Y position (in pixels) relative to paren t V+ Lan gu age Referen ce Gu ide Page 3 6 0 FSE T program in stru ction Defau lt: /POSITION 0 0 Attribu te: /PULLDOW N Explan ation : Ou tpu ts text in to a pu ll-down win dow, an d displays th e pu lldown win dow u n der th e specified men u -bar item if th at item is cu rren tly selected (h igh ligh ted). (Th is keyword may n ot be specified with FOPE N.) All th e strin gs specified are displayed, left ju stified, stacked vertically, in a win dow th e width of th e lon gest strin g (plu s a space on each side of th e strin g). For VGB-equ ipped systems, with th e stan dard fon t, th e pu lldown win dow may h ave a maximu m area equ ivalen t to 2 5 lin es of text, 2 5 ch aracters wide. Th ere can be a maximu m of 3 0 lin es of text. If th ere are more th an 2 5 lin es, th e maximu m pu ll-down will be less th an 2 5 ch aracters wide; con versely, if th ere are fewer th an 2 5 lin es, th e pu ll-down can be more th an 2 5 ch aracters wide. E ach lin e of text will be tru n cated on th e righ t if n ecessary. For systems u sin g th e AdeptWin dows PC in terface, th e limit is determin ed by th e FSE T attribu te list-th e maximu m len gth is 5 1 2 ch aracters. See th e /IGNORE keyword for in formation on h ow to disable pu ll-down items. On ly on e pu ll-down win dow can be presen t in th e en tire system at an y on e time. Argu men ts: Nu mber of th e men u -bar item with wh ich th is pu ll-down list is associated (1 [leftmost item] to N [righ tmost item]) followed by a list of strin gs (each in sin gle qu otes) separated by spaces Defau lt: No pu ll-down men u specified Attribu te: /S ELECT Explan ation : Specifies th at a win dow is selected for receivin g in pu t. Th e effect of th is keyword is equ ivalen t to clickin g th e mou se on th e win dow. Argu men ts: Non e Defau lt: Th e win dow is n ot selected Attribu te: /S HOW V+ Lan gu age Referen ce Gu ide Page 3 6 1 FSE T program in stru ction Explan ation : Th is attribu te is ign ored by th e AdeptWin dows PC in terface. Forces a win dow an d all its an cestors to be displayed. (Th is keyword differs from /DISPLAY-th at keyword does n ot display a win dow if an y on e of its an cestors is n ot displayed.) Argu men ts: Non e Defau lt: Non e Attribu te: /S I ZE Explan ation : Sets th e size of th e win dow in th e display. Th e size specified overrides an y mou se drag th at may h ave been don e by you . Th is keyword may n ot be specified for con trol-bar win dows. (Th is keyword is ign ored if it is specified with FOPE N an d th e win dow already exists.) Th e X valu e is always rou n ded u p to be an even n u mber. For all win dows, X an d Y valu es less th an 8 are set to 8 . Th e valu es of X an d Y are clipped to th e fu ll size of th e win dow as requ ired. Th is keyword may also specify th e size of an icon or fon t (see th e /ICON or /DE FFONT keyword for th e FOPE N in stru ction ). Argu men ts: l l X size (in pixels) Y size (in pixels) Defau lt: Display th e wh ole win dow (see /MAXSIZE described in th e FOPE N in stru ction ) Attribu te: /S PECI AL Explan ation : E xcept for /SPE CIAL NOSE LE CTABLE , th is attribu te is ign ored by th e AdeptWin dows PC in terface. Sets special attribu tes for th e win dow. Argu men ts: On e or more of th e followin g keywords. l l l l l DE SE LE CT = Allow deselection NODE SE LE CT = Don 't allow deselection POSITION = Allow movin g by draggin g title bar NOPOSITION = Don 't allow draggin g of title bar SE LE CTABLE = Allow win dow to be selected from pu lldown men u u n der Adept icon V+ Lan gu age Referen ce Gu ide Page 3 6 2 FSE T program in stru ction l l l NOSE LE CTABLE = Don 't allow win dow to be selected from pu ll-down men u u n der Adept icon . (Win dow n ame is dimmed in pu ll-down men u .) SIZE = Allow resize with sizin g icon NOSIZE = Don 't allow resize with sizin g icon Defau lt: /SPE CIAL DE SE LE CT POSITION SE LE CTABLE SIZE Attribu te: /S TACK Explan ation : Sets th e position of th e win dow in its win dow stack, wh ich determin es th e layerin g of th e win dows in th e display. Th is keyword may n ot be specified for con trol-bar win dows. No ch ild of a win dow can be stacked below th at win dow's con trol bars. Argu men ts: Code valu e for desired position : l l 1 Move to top of paren t's stack -1 Move to bottom of paren t's stack Defau lt: /STACK 1 Attribu te: /TERMI NAL Explan ation : Sets ch aracteristics of th e termin al emu lator u sed to ou tpu t text to th e win dow. Argu men ts: On e or more of th e followin g keywords. l l l l l l CURSOR = Display th e text cu rsor NOCURSOR = Do n ot display text cu rsor OVE RSTRIKE = Force design ated overstrike ch aracters to overstrike th e previou s ch aracter NOOVE RSTRIKE = Defeat overstrikin g WRAP = Wrap lin es of text th at are too lon g NOWRAP = Tru n cate lon g lin es of text Defau lt: /TE RMINAL CURSOR OVE RSTRIKE WRAP Attribu te: /TI TLE Explan ation : Set th e win dow title, wh ich is th e text th at is displayed in th e title bar. Th e title h as n o oth er mean in g to th e V+ system. Argu men ts: Strin g en closed in sin gle qu otes. Th e strin g will be tru n cated to 4 0 ch aracters. V+ Lan gu age Referen ce Gu ide Page 3 6 3 FSE T program in stru ction Defau lt: Same as th e win dow n ame Attribu te: /UPDATE an d /NOUPDATE Explan ation : In n ormal operation , th e screen display is u pdated every time n ew graph ics appear in an y displayed win dow. Th e /NOUPDATE keyword stops th is process for th e win dow cu rren tly open , th ereby h idin g all n ew graph ics from th e screen display u n til n ormal operation resu mes. Th e /UPDATE keyword will force th e screen display to be u pdated an d n ormal operation to resu me. (Th is keyword may n ot be specified with th e FOPE N in stru ction .) Argu men ts: Non e Defau lt: /UPDATE Attribu te: /V_ ARROW I NC Explan ation : Sets th e ch an ge in th e position of th e scroll h an dle in th e vertical scroll bar th at will be cau sed by clickin g on th e arrow bu tton s in th e vertical scroll bar. (Th is keyword is valid on ly wh en th e even t GRAB_ V_ SCROLL is en abled [see th e GE TE VE NT in stru ction ].) Argu men ts: Nu mber of u n its (see V_ RANGE ) to move th e h an dle for each click on an arrow bu tton (th e valu e mu st be greater th an or equ al to zero) Defau lt: Pixel h eigh t of th e cu rren t fon t cell Attribu te: /V_ HANDLE Explan ation : Sets th e displayed position of th e scroll h an dle in th e vertical scroll bar. (Th is keyword is valid on ly wh en th e even t GRAB_ V_ SCROLL is en abled [see GE TE VE NT].) Argu men ts: Relative position alon g bar (n ote th at th is is n ot a pixel cou n t; 0 = topmost en d; bottommost en d may be set with /V_ RANGE ) Defau lt: Cu rren t scroll position Attribu te: /V_ RANGE V+ Lan gu age Referen ce Gu ide Page 3 6 4 FSE T program in stru ction Explan ation : Sets th e valu e of th e bottommost position of th e scroll h an dle in th e vertical scroll bar. (Th is keyword is valid on ly wh en th e even t GRAB_ V_ SCROLL even t is en abled [see GE TE VE NT].) Argu men ts: Valu e associated with bottommost position of th e scroll h an dle (th e valu e mu st be greater th an or equ al to zero; if n h an dle position s are desired, u se th e valu e n -1 ) Defau lt: Total n u mber of pixels th at th e win dow can be scrolled (n ot th e h eigh t of th e win dow) Attribu te: /V_ S CROLL Explan ation : Sets th e vertical scroll position of th e displayed con ten ts of th e win dow. (Th is keyword is ign ored if it is specified with FOPE N an d th e win dow already exists.) Argu men ts: Vertical offset (in pixels) in th e bitmap to th e first row to display (th e valu e mu st be greater th an or equ al to zero) Defau lt: /V_ SCROLL 0 Usin g FS ET W ith S erial Lin es Th e followin g specification s can be u sed as argu men ts to directly ATTACH a serial lin e: LOCAL.SE RIAL:n Local serial lin e n on th e local CPU. For Adept CPU boards, n = 1 , 2 , 3 , or 4 . SE RIAL:n Global serial lin e n on th e Adept SIO board. For Adept SIO board, n = 1 , 2 , 3 , or 4. As a con ven ien ce, th e followin g syn on yms may be u sed: KE RMIT Th e serial lin e cu rren tly con figu red for Kermit protocol. MONITOR Th e serial lin e cu rren tly con figu red for u se as th e mon itor termin al. Th e keywords listed in th e followin g table may appear in th e keyword list strin g. FS ET S erial-Lin e Attribu tes Attribu te Argu men t Description V+ Lan gu age Referen ce Gu ide Page 3 6 5 FSE T program in stru ction /PARITY NONE No parity gen eration E VE N Use even parity ODD Use odd parity /STOP_ BITS 1 or 2 Use 1 or 2 stop bits per byte /BYTE _ LE NGTH 7 or 8 Use 7 or 8 bits per byte /FLOW NONE No flow con trol XON_ XOFF Detect an d gen erate XON/XOFF (tu rn off modem) MODE M Use modem con trol RTS/CTS (tu rn off XON_ XOFF). Available on ly for LOCAL.SE RIAL 2 an d 3 , an d SE RIAL 1 , 2 , an d 3 . OFF Tu rn off th e DTR modem sign al. Available on ly for LOCAL.SE RIAL 2 an d 3 , an d SE RIAL 1 , 2 , an d 3 . ON Tu rn on th e DTR modem sign al. Available on ly for LOCAL.SE RIAL 2 an d 3 , an d SE RIAL 1 , 2 , an d 3 . /DTR V+ Lan gu age Referen ce Gu ide Page 3 6 6 FSE T program in stru ction /MULTIDROP Use mu ltidrop mode (Valid on ly for LOCAL.SE RIAL:1 on Adept CPUs) OFF Disable recogn ition of CTRL+O for flu sh in g ou tpu t ON /SPE E D Do n ot u se mu ltidrop mode ON /FLUSH OFF E n able recogn ition of CTRL+O for flu sh in g ou tpu t 110, 300, 600, 1200, 2400, 4800, 7200, 9600, 19200, 38400 Select th e in dicated bau d rate. For th e Adept SIO board, a bau d rate of 1 9 2 0 0 is in compatible with a bau d rate of 7 2 0 0 or 3 8 4 0 0 on a pair-wise basis. Th e pairs are: SE RIAL:1 an d SE RIAL:4 SE RIAL:2 an d SE RIAL:3 Th e drivers for KE RMIT, DDCMP, an d NE TWORK do n ot su pport all th e modes in dicated by th e keywords; th ey ign ore th ose th at are n ot su pported. Usin g FS ET W ith NFS an d TCP Th e followin g AdeptNet devices may be referen ced with th e FSE T> in stru ction : NFS Network File System TCP Tran smission Con trol Protocol You can u se th e attribu tes listed in th e table FSE T Attribu tes for AdeptNet wh en accessin g th ese devices with th e FSE T in stru ction : FS ET Attribu tes for AdeptNet Attribu te Description /ADDRE SS IP address. (Applies on ly to th e TCP device.) /MOUNT Defin es th e n ame to be u sed for an NFS server remote disk. (Applies on ly to th e NFS device.) /NODE Node n ame. /PATH Path for NFS server remote disk. (Applies on ly to th e NFS device.) For access to drives/folders on Win dows-based PCs, u se th e Win - V+ Lan gu age Referen ce Gu ide Page 3 6 7 FSE T program in stru ction dows path format. E xamples: a:\ ; c:\disks You may defin e n ew n odes on th e n etwork u sin g th e FSE T program in stru ction to access a logical u n it th at h as been attach ed to th e TCP device. Th e strin g u sed with th e FSE T in stru ction h as th e same format as th at u sed with th e NODE statemen t in th e V+ con figu ration file (see th e later example). You may also defin e n ew remote mou n ts, u sin g th e FSE T program in stru ction to access a logical u n it th at h as been attach ed to th e NFS device. Th e strin g u sed with th e FSE T in stru ction h as th e same format as th at u sed with th e MOUNT statemen t in th e V+ con figu ration file (see th e later example). E xamples Graph ics Th e followin g FSE T in stru ction cau ses a pu ll-down men u to be displayed u n der th e men u -bar item ju st selected by you (assu min g th at th e array elemen t even t[2 ] h as been set by a GE TE VE NT in stru ction th at detected a men u even t): FSET (lun) "/PULLDOWN", event[2], $menu[event[2]] Th is in stru ction requ ires th at strin g array elemen ts $ men u [n ] be defin ed for each of th e men u items displayed on th e men u bar. Th e followin g lin e sh ows h ow a pu ll-down list with fou r items can be defin ed for th e first item on th e men u bar. (Note th at th e men u items can h ave differen t len gth s, th ey can con sist of mu ltiple words, an d th ere is a space between th e sin gle qu otes delin eatin g items.) $menu[1] = "'Item #1' 'Second Item' 'One more item' 'Last item'" Th e followin g in stru ction takes con trol of th e vertical scroll bar away from th e win dow man ager. Th e vertical scroll bar is set to retu rn valu es from 0 to 1 0 . Th e in itial position of th e scroll-bar h an dle is at th e top (zero) an d each time th e u p-arrow or down -arrow icon is clicked, th e valu e of th e scroll-bar h an dle position ch an ges by 2 u n its. FSET (lun) "/EVENT GRAB_V_SCROLL/V_RANGE 10/V_HANDLE 0/V_ARROWINC 2" Th e followin g example attach es serial lin e 2 an d sets th e bau d rate to 2 4 0 0 : ATTACH (slun, 4) "SERIAL:2" FSET (slun) "/SPEED 2400" AdeptNet Defin e a n ew n ode called SE RVE R2 with th e IP address 1 7 2 .1 6 .2 0 0 .1 0 2 : ATTACH (lun, 4) "TCP" V+ Lan gu age Referen ce Gu ide Page 3 6 8 FSE T program in stru ction FSET (lun) "/NODE 'SERVER2' /ADDRESS 172 16 200 102" Defin e a n ew NFS mou n t with th e disk n ame DISK2 to access th e exported directory /a of th e n ode (server) called SE RVE R1 (wh ich mu st already be defin ed): ATTACH (lun, 4) "NFS" FSET (lun) "/MOUNT 'DISK2' /NODE 'SERVER1' /PATH '/a'" For a Win dows-based PC, defin e a n ew NFS mou n t with th e device n ame XC to access th e exported directory c:\adept\disks\disk_ c of th e n ode (server) called SE RVE R2 (wh ich mu st already be defin ed): ATTACH (lun, 4) "NFS" fset nfs /mount 'XC' /node 'SERVER2' /path 'c:\adept\disks\disk_c' Related Keywords FOPE N program in stru ction IOSTAT real-valu ed fu n ction V+ Lan gu age Referen ce Gu ide Page 3 6 9 GAIN.SE T program in stru ction GAIN.SET program instruction Syntax GAI N.S ET set, motor Function Select a set of feedback gain parameters for on e or more motors of th e cu rren tly selected robot. Usage Considerations Th is in stru ction cu rren tly applies on ly to th e robots (an d join ts) specified in th e tables below. For th e oth er motors of th ese robots an d for all oth er robots, th is in stru ction h as n o effect (an d cau ses n o error). Th is in stru ction affects th e robot cu rren tly selected with a SE LE CT program in stru ction . Th e GAIN.SE T in stru ction takes effect immediately an d is n ot syn ch ron ized with robot motion segmen ts. A task does n ot h ave to be attach ed to th e robot to issu e th is in stru ction . Parameters set Option al real expression th at specifies th e gain set parameter valu e to u se. Th e defau lt set is selected if th is parameter is zero. See th e tables at th e en d of th e Details section for parameter valu es. motor Option al real expression th at specifies th e motor of th e selected robot. Cu rren tly, on ly motor 4 is a valid selection for th e SCARA robots in th e tables below. For th e 6 -axis robots (su ch as th e Viper s1 7 0 0 ), th is parameter applies to an y join t on th e robot. Details Th is in stru ction selects a set of predefin ed feedback gain parameters th at con trol th e servotu n in g valu es for th e specified motor of th e selected robot. It is u sed to compen sate for payload mass, payload in ertia, an d application requ iremen ts th at exceed th e robot's n ormal limits. If n ecessary, you can u se th is in stru ction each time th e payload ch an ges (for example, wh en th e robot picks u p a h eavy object an d th en picks u p a ligh t object). See th e Adept Motion VME Developer's Gu ide or th e Adept SmartMotion Developer's Gu ide for in formation on robot tu n in g. NOTE: Th e referen ce above is for in formation pu rposes on ly. Th e GAIN.SE T program in stru ction u ses predefin ed parameters th at are n ot u ser-adju stable. V+ Lan gu age Referen ce Gu ide Page 3 7 0 GAIN.SE T program in stru ction PAYLOAD is a related program in stru ction u sed to select a set of feedforward gain parameters. Becau se GAIN.SE T an d PAYLOAD affect differen t gain parameters, th ere is n o con flict between th ese two in stru ction s. Th erefore, th e order of th eir execu tion is u n importan t. S et Parameter Valu es for th e AdeptOn e ( J4 ) S et Parameter Valu e Payload Ran ge ( kgcm2) 0 0 - 256 1 256 - 512 2 512 - 1112 3 1112 - 1884 4 1884 - 2926 5 0 - 256 Th is settin g provides smooth er join t 4 motion at low speed. S et Parameter Valu es for th e AdeptOn eXL ( J4 ) S et Parameter Valu e Payload Ran ge ( kgcm2) 0 0 - 879 1 879 - 2050 2 2050 - 3180 S et Parameter Valu es for th e PackOn e ( J4 ) S et Parameter Valu e 0 Payload Ran ge ( kgcm2) Fu ll ran ge. V+ Lan gu age Referen ce Gu ide Page 3 7 1 GAIN.SE T program in stru ction >1 Tested/optimized for 2 4 kg load. S et Parameter Valu es for th e AdeptTh ree ( J4 ) S et Parameter Valu e 0 Payload Ran ge ( kgcm2) 0 - 7316 Su itable for fu ll load ran ge. However, th ere may be some respon se degradation as load in creases. >1 0 - 1173 >2 1173 - 2786 >3 2786 - 4838 >4 4838 - 7316 S et Parameter Valu es for th e AdeptTh ree-XL ( J4 ) S et Parameter Valu e Payload Ran ge ( kgcm2) >0 0 - 2930 Su itable for specified load ran ge. However, th ere may be some respon se degradation as load in creases. >1 0 - 879 >2 879 - 2930 >3 2930 - 5860 >4 5860 - 10255 V+ Lan gu age Referen ce Gu ide Page 3 7 2 GAIN.SE T program in stru ction >5 10255 - 14855 S et Parameter Valu es for th e Adept Viper s1 7 0 0 ( all join ts) S et Parameter Valu e Payload Ran ge ( kgcm2) 0 Defau lt (fu ll payload ran ge) 1 Fu ll payload ran ge. Th is settin g provides smooth er join t motion at low speed for an y payload with in th e robot's allowed payload ran ge. However, th ere may be some degradation of h igh -speed settlin g. Related Keywords ACCE L program in stru ction SPE E D mon itor comman d SPE E D program in stru ction V+ Lan gu age Referen ce Gu ide Page 3 7 3 GARC program in stru ction GAR C program instruction Syntax GARC ( lu n , mode) xc, yc, radiu s, an g0 , an gn Function Draw an arc or a circle in a graph ics win dow. Usage Considerations Th is in stru ction is available on ly with a graph ics-based system. Parameters lu n Real valu e, variable, or expression (in terpreted as an in teger) th at defin es th e logical u n it n u mber of th e win dow to be accessed. (See th e ATTACH in stru ction for a description of u n it n u mbers.) mode Option al real valu e, variable, or expression (in terpreted as a bit field) specifyin g h ow th e in stru ction is to operate. Zero is assu med if th e parameter is omitted. Th e bit in terpretation s are given below. Bit 2 Use (0 ) vs. Ign ore (1 ) an gles Mask valu e = 2 If th is bit is set, a fu ll circle is drawn regardless of th e valu es of th e an g0 an d an gn parameters. xc, yc Real valu es, variables, or expression s (in terpreted as in tegers) specifyin g th e coordin ates (in pixels) of th e cen ter of th e circu lar arc. Th e origin for th e coordin ate system (0 ,0 ) is th e top left corn er of th e win dow, with positive X directed to th e righ t an d positive Y directed toward th e bottom. radiu s Real valu e, variable, or expression (in terpreted as an in teger) specifyin g th e radiu s (in pixels) of th e circu lar arc. If th e valu e is zero, a poin t is drawn . Noth in g is drawn if th e valu e is n egative. an g0 , an gn Option al real valu es, variables, or expression s specifyin g startin g an d stoppin g an gles (in degrees) for th e arc. A circle is drawn if both parameters are omitted or both parameters h ave th e same valu e. Th e an gles are measu red cou n terclockwise from a lin e poin tin g to th e righ t. Details Th e arc or circle is drawn with th e cu rren t graph ics foregrou n d color (see GCOLOR), textu re (see GTE XTURE ), an d logical operation (see GLOGICAL). Opaqu e textu res are always u sed, regardless of th e cu rren t opaqu e/tran sparen t mode settin g (see GTE XTURE ). V+ Lan gu age Referen ce Gu ide Page 3 7 4 GARC program in stru ction Th is in stru ction operates on th e win dow th at is cu rren tly open for th e specified logical u n it. If th e win dow is open in n on bu ffered mode, th e in stru ction sen ds a requ est to th e win dow man ager an d takes effect immediately. If th e win dow is open in bu ffered mode, th e effect is displayed wh en th e bu ffer fills or an FE MPTY in stru ction is execu ted. E xamples In th e win dow open on graph ics logical u n it 2 0 , draw an arc cen tered at coordin ates (1 0 ,1 5 ) with 5 0 -pixel radiu s, startin g at an gle 9 0 (top of circle) an d movin g cou n terclockwise to an gle 0 (righ t side of circle): GARC (20) 10, 15, 50, 90, 0 In th e win dow open on graph ics logical u n it 2 0 , draw a complete circle cen tered at coordin ates (1 0 ,1 5 ) with 5 0 -pixel radiu s (ign ore th e an gle argu men ts): GARC (20,2) 10, 15, 50, 90, 0 In th e win dow open on graph ics logical u n it 2 0 , draw a complete circle cen tered at coordin ates (1 0 ,1 5 ) with 5 0 -pixel radiu s: GARC (20) 10, 15, 50 Related Keywords FOPE N program in stru ction GCLIP program in stru ction GCOLOR program in stru ction GLOGICAL program in stru ction GTE XTURE program in stru ction GTRANS program in stru ction V+ Lan gu age Referen ce Gu ide Page 3 7 5 GCHAIN program in stru ction GCHAIN program instruction Syntax GCHAI N ( lu n ) x, y, poin ts, direction [ in dex] Function Draw a ch ain of poin ts in a graph ics win dow to form a complex figu re. Usage Considerations Th is in stru ction is available on ly with a graph ics-based system. V+ Lan gu age Referen ce Gu ide Page 3 7 6 GCHAIN program in stru ction Parameters lu n Real valu e, variable, or expression (in terpreted as an in teger) th at defin es th e logical u n it n u mber of th e win dow to be accessed. (See th e ATTACH in stru ction for a description of u n it n u mbers.) x, y Option al real valu es, variables, or expression s (in terpreted as in tegers) specifyin g th e startin g poin t for th e ch ain . If both parameters are omitted, th e ch ain is con tin u ed from th e last ch ain poin t drawn sin ce th e last FOPE N in stru ction (or from [0 ,0 ] if th ere h as been n o previou s GCHAIN sin ce th e last FOPE N). If eith er valu e is omitted, th e oth er valu e mu st also be omitted. poin ts Real valu e, variable, or expression (in terpreted as an in teger) specifyin g th e n u mber of poin ts in th e ch ain , n ot cou n tin g th e startin g poin t. Th e startin g poin t is drawn , except wh en x an d y are omitted. Th e acceptable ran ge of poin ts is 0 to 1 0 0 8 , in clu sive. direction [ ] Real array th at con tain s direction codes for th e respective poin ts in th e ch ain . Th e valu es in dicate th e direction s to th e su ccessive pixels in th e ch ain , as follows (an gles are measu red cou n terclockwise from a lin e poin tin g to th e righ t): valu e valu e Direction 0 0 degrees 4 1 8 0 degrees 1 4 5 degrees 5 2 2 5 degrees 2 9 0 degrees 6 2 7 0 degrees 3 in dex Direction 1 3 5 degrees 7 3 1 5 degrees Option al real valu e, variable, or expression (in terpreted as an in teger) specifyin g th e first array elemen t to be accessed. E lemen t zero is accessed first if n o in dex is specified. Details Th is in stru ction draws a ch ain of pixels to form an arbitrary sh ape. Th e ch ain is drawn with th e cu rren t graph ics foregrou n d color (see GCOLOR), textu re (see GTE XTURE ), an d logical operation (see GLOGICAL). Opaqu e textu res are always u sed, regardless of th e opaqu e/tran sparen t mode settin g (see GTE XTURE ). V+ Lan gu age Referen ce Gu ide Page 3 7 7 GCHAIN program in stru ction Th is in stru ction operates on th e win dow th at is cu rren tly open for th e specified logical u n it. If th e win dow is open in n on bu ffered mode, th e in stru ction sen ds a requ est to th e win dow man ager an d takes effect immediately. If th e win dow is open in bu ffered mode, th e effect is displayed wh en th e bu ffer fills or an FE MPTY in stru ction is execu ted. E xample In th e win dow open on graph ics logical u n it 2 0 , draw a ch ain of 3 0 pixels startin g at location (2 5 ,1 0 ). Th e relative position of each pixel is fou n d in elemen ts dir[0 ] th rou gh dir[2 9 ]: GCHAIN (20) 25, 10, 30, dir In th e win dow open on graph ics logical u n it 2 0 , draw a ch ain of 2 5 pixels, startin g wh ere th e previou s ch ain left off. Th e relative position of each pixel is in array elemen ts dir[6 ] th rou gh dir[3 0 ]: GCHAIN (20) , , 25, dir[6] Related Keywords FOPE N program in stru ction GCLIP program in stru ction GCOLOR program in stru ction GLOGICAL program in stru ction GPOINT program in stru ction GTE XTURE program in stru ction GTRANS program in stru ction V+ Lan gu age Referen ce Gu ide Page 3 7 8 GCLE AR program in stru ction GCLEAR program instruction Syntax GCLEAR ( lu n ) Function Clear an en tire graph ics win dow to th e backgrou n d color. Usage Considerations Th is in stru ction is available on ly with a graph ics-based system. Parameter lu n Real valu e, variable, or expression (in terpreted as an in teger) th at defin es th e logical u n it n u mber of th e win dow to be accessed. (See th e ATTACH in stru ction for a description of u n it n u mbers.) Details Th is in stru ction operates on th e win dow th at is cu rren tly open for th e specified logical u n it. If th e win dow is open in n on bu ffered mode, th e in stru ction sen ds a requ est to th e win dow man ager an d takes effect immediately. If th e win dow is open in bu ffered mode, th e effect is displayed wh en th e bu ffer fills or an FE MPTY in stru ction is execu ted. Th is in stru ction also deletes all slide bars (see GSLIDE ) in th e win dow th at is cu rren tly open . E xample Set th e en tire win dow open on graph ics logical u n it 2 0 to th e backgrou n d color, erasin g an y cu rren t display an d deletin g an y slide bars in th at win dow: GCLEAR (20) Related Keywords ATTACH program in stru ction FOPE N program in stru ction GCOLOR program in stru ction GSLIDE program in stru ction V+ Lan gu age Referen ce Gu ide Page 3 7 9 GCLIP program in stru ction GCLIP program instruction Syntax GCLI P ( lu n ) x, y, dx, dy Function Set th e clippin g rectan gle for all graph ics in stru ction s (except GFLOOD), to su ppress all su bsequ en t graph ics th at fall ou tside th e rectan gle. Usage Considerations Th is in stru ction is available on ly with a graph ics-based system. If th e rectan gle is set improperly, all su bsequ en t graph ics may be su ppressed. Th e clippin g rectan gle is can celed for th e specified logical u n it wh en a win dow is open ed on th e logical u n it with th e FOPE N in stru ction . Parameters lu n Real valu e, variable, or expression (in terpreted as an in teger) th at defin es th e logical u n it n u mber of th e win dow to be accessed. (See th e ATTACH in stru ction for a description of u n it n u mbers.) x, y Option al real valu es, variables, or expression s (in terpreted as in tegers) specifyin g th e (pixel) coordin ates of th e top left corn er of th e clippin g rectan gle. Omitted parameters defau lt to zero. dx, dy Option al real valu es, variables, or expression s (in terpreted as in tegers) specifyin g th e (pixel) width an d h eigh t, respectively, of th e clippin g rectan gle. Zero is assu med for an omitted parameter, u n less all parameters are omitted or zero-see below. Details Th is in stru ction defin es a clippin g rectan gle th at limits th e portion of th e win dow affected by all th e V+ graph ics in stru ction s, except for th e GFLOOD in stru ction . Th at is, th e graph ics man ager au tomatically su ppresses an y graph ics ou tpu t th at fall ou tside th e clippin g rectan gle. If all parameters are omitted or specified to be zero, th e clippin g rectan gle is set to be th e en tire win dow. If th e clippin g rectan gle is specified to exten d beyon d th e win dow bou n dary, th e rectan gle will be limited to th e win dow bou n dary. V+ Lan gu age Referen ce Gu ide Page 3 8 0 GCLIP program in stru ction Th is in stru ction operates on th e win dow th at is cu rren tly open for th e specified logical u n it. If th e win dow is open in n on bu ffered mode, th e in stru ction sen ds a requ est to th e win dow man ager an d takes effect immediately. If th e win dow is open in bu ffered mode, th e effect is displayed wh en th e bu ffer fills or an FE MPTY in stru ction is execu ted. E xample Th e followin g in stru ction sets th e clippin g rectan gle (for th e cu rren t win dow open on graph ics logical u n it 2 0 ) to h ave its top left-h an d corn er at location (1 0 ,1 5 ). Th e width is 1 0 0 pixels, an d th e h eigh t is 2 0 0 pixels. All su bsequ en t graph ics ou tpu t for th e logical u n it th at falls ou tside th is rectan gle is su ppressed: GCLIP (20) 10, 15, 100, 200 Related Keywords FOPE N program in stru ction GARC program in stru ction GCHAIN program in stru ction GCOPY program in stru ction GICON program in stru ction GLINE program in stru ction GLINE S program in stru ction GPANE L program in stru ction GPOINT program in stru ction GRE CTANGLE program in stru ction GSCAN program in stru ction GSLIDE program in stru ction GTYPE program in stru ction V+ Lan gu age Referen ce Gu ide Page 3 8 1 GCOLOR program in stru ction GCOLOR program instruction Syntax GCOLOR ( lu n ) foregrn d, backgrn d Function Set th e foregrou n d an d backgrou n d colors for su bsequ en t graph ics ou tpu t. Usage Considerations Th is in stru ction is available on ly with a graph ics-based system. Th e foregrou n d an d backgrou n d colors are reset for th e specified logical u n it wh en a win dow is open ed on th e logical u n it with FOPE N. Parameters lu n Real valu e, variable, or expression (in terpreted as an in teger) th at defin es th e logical u n it n u mber of th e win dow to be accessed. (See th e ATTACH in stru ction for a description of u n it n u mbers.) foregrn d Option al real valu e, variable, or expression (in terpreted as an in teger) specifyin g th e foregrou n d color. Color valu es ran ge from 0 to 1 5 . Th e color is n ot ch an ged if th e parameter is omitted or if it h as th e valu e -1 . backgrn d Option al real valu e, variable, or expression (in terpreted as an in teger) specifyin g th e backgrou n d color. Color valu es ran ge from 0 to 1 5 . Th e color is n ot ch an ged if th e parameter is omitted or if it h as th e valu e -1 . Details Th e GCOLOR in stru ction sets th e foregrou n d an d backgrou n d colors for su bsequ en t graph ics ou tpu t from an y of th e followin g in stru ction s: GARC GLINE GRE CTANGLE GCHAIN GLINE S GSCAN GCLE AR GPANE L GTYPE GFLOOD GPOINT V+ Lan gu age Referen ce Gu ide Page 3 8 2 GCOLOR program in stru ction For 1 6 -color win dows, th e fu ll ran ge of color valu es (0 to 1 5 ) specify differen t colors. For 2 color win dows, all even valu es (in clu din g 0 ) specify ligh t blu e, an d all odd valu es specify black. Th e stan dard color valu es are sh own in th e followin g table. Th ese colors may be ch an ged by u sin g th e /LUT attribu te for th e FSE T in stru ction . Th is in stru ction operates on th e win dow th at is cu rren tly open for th e specified logical u n it. Th e effect of th is in stru ction applies to all su bsequ en t ou tpu t to th e win dow. (Note, h owever, th at if th e win dow is open in bu ffered mode, th e effect is n ot displayed u n til th e bu ffer fills or an FE MPTY in stru ction is execu ted.) S tan dard Graph ics Color Valu es Nu mber Color 0 Vision Video 1 Black 2 Dark gray 3 Blu e 4 Blu e gray 5 Ligh t blu e 6 Green 7 Dark green 8 Yellow 9 Oran ge 10 Red 11 Maroon 12 Pin k 13 Mediu m gray 14 Ligh t gray 15 Wh ite V+ Lan gu age Referen ce Gu ide Page 3 8 3 GCOLOR program in stru ction E xamples For th e win dow open on graph ics logical u n it 2 0 , set th e foregrou n d color to black (1 ) an d th e backgrou n d color to wh ite (1 5 ) for su bsequ en t graph ics in stru ction s: GCOLOR (20) 1, 15 For th e win dow open on graph ics logical u n it 2 0 , set th e foregrou n d color to green (6 ) for su bsequ en t graph ics in stru ction s (an d do n ot ch an ge th e backgrou n d color): GCOLOR (20) 6 Related Keywords FOPE N program in stru ction GARC program in stru ction GCHAIN program in stru ction GFLOOD program in stru ction GLINE program in stru ction GLINE S program in stru ction GPANE L program in stru ction GPOINT program in stru ction GRE CTANGLE program in stru ction GSCAN program in stru ction GTYPE program in stru ction V+ Lan gu age Referen ce Gu ide Page 3 8 4 GCOPY program in stru ction GCOPY program instruction Syntax GCOPY ( lu n ) x, y = src_ x, src_ y, dx, dy Function Copy on e region of a win dow to an oth er region in th e same win dow. Usage Considerations Th is in stru ction is available on ly with a graph ics-based system. Parameters lu n Real valu e, variable, or expression (in terpreted as an in teger) th at defin es th e logical u n it n u mber of th e win dow to be accessed. (See th e ATTACH in stru ction for a description of u n it n u mbers.) x, y Real valu es, variables, or expression s (in terpreted as in tegers) specifyin g th e coordin ates (in pixels) of th e top left corn er of th e destin ation region . src_ x, src_ y Real valu es, variables, or expression s (in terpreted as in tegers) specifyin g th e coordin ates (in pixels) of th e top left corn er of th e sou rce region from wh ich bitmap in formation is to be obtain ed. dx, dy Real valu es, variables, or expression s (in terpreted as in tegers) specifyin g th e width an d h eigh t, respectively, of th e region to copy. Both of th ese valu es mu st be greater th an zero. Details Th e specified region of th e win dow is copied directly to th e destin ation region with th e cu rren t logical operation applied (see GLOGICAL). Th is in stru ction operates on th e win dow th at is cu rren tly open for th e specified logical u n it. If th e win dow is open in n on bu ffered mode, th e in stru ction sen ds a requ est to th e win dow man ager an d takes effect immediately. If th e win dow is open in bu ffered mode, th e effect is displayed wh en th e bu ffer fills or an FE MPTY in stru ction is execu ted. E xample Th e followin g in stru ction copies, in th e win dow open on graph ics logical u n it 2 0 , a 5 -by-7 region from th e rectan gle with its top left corn er at (1 0 ,1 5 ) to th e rectan gle with its top left V+ Lan gu age Referen ce Gu ide Page 3 8 5 GCOPY program in stru ction corn er at (0 ,2 ): GCOPY(20) 0, 2 = 10, 15, 5, 7 Related Keywords FOPE N program in stru ction GCLIP program in stru ction GLOGICAL program in stru ction V+ Lan gu age Referen ce Gu ide Page 3 8 6 GE TC real-valu ed fu n ction GETC real-valued function Syntax GETC ( lu n , mode) Function Retu rn th e n ext ch aracter (byte) from a device or in pu t record on th e specified logical u n it. Usage Considerations Th e logical u n it mu st be attach ed by th e program for n ormal, variable-len gth record in pu t/ou tpu t. Parameters lu n Real valu e, variable, or expression (in terpreted as an in teger) th at iden tifies th e device to be accessed. (See th e ATTACH in stru ction for a description of th e u n it n u mbers.) mode Real valu e, variable, or expression (in terpreted as an in teger) th at specifies th e mode of th e read operation . Cu rren tly, th e mode is u sed on ly for th e termin al an d serial I/O logical u n its. Th e valu e is in terpreted as a sequ en ce of bit flags as detailed below. (All bits are assu med to be clear if n o mode valu e is specified.) Bit 1 ( LS B) Disable waitin g for in pu t ( mask valu e = 1 ) If th is bit is clear, program execu tion is su spen ded u n til th e n ext byte is received. If th e bit is set an d n o bytes are available, th e fu n ction immediately retu rn s th e error code for * No data received* (-5 2 6 ). NOTE: A -5 2 6 error may be retu rn ed by th e first n o-wait GE TC even if th ere are bytes qu eu ed. Bit 2 Disable ech o ( mask valu e = 2 ) If th is bit is clear, in pu t from th e termin al is ech oed back to th e sou rce. If th e bit is set, ch aracters are n ot ech oed back to th e sou rce. (Th is bit is ign ored for th e serial lin es.) Details Th e n ext byte from th e device is retu rn ed. Wh en readin g from a record-orien ted device su ch as th e system termin al or a disk file, th e carriage-retu rn an d lin e-feed ch aracters at th e en d V+ Lan gu age Referen ce Gu ide Page 3 8 7 GE TC real-valu ed fu n ction of records are also retu rn ed. Wh en th e en d of a disk file is reach ed, a Ctrl+Z ch aracter (2 6 decimal) is retu rn ed. Wh en readin g from th e termin al, GE TC will retu rn th e n ext ch aracter en tered at th e keyboard. All con trol ch aracters will be read, except Ctrl+S, Ctrl+Q, Ctrl+O, an d Ctrl+W, wh ich will h ave th eir n ormal termin al con trol fu n ction s. Wh en readin g from th e serial lin e, GE TC will retu rn th e n ext data byte immediately, u n modified. (Note th at if th e serial lin e is con figu red to recogn ize Ctrl+S an d Ctrl+Q au tomatically as con trol ch aracters, th en th ose ch aracters are n ot retu rn ed by th e GE TC fu n ction .) Normally, th e byte valu e retu rn ed is in th e ran ge 0 to 2 5 5 (decimal). If an in pu t error occu rs, a n egative error code n u mber is retu rn ed. Th e mean in gs of th e error codes are listed in th e section System Messages. E xample Th e followin g program segmen t reads ch aracters from a disk file u n til a comma (,) ch aracter, a con trol ch aracter, or an I/O error is en cou n tered. Th e ch aracters are appen ded to th e strin g variable $ field. (Th e disk file mu st h ave already been open ed for accessin g variable-len gth records.) $field = "" c = GETC(5) WHILE (c > ^H1F) AND (c <> ',) DO $field = $field+$CHR(c) c = GETC(5) END IF c < 0 THEN TYPE $ERROR(c) HALT END Related Keywords ATTACH program in stru ction RE AD program in stru ction V+ Lan gu age Referen ce Gu ide Page 3 8 8 GE T.E VE NT real-valu ed fu n ction GET.EVENT real-valued function Syntax GET.EVENT ( task) Function Retu rn even ts th at are set for th e specified task. Usage Considerations Do n ot con fu se GE T.E VE NT with th e GE TE VE NT program in stru ction , wh ich retu rn s in formation from a graph ics win dow or th e termin al. Parameter task Option al real valu e, variable, or expression (in terpreted as an in teger) th at specifies th e task for wh ich even ts are to be retu rn ed. Th e valid ran ge is -1 to 6 , or -1 to 2 7 , in clu sive. If th e parameter is omitted, or h as th e valu e -1 , th e cu rren t task is referen ced. NOTE: Th e basic system allows 7 tasks (0 – 6 ). Th e V+ E xten sion s option allows 2 8 tasks (0 – 2 7 ). Details Th e even ts are retu rn ed in a valu e th at sh ou ld be in terpreted as a sequ en ce of bit flags, as detailed below. Bit 1 (LSB) I/O Completion (mask valu e = 1 ) Th is bit bein g set in dicates th at a system in pu t/ou tpu t operation h as completed. See th e description s of SE T.E VE NT an d WAIT.E VE NT for more details. Related Keywords CLE AR.E VE NT program in stru ction SE T.E VE NT program in stru ction WAIT.E VE NT program in stru ction V+ Lan gu age Referen ce Gu ide Page 3 8 9 GE TE VE NT program in stru ction GETEVENT program instruction Syntax GETEVENT ( lu n , mode) even ts[ in dex] Function Retu rn in formation describin g in pu t from a graph ics win dow or in pu t from th e termin al. Usage Considerations A graph ics win dow mu st be open for read access on th e specified logical u n it. If keyboard in pu t is bein g read, th e termin al mu st be attach ed. NOTE: Do n ot con fu se GE TE VE NT with th e GE T.E VE NT real-valu ed fu n ction , wh ich retu rn s even ts for a specified task. Parameters lu n Real valu e, variable, or expression (in terpreted as an in teger) th at defin es th e logical u n it n u mber of th e win dow to be accessed. (See th e ATTACH in stru ction for a description of u n it n u mbers.) mode Option al real valu e, variable, or expression (in terpreted as a bit field) specifyin g h ow th e in stru ction is to operate. Zero is assu med if th e parameter is omitted. Th e bit in terpretation s are given below. Bit 1 (LSB) Wait (0 ) vs. No wait (1 ) (mask valu e = 1 ) If th is bit is clear, program execu tion is su spen ded u n til th e n ext even t is received. If th e bit is set an d n o even ts are available, th e array con tain s th e error code for * No data received* (-5 2 6 ) (see n ote below). NOTE: A -5 2 6 error may sometimes be retu rn ed by a n o-wait GE TE VE NT in stru ction even if th ere are already even ts qu eu ed. Su bsequ en t GE TE VE NT in stru ction s retu rn th ese even ts. even ts[ ] Real array th at receives th e even t code n u mber an d data if an y even t is available. Th e format of th e even t in formation is described below. in dex Option al real valu e, variable, or expression (in terpreted as an in teger) specifyin g th e first array elemen t to receive data. E lemen t zero is accessed first if n o in dex is specified. V+ Lan gu age Referen ce Gu ide Page 3 9 0 GE TE VE NT program in stru ction Details Th e GE TE VE NT in stru ction operates on th e win dow th at is cu rren tly open for th e specified logical u n it. If th e win dow is open for write-on ly access, an error is reported an d n o even t in formation is available. All in pu t from a win dow-in clu din g movemen t of th e poin tin g device, bu tton presses, keyboard in pu t, an d win dow statu s ch an ges-can be received in th e form of even ts. Recogn ition of th e variou s even ts is en abled for a win dow with th e /E VE NT attribu te keyword for th e FOPE N an d FSE T in stru ction s (see below). Wh en ever an en abled even t occu rs for a win dow, th e even t is placed in an even t qu eu e for th at win dow. Th e GE TE VE NT in stru ction allows an application program to read even ts from th e qu eu es an d process th em. Th e in formation retu rn ed in th e even ts[ ] array in dicates th e su ccess or failu re of th e in stru ction an d, if su ccessfu l, wh ich even ts occu rred. Th e format of th e even ts[ ] array is as follows: Array elemen t in dex+0 Description of con ten ts E rror code or even t code If th is valu e is less th an zero, th e in stru ction h as failed an d th e valu e is a stan dard V+ error n u mber. In th is case, n o oth er elemen ts are sign ifican t. If th is valu e is zero or positive, th e valu e is a code th at in dicates wh ich even t h as occu rred. (See below for description s of th e even t codes.) in dex+1 E ven t argu men t #1 (if an y, see below) ... in dex+N E ven t argu men t #N (if an y, see below) After a GE TE VE NT in stru ction is execu ted, th e real-valu ed fu n ction IOSTAT(logical_ u n it, 2 ) retu rn s th e n u mber of valu es placed in th e even ts[ ] array, in clu din g th e even t code an d an y argu men ts. Th e FCMND program in stru ction (with comman d code #1 0 2 ) can be u sed to discard all th e even ts waitin g to be processed. If keyboard even ts are en abled for a win dow, all key presses (except Crtl+W, Crtl+S, an d Ctrl+Q) are retu rn ed wh en ever th e win dow is selected. GE TE VE NT can also be u sed to in tercept keyboard in pu t to th e mon itor win dow simply by ATTACHin g th e termin al an d specifyin g th e termin al LUN in th e GE TE VE NT in stru ction (a win dow does n ot h ave to be open an d even ts do n ot h ave to be en abled). V+ Lan gu age Referen ce Gu ide Page 3 9 1 GE TE VE NT program in stru ction E vent Codes E ach even t is iden tified by an in teger called th e even t code. Th is code tells wh ich even t h as occu rred. E ven ts may h ave a n u mber of associated argu men ts, an d th e application program mu st in terpret th em. Th e followin g table sh ows, for each even t, th e even t code an d th e argu men ts. (E ach argu men t listed below is a 1 6 -bit in teger valu e.) Graph ics Even ts Codes Code Description Argu men ts ( see n otes below) 0 Key press key = ASCII valu e of key pressed 1 Bu tton down bu tton _ mask, x, y (See n ote 1 ) 2 Bu tton u p bu tton _ mask, x, y (See n ote 1 ) 3 Dou ble click bu tton _ mask, x, y (See n otes 1 & 2 ) 4 Poin ter moved bu tton _ mask, x, y (See n ote 1 ) 5 Win dow select 6 Win dow deselect 7 Slide bar bu tton down ID, position , max_ pos (See n ote 3 ) 8 Slide bar poin ter move ID, position , max_ pos (See n ote 3 ) 9 Slide bar bu tton u p ID, position , max_ pos (See n ote 3 ) 10 Size bu tton down du mmy (zero), dx, dy (See n ote 4 ) 11 Size poin ter move du mmy (zero), dx, dy (See n ote 4 ) 12 Size bu tton u p du mmy (zero), dx, dy (See n ote 4 ) 13 Not u sed 14 Men u selected men u , item (See n ote 5 ) 15 Poin ter en ter win dow V+ Lan gu age Referen ce Gu ide Page 3 9 2 GE TE VE NT program in stru ction 16 Poin ter exit win dow 17 Close win dow 18 Open win dow 20 Con n ected to a PC 21 Discon n ected from a PC Th e followin g n otes apply to th e previou s table: Note 1 Th e bu tton bit mask con sists of a bit for each bu tton on th e poin tin g device. Th e mask valu es are 1 for bu tton 1 , 2 for bu tton 2 , an d 4 for bu tton 3 . On th ree-bu tton poin tin g devices, bu tton 1 is th e left bu tton , 2 is th e middle bu tton , an d 3 is th e righ t bu tton . On two-bu tton devices (su ch as th e Adept in tegrated keyboard), th e left bu tton is #2 an d th e righ t bu tton is #3 . For bu tton down , bu tton u p, an d dou ble-click even ts, on ly a sin gle bit is set in th e mask, correspon din g to th e bu tton th at gen erated th e even t. For poin ter-moved even ts, th e bit mask reflects th e cu rren t state of all th ree poin ter device bu tton s. A set bit in dicates th at th e correspon din g bu tton is pressed. Note 2 A dou ble-click even t occu rs in addition to all of th e fou r oth er bu tton even ts th at created it. Th e complete sequ en ce is: bu tton down , bu tton u p, bu tton down , dou ble click, bu tton u p. Note 3 Th ese even ts are retu rn ed by th e slide bars (see th e GSLIDE in stru ction ) con tain ed in th e win dow, as well as th e h orizon tal an d vertical scroll bars belon gin g to th e win dow. For u ser-defin ed slide bars, th e ID n u mber is su pplied by you in th e GSLIDE in stru ction th at creates th e slide bar. Th e position is in th e ran ge zero to max_ pos (wh ich is also su pplied by you in th e GSLIDE in stru ction ). Th e ID n u mber for th e win dow vertical scroll bar is -1 . If vertical scroll is n ot bein g grabbed (see th e GRAB_ V_ SCROLL keyword below), th e position is th e actu al vertical scroll in pixels. max_ pos is th e maximu m possible vertical scroll in pixels. If vertical scroll is bein g grabbed, max_ pos may be previou sly set by you (see /V_ RANGE u n der th e FSE T in stru ction ). position may also be set by you , alth ou gh it will be modified by poin ter device activity (see th e attribu tes /V_ HANDLE an d /V_ ARROWINC for th e FSE T in stru ction ). V+ Lan gu age Referen ce Gu ide Page 3 9 3 GE TE VE NT program in stru ction Th e ID n u mber for th e win dow h orizon tal scroll bar is -2 . If h orizon tal scroll is n ot bein g grabbed (see th e GRAB_ H_ SCROLL> keyword below), position is th e actu al h orizon tal scroll in pixels. max_ pos is th e maximu m possible h orizon tal scroll in pixels. If h orizon tal scroll is bein g grabbed, max_ pos may be previou sly set by you (see /H_ RANGE u n der th e FSE T in stru ction ). Position may also be set by you , alth ou gh it will be modified by poin ter device activity (see th e attribu tes /H_ HANDLE an d /H_ ARROWINC for th e FSE T in stru ction ). Note 4 All th e sizin g even ts retu rn th e n ew win dow width (dx) an d h eigh t (dy). At th e time eith er or both of th e NTFY_ SIZE an d GRAB_ SIZE even ts are en abled (see /E VE NT keywords below), a size bu tton down even t followed by a size bu tton u p even t are retu rn ed with th e cu rren t win dow size. Note 5 Th e argu men ts for th e men u -selected even t sh ou ld be in terpreted as follows: Men u Description I tem 0 Men u -bar item selected Item n u mber of men u -bar item selected. (Th e program sh ou ld issu e an FSE T /PULLDOWN ... in respon se.) >0 Pu ll-down item Row n u mber of pu ll-down item selected selected, cou n tin g from 1 . E nabling E vent Recognition In order to improve system efficien cy an d min imize memory requ iremen ts, on ly even ts th at are actu ally n eeded sh ou ld be en abled. E ven ts th at are n ot en abled do n ot appear in an y qu eu e an d are simply ign ored. E ven t recogn ition is con trolled with th e /E VE NT attribu te keyword specified in an FOPE N or FSE T in stru ction . Th e argu men t for th e /E VE NT keyword is a list of even t keywords, each of wh ich iden tifies an even t to be en abled or disabled. In gen eral, each even t keyword can be prefixed with NO to disable th e even t. If con flictin g even t keywords are en cou n tered, th e later keyword takes preceden ce. Th e /E VE NT keywords are sh own in th e followin g table alon g with th e n ames of th e even ts th ey con trol. Wh en a win dow is created, n o even ts are en abled. Th u s, th e desired even ts mu st all be specified with th e /E VE NT keyword in an FOPE N or FSE T in stru ction . E ach of th e keywords may be abbreviated as lon g as th e abbreviation can n ot be con fu sed with an oth er keyword's. V+ Lan gu age Referen ce Gu ide Page 3 9 4 GE TE VE NT program in stru ction NOTE: To en su re th at programs will be compatible with fu tu re releases of V+, do n ot abbreviate keywords. /EVENT Keywords an d Description s Keyword BUTTON Description & effect wh en en abled Poin ter bu tton ch an ge (see Note 1 below) Even ts en abled Bu tton down Bu tton u p Dou ble click CONNE CT Con n ect an d discon n ect even t n otification . If th e even t valu e retu rn ed is 2 0 , th en you are con n ected to th e PC. If th e even t valu e retu rn ed is 2 1 , th en you are discon n ected from th e PC. Notification GRAB_ H_ SCROLL Horizon tal scroll even ts go to program an d do n ot ch an ge win dow (see Note 2 below) Scroll h orizon tal GRAB_ OPE N Win dow open an d close even ts go to program an d do n ot ch an ge th e win dow Open win dow Close win dow GRAB_ SIZE Size ch an ge even ts go to program an d do n ot ch an ge win dow (see Note 3 below) Size ch an ge GRAB_ V_ SCROLL Vertical scroll even ts go to program an d do n ot ch an ge win dow (see Note 2 below) Scroll vertical KE YPRE SS Keyboard in pu t processed if th e win dow is selected Keypress ME NU Pu ll-down men u selection s Men u selected MOVE _ ANY Poin ter-move even t an y time (n ot implemen ted) Poin ter move V+ Lan gu age Referen ce Gu ide Page 3 9 5 GE TE VE NT program in stru ction MOVE _ B1 Poin ter move wh ile bu tton 1 down (see Note 1 below) Poin ter move MOVE _ B2 Poin ter move wh ile bu tton 2 down (see Note 1 below) Poin ter move MOVE _ B3 Poin ter move wh ile bu tton 3 down (see Note 1 below) Poin ter move NONE Disable all even ts (may n ot be preceded with NO) Non e NTFY_ H_ SCROLL Horizon tal scroll-even ts go to program an d also ch an ge win dow Scroll h orizon tal NTFY_ OPE N Win dow open an d close-even ts go to program an d also ch an ge win dow Open win dow Close win dow NTFY_ SIZE Size ch an ge-even ts go to program an d also ch an ge win dow (see Note 3 below) Size ch an ge NTFY_ V_ SCROLL Vertical scroll-even ts go to program an d also ch an ge win dow Scroll vertical OBJE CT E ven t occu rs wh en clickin g an d draggin g with in a slide bar (see Notes 1 an d 4 below) Slide bar POINTE R_ CHANGE program in stru ction E ven t occu rs wh en poin ter crosses win dow bou n daries (n ot implemen ted) Poin ter en ter win dow Poin ter exit win dow SE LE CT_ WINDOW E ven t occu rs wh en select statu s of th e win dow ch an ges Win dow select Win dow deselect Th e followin g n otes apply to th e in formation in th e previou s table: Note 1 If th e OBJE CT keyword is specified togeth er with th e BUTTON an d MOVE _ B2 keywords, th e slide bar even ts may be retu rn ed as well as poin ter-2 move an d bu tton -2 even ts. All even ts cau sed by bu tton 2 th at do n ot cau se a slide bar even t are retu rn ed as poin ter-move or bu tton -2 even ts. On th e oth er h an d, if th e cu rsor is with in an active slide bar, on ly slide bar even ts are retu rn ed. V+ Lan gu age Referen ce Gu ide Page 3 9 6 GE TE VE NT program in stru ction Note 2 (Th e followin g paragraph s apply equ ally to th e h orizon tal an d vertical scroll bars. For th e h orizon tal bar, su bstitu te th e keywords GRAB_ H_ SCROLL, /H_ RANGE , /H_ HANDLE , an d /H_ ARROWINC for GRAB_ V_ SCROLL, /V_ RANGE , /V_ HANDLE , an d /V_ ARROWINC, respectively.) Th e vertical scroll bar operates in essen tially two modes. In th e first mode (in wh ich th e GRAB_ V_ SCROLL even t h as n ot been en abled), th e vertical scroll bar is u n der th e con trol of th e win dow man ager. In th is mode, th e maximu m valu e of th e position retu rn ed by th e vertical scroll bar is equ al to th e total possible win dow scroll (in pixels). In th e secon d mode, th e vertical scroll bar is u n der th e con trol of th e application program. Th is occu rs wh en th e GRAB_ V_ SCROLL even t h as been en abled. In th is mode, th e maximu m valu e of th e position retu rn ed by th e scroll bar can be set by u sin g th e FSE T in stru ction with th e /V_ RANGE attribu te. Addition ally, th e vertical scroll h an dle position an d th e position in cremen t du e to th e arrow bu tton s can be set (see /V_ HANDLE an d V_ ARROWINC attribu tes for th e FSE T in stru ction ). At th e time th e GRAB_ V_ SCROLL even t is disabled, th e vertical scroll bar retu rn s to th e con trol of th e win dow man ager. Th e maximu m valu e of th e position retu rn ed by th e vertical scroll bar is again equ al to th e total possible win dow scroll in pixels. Th e in formation set by /V_ RANGE , /V_ HANDLE , an d /V_ ARROWINC will be lost. Note 3 At th e time a GRAB_ SIZE or NTFY_ SIZE even t is en abled, a size bu tton down even t an d a size bu tton u p even t are sen t to th e win dow. In th is man n er, a u ser program may obtain th e size of a win dow as soon as eith er of th ese even ts is en abled. Note 4 Th e slide-bar even ts can be cau sed on ly by bu tton 2 . Clickin g an d/or draggin g on a slide bar with an y oth er bu tton will cau se on ly poin termove or bu tton even ts (if th ey are en abled). E xample Get th e n ext even t from th e win dow cu rren tly open for read on graph ics logical u n it 2 0 . Stores th e even t code an d argu men ts in array elemen ts even ts[0 ], even ts[1 ], etc. GETEVENT (20) events Related Keywords FCMND program in stru ction FOPE N program in stru ction V+ Lan gu age Referen ce Gu ide Page 3 9 7 GE TE VE NT program in stru ction FSE T program in stru ction V+ Lan gu age Referen ce Gu ide Page 3 9 8 GFLOOD program in stru ction GFLOOD program instruction Syntax GFLOOD ( logical_ u n it) x, y Function Flood a region in a graph ics win dow with color. Usage Considerations Th is in stru ction is available on ly with a graph ics-based system. Th is in stru ction is fairly slow an d sh ou ld be avoided in time-critical application s. Parameters lu n Real valu e, variable, or expression (in terpreted as an in teger) th at defin es th e logical u n it n u mber of th e win dow to be accessed. (See th e ATTACH in stru ction for a description of u n it n u mbers.) x, y Real valu es, variables, or expression s (in terpreted as in tegers) specifyin g th e (pixel) coordin ates of th e seed poin t from wh ich th e floodin g is to proceed. Details Th is in stru ction floods an y region en closin g th e given poin t (x,y) with th e cu rren t graph ics foregrou n d color (see GCOLOR). Th e ou tpu t from th e GFLOOD in stru ction is n ot affected by th e cu rren t textu re or logical operation . Th e floodin g starts with th e assu mption th at th e color of th e specified seed pixel at (x,y) is th e old color th at is to be replaced with th e n ew color specified. As GFLOOD floods th e area arou n d (x,y) with th e n ew color, it looks for region bou n daries to stop th e flood. An y pixel differen t from th e in itial old color is treated as a region bou n dary. Th is in stru ction operates on th e win dow th at is cu rren tly open for th e specified logical u n it. If th e win dow is open in n on bu ffered mode, th e in stru ction sen ds a requ est to th e win dow man ager an d takes effect immediately. If th e win dow is open in bu ffered mode, th e effect is displayed wh en th e bu ffer fills or an FE MPTY in stru ction is execu ted. E xample In th e win dow cu rren tly open on graph ics logical u n it 2 0 , ch an ge th e pixel at coordin ates (1 0 0 ,1 2 0 ) to th e cu rren t foregrou n d color, an d propagate th at ch an ge to all su rrou n din g pixels th at h ave th e origin al color of pixel (1 0 0 ,1 2 0 ). V+ Lan gu age Referen ce Gu ide Page 3 9 9 GFLOOD program in stru ction GFLOOD (20) 100, 120 Related Keywords FOPE N program in stru ction GCOLOR program in stru ction V+ Lan gu age Referen ce Gu ide Page 4 0 0 GGE TLINE program in stru ction GGETLINE program instruction Syntax GGETLI NE ( logical_ u n it) $ data[ in dex] , n u m.pix = x, y, n x Function Retu rn pixel in formation from a sin gle pixel row in a graph ics win dow. Usage Considerations Th is in stru ction is available on ly with a graph ics-based system. Older version s of V+ provided th e in stru ction GGE T.LINE , wh ich h as a similar fu n ction . GGE T.LINE is su pported in th is V+ version , bu t will become obsolete in a fu tu re version . New code sh ou ld u se th e syn tax presen ted h ere. E xistin g code sh ou ld be u pdated to u se th e n ew in stru ction n ame. Th is in stru ction is n ot available wh en u sin g AdeptWin dows PC. Parameters lu n Real valu e, variable, or expression (in terpreted as an in teger) th at defin es th e logical u n it n u mber of th e win dow to be accessed. (See th e ATTACH in stru ction for a description of u n it n u mbers.) $ data[ ] Strin g array th at receives th e retu rn ed pixel in formation . Th e format of th e pixel in formation is described below. in dex Option al real valu e, variable, or expression (in terpreted as an in teger) specifyin g th e first array elemen t to receive data. E lemen t zero is accessed first if n o in dex is specified. n u m.pix Retu rn s th e n u mber of pixels in th e $ data[ ] array. Th is will be less th an th e n u mber of pixels requ ested if th e edge of th e win dow is en cou n tered before n x pixels can be retu rn ed. x, y Real valu es, variables, or expression s (in terpreted as in tegers) specifyin g th e (pixel) coordin ates of th e startin g poin t of th e row of pixels to retu rn . nx Real valu e, variable, or expression (in terpreted as an in teger) specifyin g th e n u mber of pixels to retu rn . V+ Lan gu age Referen ce Gu ide Page 4 0 1 GGE TLINE program in stru ction Details Th e GGE TLINE in stru ction operates on th e win dow th at is cu rren tly open for th e specified logical u n it. Th is in stru ction allows an application program to retrieve pixel in formation from a graph ics win dow. Th e in formation retu rn ed in th e strin g array describes n x pixels in row y of th e graph ics win dow, startin g at colu mn x. Th e format of th e strin g array is as follows: For win dows with 4 bits per pixel (/COLORS 1 6 ): Byte 1 of $ data[ in dex] Bit #: 8 Pixel #: 7 6 5 x 4 3 2 1 x+1 Byte 2 of $ data[ in dex] Bit #: 8 Pixel #: 7 6 5 x+2 4 3 etc. 2 1 etc. x+3 etc. For win dows with 1 bit per pixel (/COLORS 2 ): Byte 1 of $ data[ in dex] Bit: 8 7 6 5 4 3 2 1 Pixel #: x x+1 x+2 x+3 x+4 x+5 x+6 x+7 Byte 2 of $ data[ in dex] etc. Bit: 8 7 6 5 4 3 2 1 etc. Pixel #: x+8 x+9 x+1 0 x+1 1 x+1 2 x+1 3 x+1 4 x+1 5 etc. If more th an 1 2 8 bytes of data are retu rn ed, th e 1 2 9 th data byte is retu rn ed as th e first byte of $ data[in dex+1 ], th e 2 5 7 th data byte is retu rn ed as th e first byte of $ data[in dex+2 ], an d so forth . All th e elemen ts of $ data filled with data will be 1 2 8 bytes lon g, except for th e last elemen t filled (wh ich will be from zero to 1 2 7 bytes lon g). Th is fact can be u sed to determin e th e n u mber of bytes actu ally con tain in g pixel data (see th e example below). V+ Lan gu age Referen ce Gu ide Page 4 0 2 GGE TLINE program in stru ction E xample Th e followin g in stru ction accesses th e win dow open ed on logical u n it n u mber 2 0 . Pixel data from th e win dow is placed in array elemen ts $ data[0 ] an d $ data[1 ], startin g from th e pixel at coordin ates (1 0 0 ,5 0 ). Data for 2 5 0 pixels will be retu rn ed (u n less th e righ t margin of th e win dow is en cou n tered first). GGETLINE (20) $data = 100, 50, 250 Th e followin g program segmen t sh ows h ow to compu te th e actu al n u mber of bytes of pixel data retu rn ed in th e array $ data. index = 0 bytes = 0 DO length = LEN($data[index]) bytes = bytes+length index = index+1 UNTIL length < 128 ;First array index ;Number of data bytes ;Length of this element ;Total the bytes ;On to the next element ;Partial string signals end Related Keyword FOPE N program in stru ction V+ Lan gu age Referen ce Gu ide Page 4 0 3 GICON program in stru ction GICON program instruction Syntax GI CON ( lu n , mode) x, y, $ n ame, in dex Function Draw a predefin ed graph ic symbol (icon ) in a graph ics win dow. Usage Considerations Th is in stru ction is available on ly with a graph ics-based system. Th e specified icon mu st be eith er a predefin ed system icon or a defin ed u ser icon . V+ Lan gu age Referen ce Gu ide Page 4 0 4 GICON program in stru ction Parameters lu n Real valu e, variable, or expression (in terpreted as an in teger) th at defin es th e logical u n it n u mber of th e win dow to be accessed. (See th e ATTACH in stru ction for a description of u n it n u mbers.) mode Option al real valu e, variable, or expression (in terpreted as an in teger) specifyin g th e icon drawin g mode. Th e mode valu es are as follows: 0 Draw a static icon u sin g th e actu al icon colors, overwritin g th e display. (Th is is th e defau lt.) 1 Draw a static icon u sin g th e actu al icon colors, overwritin g th e display, bu t draw on ly every oth er pixel. (Th e resu ltin g icon image looks like it h as vertical, tran sparen t stripes.) 2 Draw a static icon in complemen t modeth e icon image is exclu sive ORed with th e cu rren t win dow con ten ts. (Note th at drawin g an icon a secon d time in th is mode will restore th e previou s backgrou n d.) 3 E rase th e cu rren t movable icon , if an y. Th e x, y, $ n ame, an d in dex parameters are ign ored in th is mode. 4 After erasin g an y previou s movable icon , draw th e icon in complemen t mode. Th e n ew icon becomes th e cu rren t movable icon . x, y Real valu es, variables, or expression s (in terpreted as in tegers) specifyin g th e (pixel) coordin ates of wh ere th e icon is to be drawn . Th e icon referen ce poin t is placed at th ese coordin ates. Th e location of th e referen ce poin t in th e icon depen ds u pon th e particu lar icon , bu t it is n ormally th e top left corn er or th e cen ter of th e icon . $ n ame Strin g valu e, variable, or expression specifyin g th e n ame of th e icon to be drawn . (Icon n ames follow th e same con ven tion as n ormal V+ variable n ames.) V+ Lan gu age Referen ce Gu ide Page 4 0 5 GICON program in stru ction in dex Option al real valu e, variable, or expression (in terpreted as an in teger) specifyin g wh ich elemen t is to be drawn from an array of icon s. Th e valu e may ran ge from 0 to 2 5 5 . E lemen t zero is drawn if n o in dex is specified, or if th e specified in dex is larger th an th e last array elemen t defin ed. Details Th is in stru ction draws a system-defin ed or u ser-defin ed graph ic symbol in th e cu rren t win dow associated with th e in dicated logical u n it n u mber. Th e symbol, called an icon , con sists of a rectan gu lar region of pixels with arbitrary colors. Th e symbol is referen ced by n ame, an d may be eith er a stan dard system icon (see th e list below) or a u ser-defin ed icon . Max in dex Description CHE CK_ BOX 3 Ch eck box for on /off selection CURSOR 0 Poin tin g-device cu rsor RADIO_ BUTTON 3 Pu sh bu tton for on /off selection I con n ame SYSTE M_ ADE PT Adept icon in screen u pper left SYSTE M_ CLOSE 2 Close icon in win dow u pper left SYSTE M_ CURSOR 6 Cu rsors SYSTE M_ DOWN 1 Down arrow SYSTE M_ H_ HANDLE 1 Han dle for h orizon tal scroll bar SYSTE M_ LE FT 1 Left arrow SYSTE M_ MINMAX 1 Min /max icon above vertical scroll bar SYSTE M_ NULL SYSTE M_ RIGHT Nu ll icon 1 Righ t arrow V+ Lan gu age Referen ce Gu ide Page 4 0 6 GICON program in stru ction SYSTE M_ SCROLL 2 Scroll bar display/su ppress icon SYSTE M_ SIZE 1 Size icon in win dow lower righ t SYSTE M_ UP 1 Up arrow SYSTE M_ V_ HANDLE 1 Han dle for vertical scroll bar Cu stom icon s can be developed an d stored in disk files with th e Adept Icon E ditin g Utility program. At ru n time, you r application program can call th e program load.icon to read th e data files an d defin e th e icon s in graph ics memory. On ce th ey are loaded in to graph ics memory, th e icon s can be displayed with th e GICON in stru ction . NOTE: Th e icon editin g u tility is available with AIM software packages or with th e Adept Application Disk (con tact Adept to requ est th is disk). Cu stom icon s also can be created directly by u sin g th e FOPE N in stru ction to open an icon (see th e FOPE N in stru ction for a description of th e /ICON attribu te) an d th en u sin g th e WRITE in stru ction to write image data in to graph ics memory. After an icon h as been open ed for defin ition , th e WRITE in stru ction mu st be u sed repeatedly to defin e each row of th e icon bitmap. Th e strin g su pplied to th e WRITE in stru ction mu st con tain th e followin g items in th e order listed: 1 . A 1 6 -bit in teger in dicatin g th e in dex of th e icon bein g defin ed [for example, defin ed by $ INTB(in dex)] 2 . A 1 6 -bit in teger in dicatin g th e row of th e icon bein g defin ed [for example, defin ed by $ INTB(row)] 3 . E n ou gh fou r-bit pixel valu es to defin e a row of th e icon -data in excess of th at n eeded to defin e a row will be ign ored. For example, th e valu e for a pair of pixels can be defin ed by an expression like: $CHR(^H10*first_pixel+second_pixel) 4 . Th e /S format con trol specifier-to preven t carriage-retu rn an d lin e-feed ch aracters from bein g appen ded to th e strin g A on e-bit-per-pixel version of th e icon is also defin ed au tomatically. All zero pixels in th e fou rbit-per-pixel icon appear as 0 pixels in th e on e-bit-per-pixel icon , an d all n on zero pixels appear as 1 pixels. User-defin ed icon s can be deleted from th e graph ics memory by u sin g th e /ICON qu alifier in an FDE LE TE in stru ction . See FDE LE TE for details. V+ Lan gu age Referen ce Gu ide Page 4 0 7 GICON program in stru ction Icon s may be stored an d referen ced as arrays. Th en th e option al in dex parameter in dicates wh ich of th e array elemen ts is to be displayed. All th e icon s in an array h ave th e same size. For arrays of icon s th at are to be selected via a mou se bu tton press, th e Adept con ven tion is to u se an even n u mbered array in dex (for example, 0 ) for th e icon displayed wh en th e bu tton is n ot pressed, an d th e n ext in dex (for example, 1 ) for th e correspon din g bu tton -down icon . If th ere is n o icon defin ed with th e specified n ame an d in dex, th e system icon SYSTE M_ NULL is displayed an d n o error is retu rn ed. Th is icon appears (wh en mode is 0 ) as a large red qu estion mark. Icon s are n ot affected by th e cu rren t logical operation , textu re, or pattern . Depen din g on th e mode parameter, icon s may be eith er static or movable. Static icon s are drawn in n ormal mode, u sin g th e actu al icon colors, or in complemen t mode (see below). Movable icon s are always drawn in complemen t mode. V+ keeps track of th e movable icon in each win dow, an d erases it (restorin g th e backgrou n d) in modes 3 an d 4 . On ly on e movable icon is available in each win dow. Wh en an icon is drawn in complemen t mode, th e bitmap for th e icon is exclu sive ORed with th e bitmap for th e win dow (u sin g th e cu rren t GLOGICAL plan es mask), so th e colors displayed are n ormally differen t from th e actu al icon colors. Pixel color zero is assu med to be tran sparen t an d allows th e backgrou n d to sh ow. Th u s, live video can n ot be displayed with in an icon u n less th e backgrou n d is already live video. Th e GICON in stru ction operates on th e win dow th at is cu rren tly open for th e specified logical u n it. If th e win dow is open in n on bu ffered mode, th e in stru ction sen ds a requ est to th e win dow man ager an d takes effect immediately. If th e win dow is open in bu ffered mode, th e icon is displayed wh en th e bu ffer fills or an FE MPTY in stru ction is execu ted. E xample Th e followin g in stru ction s draw system-defin ed icon s in th e win dow cu rren tly open on logical u n it n u mber 2 0 . Th e first in stru ction draws th e system-defin ed u p-arrow icon (n amed SYSTE M_ UP), with its u pper left-h an d corn er at location (1 0 ,1 5 ). Th e secon d in stru ction draws th e bu tton -down version of th e same icon , in complemen t mode, to th e righ t of th e first icon : GICON (20) 10, 15, "SYSTEM_UP" GICON (20, 2) 50, 15, "SYSTEM_UP", 1 Related Keywords FDE LE TE program in stru ction FOPE N program in stru ction GCLIP program in stru ction V+ Lan gu age Referen ce Gu ide Page 4 0 8 GLINE program in stru ction GLINE program instruction Syntax GLI NE ( lu n ) x0 , y0 , xn , yn Function Draw a sin gle lin e segmen t in a graph ics win dow. Usage Considerations Th is in stru ction is available on ly with a graph ics-based system. Parameters lu n Real valu e, variable, or expression (in terpreted as an in teger) th at defin es th e logical u n it n u mber of th e win dow to be accessed. (See th e ATTACH in stru ction for a description of u n it n u mbers.) x0 , y0 Real valu es, variables, or expression s (in terpreted as in tegers) specifyin g th e (pixel) coordin ates of th e startin g poin t of th e lin e. xn , yn Real valu es, variables, or expression s (in terpreted as in tegers) specifyin g th e (pixel) coordin ates of th e en din g poin t of th e lin e. Details Th e lin e is drawn with th e cu rren t graph ics foregrou n d color (see GCOLOR), textu re (see GTE XTURE ), an d logical operation (see GLOGICAL). Th is in stru ction operates on th e win dow th at is cu rren tly open for th e specified logical u n it. If th e win dow is open in n on bu ffered mode, th e in stru ction sen ds a requ est to th e win dow man ager an d takes effect immediately. If th e win dow is open in bu ffered mode, th e effect is displayed wh en th e bu ffer fills or an FE MPTY in stru ction is execu ted. E xample In th e win dow cu rren tly open on graph ics logical u n it 2 0 , draw a lin e from coordin ates (1 0 0 ,1 1 0 ) to (4 0 0 ,4 5 0 ), u sin g th e cu rren t foregrou n d color: GLINE (20) 100, 110, 400, 450 Related Keywords ATTACH program in stru ction V+ Lan gu age Referen ce Gu ide Page 4 0 9 GLINE program in stru ction FOPE N program in stru ction GARC program in stru ction GCLIP program in stru ction GCOLOR program in stru ction GLINE S program in stru ction GLOGICAL program in stru ction GTE XTURE program in stru ction GTRANS program in stru ction V+ Lan gu age Referen ce Gu ide Page 4 1 0 GLINE S program in stru ction GLINES program instruction Syntax GLI NES ( logical_ u n it, mode) poin ts, coord[ offset, in dex] Function Draw mu ltiple lin e segmen ts in a graph ics win dow. Usage Considerations Th is in stru ction is available on ly with a graph ics-based system. V+ Lan gu age Referen ce Gu ide Page 4 1 1 GLINE S program in stru ction Parameters lu n Real valu e, variable, or expression (in terpreted as an in teger) th at defin es th e logical u n it n u mber of th e win dow to be accessed. (See th e ATTACH in stru ction for a description of u n it n u mbers.) mode Option al real valu e, variable, or expression (in terpreted as a bit field) specifyin g h ow th e in stru ction is to operate. Zero is assu med if th e parameter is omitted. Th e bit in terpretation s are given below. Bit 2 Open ( 0 ) vs. Closed ( 2 ) Mask valu e = 2 If th is bit is set, a lin e is drawn from th e last poin t to th e first to form a closed polygon . poin ts Real valu e, variable, or expression (in terpreted as an in teger) specifyin g th e n u mber of poin ts to con n ect with lin es. coord[ ,] Real array con tain in g pairs of position coordin ates (in pixels) for th e poin ts. Th e array in dexes are described below. Th e array elemen ts are in terpreted as follows: Array elemen t coord[offset+0 ,in dex+0 ] X coordin ate for first poin t coord[offset+1 ,in dex+0 ] Y coordin ate for first poin t coord[offset+0 ,in dex+1 ] X coordin ate for secon d poin t coord[offset+1 ,in dex+1 ] offset I n terpretation of valu e Y coordin ate for secon d poin t Option al real valu e, variable, or expression (in terpreted as an in teger) specifyin g th e left-h an d array in dex valu e th at accesses th e X compon en ts of th e coordin ates for th e poin ts to be con n ected. Zero is assu med if th is parameter is omitted-in wh ich case in dex also mu st be omitted. Th e X valu e is accessed u sin g a left-h an d in dex equ al to offset. Th e Y valu e is accessed u sin g a left-h an d in dex equ al to (offset+1 ). in dex Option al real valu e, variable, or expression (in terpreted as an in teger) specifyin g th e array elemen ts to access for th e first poin t in th e series. Zero is assu med if th is parameter is omitted. Th e maximu m n u mber of elemen ts allowed is 1 2 7 . V+ Lan gu age Referen ce Gu ide Page 4 1 2 GLINE S program in stru ction Details Th is in stru ction draws a series of lin es between th e specified poin ts. Th e mode parameter provides th e option of h avin g th e last poin t au tomatically con n ected to th e first poin t, formin g a closed polygon . Th e lin es are drawn with th e cu rren t graph ics foregrou n d color (see GCOLOR), textu re (see GTE XTURE ), an d logical operation (see GLOGICAL). Th is in stru ction operates on th e win dow th at is cu rren tly open for th e specified logical u n it. If th e win dow is open in n on bu ffered mode, th e in stru ction sen ds a requ est to th e win dow man ager an d takes effect immediately. If th e win dow is open in bu ffered mode, th e effect is displayed wh en th e bu ffer fills or an FE MPTY in stru ction is execu ted. E xamples Th e followin g in stru ction draws lin es con n ectin g a series of 1 0 poin ts in th e win dow cu rren tly open on graph ics logical u n it 2 0 , u sin g th e foregrou n d color. Th e en dpoin ts of th e first lin e h ave coordin ates (lin es[1 ,1 ],lin es[2 ,1 ]) an d (lin es[1 ,2 ], lin es[2 ,2 ]). Th e en dpoin ts of th e last lin e are (lin es[1 ,9 ],lin es[2 ,9 ]) an d (lin es[1 ,1 0 ],lin es[2 ,1 0 ]): GLINES (20) 10, lines[1,1] Th e followin g in stru ction draws a closed polygon with five sides in th e win dow cu rren tly open on graph ics logical u n it 2 0 , u sin g th e foregrou n d color. Th e en dpoin ts of th e first lin e h ave coordin ates (lin es[0 ,0 ], lin es[1 ,0 ]) an d (lin es[0 ,1 ],lin es[1 ,1 ]). Th e en dpoin ts of th e last lin e are (lin es[0 ,4 ],lin es[1 ,4 ]) an d (lin es[0 ,0 ], lin es[1 ,0 ]): GLINES (20, 2) 5, lines[,] Related Keywords FOPE N program in stru ction GCLIP program in stru ction GCOLOR program in stru ction GLINE program in stru ction GLOGICAL program in stru ction GRE CTANGLE program in stru ction GSCAN program in stru ction GTE XTURE program in stru ction GTRANS program in stru ction V+ Lan gu age Referen ce Gu ide Page 4 1 3 GLOBAL program in stru ction GLOBAL program instruction Syntax GLOBAL type variable, ..., variable Function Declare a variable to be global an d specify th e type of th e variable. GLOBAL statemen ts mu st appear before an y execu table statemen t in th e program. Parameters type Option al parameter specifyin g th e type of a variable. Th e acceptable types are: LOC Location variable (tran sformation , precision poin t, belt) RE AL Sin gle-precision real variable DOUBLE Dou ble-precision real variable See th e Details section for th e defau lt type. variable Variable n ame (belt, precision poin t, real-valu e, strin g, an d tran sformation ). E ach variable can be a simple variable or an array. If th e type parameter is specified, all th e variables mu st match th e specified type. Array variables mu st n ot h ave th eir in dexes specified. Details Variables th at are n ot declared to be AUTO or LOCAL are GLOBAL by defau lt. Un declared scalar variables defau lt to sin gle precision . Th u s, sin gle-precision an d location global variables do n ot n eed to be declared. However, th e on ly way to gu aran tee a dou ble-precision global variable is with th e GLOBAL in stru ction . Global variables can be seen by an y program th at does n ot declare a LOCAL or AUTO variable of th e same n ame. Th u s, if program_ a declares var1 to be a GLOBAL variable an d program_ b declares var1 to be AUTO, program_ b can n ot u se or alter GLOBAL var1 . A n ew copy of variable var1 th at is specific to program_ b is created each time program_ b execu tes. GLOBAL DOUBLE s mu st be declared in each program in wh ich th ey are u sed. V+ Lan gu age Referen ce Gu ide Page 4 1 4 GLOBAL program in stru ction E xamples GLOBAL $str_1, $str_2, x GLOBAL LOC #ppoint_1 GLOBAL DOUBLE var_1, var_2 ;create 2 string and 1 untyped variable ;create 1 global precision point variable ;create 2 double prec. reals Related Keywords AUTO program in stru ction LOCAL program in stru ction V+ Lan gu age Referen ce Gu ide Page 4 1 5 GLOGICAL program in stru ction GLOGICAL program instruction Syntax GLOGI CAL ( logical_ u n it) code, plan es Function Set th e logical operation to be performed between n ew graph ics ou tpu t an d graph ics data already displayed, an d select wh ich bit plan es are affected by graph ics in stru ction s. Usage Considerations Th is in stru ction is available on ly with a graph ics-based system. Th e logical operation an d th e bit-plan e settin gs are reset for th e specified logical u n it wh en a win dow is open ed on th e logical u n it with th e FOPE N in stru ction . V+ Lan gu age Referen ce Gu ide Page 4 1 6 GLOGICAL program in stru ction Parameters lu n Real valu e, variable, or expression (in terpreted as an in teger) th at defin es th e logical u n it n u mber of th e win dow to be accessed. (See th e ATTACH in stru ction for a description of u n it n u mbers.) code Option al real valu e, variable, or expression (in terpreted as an in teger) specifyin g th e fu n ction code of th e logical operation to be performed on graph ics data as it is ou tpu t to th e display. Th e specified operation , as described in th e followin g table, is performed with th e n ew ou tpu t (sou rce) an d an y previou s ou tpu t already in th e win dow (dest). Th e valu e 3 is u sed if th is parameter is omitted. (Most of th ese logical operation s are u sed on ly in u n u su al circu mstan ces.) code Logical operation selected 0 0 [set dest bits to 0 ] 1 sou rce AND dest 2 sou rce AND (NOT dest) 3 sou rce 4 (NOT sou rce) AND dest 5 dest [do n ot ch an ge dest] 6 sou rce XOR dest 7 sou rce OR dest 8 (NOT sou rce) AND (NOT dest) 9 (NOT sou rce) XOR dest 10 NOT dest 11 sou rce OR (NOT dest) 12 NOT sou rce V+ Lan gu age Referen ce Gu ide Page 4 1 7 GLOGICAL program in stru ction 13 14 (NOT sou rce) OR (NOT dest) 15 plan es (NOT sou rce) OR dest 1 [set dest bits to 1 ] Option al real valu e, variable, or expression (in terpreted as a 1 -bit or 4 -bit field) specifyin g th e bit plan es th at are to be accessed du rin g su bsequ en t graph ics ou tpu t. For each bit th at is set, th e correspon din g bit plan e is en abled for writin g du rin g su bsequ en t comman ds. All bit plan es are en abled if th is parameter is omitted. Details Th is in stru ction establish es th e logical operation to be performed between th e ou tpu t requ ested by a graph ics in stru ction an d th e existin g graph ics ou tpu t already in th e win dow. Th at is, th e logical operation selected is performed for all su bsequ en t graph ics ou tpu t, u n til an oth er GLOGICAL in stru ction is execu ted. GLOGICAL also selects wh ich bit plan es are affected by graph ics ou tpu t. In a 1 6 -color win dow, th e color at each pixel is represen ted by 4 bits. Th e plan es parameter restricts graph ics operation s to ch an gin g on ly certain bits with in each pixel. Th e color of a pixel as seen on th e screen th en depen ds u pon th e combin ation of previou s u n ch an ged bit valu es an d an y n ew bit valu es. Normally, all bit plan es sh ou ld be written . Ou tpu t from all th e followin g in stru ction s is affected by th e cu rren t GLOGICAL settin gs: GARC GCHAIN GFLOOD GLINE GPOINT GRE CTANGLE GSCAN GLINE S GTYPE Th is in stru ction operates on th e win dow th at is cu rren tly open for th e specified logical u n it. Th e effect of th is in stru ction applies to all su bsequ en t ou tpu t to th e win dow. (Note, h owever, th at if th e win dow is open in bu ffered mode, th e effect is n ot displayed u n til th e bu ffer fills or an FE MPTY in stru ction is execu ted.) E xamples For th e win dow open on graph ics logical u n it 2 0 , select th e 3 low-order bits (mask 7 ) of each pixel to be written directly from th e 3 low-order bits of th e graph ics sou rce (fu n ction code 3 ) for su bsequ en t graph ics in stru ction s. GLOGICAL (20) 3, 7 For th e win dow open on graph ics logical u n it 2 0 , specify th at for su bsequ en t graph ics ou tpu t all bits of each pixel are written as th e exclu sive OR of th e existin g pixel valu e with th e n ew V+ Lan gu age Referen ce Gu ide Page 4 1 8 GLOGICAL program in stru ction valu e from th e graph ics ou tpu t (fu n ction code 6 ): GLOGICAL (20) 6 For th e win dow open on graph ics logical u n it 2 0 , can cel an y special logical operation or bit plan e selection s, so th at su bsequ en t graph ics in stru ction s write all pixels n ormally: GLOGICAL (20) Related Keywords FOPE N program in stru ction GARC program in stru ction GCHAIN program in stru ction GCOPY program in stru ction GLINE program in stru ction GLINE S program in stru ction GPOINT program in stru ction GRE CTANGLE program in stru ction GSCAN program in stru ction GTYPE program in stru ction V+ Lan gu age Referen ce Gu ide Page 4 1 9 GOTO program in stru ction GOTO program instruction Syntax GOTO label Function Perform an u n con dition al bran ch to th e program step iden tified by th e given label. Parameter label Label of th e program step to wh ich execu tion is to bran ch . Step labels are in teger valu es th at ran ge in valu e from 0 to 6 5 5 3 5 . Details Th is in stru ction cau ses program execu tion to ju mp to th e lin e th at con tain s th e specified step label. Note th at a step label is differen t from a lin e n u mber. Lin e n u mbers are th e n u mbers au tomatically assign ed by th e V+ program editors to assist th e editin g process. Step labels mu st be explicitly en tered on program lin es wh ere appropriate. Modern , stru ctu red programmin g con siders GOTO statemen ts to be poor programmin g practice. Adept su ggests you u se on e of th e oth er con trol stru ctu res in place of GOTO statemen ts. E xample Th e followin g program segmen t asks you to en ter a n u mber from 1 to 1 0 0 . If th e n u mber in pu t is n ot in th at ran ge, th e GOTO 1 0 in stru ction at lin e n u mber 2 7 cau ses execu tion to ju mp to step label 1 0 (at lin e n u mber 2 3 ). 21 22 23 24 25 26 27 28 ; Get a number from the user 10 PROMPT "Enter a number from 1 to 100: ", number IF (number < 1) OR (number > 100) THEN TYPE /B, /C1, *Invalid response*, /C1 GOTO 10 END Related Keywords DO program in stru ction E XIT program in stru ction FOR program in stru ction IF ... THE N program in stru ction V+ Lan gu age Referen ce Gu ide Page 4 2 0 GOTO program in stru ction NE XT program in stru ction WHILE program in stru ction V+ Lan gu age Referen ce Gu ide Page 4 2 1 GPANE L program in stru ction GPANEL program instruction Syntax GPANEL ( lu n , mode) x, y, dx, dy Function Draw a rectan gu lar pan el with sh adowed or grooved edges. Usage Considerations Th is in stru ction is available on ly with a graph ics-based system. Parameters lu n Real valu e, variable, or expression (in terpreted as an in teger) th at defin es th e logical u n it n u mber of th e win dow to be accessed. (See th e ATTACH in stru ction for a description of u n it n u mbers.) mode Option al real valu e, variable, or expression (in terpreted as a bit field) specifyin g h ow th e in stru ction is to operate. Zero is assu med if th e parameter is omitted. Th e bit in terpretation s are given below. l l l Bit 1 (LSB) E mpty (0 ) vs. Filled (1 ) (mask valu e = 1 ) If th is bit is set, th e pan el area is filled with th e cu rren t foregrou n d color. Bit 2 Raised (0 ) vs. Su n ken (1 ) (mask valu e = 2 ) If th is bit is set, th e pan el edges are sh aded to appear depressed below, rath er th an raised above, th e su rrou n din g area. Bit 3 Pan el (0 ) vs. Groove (1 ) (mask valu e = 4 ) If th is bit is set, a rectan gu lar groove or ridge (depen din g on bit #2 ) two pixels wide is drawn arou n d th e pan el area in stead of a sh aded edge. x, y Real valu es, variables, or expression s (in terpreted as in tegers) specifyin g th e coordin ates (in pixels) of th e in terior pixel in th e top left corn er of th e rectan gu lar pan el. Th at is, th ese parameters locate th e top left-most pixel on th e su rface of th e pan el. dx, dy Real valu es, variables, or expression s (in terpreted as in tegers) specifyin g th e width an d h eigh t, respectively, of th e pan el su rface or th e area with in th e grooves. Both of th ese valu es mu st be greater th an zero. Details Th is in stru ction draws a rectan gu lar pan el in th e graph ics win dow, similar to th e ou tpu t from th e GRE CTANGLE in stru ction . Th e pan el is drawn (an d option ally filled) with th e cu rren t V+ Lan gu age Referen ce Gu ide Page 4 2 2 GPANE L program in stru ction graph ics foregrou n d color (see GCOLOR). Un like GRE CTANGLE , h owever, th e GPANE L in stru ction h as th e followin g featu res: l l Th e edges of th e rectan gle are sh adowed to make it appear raised or depressed relative to th e su rrou n din g area. Th e edges of th e rectan gle can be made to appear as a groove or ridge en closin g th e rectan gle, rath er th an raisin g or depressin g th e su rface of th e rectan gle. l Th e cu rren t graph ics logical operation (as set by GLOGICAL) is n ot performed. l Th e cu rren t graph ics textu re settin gs (as set by GTE XTURE ) are ign ored. Th is in stru ction operates on th e win dow th at is cu rren tly open for th e specified logical u n it. If th e win dow is open in n on bu ffered mode, th e in stru ction sen ds a requ est to th e win dow man ager an d takes effect immediately. If th e win dow is open in bu ffered mode, th e effect is displayed wh en th e bu ffer fills or an FE MPTY in stru ction is execu ted. E xamples In th e win dow cu rren tly open on graph ics logical u n it 2 0 , draw a stan dard raised pan el at coordin ates (1 0 ,1 5 ) with width 5 0 an d h eigh t 2 0 : GPANEL (20) 10, 15, 50, 20 In th e win dow cu rren tly open on graph ics logical u n it 2 0 , draw a su n ken pan el, filled with th e foregrou n d color, at coordin ates (1 0 ,5 0 ) with width 6 0 an d h eigh t 3 0 : GPANEL (20,3) 10, 50, 60, 30 In th e win dow cu rren tly open on graph ics logical u n it 2 0 , draw a ridge arou n d a rectan gu lar area at coordin ates (1 0 ,6 0 ) with width 4 0 an d h eigh t 2 0 : GPANEL (20,6) 10, 60, 40, 20 Related Keywords FOPE N program in stru ction GCLIP program in stru ction GCOLOR program in stru ction GRE CTANGLE program in stru ction GTRANS program in stru ction V+ Lan gu age Referen ce Gu ide Page 4 2 3 GPOINT program in stru ction GPOINT program instruction Syntax GPOI NT ( lu n ) x, y Function Draw a sin gle poin t in a graph ics win dow. Usage Considerations Th is in stru ction is available on ly with a graph ics-based system. Parameters lu n Real valu e, variable, or expression (in terpreted as an in teger) th at defin es th e logical u n it n u mber of th e win dow to be accessed. (See th e ATTACH in stru ction for a description of u n it n u mbers.) x, y Real valu es, variables, or expression s (in terpreted as in tegers) specifyin g th e coordin ates (in pixels) of th e poin t to be ou tpu t. Details Th e poin t is drawn with th e cu rren t graph ics foregrou n d color (see GCOLOR) an d logical operation (see GLOGICAL). Th is in stru ction operates on th e win dow th at is cu rren tly open for th e specified logical u n it. If th e win dow is open in n on bu ffered mode, th e in stru ction sen ds a requ est to th e win dow man ager an d takes effect immediately. If th e win dow is open in bu ffered mode, th e effect is displayed wh en th e bu ffer fills or an FE MPTY in stru ction is execu ted. E xample In th e win dow cu rren tly open on graph ics logical u n it 2 0 , draw a sin gle poin t with th e foregrou n d color at coordin ates (1 0 0 ,1 1 0 ): GPOINT (20) 100, 110 Related Keywords FOPE N program in stru ction GCHAIN program in stru ction GCLIP program in stru ction GCOLOR program in stru ction V+ Lan gu age Referen ce Gu ide Page 4 2 4 GPOINT program in stru ction GLOGICAL program in stru ction GTRANS program in stru ction V+ Lan gu age Referen ce Gu ide Page 4 2 5 GRE CTANGLE program in stru ction GR ECTANGLE program instruction Syntax GRECTANGLE ( lu n , mode) x, y, dx, dy Function Draw a rectan gle in a graph ics win dow. Usage Considerations Th is in stru ction is available on ly with a graph ics-based system. Parameters lu n Real valu e, variable, or expression (in terpreted as an in teger) th at defin es th e logical u n it n u mber of th e win dow to be accessed. (See th e ATTACH in stru ction for a description of u n it n u mbers.) mode Option al real valu e, variable, or expression (in terpreted as a bit field) specifyin g h ow th e in stru ction is to operate. Zero is assu med if th e parameter is omitted. Th e bit in terpretation s are given below. Bit 1 (LSB) E mpty (0 ) vs. Filled (1 ) (mask valu e = 1 ) If th is bit is set, th e rectan gle is filled with th e foregrou n d color. x, y Real valu es, variables, or expression s (in terpreted as in tegers) specifyin g th e coordin ates (in pixels) of th e top left corn er of th e rectan gle. dx, dy Real valu es, variables, or expression s (in terpreted as in tegers) specifyin g th e width an d h eigh t, respectively, of th e rectan gle. Both of th ese valu es mu st be greater th an zero. Details Th e rectan gle is drawn an d/or filled with th e cu rren t graph ics foregrou n d color (see GCOLOR), textu re (see GTE XTURE ), an d logical operation (see GLOGICAL). Th is in stru ction operates on th e win dow th at is cu rren tly open for th e specified logical u n it. If th e win dow is open in n on bu ffered mode, th e in stru ction sen ds a requ est to th e win dow man ager an d takes effect immediately. If th e win dow is open in bu ffered mode, th e effect is displayed wh en th e bu ffer fills or an FE MPTY in stru ction is execu ted. E xamples In th e win dow cu rren tly open on graph ics logical u n it 2 0 , draw a solid rectan gle in th e foregrou n d color at coordin ates (1 0 ,2 0 ), with width 3 0 an d h eigh t 4 0 : V+ Lan gu age Referen ce Gu ide Page 4 2 6 GRE CTANGLE program in stru ction GRECTANGLE (20,1) 10, 20, 30, 40 In th e win dow cu rren tly open on graph ics logical u n it 2 0 , draw a rectan gle ou tlin e in th e foregrou n d color at coordin ates (7 5 ,8 0 ), with width 4 0 an d h eigh t 5 0 : GRECTANGLE (20) 75, 80, 40, 50 Related Keywords FOPE N program in stru ction GCLIP program in stru ction GCOLOR program in stru ction GLOGICAL program in stru ction GPANE L program in stru ction GTE XTURE program in stru ction GTRANS program in stru ction V+ Lan gu age Referen ce Gu ide Page 4 2 7 GSCAN program in stru ction GSCAN program instruction Syntax GS CAN ( lu n ) lin es, data[ offset, in dex] Function Draw a n u mber of h orizon tal lin es in a graph ics win dow to form a complex figu re. Usage Considerations Th is in stru ction is available on ly with a graph ics-based system. V+ Lan gu age Referen ce Gu ide Page 4 2 8 GSCAN program in stru ction Parameters lu n Real valu e, variable, or expression (in terpreted as an in teger) th at defin es th e logical u n it n u mber of th e win dow to be accessed. (See th e ATTACH in stru ction for a description of u n it n u mbers.) lin es Real valu e, variable, or expression (in terpreted as an in teger) specifyin g th e n u mber of scan lin es to draw. data[ ,] Real array con tain in g sets of data valu es (in pixels) for th e lin es. Th e array in dexes are described below. Th e array elemen ts are in terpreted as follows: Array elemen t data[offset+0 ,in dex+0 ] X coordin ate for 1 st start poin t data[offset+1 ,in dex+0 ] Y coordin ate for 1 st start poin t data[offset+2 ,in dex+0 ] Len gth of first lin e data[offset+0 ,in dex+1 ] X coordin ate for 2 n d start poin t data[offset+1 ,in dex+1 ] Y coordin ate for 2 n d start poin t data[offset+2 ,in dex+1 ] offset I n terpretation of valu e Len gth of secon d lin e Option al real valu e, variable, or expression (in terpreted as an in teger) specifyin g th e left-h an d array in dex valu e th at accesses th e X compon en ts of th e coordin ates for th e start poin ts. Zero is assu med if th is parameter is omitted-in th at case in dex mu st also be omitted. Th e X valu e is accessed u sin g a left-h an d in dex equ al to offset. Th e Y valu e is accessed u sin g a left-h an d in dex equ al to (offset+1 ). Th e len gth valu e is accessed u sin g a left-h an d in dex equ al to (offset+2 ). in dex Option al real valu e, variable, or expression (in terpreted as an in teger) specifyin g th e array elemen ts to access for th e first lin e in th e series. Zero is assu med if th is parameter is omitted. V+ Lan gu age Referen ce Gu ide Page 4 2 9 GSCAN program in stru ction Details Th is in stru ction draws a n u mber of h orizon tal lin es in th e win dow to form a complex figu re. Th e scan lin es are drawn with th e cu rren t graph ics foregrou n d color (see GCOLOR), textu re (see GTE XTURE ), an d logical operation (see GLOGICAL). Th is in stru ction operates on th e win dow th at is cu rren tly open for th e specified logical u n it. If th e win dow is open in n on bu ffered mode, th e in stru ction sen ds a requ est to th e win dow man ager an d takes effect immediately. If th e win dow is open in bu ffered mode, th e effect is displayed wh en th e bu ffer fills or an FE MPTY in stru ction is execu ted. E xamples In th e win dow cu rren tly open on graph ics logical u n it 2 0 , draw 2 5 h orizon tal lin es in foregrou n d color. Th e first lin e starts at (scan [0 ,0 ],scan [1 ,0 ]) an d h as len gth scan [2 ,0 ]. Th e last lin e starts at (scan [0 ,2 4 ],scan [1 ,2 4 ]) an d h as len gth scan [2 ,2 4 ]: GSCAN (20) 25, scan[,] In th e win dow cu rren tly open on graph ics logical u n it 2 0 , draw 1 5 h orizon tal lin es in foregrou n d color. Th e first lin e starts at (scan [2 ,3 ],scan [3 ,3 ]) an d h as len gth scan [4 ,3 ]. Th e last lin e starts at (scan [2 ,1 7 ],scan [3 ,1 7 ]) an d h as len gth scan [4 ,1 7 ]: GSCAN (20) 15, scan[2,3] Related Keywords FOPE N program in stru ction GCLIP program in stru ction GCOLOR program in stru ction GLOGICAL program in stru ction GTE XTURE program in stru ction V+ Lan gu age Referen ce Gu ide Page 4 3 0 GSLIDE program in stru ction GSLIDE program instruction Syntax GS LI DE ( lu n , mode) id = x, y, len gth , max_ pos, arrow_ in c, h an dle Function Draw a slide bar in preparation for receivin g slide even ts. Usage Considerations Th is in stru ction is available on ly with a graph ics-based system. V+ Lan gu age Referen ce Gu ide Page 4 3 1 GSLIDE program in stru ction Parameters lu n Real valu e, variable, or expression (in terpreted as an in teger) th at defin es th e logical u n it n u mber of th e win dow to be accessed. (See th e ATTACH in stru ction for a description of u n it n u mbers.) mode Option al real valu e, variable, or expression (in terpreted as a bit field) specifyin g h ow th e in stru ction is to operate. Zero is assu med if th e parameter is omitted. Th e bit in terpretation s are given below. Bit 1 ( LS B) Create/Update ( 0 ) vs. Delete ( 1 ) ( mask valu e = 1) Th e slide bar is deleted if th is bit is set. Oth erwise, th e slide bar is created, or it is u pdated if it already exists. Bit 2 Horizon tal ( 0 ) vs. Vertical ( 1 ) ( mask valu e = 2 ) If th is bit is set, th e slide bar is created as a vertical slide bar. Oth erwise, th e slide bar is h orizon tal. Th is bit is ign ored if th e slide bar already exists. id Real valu e, variable, or expression (in terpreted as an in teger) specifyin g th e ID n u mber of th e slide bar. Th is n u mber is retu rn ed with slide even t data to iden tify th e slide bar to wh ich th e data applies. Th e valu e can n ot be n egative. NOTE: All th e followin g parameters (except for h an dle) mu st be specified if th e slide bar is bein g created. If th e slide bar already exists, th ese parameters can be omitted an d (except for h an dle) will be ign ored if th ey are specified. x, y Option al real valu es, variables, or expression s (in terpreted as in tegers) specifyin g th e (pixel) coordin ates of th e top left corn er of th e slide bar. Omitted valu es defau lt to zero. len gth Real valu e, variable, or expression (in terpreted as an in teger) specifyin g th e width of a h orizon tal slide bar or th e h eigh t of a vertical slide bar. Th e valu e can n ot be n egative. max_ pos Real valu e, variable, or expression (in terpreted as an in teger) specifyin g th e valu e to be associated with th e maximu m h an dle position in th e slide bar (wh ich is th e righ t en d of a h orizon tal slide bar an d th e bottom en d of a vertical slide bar). Th is parameter also determin es h ow man y position s th e slide-bar h an dle can h ave in th e slide bar (see below). If max_ pos is zero, th e slide bar is drawn with ou t a h an - V+ Lan gu age Referen ce Gu ide Page 4 3 2 GSLIDE program in stru ction dle an d th e slide bar is in active. Th e valu e can n ot be n egative. Th e maximu m valu e is 6 5 ,5 3 5 . arrow_ in c Real valu e, variable, or expression (in terpreted as an in teger) specifyin g th e ch an ge in th e position of th e slide-bar h an dle th at occu rs for each mou se click on on e of th e arrow bu tton s (see below). Th e valu e can n ot be n egative. h an dle Option al real valu e, variable, or expression (in terpreted as an in teger) specifyin g th e position of th e h an dle (see below). Th e slide-bar h an dle position is set even if th e slide bar already exists. If h an dle is greater th an max_ pos, max_ pos is u sed. Zero is u sed if th is parameter is omitted or its valu e is n egative. Details Th is in stru ction creates or adju sts a u ser-defin ed slide bar in a graph ics win dow. Th e slide bar h as th e same appearan ce as th e scroll bars V+ displays on th e edges of win dows. If slide bar even ts are en abled (see th e OBJE CT even t keyword described with th e GE TE VE NT in stru ction ), th e slide bar retu rn s even ts cau sed by clickin g an d/or draggin g th e mou se cu rsor on th e slide bar. If slide bar even ts are disabled (or th e max_ pos parameter is specified to be zero), th e slide bar is in active. Th at is, th e slide-bar graph ics do n ot reflect mou se cu rsor activity, an d n o even ts are retu rn ed. Wh en th e slide bar is active, th e slide-bar h an dle can be moved to discrete position s in th e slide bar, n u mbered from 0 to max_ pos. If you move th e h an dle to a position between two discrete position s, th e h an dle au tomatically ju mps to th e n earest discrete position wh en th e mou se bu tton is released. Th e parameter arrow_ in c establish es h ow man y discrete position s th e h an dle moves wh en you click on on e of th e arrow bu tton s. Th e h an dle parameter sets th e discrete position at wh ich th e h an dle is to be drawn . Th is in stru ction operates on th e win dow th at is cu rren tly open for th e specified logical u n it. If th e win dow is open in n on bu ffered mode, th e in stru ction sen ds a requ est to th e win dow man ager an d takes effect immediately. If th e win dow is open in bu ffered mode, th e slide bar is displayed wh en th e bu ffer fills or an FE MPTY in stru ction is execu ted. Related Keywords FOPE N program in stru ction FSE T program in stru ction GCLIP program in stru ction V+ Lan gu age Referen ce Gu ide Page 4 3 3 GTE XTURE program in stru ction GTEXTUR E program instruction Syntax GTEXTURE ( lu n ) mode, pattern Function Set th e opaqu e/tran sparen t mode an d th e textu re pattern for su bsequ en t graph ics ou tpu t. Usage Considerations Th is in stru ction is available on ly with a graph ics-based system. Th e textu re mode an d pattern are reset for th e specified logical u n it wh en a win dow is open ed on th e logical u n it with th e FOPE N in stru ction . Parameters lu n Real valu e, variable, or expression (in terpreted as an in teger) th at defin es th e logical u n it n u mber of th e win dow to be accessed. (See th e ATTACH in stru ction for a description of u n it n u mbers.) mode Option al real valu e, variable, or expression (in terpreted as an in teger) specifyin g th at graph ics ou tpu t is opaqu e (mode = 0 ) or tran sparen t (mode = 1 ). Th e valu e 1 is assu med if th is parameter is omitted. pattern Option al real valu e, variable, or expression (in terpreted as a 1 6 -bit in teger) specifyin g th e textu re pattern . A solid pattern (correspon din g to ^HFFFF) is assu med if th is parameter is omitted. Details Wh en ch aracters or textu red graph ics are drawn , th e con ten ts of th e win dow in th e spaces beh in d th e graph ics can be left u n ch an ged (tran sparen t mode) or set to th e cu rren t backgrou n d color (opaqu e mode). For n on textu red, n on ch aracter graph ics, th is mode h as n o effect. Th e in teriors of filled geometric figu res (drawn with mode bit 1 set) are always drawn solid, regardless of th e textu re. Th e textu re pattern allows dotted or dash ed graph ics to be drawn . Th e specified pattern is logically ANDed with th e n ormal graph ics ou tpu t. Th is pattern is repeated every 4 pixels (in 1 6 color win dows) or 3 2 pixels (in 2 -color win dows) alon g th e geometric object drawn . Th e pixels th at correspon d to bits set in th e pattern are drawn with th e foregrou n d color. Th e pixels th at correspon d to bits clear in th e pattern are eith er set to th e backgrou n d color (in opaqu e mode) or are u n ch an ged (in tran sparen t mode). V+ Lan gu age Referen ce Gu ide Page 4 3 4 GTE XTURE program in stru ction Th e followin g in stru ction s are affected by th e GTE XTURE opaqu e/tran sparen t mode settin g an d textu re pattern , with exception s as n oted. l l l l l l l GARC (always in opaqu e mode) GCHAIN (always in opaqu e mode) GLINE GLINE S GRE CTANGLE GSCAN GTYPE (n ot affected by pattern ) Th is in stru ction operates on th e win dow th at is cu rren tly open for th e specified logical u n it. Th e effect of th is in stru ction applies to all su bsequ en t ou tpu t to th e win dow. (Note, h owever, th at if th e win dow is open in bu ffered mode, th e effect will n ot be displayed u n til th e bu ffer fills or an FE MPTY in stru ction is execu ted.) E xamples Th e followin g two in stru ction s will draw a vertical dash ed lin e, u sin g th e foregrou n d color, on th e cu rren t con ten ts of th e win dow cu rren tly open on graph ics logical u n it 2 0 : GTEXTURE (20) 1, ^HF0F0 GLINE (20) 50, 40, 50, 100 Th ese two in stru ction s draw a rectan gle in th e win dow cu rren tly open on graph ics logical u n it 2 1 (dotted lin es are drawn , altern atin g between th e foregrou n d an d backgrou n d colors): GTEXTURE (21) 0, ^H3333 GRECTANGLE(21) 30, 40, 150, 160 Related Keywords FOPE N program in stru ction GARC program in stru ction GCHAIN program in stru ction GLINE program in stru ction GLINE S program in stru ction GRE CTANGLE program in stru ction GSCAN program in stru ction GTYPE program in stru ction V+ Lan gu age Referen ce Gu ide Page 4 3 5 GTRANS program in stru ction GTR ANS program instruction Syntax GTRANS ( lu n , mode) array[,] Function Scale, rotate, offset, an d apply perspective correction to all su bsequ en t graph ics in stru ction s. Usage Considerations Th is in stru ction is available on ly with a graph ics-based system. Th e mode valu es 1 an d 2 can be u sed on ly in systems equ ipped with th e AdeptVision VXL option . With vision systems, th is in stru ction allows you to specify graph ics ou tpu t to th e vision win dow in real-world millimeters. Parameters lu n In teger specifyin g th e graph ics logical u n it to wh ich to apply th e graph ics tran sformation . mode In teger specifyin g operation al mode: 0 1 Use th e camera calibration data in effect for th e last camera th at altered th e vision system display frame store. Do n ot u se th e perspective distortion correction matrix. 2 array[,] Use valu es in array[,] (defau lt mode) Use th e camera calibration data in effect for th e last camera th at altered th e vision system display frame store. Use th e perspective distortion correction matrix. Wh en mode = 0 , th e valu es in array[,] are u sed to tran sform th e position an d orien tation of su bsequ en t graph ics in stru ction s. Details If mode an d array[,] are omitted, th e vision tran sformation is can celed. Wh en mode = 0 , th e valu es in array[,] are u sed to tran sform th e position an d orien tation compon en ts of su bsequ en t graph ics in stru ction s. Th e affected in stru ction s are listed in th e followin g table. V+ Lan gu age Referen ce Gu ide Page 4 3 6 GTRANS program in stru ction I n stru ction an d Parameters Parameters Affected GARC (lu n , mode) xc, yc, radiu s, an g0 , an gn Th e variables xc an d yc are tran sformed. Th e valu e of radiu s is mu ltiplied by th e scalin g. Th e valu es of an g0 an d an gn are ch an ged by th e rotation an gle. GCHAIN (lu n ) x, y, n , poin ts[n ] On ly x an d y are tran sformed. GFLOOD (lu n ) x, y Both x an d y are tran sformed. GICON (lu n , mode) x, y, $ n ame, in dex x an d y are tran sformed. GLINE (lu n ) x0 , y0 , xn , yn x0 , y0 , xn , yn are tran sformed. GLINE S (lu n , mode) n , poin ts[2 ,n ] E very array[0 ,n ] an d array[1 ,n ] are tran sformed in pairs. GPANE L (lu n , mode) x, y, dx, dy On ly x an d y are tran sformed. GPOINT (lu n ) x, y x an d y are tran sformed. GRE CTANGLE (lu n , mode) x, y, dx, dy On ly x an d y are tran sformed. GSCAN (lu n ) n , array[3 ,n ] E very array[0 ,n ] an d array[1 ,n ] are tran sformed in pairs. GSLIDE (lu n , mode) id = x, y, len gth , n u m_ pos, arrow_ in c, h an dle On ly x an d y are tran sformed. GTYPE (lu n , mode) x, y, $ text, fon t_ n u mber, path , rotation On ly x an d y are tran sformed. GCLE AR GCLIP Not affected. V+ Lan gu age Referen ce Gu ide Page 4 3 7 GTRANS program in stru ction GCOLOR GCOPY GLOGICAL GTE XTURE In modes 1 an d 2 , th e camera calibration for th e most recen tly u sed camera su pplies th e tran sformation matrix. See th e section Wh y Calibrate a Camera? in th e AdeptVision User's Gu ide, for details on th e tran sformation matrix. Th e more common tran sformation s are defin ed by th e followin g arrays: scale tran slate rotate x 0 0 1 0 dx cosθ -sin θ 0 0 x 0 0 1 dy sin θ cosθ 0 0 0 1 0 0 1 0 0 1 E xamples Th is example dou bles th e size of all graph ics: FOR i = 0 to 2 FOR j = 0 to 2 ta[i,j] = 0 END END ;Define 0 elements ta[0,0] = 2 ta[1,1] = 2 ta[2,2] = 1 ;Define scaling elements GTRANS (20) ta[,] ;Assume window is attached ; Graphics instructions go here GTRANS (20) ;Cancel transformation Th e followin g example applies th e basic camera calibration tran sformation to all su bsequ en t graph ics in stru ction s. Graph ics ou tpu t is placed based on th e size of th e field of view. In th is example, th e field of view is 3 0 mm x 2 0 mm, an d an X is placed in th e middle of th e vision win dow: ATTACH (glun, 4) "GRAPHICS" FOPEN (glun) "Vision /MAXSIZE 640 480" GTRANS (glun,1) GTYPE (glun) 15, 10, "X" V+ Lan gu age Referen ce Gu ide Page 4 3 8 GTYPE program in stru ction GTYPE program instruction Syntax GTYPE ( lu n , mode) x, y, $ text, fon t_ n u mb Function Display a text strin g in a graph ics win dow. Usage Considerations Th is in stru ction is available on ly with a graph ics-based system. Parameters lu n Real valu e, variable, or expression (in terpreted as an in teger) th at defin es th e logical u n it n u mber of th e win dow to be accessed. (See th e ATTACH in stru ction for a description of u n it n u mbers.) mode Option al real valu e, variable, or expression (in terpreted as an in teger). Bits 1 an d 2 of th e valu e con trol attribu tes of th e ou tpu t. Bit 1 con trols th e relation sh ip between th e x, y parameters an d th e origin of th e text strin g. Bit 2 con trols th e overstrike featu re. Th e defau lt is 0 . x, y Real valu es, variables, or expression s (in terpreted as an in teger) specifyin g th e X an d Y coordin ates (in pixels) of eith er th e left en d of th e baselin e on wh ich th e ch aracters are written (mode bit 1 = 0 ), or th e top left corn er of th e text strin g (mode bit 1 = 1 ), as sh own in th e figu re E ffect of mode Bit 1 . $ text Strin g valu e, variable, or expression specifyin g th e ch aracters to be ou tpu t. fon t_ n u mb Option al real valu e, variable, or expression (in terpreted as an in teger) specifyin g th e n u mber of th e ch aracter fon t to be u sed. Th e stan dard fon t (n u mber 1 ) is assu med if th is parameter is omitted. Details Th is in stru ction displays a text strin g at th e specified coordin ates. Th e text is drawn with th e cu rren t graph ics foregrou n d color (see GCOLOR) an d logical operation (see GLOGICAL). Th e cu rren t opaqu e/tran sparen t mode is u sed, bu t th e cu rren t textu re pattern is ign ored (see GTE XTURE ). V+ Lan gu age Referen ce Gu ide Page 4 3 9 GTYPE program in stru ction If mode bit 2 = 1 , th e overstrike is defeated (design ated overstrike ch aracters are ou tpu t to th eir own space). If mode bit 2 = 0 , design ated overstrike ch aracters are displayed over th e previou s ch aracter. NOTE: Wh en a fon t is defin ed, ch aracters can be design ated as overstrike ch aracters th at are prin ted on top of th e previou s ch aracter. Th is in stru ction operates on th e win dow th at is cu rren tly open for th e specified logical u n it. If th e win dow is open in n on bu ffered mode, th e in stru ction sen ds a requ est to th e win dow man ager an d takes effect immediately. If th e win dow is open in bu ffered mode, th e effect is displayed wh en th e bu ffer fills or an FE MPTY in stru ction is execu ted. E ffect of mode Bit 1 E xamples Th e followin g in stru ction draws, in th e win dow cu rren tly open on graph ics logical u n it 2 0 , th e ch aracters Label in fon t #1 . Th e top left corn er of th e ch aracter strin g is at coordin ates (1 0 , 8 0 ): GTYPE(20, 1) 10, 80, "Label", 1 Th e followin g in stru ction draws, in th e win dow cu rren tly open on graph ics logical u n it 2 0 , th e ch aracters Abcdef in th e stan dard fon t. Th e left en d of th e baselin e for th e ch aracter strin g is at coordin ates (5 0 , 5 0 ). GTYPE (20) 50, 50, "Abcdef" Related Keywords FOPE N program in stru ction GCLIP program in stru ction GCOLOR program in stru ction V+ Lan gu age Referen ce Gu ide Page 4 4 0 GTYPE program in stru ction GLOGICAL program in stru ction GTE XTURE program in stru ction GTRANS program in stru ction V+ Lan gu age Referen ce Gu ide Page 4 4 1 HALT program in stru ction HALT program instruction Syntax HALT Function Stop program execu tion an d do n ot allow th e program to be resu med. Usage Considerations Th e PROCE E D comman d can n ot be u sed to resu me program execu tion after a HALT in stru ction cau ses th e program to h alt. HALT forces an FCLOSE an d/or DE TACH on th e disk an d serial commu n ication logical u n its as requ ired. Details Cau ses a BRE AK an d th en termin ates execu tion of th e application program regardless of an y program loops remain in g to be completed (see th e E XE CUTE comman d an d in stru ction ). Th e message (HALTE D) is displayed. After termin ation by a HALT in stru ction , program execu tion can n ot be resu med with a PROCE E D or RE TRY comman d. Related Keywords PAUSE program in stru ction RE TURN program in stru ction STOP program in stru ction V+ Lan gu age Referen ce Gu ide Page 4 4 2 HAND real-valu ed fu n ction HAND real-valued function Syntax HAND Function Retu rn th e cu rren t h an d open in g. Usage Considerations Th e HAND fu n ction retu rn s in formation for th e robot selected by th e task execu tin g th e fu n ction . If th e V+ system is n ot con figu red to con trol a robot, u se of th e HAND fu n ction does n ot gen erate an error du e to th e absen ce of a robot. However, th e in formation retu rn ed by th e fu n ction may n ot be mean in gfu l. Th e word " h an d" can n ot be u sed as a program n ame or variable n ame. Details Th is fu n ction retu rn s 0 if th e h an d is closed or 1 if th e h an d is open ed or relaxed. Related Keywords CLOSE program in stru ction CLOSE I program in stru ction OPE N program in stru ction OPE NI program in stru ction RE LAX program in stru ction RE LAXI program in stru ction SE LE CT program in stru ction SE LE CT real-valu ed fu n ction V+ Lan gu age Referen ce Gu ide Page 4 4 3 HAND.TIME system parameter HAND.TIME system parameter Syntax ... HAND.TI ME Function E stablish th e du ration of th e motion delay th at occu rs du rin g OPE NI, CLOSE I, an d RE LAXI in stru ction s. Usage Considerations Th e cu rren t valu e of th e HAND.TIME parameter can be determin ed with th e PARAME TE R mon itor comman d or real-valu ed fu n ction . Th e valu e of th e HAND.TIME parameter can be modified on ly with th e PARAME TE R mon itor comman d or program in stru ction . Th e parameter n ame can be abbreviated. If th e V+ system is con trollin g more th an on e robot, th e HAND.TIME parameter con trols th e h an d operation times for all th e robots. Details Th e OPE NI, CLOSE I, an d RE LAXI in stru ction s are u sed to operate th e h an d after th e robot h as stopped movin g. Th e HAND.TIME parameter determin es th e time allotted to th e h an d actu ation before th e n ext robot motion can be in itiated. Th e valu e for th is parameter is in terpreted as th e n u mber of secon ds to delay. It can ran ge from 0 to 1 0 18. Becau se of th e way V+ gen erates time delays, th e HAND.TIME parameter is in tern ally rou n ded to th e n earest mu ltiple of 0 .0 1 6 secon ds. Th is parameter is set to 0 .0 5 secon ds wh en th e V+ system is in itialized. E xample Set th e h an d operation delay time to 0 .5 secon ds: PARAMETER HAND.TIME = 0.5 Related Keywords CLOSE I program in stru ction OPE NI program in stru ction RE LAXI program in stru ction PARAME TE R mon itor comman d V+ Lan gu age Referen ce Gu ide Page 4 4 4 HAND.TIME system parameter PARAME TE R program in stru ction PARAME TE R real-valu ed fu n ction V+ Lan gu age Referen ce Gu ide Page 4 4 5 HE RE program in stru ction HER E program instruction Syntax HERE location _ var Function Set th e valu e of a tran sformation or precision -poin t variable equ al to th e cu rren t robot location . Usage Considerations Th e HE RE in stru ction retu rn s in formation for th e robot selected by th e task execu tin g th e in stru ction . If th e V+ system is n ot con figu red to con trol a robot, execu tin g th e HE RE in stru ction does n ot gen erate an error becau se of th e absen ce of a robot. However, th e location valu e retu rn ed may n ot be mean in gfu l. Th e word " h ere" can n ot be u sed as a program n ame or variable n ame. Parameter location _ var Tran sformation , precision poin t, or compou n d tran sformation th at en ds with a tran sformation variable. Details Th is in stru ction sets th e valu e of a tran sformation or precision -poin t variable equ al to th e cu rren t robot location . Normally, th e robot location is determin ed by readin g th e in stan tan eou s valu es of th e join t en coders. However, if th e robot h as eith er backlash or lin earity compen sation en abled, th e comman ded robot location is u sed. If th e location _ var is a compou n d tran sformation , on ly th e righ t-most tran sformation is defin ed. Its valu e is set equ al to th e cu rren t robot location relative to th e referen ce frame determin ed by th e oth er tran sformation s. An error message resu lts if an y of th e oth er tran sformation s are n ot already defin ed. E xamples Set th e tran sformation part equ al to th e cu rren t robot location : HERE part Assign th e cu rren t location of th e robot to th e precision poin t #part: V+ Lan gu age Referen ce Gu ide Page 4 4 6 HE RE program in stru ction HERE #part Related Keywords HE RE mon itor comman d HE RE tran sformation fu n ction SE LE CT program in stru ction SE LE CT real-valu ed fu n ction SE T program in stru ction V+ Lan gu age Referen ce Gu ide Page 4 4 7 HE RE tran sformation fu n ction HER E transformation function Syntax HERE Function Retu rn a tran sformation valu e th at represen ts th e cu rren t location of th e robot tool poin t. Usage Considerations Th e cu rren t location is obtain ed by readin g th e in stan tan eou s valu e of th e join t en coders so th at it represen ts th e actu al location of th e robot. NOTE: If th e robot h as eith er backlash or lin earity compen sation en abled, th is fu n ction retu rn s th e comman ded robot location in stead of th e valu e determin ed from th e join t en coder readin gs. Th e HE RE fu n ction retu rn s in formation for th e robot selected by th e task execu tin g th e fu n ction . If th e V+ system is n ot con figu red to con trol a robot, u se of th e HE RE fu n ction does n ot gen erate an error du e to th e absen ce of a robot. However, th e in formation retu rn ed by th e fu n ction may n ot be mean in gfu l. Th e word " h ere" can n ot be u sed as th e n ame of a program or variable. E xample Calcu late th e distan ce between th e cu rren t robot location an d th e location th e robot is cu rren tly movin g to: dist = DISTANCE(HERE, DEST) Related Keywords DE ST tran sformation fu n ction HE RE mon itor comman d HE RE program in stru ction SE LE CT program in stru ction SE LE CT real-valu ed fu n ction V+ Lan gu age Referen ce Gu ide Page 4 4 8 HOUR.ME TE R real-valu ed fu n ction HOUR .METER real-valued function Syntax HOUR.METER Function Retu rn th e cu rren t valu e of th e robot h ou r meter. Usage Considerations Th is fu n ction applies on ly to th e AdeptOn e-MV, AdeptTh ree-MV, an d Adept 5 5 0 robots. You can type listr h ou r.meter to display th e cu rren t valu e of th e robot h ou r meter. Th e word " h ou r.meter" can n ot be u sed as a program n ame or variable n ame. Details Th e robot h ou r meter records th e n u mber of h ou rs th at robot power h as been tu rn ed on . Th e meter is u pdated after on e h alf h ou r of power-on time an d h ou rly th ereafter. Th e h ou r meter is main tain ed by th e Robot Sign atu re Card (RSC) in th e base of th e robot. If th e RSC does n ot respon d, th e HOUR.ME TE R fu n ction retu rn s th e valu e -1 . E xamples To display th e cu rren t readin g of th e robot h ou r meter on th e system termin al, type listr hour.meter Assign th e cu rren t readin g of th e robot h ou r meter to th e real-valu ed variable " start" : start = HOUR.METER V+ Lan gu age Referen ce Gu ide Page 4 4 9 ID real-valu ed fu n ction ID real-valued function Syntax I D ( compon en t, device, board) Function Retu rn valu es th at iden tify th e con figu ration of th e cu rren t system. Parameters compon en t Real valu e, variable, or expression (in terpreted as an in teger) wh ose valu e determin es wh ich compon en t of iden tification in formation is retu rn ed. device Option al real valu e, variable, or expression (in terpreted as an in teger) wh ose valu e selects th e device to be iden tified. Device #1 (th e basic system) is assu med if th is parameter is omitted. board Option al in teger specifyin g th e CPU of in terest wh en th e device parameter valu e equ als 4 . Board #1 (th e main CPU) is assu med if th is parameter is omitted. Details Th e ID fu n ction en ables a program to access th e in formation displayed by th e ID mon itor comman d. Th e valu es of th e compon en ts are th e same as th e fields displayed by th at comman d. Th e fu n ction retu rn s th e valu e 0 for devices th at do n ot exist. Device n u mbers 6 an d 7 are in valid an d retu rn th e valu e 0 , as do an y oth er specified devices th at do n ot exist. For valid devices, an * In valid argu men t* error message is reported if th e requ ested compon en t is n ot valid. Th e followin g table describes th e type of in formation retu rn ed wh en th e device parameter is set at a specified valu e. To see th e acceptable valu es for th e compon en t parameter an d th e type of in formation retu rn ed for each device valu e, click on th e device lin k in th e table below. To obtain in formation on ... S et th e device parameter to... Th e Basic system device = 1 (Th is is th e defau lt valu e.) Man u al Con trol Pen dan t device = 2 retu rn s in formation abou t th e man u al con trol pen dan t. Vision System device = 3 retu rn s in formation abou t th e vision V+ Lan gu age Referen ce Gu ide Page 4 5 0 ID real-valu ed fu n ction system. Servos device = 5 retu rn s in formation abou t th e servos. Robot device = 8 or device = 1 0 +r retu rn s in formation abou t th e robot. CPU an d board in fo device = 4 retu rn s in formation abou t th e CPU an d processor board (if th e board parameter is specified). Force Sen sin g Systems device = 5 0 retu rn s in formation abou t force sen sin g systems. NOTE: Device n u mber 9 is reserved for Adept in tern al u se. compon en t Resu lt of I D ( compon en t, 1 ) 1 Model design ation of th e system con troller 2 Serial n u mber of th e system con troller 3 Version n u mber of th e V+ software in u se 4 Revision n u mber of th e V+ software in u se 5 First option word for th e V+ system (* ) 6 Secon d option word for th e V+ system (* ) 7 Size of th e system program memory (in kilobytes, K [1 K = 1 0 2 4 8 bit bytes]) 8 Con troller option word (* ) 9 Con troller produ ct-type valu e 10 Retu rn s th e SmartCon troller base board revision code. NOTE: Th is ID compon en t is available on ly in V+ version 1 5 .0 an d later. 11 Con troller h ardware con figu ration . Th is field sh ou ld be in terpreted as V+ Lan gu age Referen ce Gu ide Page 4 5 1 ID real-valu ed fu n ction a bit field. For details on th e in formation retu rn ed, see th e section Con troller Hardware Con figu ration retu rn ed by ID(1 1 ,1 ), below. 12 Retu rn s th e first an d secon d parts of th e secu rity ID (sh own as " aaaa-bbbb" ) below. (Th e valu e retu rn ed n eeds to be displayed in h exadecimal format to look th e same as " aaaa-bbbb" .) Securit y I D: aaaa-bbbb-cccc NOTE: Th is ID compon en t is available on ly in V+ version 1 5 .0 an d later. 13 Retu rn s th e th ird part of th e secu rity ID (sh own as " cccc" ) below. (Th e valu e retu rn ed n eeds to be displayed in h exadecimal format to look th e same as " cccc" .) Securit y I D: aaaa-bbbb-cccc NOTE: Th is ID compon en t is available on ly in V+ version 1 5 .0 an d later. * Th e system an d con troller option words are described in th e V+ Lan gu age Referen ce Gu ide. Con troller Hardware Con figu ration retu rn ed by I D( 1 1 ,1 ) Th e valu e for th e con troller h ardware con figu ration [retu rn ed by ID(1 1 ,1 )] sh ou ld be in terpreted as a bit field, as follows: Bit 1 - ( LS B) Graph ics system processor ( mask = 1 ) Th is bit is set if th e system processor in th e con troller in clu des h ardware compon en ts for graph ics ou tpu t by th e V+ system. Bit 2 - V+ mon itor ou tpu ts to graph ics mon itor ( mask = 2 ) Th is bit is set if th e system processor su pports graph ics ou tpu t an d th e con figu ration switch es on th e system processor are set to direct th e V+ mon itor ou tpu t to th e graph ics mon itor. Th is bit is 0 if th e V+ mon itor ou tpu t is directed to a termin al con n ected to th e system con troller. Bit 3 - Not u sed Bit 4 - S I O board presen t ( mask = 8 ) Th is bit is set if th e SIO board is presen t in th e con troller. Bit 5 - AdeptW in dows ( mask = 1 6 ) V+ Lan gu age Referen ce Gu ide Page 4 5 2 ID real-valu ed fu n ction Th is bit is set if th e con troller is u sin g th e AdeptWin dows u ser in terface. Bit 6 - i9 6 0 h ardware as an I /O coprocessor ( mask = 3 2 ) Wh en th is bit is set, it in dicates th at th e system h as fu n ction al i9 6 0 h ardware as an I/O coprocessor. Bit 7 - i9 6 0 h ardware an d software is ru n n in g ( mask = 6 4 ) Wh en th is bit is set, it in dicates th at th e system h as fu n ction al i9 6 0 h ardware an d its software is ru n n in g. Bit 8 - Device B floppy board presen t ( mask = 1 2 8 ) Th is bit is set if a device B floppy in terface board is presen t in th e con troller. NOTE: Th is bit in dicates on ly th at th e in terface board is presen t. It does n ot in dicate th at th e floppy drive is in stalled. Bit 9 - 1 3 9 4 in terface active ( mask = 2 5 6 ) Wh en th is bit is set, it in dicates th at th e system h as a 1 3 9 4 in terface th at is active. Bit 1 0 - Matrox Vision PMC board ( mask = 5 1 2 ) If th is bit is set, it in dicates th at a Matrox vision (C8 0 ) board is presen t. Th is flag does n ot in dicate th at AVI vision h as been en abled. Bit 1 1 - S martCon troller PCI bu s an d Adept h ardware in terface ( mask =1 0 2 4 ) If set in dicates th at th e SmartCon troller PCI bu s an d Adept h ardware in terface are presen t. Th is bit is always set on a SmartCon troller system. Man u al Con trol Pen dan t Device n u mber 2 refers to th e man u al con trol pen dan t. Th e compon en t parameter mu st h ave th e valu e 1 . Th e valu e retu rn ed is th e version n u mber of th e pen dan t software. Vision S ystem Con figu ration Device n u mber 3 refers to th e AdeptVision system. (If th e vision system is n ot in stalled, all valu es are retu rn ed as zero.) Th e acceptable valu es for th e compon en t parameter, an d th e correspon din g valu es retu rn ed, are listed below. (If th e system h as mu ltiple vision systems, th e in formation retu rn ed is for th e vision system th at is cu rren tly selected. Th e n u mber of th e vision system th at is cu rren tly selected can be obtain ed with th e fu n ction SE LE CT(VISION).) compon en t 1 Resu lt of I D ( compon en t, 3 ) Model design ation of th e vision system V+ Lan gu age Referen ce Gu ide Page 4 5 3 ID real-valu ed fu n ction 2 Serial n u mber of th e vision system 3 Version n u mber of th e vision software in u se 4 Revision n u mber of th e vision software in u se 5 Option word for th e vision system (For details, Vision Option Word.) 6 Size of th e vision system RAM memory (in K) CPU an d Board Con figu ration Device n u mber 4 refers to th e system CPUs. (If th e in dicated board does n ot exist, all valu es are retu rn ed as -1 .) compon en t Resu lt of I D ( compon en t, 4 , board) 1 Nu mber of th e CPU 2 Not cu rren tly u sed 3 Th e CPU board version n u mber 4 Th e CPU board revision n u mber NOTE:If you are ru n n in g V+ 1 5 .0 or later, th is retu rn s th e SmartCon troller CPU board revision code. 5 CPU type: 0 = Heu rikon 6 8 0 4 0 (obsolete) 1 = Adept 6 8 0 3 0 (obsolete) 2 = Motorola 6 8 0 4 0 (obsolete) 3 = Motorola 6 8 0 6 0 (obsolete) 4 = AWC 6 8 0 4 0 5 = AWC 6 8 0 6 0 6 = SmartCon troller CS 7 = SmartCon troller CX V+ Lan gu age Referen ce Gu ide Page 4 5 4 ID real-valu ed fu n ction 6 Bit field in dicatin g wh ich software modu les are active on th e board. Bit defin ition s are provided in th e followin g table. Mask Valu e Bit # I n terpretation W h en Bit S et Decimal Hexadecimal 1 1 1 Processor is ru n n in g th e V+ Operatin g System 2 2 2 Processor is ru n n in g th e Vision processin g software 3 4 4 Processor is ru n n in g th e Servo software 4 -1 6 7 Reserved for fu tu re u se (cu rren tly zero) Size of th e ran dom access memory (RAM) on th e CPU board (in K) S ervo Con figu ration Device n u mber 5 retu rn s servo in formation . (If n o servo is presen t, all valu es are retu rn ed as zero.) compon en t Resu lt of I D ( compon en t, 5 ) 3 Retu rn s th e servo version n u mber 4 Retu rn s th e servo revision n u mber Robot an d En coder Con figu ration Device n u mber 8 retu rn s in formation for th e cu rren tly selected robot. Th e acceptable valu es for th e compon en t parameter are th e same as for a specified robot. (See th e followin g table.) Device n u mber 1 0 refers to th e extern al en coders con n ected to th e robot con troller. Th e acceptable valu es for th e compon en t parameter are th e same as for a robot. V+ Lan gu age Referen ce Gu ide Page 4 5 5 ID real-valu ed fu n ction Device n u mbers 1 1 , 1 2 , ... refer to robot n u mber 1 , 2 , ..., respectively, for each robot con n ected to th e con troller. Th at is, a device n u mber equ al to 1 0 +r refers to robot n u mber r, wh ich can ran ge from 1 to th e valu e retu rn ed by th e fu n ction SE LE CT(ROBOT, -1 ). Th e n u mber of th e robot th at is cu rren tly selected can be obtain ed with th e fu n ction SE LE CT(ROBOT).Th e acceptable valu es for th e compon en t parameter, an d th e correspon din g valu es retu rn ed, are listed in th e followin g table. compon en t Resu lt of I D ( compon en t, 1 0 +r) 1 Model design ation of th e robot 2 Serial n u mber of th e robot 3 Nu mber of motors con figu red for th e robot Th is n ormally is equ al to th e n u mber of con figu red join ts (see compon en t 7 ). 4 Valu e in terpreted as bit flags for th e robot join ts th at are en abled: bit 1 for join t 1 , an d so on . (Th e valu e is zero if th e robot does n ot h ave join ts th at can be disabled selectively. For example, th is valu e is defin ed for th e X/Y/Z/Th eta robot bu t is zero for th e 4 /5 -axis SCARA modu le.) 5 Robot con trol-modu le iden tification n u mber 6 Nu mber for th e robot con trol-modu le qu alifier 7 Nu mber of robot join ts con figu red for u se 8 Robot option word (* ) 9 Robot produ ct-type valu e 10 Nu mber of Cartesian axes u sed du rin g motion plan n in g Th is valu e specifies h ow man y valu es mu st be defin ed in th e robot load-modu le arrays th at specify th e maximu m Cartesian velocities an d acceleration s. 11 Secon d robot option word (* ) 12 In formation on th e robot modu le Cu rren tly, on ly bit 1 (mask 1 ) is defin ed. If set, th is bit in dicates th at th e specified robot is an Adept robot. V+ Lan gu age Referen ce Gu ide Page 4 5 6 ID real-valu ed fu n ction 13 Retu rn s th e safety level for th e robot. Possible valu es are: 0 = No special safety level 1 = Con figu red as Category 1 Robot System per ISO 1 0 2 1 8 an d E N9 5 4 3 = Con figu red as Category 3 Robot System per ISO 1 0 2 1 8 an d E N9 5 4 NOTE: Th is ID compon en t is available on ly in V+ version 1 6 .0 an d later. * Th e robot option words are described in th e Robot Option Words topic Force S en sin g Con figu ration Device n u mber 5 0 refers to th e cu rren tly selected force sen sor. Device n u mbers 5 1 th rou gh 6 6 refer to force sen sors n u mbered 1 to 1 6 , respectively. See th e docu men tation for th e SE LE CT program in stru ction for an explan ation of selectin g amon g mu ltiple force sen sors. Th e acceptable valu es for th e compon en t parameter, an d th e correspon din g valu es retu rn ed, are listed below. compon en t Resu lt of I D ( compon en t, 5 0 ) 1 Model n u mber of force sen sor (0 if n o force sen sor is con n ected) 2 Serial n u mber of force sen sor (0 if n o force sen sor is con n ected) 3 Version n u mber of VME Force In terface (VFI) firmware 4 Version n u mber of force-sen sin g software 5 Option word for force system 6 Size of th e data collection bu ffer (in K) Related Keywords ID mon itor comman d $ ID strin g fu n ction SE LE CT mon itor comman d SE LE CT program in stru ction V+ Lan gu age Referen ce Gu ide Page 4 5 7 ID real-valu ed fu n ction SE LE CT real-valu ed fu n ction V+ Lan gu age Referen ce Gu ide Page 4 5 8 $ ID strin g fu n ction $ID string function Syntax $ I D ( select) Function Retu rn th e system ID strin g. Parameter select In teger specifyin g th e ID in formation to retu rn . It may be: I n teger Description -1 Retu rn s th e system edit message. -2 Retu rn s th e edit letter an d issu e n u mber for th e V+ system. -3 Retu rn s th e vision edit message strin g. -4 Retu rn s th e servo edit message strin g. Details Th is fu n ction retu rn s a strin g th at iden tifies th e release edition an d date of th e requ ested system software compon en t. Related Keywords ID mon itor comman d ID real-valu ed fu n ction V+ Lan gu age Referen ce Gu ide Page 4 5 9 IDE NTICAL real-valu ed fu n ction IDENTICAL real-valued function Syntax I DENTI CAL ( location , location ) Function Determin e wh eth er two location valu es are exactly th e same. Parameter location Tran sformation valu e th at defin es on e of th e location s of in terest. Th is can be a fu n ction , a variable, or a compou n d tran sformation . Details Th is fu n ction retu rn s th e valu e TRUE if th e position al an d rotation al compon en ts of th e two specified location s are exactly th e same. E ven a sin gle-bit differen ce in an y of th e compon en ts resu lts in th e valu e FALSE bein g retu rn ed. E xample Th e statemen t x = IDENTICAL(base.1:loc,part) sets th e valu e of th e real variable x to TRUE if th e valu e of loc relative to th e base.1 frame is exactly th e same as th e valu e stored in th e variable part. Related Keyword DISTANCE real-valu ed fu n ction V+ Lan gu age Referen ce Gu ide Page 4 6 0 IF logical_ expr THE N program in stru ction IF logical_expr THEN program instruction Syntax I F logical_ expr THEN first steps E LSE secon d steps E ND Function Con dition ally execu te a grou p of in stru ction s (or on e of two grou ps) depen din g on th e resu lt of a logical expression . Usage Considerations Th ere mu st be a match in g E ND statemen t for every IF... THE N in a program. Parameters logical_ expr Real-valu ed expression wh ose valu e is tested for TRUE (n on zero) or FALSE (zero). first_ steps Option al grou p of program in stru ction s th at are execu ted on ly if th e valu e of th e logical expression is TRUE (n on zero). secon d_ steps Option al grou p of program in stru ction s th at are execu ted on ly if th e valu e of th e logical expression is FALSE (zero). Th e E LSE statemen t may be omitted if th ere are n o steps in th is grou p. Details Th is con trol stru ctu re provides a mean s for con dition ally execu tin g on e of two grou ps of in stru ction s. In detail, it is processed as follows: 1 . logical_ expr is evalu ated. If th e resu lt is FALSE (zero), skip to item 4 below. 2 . Th e first grou p of in stru ction steps is execu ted. 3 . Skip to item 5 below. V+ Lan gu age Referen ce Gu ide Page 4 6 1 IF logical_ expr THE N program in stru ction 4 . If th ere is an E LSE step, th e secon d grou p of in stru ction steps is execu ted. 5 . Program execu tion con tin u es at th e first step after th e E ND step. Th e E LSE an d E ND steps mu st be on lin es by th emselves as sh own . Th ere are n o restriction s on th e in stru ction s th at can be in eith er grou p in th e stru ctu re. Th u s, n ested IF stru ctu res can be u sed. E xamples Con sider th e followin g segmen t of a V+ program. If th e valu e of row is greater th an 5 , th e expression row > 5 will be TRUE (-1 .0 ), so step 2 2 is execu ted an d 2 4 is n ot execu ted. Oth erwise, step 2 2 is n ot execu ted, bu t step 2 4 is execu ted: 21 22 23 24 25 IF row > 5 THEN spacing = 10 ELSE spacing = 20 END Th e n ext program segmen t determin es wh eth er th e variable in pu t.sign al h as been defin ed. If it h as, th e program ch ecks th e sign al in dicated by th e valu e of in pu t.sign al an d types differen t messages depen din g on its settin g. Note th at th e ou ter IF does n ot in clu de an E LSE clau se: 71 72 73 74 75 76 77 IF DEFINED(input.signal) THEN IF SIG(input.signal) THEN TYPE "The input signal is ON" ELSE TYPE "The input signal is OFF" END END Refer to th e DE FINE D fu n ction for details on testin g n on real argu men ts. Related Keywords CASE program in stru ction DE FINE D real-valu ed fu n ction E LSE program in stru ction IF... GOTO program in stru ction V+ Lan gu age Referen ce Gu ide Page 4 6 2 IF logical_ expr GOTO program in stru ction IF logical_expr GOTO program instruction Syntax I F logical_ expr GOTO label Function Bran ch to th e specified step label if th e valu e of th e logical expression is TRUE (n on zero). Usage Considerations In gen eral, it is a better programmin g practice to u se th e IF ... THE N con trol stru ctu re rath er th an th is in stru ction . Parameters logical_ expr Real-valu ed expression wh ose valu e is tested for TRUE (n on zero) or FALSE (zero). label Program step label of a step in th e cu rren t program. Details If th e valu e of th e expression is n on zero, program execu tion bran ch es an d begin s execu tin g th e statemen t with a label match in g th e on e specified. If th e valu e of th e expression is zero, th e n ext in stru ction is execu ted as u su al. If th e specified statemen t label is n ot defin ed, th e program is n ot execu table. An y attempt to bran ch to an u n defin ed label is iden tified wh en th e SE E editor is exited an d wh en th e program is loaded in to memory from a disk file. E xample Th e most common u se for IF...GOTO is as an exit-on -error in stru ction . Th e followin g code ch ecks each I/O operation an d bran ch es to a label wh en ever an I/O error occu rs: ATTACH(dlun, 4) "DISK" IF IOSTAT(dlun) < 0 GOTO 100 FOPENW(dlun) "my_file" IF IOSTAT(dlun) < 0 GOTO 100 ... FCLOSE(dlun) "my_file" IF IOSTAT(dlun) < 0 GOTO 100 DETACH(dlun) 100 IF IOSTAT(dlun) < 0 THEN TYPE $ERROR(IOSTAT(dlun)) END V+ Lan gu age Referen ce Gu ide Page 4 6 3 IF logical_ expr GOTO program in stru ction Related Keywords GOTO program in stru ction IF ... THE N program in stru ction V+ Lan gu age Referen ce Gu ide Page 4 6 4 IGNORE program in stru ction IGNOR E program instruction Syntax I GNORE sign al Function Can cel th e effect of a RE ACT or RE ACTI in stru ction . Usage Considerations On ly digital I/O sign als th at are in stalled an d con figu red as in pu ts are available for reaction mon itorin g. Th e IGNORE in stru ction mu st be execu ted by th e same program task th at can celed th e RE ACT or RE ACTI in stru ction . Parameter sign al Digital in pu t sign al n u mber in th e ran ge 1 0 0 1 to 1 0 1 2 , an in tern al sign al in th e ran ge 2 0 0 1 to 2 0 0 8 , or 0 . Details Disables con tin u ou s mon itorin g of th e specified sign al, can celin g th e effect of th e last RE ACT or RE ACTI for th is sign al. Th is in stru ction h as n o effect if a valu e of zero is specified. E xample Stop mon itorin g of th e digital in pu t or soft sign al iden tified by th e valu e of test. IGNORE test Related Keywords LOCK program in stru ction RE ACT program in stru ction RE ACTI program in stru ction V+ Lan gu age Referen ce Gu ide Page 4 6 5 INRANGE real-valu ed fu n ction INR ANGE real-valued function Syntax I NRANGE ( location ) Function Retu rn a valu e th at in dicates wh eth er a location can be reach ed by th e robot an d, if n ot, wh y n ot. Usage Considerations Th e INRANGE fu n ction retu rn s in formation for th e robot selected by th e task execu tin g th e fu n ction . Parameter location Tran sformation fu n ction , variable, or compou n d th at specifies a desired position an d orien tation for th e robot tool tip. Details Th e fu n ction retu rn s a valu e th at in dicates wh eth er or n ot th e given location can be reach ed by th e robot. Th e valu e zero in dicates th at th e specified location can be reach ed. If th e location can n ot be reach ed, th e retu rn ed valu e is a coded bin ary n u mber th at iden tifies th e reason . A bit equ al to 1 in th e valu e in dicates th at th e correspon din g robot con strain t wou ld be violated, as sh own in th e table below: Mask Valu e Bit # Hex Decimal I n dication if bit set 1 1 1 Join t or motor 1 is limitin g 2 2 2 Join t or motor 2 is limitin g 3 4 4 Join t or motor 3 is limitin g 4 8 8 Join t or motor 4 is limitin g 5 10 16 Join t or motor 5 is limitin g 6 20 32 Join t or motor 6 is limitin g V+ Lan gu age Referen ce Gu ide Page 4 6 6 INRANGE real-valu ed fu n ction 7 40 64 Join t or motor 7 is limitin g 8 80 128 Join t or motor 8 is limitin g 9 100 256 Join t or motor 9 is limitin g 10 200 512 Join t or motor 1 0 is limitin g 11 400 1024 Join t or motor 1 1 is limitin g 12 800 2048 Join t or motor 1 2 is limitin g 13 1000 4096 Collision detected 14 2000 8192 Location is too close in 15 4000 16384 Location is too far ou t 16 8000 32768 Motor is limitin g, rath er th an join t (see below) If th e motion system is con figu red to retu rn motor-limit as well as join t-limit errors, bit 1 6 in dicates wh eth er a join t or motor wou ld limit motion to location . If bit 1 6 is set, all th e join ts passed th eir limit ch ecks, an d th e in dicated motor is limitin g. Oth erwise, th e in dicated join t is limitin g. Th e mask valu es in dicated above can be u sed with th e BAND operator to determin e if a correspon din g bit is set. E xample Retu rn s th e valu e zero if th e robot can reach th e location defin ed by th e compou n d tran sformation pallet:h ole. INRANGE(pallet:hole) If both join ts 2 an d 3 wou ld preven t th e motion from bein g made, th e valu e retu rn ed wou ld be 6 . Related Keyword SE LE CT program in stru ction SE LE CT real-valu ed fu n ction V+ Lan gu age Referen ce Gu ide Page 4 6 7 INSTALL program in stru ction INSTALL program instruction Syntax I NS TALL password, op Function In stall or remove software option s available to Adept systems. Usage Considerations You mu st h ave received th e au th orization password from Adept. INSTALL can be ru n on ly on CPU #1 in mu ltiple CPU systems. Parameters password Strin g expression th at con tain s a 1 5 -ch aracter valu e assign ed by Adept. op Option al in teger in dicatin g th e desired operation : 0 = in stall option (defau lt) 1 = remove option Details Wh en you pu rch ase addition al software option s from Adept, th e software is delivered with a software licen se an d au th orization password th at en ables th e software for a particu lar con troller. If th e option is n ot en abled, th e software does n ot load correctly. Th e password is keyed both to th e software option an d th e serial n u mber of you r con troller. Th e password can n ot be u sed on an y con troller oth er th an th e on e for wh ich you pu rch ased th e software option . NOTE: For MV con trollers, if you replace an d in itialize th e AWC board in you r con troller, you mu st rein stall th e software option s. E xecu te INSTALL for each system option after th e n ew AWC board h as been in stalled. E xample If you pu rch ased th e AIM Motion Ware software from Adept an d th e password provided with th e option is 4 E X5 -2 3 GH8 -AY3 F, th e followin g in stru ction en ables th e software option : INSTALL "4EX5-23GH8-AY3F" V+ Lan gu age Referen ce Gu ide Page 4 6 8 INSTALL program in stru ction NOTE: Some option s, su ch as AIM software, h ave addition al software files th at mu st be copied to th e h ard drive. Oth er option s, su ch as AdeptVision , are already residen t an d n eed on ly to be en abled. V+ Lan gu age Referen ce Gu ide Page 4 6 9 INT real-valu ed fu n ction INT real-valued function Syntax I NT ( valu e) Function Retu rn th e in teger part of th e valu e. Parameter valu e Real-valu ed expression wh ose in teger part is retu rn ed by th is fu n ction . Details Retu rn s th e portion of th e valu e parameter to th e left of th e decimal poin t (wh en th e valu e is written with ou t th e u se of scien tific n otation ). Th e valu e is n ot rou n ded before droppin g th e fraction . Th e sign of th e valu e parameter is preserved u n less th e resu lt is zero. E xamples INT(0.123) ;Returns 0.0 INT(10.8) ;Returns 10.0 INT(-5.462) ;Returns -5.0 INT(1.3125E+2) ;Returns 131.0 INT(cost) ;Returns the value of "cost", ;truncated to an integer. INT(cost+0.5*SIGN(cost)) ;Returns the value of "cost", rounded ;to the nearest integer. (The SIGN ;function needs to be included to ;correctly round negative values of ;"cost".) Related Keyword FRACT real-valu ed fu n ction V+ Lan gu age Referen ce Gu ide Page 4 7 0 INT.E VE NT program in stru ction INT.EVENT program instruction Syntax I NT.EVENT sou rce, level Function Perform setu p to h ave an even t sen t (as th ou gh from a SE T.E VE NT in stru ction ) to th e cu rren t task if an in terru pt occu rs on a specified VME bu s vector or if a specified digital I/O sign al tran sition s to positive. Usage Considerations VME bu s in terru pts are available on ly on systems with th e option al V+ E xten sion s licen se. Parameters sou rce In teger, expression , or real variable specifyin g: l l a digital I/O sign al in th e ran ge 1 0 0 1 - 1 0 0 4 l level a VME bu s vector in th e ran ge 1 9 2 - 2 5 5 th e valu e 0 , wh ich can cels mon itorin g Option al argu men t specifyin g th e VME in terru pt requ est level to be u sed (th is does n ot apply to digital I/O sign als). Acceptable valu es are 1 an d 2 . Th e valu e 1 is assu med if th e argu men t is omitted. Details On ly two CPU boards with in a system can be con figu red for VME in terru pts. On e CPU mu st u se level 1 an d th e oth er mu st u se level 2 . On ly CPU #1 can be con figu red for fast digital in pu t in terru pts. If sou rce is set to 0 , mon itorin g is can celed for th e cu rren t task. Wh en a task exits n ormally, is killed, or is reexecu ted, mon itorin g is can celed. Th e V+ system can con n ect on ly on e fast digital in pu t to an in terru pt at an y on e time. If you attempt to con n ect more th an on e, you get a * Device n ot ready* error message. For fast digital in pu ts (1 0 0 1 , 1 0 0 2 , 1 0 0 3 , 1 0 0 4 ), in you r in terru pt h an dler (th at is, you r V+ rou tin e th at execu tes th e INT.E VE NT an d WAIT.E VE NT in stru ction s), try readin g th e digital I/O sign al directly u sin g th e SIG( ) real-valu ed fu n ction . Of cou rse, th is assu mes th at th e extern al device providin g th e in pu t sign al keeps it h igh lon g en ou gh , n ot on ly for th e INT.E VE NT to be triggered, bu t also for you r V+ rou tin e to get started. V+ Lan gu age Referen ce Gu ide Page 4 7 1 INT.E VE NT program in stru ction For VME bu s in terru pts from th ird-party boards, you sh ou ld commu n icate with each board th at you expect migh t h ave issu ed th e in terru pt, u sin g IOPUT_ & IOGE T_ , to verify (or determin e) th e sou rce. For example, you can program a th ird-party board to place a flag in th e sh ared memory area of you r system processor before it issu ed th e vectored in terru pt, an d you can th en u se IOGE T_ to read th e flag after th e even t occu rred. (Addition ally, see th e V+ Lan gu age User's Gu ide for a gen eral description of sh ared memory access.) E xample INT.EVENT 201 . . . WAIT.EVENT INT.EVENT 0 ;Initiate monitoring of vector 201 ;Wait until interrupt occurs ;Cancel monitoring of interrupts Related Keywords GE T.E VE NT real-valu ed fu n ction SE T.E VE NT program in stru ction WAIT.E VE NT program in stru ction V+ Lan gu age Referen ce Gu ide Page 4 7 2 INTB real-valu ed fu n ction INTB real-valued function Syntax I NTB ( $ strin g, first_ ch ar) Function Retu rn th e valu e of two bytes of a strin g in terpreted as a sign ed 1 6 -bit bin ary in teger. Parameters $ strin g Strin g expression th at con tain s th e two bytes to be con verted. first_ ch ar Option al real-valu ed expression th at specifies th e position of th e first of th e two bytes in th e strin g. If first_ ch ar is omitted or h as a valu e of 0 or 1 , th e first two bytes of th e strin g are extracted. If first_ ch ar is greater th an 1 , it is in terpreted as th e ch aracter position for th e first byte. For example, a valu e of 2 mean s th at th e secon d byte con tain s bits 9 to 1 6 an d th e th ird byte con tain s bits 1 to 8 . An error is gen erated if first_ ch ar specifies a byte pair th at is beyon d th e en d of th e in pu t strin g. Details Two sequ en tial bytes of a strin g are in terpreted as bein g a 2 's-complemen t 1 6 -bit sign ed bin ary in teger. Th e first byte con tain s bits 9 to 1 6 , an d th e secon d byte con tain s bits 1 to 8 . Th e main u se of th is fu n ction is to con vert bin ary n u mbers from an in pu t data record to valu es th at can be u sed in tern ally by V+. Th e expression value = INTB($string, first_char) is equ ivalen t to th e followin g in stru ction sequ en ce: value = ASC($string,first_char)*256 + ASC($string,first_char+1) IF value > 32767 THEN value = value-65536 END To compu te an u n sign ed in teger, u se: INTB($ strin g) BAND ^HFFFF. V+ Lan gu age Referen ce Gu ide Page 4 7 3 INTB real-valu ed fu n ction E xamples INTB($CHR(10)+$CHR(5)) INTB($CHR(255)+$CHR(255)) ;Returns the value 2565 ;Returns the value -1 Related Keywords ASC real-valu ed fu n ction DBLB real-valu ed fu n ction FLTB real-valu ed fu n ction $ INTB strin g fu n ction LNGB real-valu ed fu n ction VAL real-valu ed fu n ction V+ Lan gu age Referen ce Gu ide Page 4 7 4 $ INTB strin g fu n ction $INTB string function Syntax $ I NTB ( valu e) Function Retu rn a 2 -byte strin g con tain in g th e bin ary represen tation of a 1 6 -bit in teger. Parameter valu e Real-valu ed expression , th e valu e of wh ich is con verted to its bin ary represen tation . Details Th e in teger part of a real valu e is con verted in to its bin ary represen tation an d th e low 1 6 bits of th at bin ary represen tation are packed in to a strin g as two 8 -bit ch aracters. Bits 9 -1 6 are packed first, followed by bits 1 -8 . Th is fu n ction is equ ivalen t to: $CHR(INT(value/256) BAND ^HFF) + $CHR(INT(value) BAND ^HFF) Th e main u se of th is fu n ction is to con vert in tegers to bin ary represen tation with in an ou tpu t record of a data file. E xample $INTB(65*256+67) ;Returns the character string "AC". Related Keywords $ CHR strin g fu n ction $ DBLB strin g fu n ction $ FLTB strin g fu n ction INTB real-valu ed fu n ction $ LNGB strin g fu n ction V+ Lan gu age Referen ce Gu ide Page 4 7 5 INTE RACTIVE system switch INTER ACTIVE system switch Syntax ... I NTERACTI VE Function Con trol th e display of message h eaders on th e system termin al an d requ ests for con firmation before performin g certain operation s. Usage Considerations Th e INTE RACTIVE switch sh ou ld be en abled for n ormal operation of V+ from th e system termin al. NOTE: Disablin g th e INTE RACTIVE switch is cu rren tly n ot recommen ded. INTE RACTIVE is u su ally disabled on ly wh en th e system is bein g con trolled by a su pervisory compu ter to relieve th e compu ter from h avin g to process th e text of messages. Details Th is switch is in itially en abled. Wh en th is switch is disabled, th e followin g ch an ges to system operation occu r: l V+ does n ot ask for con firmation before performin g certain operation s (for example, CALIBRATE ). l Th e text of error messages is n ot ou tpu t. l Headers on in formation messages are n ot ou tpu t. l l Comman ds th at n ormally produ ce con tin u ou s ou tpu t (for example, STATUS, WHE RE 1 , an d IO) display th eir ou tpu t on ly on ce. Th e SWITCH mon itor comman d displays in formation differen tly. E ach requ ested switch is displayed as: S WITCH_NA ME [# el ements di spl ayed] [state of el ement 1]...[state of el ement n] Related Keywords DISABLE mon itor comman d DISABLE program in stru ction E NABLE mon itor comman d E NABLE program in stru ction V+ Lan gu age Referen ce Gu ide Page 4 7 6 INTE RACTIVE system switch SWITCH mon itor comman d SWITCH program in stru ction SWITCH real-valu ed fu n ction V+ Lan gu age Referen ce Gu ide Page 4 7 7 INVE RSE tran sformation fu n ction INVER SE transformation function Syntax I NVERS E ( tran sformation ) Function Retu rn th e tran sformation valu e th at is th e math ematical in verse of th e given tran sformation valu e. Parameter tran sformation Tran sformation -valu ed expression . Details Math ematically, th e valu e from th is fu n ction is a tran sformation su ch th at th e valu e of th e compou n d tran sformation sh own below is th e iden tity tran sformation (or NULL). INVERSE(trans):trans Stated an oth er way, con sider a tran sformation x th at defin es th e location of object A relative to object B. Th en INVE RSE (x) is th e tran sformation th at defin es th e location of object B relative to A. E xample Con sider th e case wh ere th e location part_ 1 is kn own in robot coordin ates, an d you wan t to fin d th e location h ole_ 1 with respect to part_ 1 . We can u se th e compou n d expression : part_1:hole_1 to represen t th e position of h ole_ 1 in robot coordin ates. Su ppose we move th e robot to h ole_ 1 an d u se th e HE RE comman d to defin e h ole_ pos as th e position of h ole_ 1 in robot coordin ates. In oth er words, we wan t to fin d h ole_ 1 , kn owin g th e valu es of part_ 1 an d h ole_ pos, an d kn owin g th at: part_1:hole_1 is equal to hole_pos We can th en u se th e INVE RSE fu n ction to determin e h ole_ 1 with th e in stru ction : SET hole_1 = INVERSE(part_1):hole_pos Note th at th e SE T in stru ction can be u sed with ou t explicit u se of INVE RSE by u sin g a compou n d tran sformation on th e left-h an d side, with iden tical resu lts. Th at is, th e in stru ction defin es h ole_ 1 . V+ Lan gu age Referen ce Gu ide Page 4 7 8 INVE RSE tran sformation fu n ction SET part_1:hole_1 = hole_pos Related Keywords HE RE program in stru ction SE T program in stru ction V+ Lan gu age Referen ce Gu ide Page 4 7 9 IOGE T real-valu ed fu n ction s IOGET real-valued functions Syntax I OGET_ ( address, type, cpu ) Function Retu rn a valu e from global memory or from a device on th e VME bu s. Usage Considerations V+ does n ot en force an y memory protection sch emes for global RAM or for accessin g th irdparty boards. It is th e programmer's respon sibility to keep track of memory u sage. Th e forms of IOGE T_ are: l IOGE TB Retu rn s on e u n sign ed byte l IOGE TD Retu rn s 6 4 -bit dou ble-precision floatin g-poin t valu e l IOGE TF Retu rn s 3 2 -bit sin gle-precision floatin g-poin t valu e l IOGE TL Retu rn s on e lon g word (3 2 bits) l IOGE TW Retu rn s on e u n sign ed word (1 6 bits) Parameters address In teger represen tin g th e address to be referen ced. Th e acceptable addresses are described below. type Option al in teger specifyin g th e memory space to be referen ced: 0 1 VME bu s stan dard address space 2 cpu CPU global RAM (defau lt) VME bu s sh ort address space Option al in teger specifyin g th e CPU to be accessed wh en type is 0 . Acceptable valu es are 0 to th e n u mber of CPUs in th e con troller. Th e defau lt is 0 (local CPU). V+ Lan gu age Referen ce Gu ide Page 4 8 0 IOGE T real-valu ed fu n ction s Details Th e IOGE T_ fu n ction s can access global memory on Adept CPUs an d th ird-party boards. Th ey can read on ly from a special section of CPU RAM an d to th e u n protected part of th e VME bu s address space. Local CPU memory an d stan dard Adept devices can n ot be accessed. Th e CPU RAM accessible to th e IOGE T_ fu n ction s can be u sed for an y desired pu rpose. For example, th is RAM can be u sed as a global area sh ared by mu ltiple processors. Note, h owever, th at it is th e programmer's respon sibility to provide an y in terlocks n eeded to assu re th e in tegrity of sh ared memory (see IOTAS). CPU global RAM 0 to ^H1 FFF Th e VME bu s specification defin es th ree in depen den t address spaces: stan dard, sh ort, an d exten ded. Adept does n ot su pport th e exten ded address space. Th e IOGE T_ fu n ction s can access addresses in th e followin g ran ges: Stan dard 0 to ^H3 FFFFF (0 to ^H7 FFFFF on n on vision systems). With a du al vision system, n o u ser memory is available in th e stan dard space. Sh ort 0 to ^H7 FFF CAUTI ON: All th ird-party boards u sed in Adept con trollers mu st first be approved by Adept. Con tact Adept application s su pport for details. Not all boards su pport th e fu ll ran ge of addresses listed above. Related Keywords $ IOGE TS strin g fu n ction IOPUT program in stru ction IOTAS real-valu ed fu n ction V+ Lan gu age Referen ce Gu ide Page 4 8 1 $ IOGE TS strin g fu n ction $IOGETS string function Syntax $ I OGETS ( address, len gth , type, cpu ) Function Retu rn a strin g valu e from a device on th e VME bu s. Usage Considerations V+ does n ot en force an y memory protection sch emes for global RAM or for accessin g th irdparty boards. It is th e programmer's respon sibility to keep track of memory u sage. Parameters address In teger represen tin g th e address to be referen ced. Th e acceptable addresses are sh own below. len gth In teger specifyin g th e len gth of th e strin g to be read (1 - 1 2 8 ). type Option al in teger specifyin g th e memory space to be referen ced: 0 1 VME bu s stan dard address space 2 cpu CPU RAM (defau lt) VME bu s sh ort address space Option al in teger specifyin g th e CPU to be accessed wh en type is 0 . Acceptable valu es are 0 to th e n u mber of CPUs in th e con troller. Th e defau lt is 0 (local CPU). Details Th e $ IOGE TS fu n ction can access global memory on Adept CPUs an d th ird-party boards. It can on ly write to a special section of CPU RAM an d from th e u n protected part of th e VME bu s address space. Local CPU memory an d stan dard Adept devices can n ot be accessed. Th e CPU RAM accessible to th e $ IOGE TS fu n ction can be u sed for an y desired pu rpose. For example, th is RAM can be u sed as a global area sh ared by mu ltiple processors. Note, h owever, th at it is th e programmer's respon sibility to provide an y in terlocks n eeded to assu re th e in tegrity of sh ared memory (see IOTAS). CPU global RAM 0 to ^H1 FFF V+ Lan gu age Referen ce Gu ide Page 4 8 2 $ IOGE TS strin g fu n ction Th e VME bu s specification defin es th ree in depen den t address spaces: stan dard, sh ort, an d exten ded. Adept does n ot su pport th e exten ded address space. Th e IOGE TS fu n ction can access addresses in th e followin g ran ges: Stan dard 0 to ^H3 FFFFF (0 to ^H7 FFFFF on n on vision systems). With a du al vision system, n o u ser memory is available in th e stan dard space. Sh ort 0 to ^H7 FFF CAUTI ON: All th ird-party boards u sed in Adept con trollers mu st first be approved by Adept. Con tact Adept application s su pport for details. Not all boards su pport th e fu ll ran ge of addresses listed above. Related Keywords IOGE T real-valu ed fu n ction IOPUT program in stru ction IOTAS real-valu ed fu n ction V+ Lan gu age Referen ce Gu ide Page 4 8 3 IOPUT program in stru ction IOPUT program instruction Syntax I OPUT_ address, type, cpu = valu e Function Write a valu e to global CPU memory or to a device on th e VME bu s. Usage Considerations V+ does n ot en force an y memory protection sch emes for global RAM or for accessin g th irdparty boards. It is th e programmer's respon sibility to keep track of memory u sage. Th e forms of IOPUT_ are: IOPUTB Writes on e u n sign ed byte IOPUTD Writes 6 4 -bit dou ble-precision floatin g-poin t valu e IOPUTF Writes 3 2 -bit sin gle-precision floatin g-poin t valu e IOPUTL Writes on e lon g word (3 2 bits) IOPUTS Writes a strin g valu e (len gth determin ed by strin g valu e) IOPUTW Writes on e u n sign ed word (1 6 bits) V+ Lan gu age Referen ce Gu ide Page 4 8 4 IOPUT program in stru ction Parameters address In teger represen tin g th e address to be referen ced. Th e acceptable valu es are described below. type Option al in teger specifyin g th e memory space to be referen ced: 0 CPU RAM (defau lt) 1 VME bu s stan dard address space 2 VME bu s sh ort address space cpu Option al in teger specifyin g th e CPU to be accessed wh en type is 0 . Acceptable valu es are 0 to th e n u mber of CPUs in th e con troller. Th e defau lt is 0 (local CPU). valu e Valu e to write (mu st agree with type in dicated by th e in stru ction n ame8 -bit valu e for IOPUTB, strin g for IOPUTS, etc.). Details Th e IOPUT_ in stru ction s can access global memory on Adept CPUs an d th ird-party boards. Th ey can write on ly to a special section of CPU RAM an d to th e u n protected part of th e VME bu s address space. Local CPU memory an d stan dard Adept devices can n ot be accessed. Th e CPU RAM accessible to th e IOPUT_ in stru ction s can be u sed for an y desired pu rpose. For example, th is RAM can be u sed as a global area sh ared by mu ltiple processors. Note, h owever, th at it is th e programmer's respon sibility to provide an y in terlocks n eeded to assu re th e in tegrity of sh ared memory (see IOTAS). CPU global RAM 0 to ^H1 FFF Th e VME bu s specification defin es th ree in depen den t address spaces: sh ort, stan dard, an d exten ded. Adept does n ot su pport th e exten ded address space. Th e IOPUT_ in stru ction s can access addresses in th e followin g ran ges: Stan dard 0 to ^H3 FFFFF (0 to ^H7 FFFFF on n on vision systems). With a du al vision system, n o u ser memory is available in th e stan dard space. Sh ort 0 to ^H7 FFF CAUTI ON: All th ird-party boards u sed in Adept con trollers mu st first be approved by Adept. Con tact Adept application s su pport for details. Not all boards su pport th e fu ll ran ge of address listed above. V+ Lan gu age Referen ce Gu ide Page 4 8 5 IOPUT program in stru ction Related Keywords IOGE T real-valu ed fu n ction $ IOGE TS strin g fu n ction IOTAS real-valu ed fu n ction V+ Lan gu age Referen ce Gu ide Page 4 8 6 IOSTAT real-valu ed fu n ction IOSTAT real-valued function Syntax I OS TAT ( lu n , mode) Function Retu rn statu s in formation for th e last in pu t/ou tpu t operation for a device associated with a logical u n it. Usage Considerations IOSTAT retu rn s in formation on ly for th e most recen t operation . If more th an on e operation is performed, th e statu s sh ou ld be ch ecked after each on e. Parameters lu n Real-valu ed expression wh ose in teger valu e is th e logical u n it n u mber for th e I/O device of in terest. (See th e description of ATTACH for in formation on th e logical u n it n u mbers recogn ized by th e V+ system an d h ow logical u n its are associated with I/O devices.) mode Option al expression th at selects th e type of I/O statu s to be retu rn ed for th e specified logical u n it. Th e followin g table sh ows th e effects of th e variou s mode valu es. (If th e mode valu e is omitted, th e valu e zero is assu med.) Mode Valu e retu rn ed by I OS TAT 0 Statu s of th e last complete I/O operation 1 Statu s of a pen din g preread requ est 2 Size in bytes of th e last file open ed or of th e last record read1 3 Statu s of an y ou tstan din g write requ est 1 Wh en sequ en tial-access mode is bein g u sed, th e byte cou n t retu rn ed by IOSTAT(...,2 ) in clu des th e carriage-retu rn an d lin efeed ch aracters at th e en d of each record. V+ Lan gu age Referen ce Gu ide Page 4 8 7 IOSTAT real-valu ed fu n ction Details Un like most V+ in stru ction s, I/O in stru ction s do n ot force th e program to stop wh en an error is detected. In stead, th e error statu s is stored in tern ally for access with th e IOSTAT fu n ction . Th is featu re allows th e program to in terpret an d possibly recover from man y I/O errors. Wh en readin g a file of u n kn own len gth , IOSTAT is th e on ly meth od to determin e wh en th e en d of th e file is reach ed. Th e valu e retu rn ed for modes 0 , 1 , an d 3 is on e of th e followin g: I OS TAT Valu e Retu rn ed on EOF Description 1 Normal su ccess; for mode 3 th is valu e in dicates th at n o write requ est is ou tstan din g. 0 Operation n ot yet complete <0 Stan dard V+ error n u mber. See System Messages for a description of stan dard V+ error n u mbers. E xamples Try to open a file for readin g, an d make su re th e file exists. If th e file does exist, record its size (in bytes). ATTACH (dlun, 4) "DISK" FOPENR (dlun) "RECORD.DAT" IF IOSTAT(dlun) < 0 THEN TYPE "Error opening file" HALT END file.size = IOSTAT(dlun,2) Read an d display records u n til th e en d of th e file is reach ed. ieeof = -504 ;End-of-file error code READ (dlun) $record WHILE IOSTAT(dlun) > 0 DO TYPE $record READ (dlun) $record END IF IOSTAT(dlun) == ieeof THEN TYPE "Normal end of file" ELSE TYPE /B, "I/O error ", $ERROR(IOSTAT(dlun)) END V+ Lan gu age Referen ce Gu ide Page 4 8 8 IOSTAT real-valu ed fu n ction FCLOSE (dlun) DETACH (dlun) In th e followin g example a TCP server program segmen t performs a n o-wait read an d th en ch ecks th e statu s to determin e wh eth er a clien t con n ection or discon n ection was made. ATTACH (lun,4) "TCP" IF IOSTAT (lun) < 0 THEN TYPE "Attach error: ", $ERROR(IOSTAT(lun)) END no_wait = 1 READ (lun, handle, no_wait) $in.str status = IOSTAT(lun) CASE status OF VALUE 1: ;Data received TYPE "Data received. Handle =", handle VALUE 100: ;New connection opened TYPE "New connection established. Handle =", handle VALUE 101: ;Connection closed TYPE "Connection closed. Handle =", handle VALUE -526: ;No data received WAIT ANY ;Some other error TYPE "Error during READ: ", $ERROR(status) GOTO 100 END Related Keywords ATTACH program in stru ction FCLOSE program in stru ction FCMND program in stru ction FE MPTY program in stru ction FOPE N program in stru ction FSE E K program in stru ction RE AD program in stru ction WRITE program in stru ction V+ Lan gu age Referen ce Gu ide Page 4 8 9 IOTAS real-valu ed fu n ction IOTAS real-valued function Syntax I OTAS ( address, type, cpu ) Function Con trol access to sh ared devices on th e VME bu s. Usage Considerations V+ does n ot en force an y memory protection sch emes for global RAM or for accessin g th irdparty boards. It is th e programmer's respon sibility to keep track of memory u sage. Parameters address In teger represen tin g th e address to be referen ced. Th e acceptable addresses are sh own below. type Option al in teger specifyin g th e memory space to be referen ced: 0 1 VME bu s stan dard address space 2 cpu CPU global RAM (defau lt) VME bu s sh ort address space Option al in teger specifyin g th e CPU to be accessed wh en type is 0 . Acceptable valu es are 0 to th e n u mber of CPUs in th e con troller. Th e defau lt is 0 (local CPU). Details Th e IOTAS fu n ction can access global memory on Adept CPUs an d th ird-party boards. It can access on ly a special section of CPU RAM an d th e u n protected part of th e VME bu s address space. Local CPU memory an d stan dard Adept devices can n ot be accessed. Th is fu n ction sets th e h igh -order (sign ) bit of th e byte at th e specified address an d retu rn s th e origin al statu s of th e h igh -order bit. Th e retu rn ed valu es are: 0 Un defin ed memory location 1 Positive (sign bit was clear) V+ Lan gu age Referen ce Gu ide Page 4 9 0 IOTAS real-valu ed fu n ction -1 Negative (sign bit was set) Th is test-an d-set operation is in divisible, wh ich mean s th at n o oth er processor can modify th e byte between th e time it is tested an d th e time it is set. Th e IOTAS fu n ction performs a h ardware-level read-modify-write (RMW) cycle on th e VME bu s to make th e test-an d-set operation in divisible in a mu ltiprocessin g en viron men t. If mu ltiple processors all access th is byte by u sin g IOTAS, th e byte can serve as an in terlock between processors. Th e CPU RAM accessible to th e IOTAS fu n ction can be u sed for an y desired pu rpose. For example, th is RAM can be u sed as a global area sh ared by mu ltiple processors. Note, h owever, th at it is th e programmer's respon sibility to provide an y in terlocks n eeded to assu re th e in tegrity of sh ared memory. CPU global RAM 0 to ^H1 FFF Th e VME bu s specification defin es th ree in depen den t address spaces: sh ort, stan dard, an d exten ded. Adept does n ot su pport th e exten ded address space. Th e IOPUT_ in stru ction s can access memory addresses in th e followin g ran ges: Stan dard 0 to ^H3 FFFFF (0 to ^H7 FFFFF on n on vision systems). With a du al vision system, n o u ser memory is available in th e stan dard space. Sh ort 0 to ^H7 FFF CAUTI ON: All th ird-party boards u sed in Adept con trollers mu st first be approved by Adept. Con tact Adept application s su pport for details. Not all boards su pport th e fu ll ran ge of address listed above. E xample A common u se of su ch an in terlock is to allow, at most, on e processor at a time to gain access to a data stru ctu re. ; Wait until the byte at ^H1000 on CPU 1 is not set WHILE IOTAS(^H1000, 0, 1) == -1 DO WAIT END ; Perform critical operation which requires interlocking ; Release the byte so another CPU can interlock it. IOPUTB(^H1000, 0, 1) = 0 If all processors u se th is mean s of in terlockin g, on ly on e at a time may perform th e critical operation . V+ Lan gu age Referen ce Gu ide Page 4 9 1 IOTAS real-valu ed fu n ction Related Keywords CAS real-valu ed fu n ction IOGE T real-valu ed fu n ction $ IOGE TS strin g fu n ction IOPUT program in stru ction TAS real-valu ed fu n ction V+ Lan gu age Referen ce Gu ide Page 4 9 2 IPS keyword IPS keyword Syntax S PEED valu e I PS ALWAYS Function Specify th e u n its for a SPE E D in stru ction as in ch es per secon d. NOTE: To specify speed in millimeters per secon d, u se th e MMPS con version factor. Usage Considerations IPS can be u sed on ly as a parameter for a SPE E D program in stru ction . Th e speed settin g specified is scaled by th e mon itor speed in effect wh en th e robot motion occu rs. Speeds specified with th e IPS parameter apply to straigh t-lin e motion s. Join t-in terpolated motion s do n ot main tain th e specified tool speed. Details IPS is an option al parameter for th e SPE E D program in stru ction , wh ich specifies th e u n its to be u sed for th e speed valu e. Th at is, wh en IPS is specified in a SPE E D in stru ction , th e speed valu e is in terpreted as in ch es/secon d (for straigh t-lin e motion s). See th e description of th e SPE E D program in stru ction for fu rth er details on settin g motion speeds with th e IPS con version factor. E xample Set th e robot tool tip speed to 2 0 in ch es/secon d for th e n ext straigh t-lin e robot motion (assu min g th e mon itor speed is set to 1 0 0 ): SPEED 20 IPS Related Keywords MMPS keyword SPE E D program in stru ction V+ Lan gu age Referen ce Gu ide Page 4 9 3 JHE RE program in stru ction JHER E program instruction Syntax JHERE variable1 , ..., variablen Function Records th e cu rren t robot join t position s in real or dou ble-precision variables. Th is in stru ction su pports MicroV+. Parameters variable1 A real or dou ble-precision variable to receive th e position of join t 1 . variablen A real or dou ble-precision variable to receive th e position of join t n . Details You can specify a maximu m of 1 2 variables. Th e variables can be array elemen ts with in dex expression s. You can omit variables from th e list as desired. Th e followin g example records th e join t-3 an d join t-5 position s respectively: JHERE , , j3,,j5 If more variables are defin ed th an th ere are join ts for a robot, th e extra variables are zero. Related Keyword JMOVE program in stru ction V+ Lan gu age Referen ce Gu ide Page 4 9 4 JMOVE program in stru ction JMOVE program instruction Syntax JMOVE expression 1 ,...,expression n Function Moves all robot join ts to position s described by a list of join t valu es. Th e robot performs a coordin ated motion in join t-in terpolated mode. Th is in stru ction is su pported by MicroV+. Parameters expression 1 An option al expression for th e join t-1 valu e. expression n An option al expression for th e n th join t valu e. NOTE: You mu st specify at least on e expression (join t), in order to move th e robot. Details You can specify a maximu m of 1 2 expression s. If an expression is omitted, th at join t is n ot moved. Th e followin g example moves on ly join t 1 an d join t 3 . JMOVE j1,,j3 If more expression s are specified th an th ere are join ts for a robot, th e extra expression s are ign ored. Related Keyword JHE RE program in stru ction V+ Lan gu age Referen ce Gu ide Page 4 9 5 JOG program in stru ction JOG program instruction Syntax JOG (statu s) robot, mode, axis, speed, location Function Moves (jogs) th e specified axis or join t of th e robot. E ach time JOG execu tes, th e specified axis or join t moves for 2 0 0 ms. Usage Considerations Th e robot mu st be DE TACHed in order to execu te th e JOG program in stru ction . Th e robot mu st be ATTACHed after u se of th e JOG in stru ction before oth er motion in stru ction s can be u sed. After th e robot is moved with th e JOG comman d or in stru ction , th e system is left in MANUAL mode (i.e., as th ou gh a man u al mode h ad been selected on th e Man u al Con trol Pen dan t). JOG mode 5 (or th e MCP) can be u sed to restore COMP mode. If a join t is ou t of ran ge, th e JOG in stru ction or comman d can be u sed to brin g th e join t back in to ran ge. See th e Details section for more in formation . V+ Lan gu age Referen ce Gu ide Page 4 9 6 JOG program in stru ction Parameters statu s An option al statu s variable (retu rn s 1 for su ccess; oth erwise, con tain s a V+ error code) robot Specifies th e robot n u mber (cu rren tly ign ored). mode Specifies th e jog mode, as follows: 1 = Free join t mode 2 = In dividu al join t con trol 3 = World coordin ates con trol 4 = Tool coordin ates con trol 5 = Restore COMP mode 7 = Jogs towards th e location specified u sin g th e speed specified. An error is retu rn ed if a location is n ot specified. axis Specifies a join t n u mber or world coordin ate (X=1 , Y=2 , ...), depen din g on th e specified jog mode (see above). speed Specifies th e speed of th e motion ; allowed ran ge is from -1 2 8 to +1 2 7 . location Option al parameter th at specifies a location variable. Th is parameter is ign ored for all modes except 7 . Details Wh en th e statu s variable is su pplied, an d th ere is an error, th e JOG in stru ction does n ot cau se program execu tion to stop. Th e error is simply retu rn ed in th e STATUS variable. E ach time JOG execu tes, th e arm moves for 2 0 0 ms. It is permitted to execu te JOG again before th e previou s motion is completed. In fact, for exten ded smooth motion , su bsequ en t JOG in stru ction s sh ou ld be execu ted with in 2 0 0 ms of th e previou s JOG in stru ction . Wh en a robot join t is ou t-of-ran ge, previou sly it was on ly possible to go in to MAN mode on th e MCP to correct th e error. Th is h as been ch an ged so th at it is n ow possible to pu t th e MCP in COMP mode. Th is allows th e JOG in stru ction to move th e join t back in to ran ge (JOG is allowed on ly in MCP COMP mode). Th is n ew COMP mode (wh ere a join t is ou t-of-ran ge) is very restricted in th at all motion comman ds (except JOG), retu rn s a * Position ou t of ran ge* error. In addition , JOG can move th e join t on ly in th e direction th at retu rn s th e join t back in to ran ge. E xamples Th e followin g are some examples of proper u se of th e JOG in stru ction : V+ Lan gu age Referen ce Gu ide Page 4 9 7 JOG program in stru ction JOG 1, 2, 1, -10 JOG 1, 3, 1, 10 JOG 1, 4, 2, 10 ;JOG joint 1 in JOINT mode ;JOG X-axis in WORLD mode ;JOG Y-axis in TOOL mode Related Keywords JMOVE program in stru ction JOG program in stru ction MOVE program in stru ction V+ Lan gu age Referen ce Gu ide Page 4 9 8 KE RMIT.RE TRY system parameter KER MIT.R ETR Y system parameter Syntax ... KERMI T.RETRY Function E stablish th e maximu m n u mber of times th e (local) Kermit driver sh ou ld retry an operation before reportin g an error. Usage Considerations Th e cu rren t valu e of th e KE RMIT.RE TRY parameter can be determin ed with th e PARAME TE R mon itor comman d or real-valu ed fu n ction . Th e valu e of th e KE RMIT.RE TRY parameter can be modified on ly with th e PARAME TE R mon itor comman d or program in stru ction . Th e parameter n ame can be abbreviated. Details Th e KE RMIT.RE TRY parameter determin es th e maximu m n u mber of times th e V+ driver for th e Kermit protocol will retry an operation wh en a commu n ication error occu rs. E xamples of tran smission errors are time-ou t errors an d ch ecksu m errors in dicatin g bad packets. NOTE: Th e settin g of th is parameter does n ot h ave th e desired effect if th e remote Kermit server h as a lower retry th resh old. If lon g pau ses are expected between su ccessive read or write operation s, th e settin g of th is parameter sh ou ld be in creased. (Th e settin g of th e KE RMIT.TIME OUT parameter sh ou ld also be in creased in th is case.) Th e valu e for th is parameter is in terpreted as an in teger valu e, wh ich can ran ge from 1 to 1 0 0 0 , in clu sive. Th is parameter is set to 1 5 wh en th e V+ system is in itialized. E xample Set th e retry limit to 5 . PARAMETER KERMIT.RETRY = 5 Related Keywords KE RMIT.TIME OUT system parameter V+ Lan gu age Referen ce Gu ide Page 4 9 9 KE RMIT.RE TRY system parameter PARAME TE R mon itor comman d PARAME TE R program in stru ction PARAME TE R real-valu ed fu n ction V+ Lan gu age Referen ce Gu ide Page 5 0 0 KE RMIT.TIME OUT system parameter KER MIT.TIMEOUT system parameter Syntax ... KERMI T.TI MEOUT Function E stablish th e delay parameter th at th e V+ driver for th e Kermit protocol sen ds to th e remote server. Usage Considerations Th e cu rren t valu e of th e KE RMIT.TIME OUT parameter can be determin ed with th e PARAME TE R mon itor comman d or real-valu ed fu n ction . Th e valu e of th e KE RMIT.TIME OUT parameter can be modified on ly with th e PARAME TE R mon itor comman d or program in stru ction . Th e parameter n ame can be abbreviated. Details Th is parameter h as n o direct effect on th e (local) V+ driver for th e Kermit commu n ication protocol. Th e settin g of th is parameter is simply sen t to th e remote server to requ est it to wait u p to th e n u mber of secon ds specified between th e packets sen t by th e local (V+) driver. Th e time-ou t valu e sh ou ld be in creased an y time lon g pau ses are expected between read or write operation s to a file open over th e Kermit lin e. Th is can occu r, for example, wh en debu ggin g a program th at h as a file open over th e Kermit lin e. (Th e settin g of th e KE RMIT.RE TRY parameter sh ou ld also be in creased in su ch cases.) Th e valu e for th is parameter is in terpreted as a n u mber of secon ds. It can ran ge from 1 to 9 5 , in clu sive. Th is parameter is set to 8 wh en th e V+ system is in itialized. E xample Set th e time-ou t limit to 1 5 secon ds. PARAMETER KERMIT.TIMEOUT = 15 Related Keywords KE RMIT.RE TRY system parameter PARAME TE R mon itor comman d PARAME TE R program in stru ction V+ Lan gu age Referen ce Gu ide Page 5 0 1 KE RMIT.TIME OUT system parameter PARAME TE R real-valu ed fu n ction V+ Lan gu age Referen ce Gu ide Page 5 0 2 KE YMODE program in stru ction KEYMODE program instruction Syntax KEYMODE first_ key, last_ key = mode, settin g Function Set th e beh avior of a grou p of keys on th e man u al con trol pen dan t. Usage Considerations Th e pen dan t mu st be attach ed before KE YMODE can be processed. For details on th e pen dan t key n u mbers, see Programmin g th e MCP or Programmin g th e T1 Pen dan t in th e V+ Lan gu age User's Gu ide. Parameters first_ key Real-valu ed expression th at defin es th e first key n u mber in a set of keys to be affected. last_ key Option al real-valu ed expression th at defin es th e last key n u mber in a set of keys to be affected. If n o valu e is provided, on ly on e key is affected. mode Real-valu ed expression th at defin es th e key mode to be set for th e specified set of keys. Th e mode mu st h ave on e of th e followin g valu es (th e modes are described below): 0 1 2 3 4 settin g Keyboard mode Toggle mode Level mode Special mode Mask mode Option al real-valu ed expression , wh ich applies on ly to modes 1 an d 4 . Assu med to be 0 if omitted. For mode 1 , th e settin g is th e in itial valu e applied to th e programmed keys. Zero sets th e keys to be off, n on -zero sets th em to be on . For mode 4 , settin g determin es if th e key is ign ored or recogn ized. Zero mean s to recogn ize th em, n on zero mean s to ign ore th em. Details Th e variou s key modes are described below. See th e description of th e PE NDANT real-valu ed fu n ction for more in formation on in teraction with th e man u al con trol pen dan t. V+ Lan gu age Referen ce Gu ide Page 5 0 3 KE YMODE program in stru ction 0 - Keyboard Mode Keys programmed in th is mode fu n ction similar to a termin al keyboard. A program can u se th e fu n ction PE NDANT(0 ) to requ est th e n u mber of th e n ext key pressed. Th e program th en wait u n til on e of th e keys programmed in KE YBOARD MODE is pressed. Th e n u mber of th e key is retu rn ed. Type-ah ead is n ot possible-th e program does n ot see an y keys th at are pressed wh ile th ere is n o PE NDANT(0 ) fu n ction pen din g. 1 - Toggle Mode Th e state of th e key may be read back on th e fly. Wh en you press a key th at is in th is mode, th e in tern al state main tain ed by V+ is toggled. Also, th e LE D on th e key (if an y) is toggled. Th e LE D is on wh en th e key's state is ON. Th e state of th e key is available even wh en th e pen dan t is n ot in USE R mode, bu t on ly if th e pen dan t is attach ed. 2 - Level Mode Th e key's cu rren t level is main tain ed by th e pen dan t an d may be read on th e fly. If th e pen dan t is n ot in USE R mode, th e level retu rn ed for th e key is zero. Th e key's state is ON on ly wh en it is actu ally bein g h eld down . Th is is u sefu l, for example, for cu rsor con trol. Th e valu e retu rn ed is n ot valid if th e pen dan t is n ot attach ed. Wh en ever a key is programmed in level mode, its repeat mode is tu rn ed off. 3 - S pecial Mode Special mode is n ot implemen ted. It sh ou ld n ot be u sed. 4 - Mask Mode Wh en settin g is n on -zero, disables pen dan t keys in th e specified ran ge. Wh en settin g = 0 , th e key(s) are reen abled. Attach /Detach Requ iremen ts Th e pen dan t mu st be attach ed (with th e ATTACH program in stru ction ) before th e program can read keys u sin g th e PE NDANT fu n ction , set th e modes of an y of th e keys, or sen d text to th e display. Addition ally, th e pen dan t mu st be in USE R mode for most in pu t an d ou tpu t operation s. Th e USE R LE D on th e pen dan t ligh ts wh en th e pen dan t is in th at mode. Th e LE D blin ks wh en a program requ est is pen din g becau se th e pen dan t is n ot in USE R mode. Defau lts Th e key modes defau lt to keyboard mode wh en th e pen dan t is attach ed. For details on programmin g th e pen dan t, see Programmin g th e MCP or Programmin g th e T1 Pen dan t in th e V+ Lan gu age User's Gu ide. V+ Lan gu age Referen ce Gu ide Page 5 0 4 KE YMODE program in stru ction E xamples Set th e man u al con trol soft keys to level mode. KEYMODE 1,5 = 2 Cau se th e Ru n /Hold key to be ign ored. KEYMODE 25 = 4, 1 Cau se th e Ru n /Hold key to h ave effect again . KEYMODE 25 = 4, 0 Related Keywords ATTACH program in stru ction PE NDANT real-valu ed fu n ction V+ Lan gu age Referen ce Gu ide Page 5 0 5 KILL program in stru ction KILL program instruction Syntax KI LL task_ n u mber Function Clear a program execu tion stack an d detach an y I/O devices th at are attach ed. Usage Considerations KILL can n ot be u sed wh ile th e specified program task is execu tin g. KILL h as n o effect if th e specified task execu tion stack is empty. Parameter task_ n u mber Option al real valu e, variable, or expression (in terpreted as an in teger) th at specifies wh ich program task is to be cleared. (See below for th e defau lt. See th e V+ Lan gu age User's Gu ide for in formation on tasks.) Details Th is operation clears th e selected program execu tion stack, closes an y open files, an d detach es an y I/O devices th at may h ave been left attach ed by abn ormal program termin ation . Th is situ ation can occu r if a program execu tes a PAUSE in stru ction or is termin ated by an ABORT comman d or in stru ction , or an error con dition , wh ile an I/O device is attach ed or a file is open . If a limited-access I/O device (su ch as th e serial I/O device) is left attach ed, n o oth er program task can u se th at device u n til it is detach ed. Th e KILL in stru ction always accesses task #0 if th e task n u mber is omitted. Related Keywords ABORT mon itor comman d ABORT program in stru ction E XE CUTE mon itor comman d E XE CUTE program in stru ction STATUS mon itor comman d V+ Lan gu age Referen ce Gu ide Page 5 0 6 LAST real-valu ed fu n ction LAST real-valued function Syntax LAS T ( array_ n ame[ ] ) Function Retu rn th e h igh est in dex u sed for an array (dimen sion ). Usage Considerations If an au tomatic variable is referen ced (see th e AUTO in stru ction ), th is fu n ction retu rn s th e in dex specified in th e AUTO statemen t th at declared th is array, regardless of wh ich elemen ts h ave been assign ed valu es. Parameter array_ n ame[ ] Name of th e array to be tested. An y type of V+ array variable can be specified: real-valu e, location , strin g, or belt. At least on e array in dex mu st be omitted (see below). Details Th is fu n ction can be u sed to determin e wh ich elemen ts of an array h ave already been defin ed. For on e-dimen sion arrays (for example, part[ ]), th is fu n ction retu rn s th e largest array in dex for wh ich an elemen t is defin ed. (See th e first example below.) For mu ltiple-dimen sion arrays (for example, $ n ames[,]), th is fu n ction retu rn s th e largest array in dex for wh ich an elemen t is defin ed for th e (left-most) dimen sion th at is omitted from th e array specification . (See th e secon d example below.) Th ere can n ot be an in dex specified to th e righ t of an omitted in dex. Note th at th e valu e retu rn ed by th is fu n ction is an in dex, n ot an array elemen t. Fu rth ermore, th e valu e is n ot a cou n t of th e array elemen ts th at are defin ed-it is th e largest in dex for wh ich an array elemen t is defin ed. Th e valu e -1 is retu rn ed if th e array does n ot h ave an y elemen ts defin ed for th e requ ested dimen sion . Th at is, -1 is retu rn ed if an y of th e followin g situ ation s occu r: l l l Th e array does n ot exist. Th e array h as more or fewer dimen sion s th an th e n u mber in dicated in th e fu n ction call. (For example, LAST(a[ ]) will retu rn -1 if th e array a h as two dimen sion s.) Th e specified dimen sion in a mu ltiple-dimen sion array h as n ot been defin ed at all. (For V+ Lan gu age Referen ce Gu ide Page 5 0 7 LAST real-valu ed fu n ction example, LAST(a[2 0 ,]) retu rn s -1 if LAST(a[,]) retu rn s 1 9 . Th at is, n o elemen ts a[2 0 ,i] exist.) Th e error * Illegal array in dex* resu lts if th ere is n ot at least on e blan k in dex in th e array specification su pplied to th is fu n ction , or if th ere is an in dex specified to th e righ t of a blan k in dex. E xamples If th e array part[ ] h as all its elemen ts defin ed from part[0 ] th rou gh part[1 0 ], th e followin g example retu rn s th e valu e 1 0 (n ot 1 1 , th e n u mber of elemen ts defin ed). LAST(part) If th e given two-dimen sion array h as elemen ts [2 ,0 ], [2 ,3 ], an d [2 ,5 ] defin ed, th e followin g example retu rn s th e valu e 5 (regardless of th e statu s of elemen ts [i,j] for i oth er th an 2 ). LAST($names[2,]) V+ Lan gu age Referen ce Gu ide Page 5 0 8 LATCH tran sformation fu n ction LATCH transformation function Syntax LATCH ( select) Function Retu rn a tran sformation valu e represen tin g th e location of th e robot at th e occu rren ce of th e last extern al trigger or AdeptForce gu arded-mode trigger. Usage Considerations LATCH(0 ) retu rn s in formation for th e robot selected by th e task execu tin g th e fu n ction . If th e V+ system is n ot con figu red to con trol a robot, u se of th e LATCH(0 ) fu n ction does n ot gen erate an error becau se of th e absen ce of a robot. However, th e in formation retu rn ed by th e fu n ction may n ot be mean in gfu l. LATCH(1 ) requ ires th e AdeptForce VME option . Parameter select Option al in teger, expression , or real variable specifyin g: 0 Robot position latch (defau lt) 1 AdeptForce gu arded-mode trigger Details LATCH(0 ) retu rn s a tran sformation valu e th at represen ts th e location of th e robot wh en th e last extern al trigger occu rred. Th e LATCHE D real-valu ed fu n ction sh ou ld be u sed to determin ed wh en an extern al trigger h as occu rred an d a valid location h as been recorded. Operation of th e extern al trigger can be con figu red with th e Adept con troller con figu ration program (in th e file CONFIG_ C.V2 on th e Utility Disk). Th is trigger may origin ate from th e vision processor or an extern al sou rce. LATCH(1 ) retu rn s th e location of th e robot at th e last AdeptForce gu arded-mode trigger. Th e LATCHE D(1 ) real-valu ed fu n ction can be u sed to determin e wh eth er an AdeptForce gu ardedmode trigger h as occu rred. See th e AdeptForce VME User's Gu ide for details of th e AdeptForce option . Th e DE VICE real-valu ed fu n ction may be u sed to read th e latch ed valu e of an extern al en coder Related Keywords DE VICE real-valu ed fu n ction V+ Lan gu age Referen ce Gu ide Page 5 0 9 LATCH tran sformation fu n ction LATCHE D real-valu ed fu n ction #PLATCH precision -poin t fu n ction V+ Lan gu age Referen ce Gu ide Page 5 1 0 LATCHE D real-valu ed fu n ction LATCHED real-valued function Syntax LATCHED ( select) Function Retu rn th e statu s of th e position latch an d/or th e AdeptForce gu arded-mode trigger. Parameter select In teger, expression , or real variable th at determin es wh eth er an y latch es h ave occu rred sin ce th e last time th e fu n ction was execu ted: Valu e Retu rn Valu e V+ Lan gu age Referen ce Gu ide Page 5 1 1 LATCHE D real-valu ed fu n ction 0 V+ version 1 5 .0 or earlier: 0 if n o position latch h as been detected -1 if a position latch was detected V+ version 1 5 .1 or later: 0 if n o latch h as been detected 1 if position -latch 1 was detected 2 if position -latch 2 is detected 1001 if position latch on th e risin g edge of fast in pu t 1 0 0 1 was detected 1002 if position latch on th e risin g edge of fast in pu t 1 0 0 2 was detected 1003 if position latch on th e risin g edge of fast in pu t 1 0 0 3 was detected [see Note 1 ] 1004 if position latch on th e risin g edge of fast in pu t 1 0 0 4 was detected [see Note 1 ] -1 0 0 1 if latch on fast in pu t 1 0 0 1 is detected for a positive edge [see Note 2 ] -1 0 0 2 if latch on fast in pu t 1 0 0 2 is detected for a positive edge [see Note 2 ] -1 0 0 3 if latch on fast in pu t 1 0 0 3 is detected for a positive edge [see Note 2 ] -1 0 0 4 if latch on fast in pu t 1 0 0 4 is detected for a positive edge [see Note 2 ] Note 1 : Does n ot apply to SmartCon troller CS-based systems. Note 2 : Applies on ly to SmartCon troller CX-based systems. <0 V+ Lan gu age Referen ce Gu ide Page 5 1 2 LATCHE D real-valu ed fu n ction Retu rn s th e statu s of th e position latch belts as follows: 0 if n o position latch h as been detected for an y belt N if th e position latch for belt N was detected 1 Retu rn s th e n u mber of th e AdeptForce gu arded-mode as follows: 0 if n o trigger h as occu rred 1 if trigger 1 h as occu rred 2 if trigger 2 h as occu rred Details Th is fu n ction retu rn s a n on zero valu e if a position latch or gu arded-mode trigger h as occu rred (an d th u s th e robot location or belt-en coder position h as been latch ed) sin ce th e LATCHE D fu n ction was last u sed. Oth erwise, th e fu n ction retu rn s th e valu e FALSE . Wh en th is fu n ction retu rn s a n on zero valu e, th e data for th e latch even t is made available for retrieval by th e followin g fu n ction s: l DE VICE Retu rn s position of extern al en coder l LATCH Retu rn s robot location as a tran sformation l #PLATCH Retu rn s robot location as a precision poin t NOTE: After a n on zero valu e is retu rn ed by th is fu n ction , su bsequ en t u se of th e fu n ction retu rn s th e valu e FALSE u n til th e n ext occu rren ce of a latch trigger. Operation of th e position latch an d extern al trigger can be con figu red with th e CONFIG_ C u tility program. Th e position latch an d extern al trigger may origin ate from th e vision processor or an extern al sou rce. For details on th e CONFIG_ C u tility, see th e In stru ction s for Adept Utility Programs. For addition al details abou t u sin g LATCHE D, see th e section Position Latch an d Vision Trigger in th e In stru ction s for Adept Utility Programs. For details on u sin g LATCHE D with th e AdeptForce option , see th e AdeptForce VME User's Gu ide. Related Keywords DE VICE real-valu ed fu n ction LATCH tran sformation fu n ction #PLATCH precision -poin t fu n ction V+ Lan gu age Referen ce Gu ide Page 5 1 3 LE FTY program in stru ction LEFTY program instruction Syntax LEFTY Function Requ est a ch an ge in th e robot con figu ration du rin g th e n ext motion so th at th e first two lin ks of a SCARA robot resemble a h u man 's left arm. Usage Considerations Con figu ration ch an ges can n ot be made du rin g straigh t-lin e motion s. If th e selected robot does n ot su pport a left-h an ded con figu ration , th is in stru ction is ign ored by th e robot. Th e LE FTY in stru ction can be execu ted by an y program task as lon g as th e robot selected by th e task is n ot attach ed by an y oth er task. Th e in stru ction applies to th e robot selected by th e task. If th e V+ system is n ot con figu red to con trol a robot, execu tin g th e LE FTY in stru ction cau ses an error. Th e followin g figu re sh ows th e LE FTY/RIGHTY con figu ration s (top view of robot). LE FTY/RIGHTY V+ Lan gu age Referen ce Gu ide Page 5 1 4 LE FTY program in stru ction Related Keywords CONFIG real-valu ed fu n ction RIGHTY program in stru ction SE LE CT program in stru ction SE LE CT real-valu ed fu n ction V+ Lan gu age Referen ce Gu ide Page 5 1 5 LE N real-valu ed fu n ction LEN real-valued function Syntax LEN ( strin g) Function Retu rn th e n u mber of ch aracters in th e given strin g. Parameter strin g Strin g con stan t, variable, or expression wh ose len gth is to be compu ted. E xample Retu rn th e n u mber of ch aracters in th e strin g $ str: $str = "Hello" str.len = LEN($str) V+ Lan gu age Referen ce Gu ide Page 5 1 6 LNGB real-valu ed fu n ction LNGB real-valued function Syntax LNGB ( $ strin g, first_ ch ar) Function Retu rn th e valu e of fou r bytes of a strin g in terpreted as a sign ed 3 2 -bit bin ary in teger. Usage Considerations Sin ce sin gle-precision n u mbers are stored in tern ally with on ly 2 4 bits of sign ifican ce, in pu t valu es th at con tain more th an 2 4 sign ifican t bits are con verted with some loss in precision . Dou ble-precision n u mbers are stored with 3 2 bits of sign ifican ce with th e MSB bein g th e sign bit. Dou bles are con verted with n o loss of precision . Parameters $ strin g Strin g con stan t, variable, or expression th at con tain s th e fou r bytes to be con verted. first_ ch ar Option al real valu e, variable, or expression (in terpreted as an in teger) th at specifies th e position of th e first of th e fou r bytes in th e strin g. An error resu lts if first_ ch ar specifies a series of fou r bytes th at goes beyon d th e en d of th e in pu t strin g. If first_ ch ar is omitted or h as th e valu e 0 or 1 , th e first fou r bytes of th e strin g are extracted. If first_ ch ar is greater th an 1 , it is in terpreted as th e ch aracter position for th e first byte (see below). Details Fou r sequ en tial ch aracters (bytes) of a strin g are in terpreted as bein g a 2 's-complemen t 3 2 bit sign ed bin ary in teger. Th e first of th e fou r bytes con tain s bits 2 5 to 3 2 of th e in teger, th e secon d of th e fou r bytes con tain s bits 1 7 to 2 4 , etc. For example, if first_ ch ar h as th e valu e 9 , th en th e n in th ch aracter (byte) in th e in pu t strin g con tain s bits 2 5 to 3 2 of th e in teger, th e ten th byte of th e strin g con tain s bits 1 7 to 2 4 , an d so forth . Th e main u se of th is fu n ction is to con vert bin ary n u mbers from an in pu t data record to valu es th at can be u sed in tern ally by V+. E xample Retu rn th e valu e 6 5 5 4 1 . V+ Lan gu age Referen ce Gu ide Page 5 1 7 LNGB real-valu ed fu n ction LNGB($INTB(1)+$INTB(5)) Related Keywords ASC real-valu ed fu n ction DBLB real-valu ed fu n ction FLTB real-valu ed fu n ction INTB real-valu ed fu n ction $ LNGB strin g fu n ction TRANSB tran sformation fu n ction VAL real-valu ed fu n ction V+ Lan gu age Referen ce Gu ide Page 5 1 8 $ LNGB strin g fu n ction $LNGB string function Syntax $ LNGB ( valu e) Function Retu rn a 4 -byte strin g con tain in g th e bin ary represen tation of a 3 2 -bit in teger. Usage Considerations Real valu es are rou n ded an d an y fraction al part is lost. Valu es mu st be in th e ran ge ^H7 FFFFFFF to -^H8 0 0 0 0 0 0 0 Parameter valu e Real valu e, variable, or expression wh ose valu e is to be con verted to its bin ary represen tation . Details Th e in teger part of a real valu e is con verted in to its bin ary represen tation ; th e low 3 2 -bits of th at bin ary represen tation are packed in to a strin g as fou r 8 -bit ch aracters. Bits 2 5 to 3 2 are packed in to th e first byte, followed by bits 1 7 to 2 4 in th e secon d byte, an d so forth . Th e main u se of th is fu n ction is to con vert in teger valu es to bin ary represen tation with in an ou tpu t record of a data file. Th e operation performed by th is fu n ction is equ ivalen t to th e followin g expression : $CHR(INT(value/^H1000000) BAND ^HFF) + $CHR(INT(value/^H10000) BAND ^HFF) + $CHR(INT(value/^H100) BAND ^HFF) + $CHR(INT(value) BAND ^HFF) E xample Retu rn s th e valu e $ INTB(6 7 )+$ INTB(1 2 3 4 5 ). $LNGB(67*65536+12345) Related Keywords $ CHR strin g fu n ction $ FLTB strin g fu n ction $ INTB strin g fu n ction V+ Lan gu age Referen ce Gu ide Page 5 1 9 $ LNGB strin g fu n ction LNGB real-valu ed fu n ction $ TRANSB strin g fu n ction V+ Lan gu age Referen ce Gu ide Page 5 2 0 LOCAL program in stru ction LOCAL program instruction Syntax LOCAL type variable, ..., variable Function Declare perman en t variables th at are defin ed on ly with in th e cu rren t program. Usage Considerations Su brou tin es can be called simu ltan eou sly by mu ltiple program tasks an d recu rsively by a sin gle task. Local an d global variables can be corru pted if su ch calls occu r in adverten tly. Th u s, th e u se of au tomatic variables in place of local variables is recommen ded. LOCAL statemen ts mu st appear before an y execu table statemen t in th e program. If a variable is listed in a LOCAL statemen t, an y global variable with th e same n ame can n ot be accessed directly by th at program. Th e valu es of local variables are n ot saved (or restored) by th e STORE (or LOAD) mon itor comman d. Parameters type Option al parameter specifyin g th e type of a variable. Th e acceptable types are: LOC Location variable (tran sformation or precision poin t) RE AL Sin gle-precision real variable DOUBLE Dou ble-precision real variable See th e description of th e GLOBAL program in stru ction for details on th e defau lt type. variable Variable n ame (belt, precision poin t, real-valu e, strin g, or tran sformation ). E ach variable can be a simple variable or an array. Array variables mu st n ot h ave th eir in dexes specified. If a type is specified, all variables mu st be of th at type. V+ Lan gu age Referen ce Gu ide Page 5 2 1 LOCAL program in stru ction Details Th is in stru ction is u sed to declare variables to be defin ed on ly with in th e cu rren t program. Th at is, a local variable can be referen ced on ly with in its own program. Also, th e n ames of local variables can be selected with ou t regard for th e n ames of local variables defin ed in oth er programs. Local variables are allocated on ly on ce du rin g program execu tion , an d th eir valu es are preserved between su ccessive su brou tin e calls. Th ese valu es are also sh ared if th e same program is execu ted by mu ltiple program tasks. If a program th at u ses LOCAL (or global) variables is called by several differen t program tasks, or called recu rsively by a sin gle task, th e valu es of th ose variables can be modified by th e differen t program in stan ces an d cau se very stran ge program errors. Th erefore, au tomatic variables sh ou ld be u sed for all temporary local variables to min imize th e ch an ce of errors. (See th e AUTO in stru ction .) Variables can be defin ed as au tomatic, global, or local. On ce a variable h as been assign ed to a class, an attempt to assign th e variable to a differen t class will resu lt in th e error * Attempt to redefin e variable class* . Variables can be defin ed on ly on ce with in th e same con text (au tomatic, local, or global). Attemptin g to defin e a variable more th an on ce (th at is, with a differen t type) will yield th e error * Attempt to redefin e variable type* . For details, see Data Types an d Operators in th e V+ Lan gu age User's Gu ide. Local variables can be referen ced with mon itor comman ds su ch as BPT, DE LE TE _ , DO, HE RE , LIST_ , POINT, TE ACH, TOOL, an d WATCH by u sin g th e option al con text specifier @. Th e gen eral syn tax is: command @task:program command_arguments For more in formation on specifyin g program con text, see th e section Programmin g V+ in th e V+ Lan gu age User's Gu ide. E xample Declare th e variables loc.a, $ an s, an d i to be local to th e cu rren t program: LOCAL loc.a, $ans, i Related Keywords AUTO program in stru ction GLOBAL program in stru ction V+ Lan gu age Referen ce Gu ide Page 5 2 2 LOCK program in stru ction LOCK program instruction Syntax LOCK priority Function Set th e program reaction lock-ou t priority to th e valu e given . Usage Considerations LOCK 0 is assu med wh en ever program execu tion is in itiated an d wh en a n ew execu tion cycle begin s. Ch an gin g th e priority may affect h ow reaction s are processed. Before u sin g th is in stru ction , be su re you kn ow wh at reaction s are active (an d th eir priorities). Parameter priority Real-valu ed expression with a valu e from 0 to 1 2 7 , wh ich becomes th e n ew reaction lock-ou t priority. Details Wh en a program is E XE CUTE d, it is placed on th e execu tion stack. Wh en th e program's task becomes th e h igh est priority task in a time slice, th e program's priority is set to 0 an d it begin s execu tion . Du rin g actu al execu tion , a program's task can be su spen ded at th e en d of a time slice, in wh ich case th e task waits u n til th e n ext time it is th e h igh est priority task in a time slice. Th e LOCK in stru ction does n ot affect th e task priority valu e with in a time slice: It on ly ch an ges th e program priority of an execu tin g program. Program priority becomes importan t wh en a reaction rou tin e (RE ACT, RE ACTE , RE ACTI) is in voked. A program can defer execu tion of a RE ACT or RE ACTI rou tin e by settin g th e temporary program priority to a valu e h igh er th an th e RE ACT or RE ACTI program priority. Th is is th e fu n ction of a LOCK in stru ction . For example, if a LOCK in stru ction ch an ges th e temporary program priority to 2 0 , an y RE ACT or RE ACTI in terru pts with lower priority valu es are deferred. (RE ACTE rou tin es can n ot be deferred by priority con sideration s.) Deferred reaction s are n ot ign ored. E very time a n ew LOCK in stru ction is processed, an y deferred reaction programs are ch ecked to see if th eir priority is h igh en ou gh for th em to execu te. As soon as th e program priority is lowered, all pen din g reaction rou tin es with a h igh er priority are ru n accordin g to th eir relative priority. Th e PRIORITY real-valu ed fu n ction can be u sed to determin e th e program priority at an y time. V+ Lan gu age Referen ce Gu ide Page 5 2 3 LOCK program in stru ction NOTE: Alth ou gh a LOCK in stru ction can be u sed to ch an ge th e program priority with in a reaction program, th e priority still retu rn s to its prereaction valu e wh en a RE TURN is execu ted in th e program. Th is occu rs on ly wh en execu tin g a RE TURN from a reaction program. E xample In crease th e program priority by 1 0 : LOCK PRIORITY+10 Related Keywords PRIORITY real-valu ed fu n ction RE ACT program in stru ction RE ACTI program in stru ction V+ Lan gu age Referen ce Gu ide Page 5 2 4 MAX real-valu ed fu n ction MAX real-valued function Syntax MAX ( valu e, ..., valu e) Function Retu rn th e maximu m valu e con tain ed in th e list of valu es. Parameter valu e E ach valu e in th e list can be specified as a real-valu ed con stan t, variable, or expression . Details Th e list of valu es provided is scan n ed for th e largest valu e, an d th at valu e is retu rn ed by th e fu n ction . Th e sign of each valu e is con sidered. Th u s, for example, th e valu e -1 0 is con sidered larger th an -1 0 0 . E xample Th e program in stru ction : max.value = MAX(x, y, z, 0) sets max.valu e to th e largest valu e of th e variables x, y, an d z, or to zero if all th ree variables h ave valu es less th an zero. Related Keyword MIN real-valu ed fu n ction V+ Lan gu age Referen ce Gu ide Page 5 2 5 MC program in stru ction MC program instruction Syntax MC mon itor_ comman d Function In trodu ce a mon itor comman d with in a comman d program. Usage Considerations Th e MC in stru ction can be con tain ed on ly with in a comman d program. (Comman d programs can con tain on ly MC in stru ction s, blan k lin es, an d commen t lin es.) Parameter mon itor_ comman d An y valid V+ mon itor comman d. Details Comman d programs are created u sin g on e of th e V+ editors. To in dicate to th e editor th at a comman d program, rath er th an a n ormal program, is bein g created, every operation lin e of a comman d program mu st begin with th e letters MC (th at is, for Mon itor Comman d follows) followed by on e or more spaces. As with regu lar application programs, comman d programs can con tain blan k lin es an d commen t lin es to add clarity. E very n on blan k lin e of a comman d program mu st con tain a mon itor comman d (or a commen t). Mon itor comman ds an d program in stru ction s can n ot be mixed. Program in stru ction s can be in clu ded, h owever, by u sin g th e DO comman d. Th at is, to in clu de an in stru ction in a comman d program, you can type a lin e with th e form mc do in stru ction . See th e V+ Operatin g System Referen ce Gu ide for details on mon itor comman ds. E xample Th e followin g comman d program loads disk files, prepares for execu tion of a program, an d begin s th e execu tion . Note th at a DO comman d is u sed to in clu de a MOVE in stru ction : 1 .PROGRAM setup() 2 MC LOAD C:project 3 MC LOAD B:project.lc 4 MC SPEED 50 5 MC DO MOVE safe.loc 6 MC EXECUTE motion, -1 7 .END Related Keywords COMMANDS mon itor comman d V+ Lan gu age Referen ce Gu ide Page 5 2 6 MC program in stru ction MCS program in stru ction V+ Lan gu age Referen ce Gu ide Page 5 2 7 MCP.ME SSAGE system switch MCP.MESSAGE system switch Syntax ... MCP.MES S AGE Function Con trol h ow system error messages are h an dled wh en th e con troller keyswitch is n ot in th e MANUAL position . Usage Considerations Systems with ou t a Con troller In terface Pan el (CIP) assu me th at th e keyswitch is in th e AUTO position . Details If th is switch is en abled, all system error messages are ou tpu t to th e man u al con trol pen dan t regardless of th e settin g of th e con troller keyswitch . In th at case, th e system operator mu st press CLR E RR on th e man u al con trol pen dan t to clear th e error con dition before system operation can con tin u e. By defau lt, th is switch is disabled. Th at is, error messages are ou tpu t on ly to th e device selected by th e con troller keyswitch . Related Keywords DISABLE mon itor comman d DISABLE program in stru ction E NABLE mon itor comman d E NABLE program in stru ction MCS.ME SSAGE system switch SWITCH mon itor comman d SWITCH program in stru ction SWITCH real-valu ed fu n ction V+ Lan gu age Referen ce Gu ide Page 5 2 8 MCP.NO.POT system switch MCP.NO.POT system switch Syntax ... MCP.NO.POT Function Modifies th e u se of th e STE P bu tton on th e MCP an d on th e T1 Pen dan t. Usage Considerations Has an effect on ly wh en th e fron t pan el keyswitch is in th e MANUAL position . Details Wh en th e MCP.NO.POT switch is en abled, an d th e fron t pan el keyswitch is set to MANUAL, an d a V+ program is execu ted, th e V+ program will execu te n ormally u n til an in stru ction th at moves th e robot is en cou n tered. Th e V+ program will th en wait u n til th e STE P bu tton on th e MCP is pressed (an d h eld) before movin g th e robot. Wh ile V+ is waitin g, th e text: Waiting for STEP button is displayed in th e mon itor win dow, an d th e MCP STE P LE D is lit. Wh en th e STE P bu tton is su bsequ en tly pressed, th e STE P LE D will be u n lit. NOTE: An ABORT comman d or a robot error will stop th e V+ program an d cau se th is wait state to be exited. If th e STE P bu tton is released, th e arm motion stops immediately. Moreover, con trary to n ormal V+ operation , in th is mode, th e motion in stru ction is n ot allowed to complete u n til th e motion actu ally completes. (Motion completion is determin ed in th e n ormal man n er, based on th e settin gs of COARSE /FINE , NULL/NONULL, CP, etc.) Th is mean s th at forward processin g of su bsequ en t V+ in stru ction s does n ot occu r wh en a motion is pau sed du e to th e STE P bu tton bein g released. In effect, th e motion in stru ction (as well as th e motion ) can be th ou gh t of as bein g RE TRY'ed repeatedly, each time th e STE P bu tton is pressed (an d h eld), u n til th e motion completes, at wh ich poin t th e V+ program con tin u es to th e n ext in stru ction . NOTE: Th e settin g of th e CP switch does n ot affect th is beh avior. In stead, th e settin g will affect on ly h ow th e en d of th e RE TRY'ed motion blen ds in to th e followin g motion , if an y, wh ich is th e n ormal fu n ction of th e CP switch . V+ Lan gu age Referen ce Gu ide Page 5 2 9 MCP.NO.POT system switch Related Keywords ABORT program in stru ction BRE AK program in stru ction CP system switch RE TRY mon itor comman d V+ Lan gu age Referen ce Gu ide Page 5 3 0 MCS program in stru ction MCS program instruction Syntax MCS strin g Function In voke a mon itor comman d from an application program. Parameter strin g Strin g valu e, variable, or expression th at defin es on e of th e V+ mon itor comman ds listed below. Details Normally, mon itor comman ds can be in voked on ly from th e system termin al or from comman d programs (wh ich con tain on ly mon itor comman ds). Th e MCS in stru ction can be u sed to in voke th e followin g mon itor comman ds from an application program: DE LE TE DE LE TE L DE LE TE M DE LE TE P DE LE TE R DE LE TE S FCOPY LOAD STORE STORE L STORE M STORE P STORE R STORE S VRE NAME Usin g th ese comman ds, an application program can store, load, an d copy programs to an d from disk, an d also delete programs from memory to make room for oth er programs. Similarly, variables can be deleted from memory wh en th ey are n o lon ger n eeded. Also, vision prototypes can be ren amed.Loadin g, storin g, an d deletin g programs an d global variables is n ot in terlocked for mu lti-task access in V+. Th erefore, if you are in corporatin g mu ltiple MCS in stru ction s in a program, you will n eed to u se TAS in terlocks to preven t mu ltiple tasks from issu in g th e in stru ction s. For details, see th e TAS program in stru ction . NOTE:If th e mon itor comman d specified in th e strin g parameter con tain s a blan k program con text (th at is, it con tain s @), an y variables listed in th e comman d are treated as th ou gh th ey are referen ced with in th e program con tain in g th e MCS in stru ction . (See th e V+ Lan gu age User's Gu ide for more in formation on program con text.) Program execu tion is n ot stopped if an error occu rs wh ile processin g th e mon itor comman d. Th e E RROR real-valu ed fu n ction can be u sed after th e MCS in stru ction to ch eck for th e occu rren ce of an error. NOTE: If a DE LE TE _ comman d is u sed with in a su brou tin e to delete on e of th e su brou tin e parameters (th at is, on e of th e variables in th e .PROGRAM statemen t), th e variable is n ot deleted an d n o error con dition is recorded. V+ Lan gu age Referen ce Gu ide Page 5 3 1 MCS program in stru ction Normal ou tpu t by th e mon itor comman d to th e system termin al is don e if th e MCS.ME SSAGE system switch is en abled. For example, th e LOAD comman d ou tpu ts th e .PROGRAM lin es from each program loaded. (Th e MCS.ME SSAGE switch is n ormally disabled.) If th e FCOPY option is u sed, logical u n its 5 (disk #1 ) an d 6 (disk #2 ) mu st be available. If LOAD or STORE _ is u sed, logical u n it # 5 mu st be available. E xample Th e followin g program loads a disk file, execu tes th e program in th e file, an d deletes th e program from th e system memory. An oth er program file is th en loaded in to memory an d execu ted. (Alth ou gh th is simple example can also be implemen ted with a comman d program, th e followin g demon strates u se of th e MCS in stru ction in a n ormal program.) .PROGRAM admin() MCS "LOAD C:setup" CALL setup MCS "DELETEP setup" MCS "LOAD C:demo_1" CALL demo_main .END Related Keywords E RROR real-valu ed fu n ction MC program in stru ction MCS.ME SSAGE system switch V+ Lan gu age Referen ce Gu ide Page 5 3 2 MCS.ME SSAGE system switch MCS.MESSAGE system switch Syntax ... MCS .MES S AGE Function E n able or disable ou tpu t to th e system termin al from mon itor comman ds execu ted with th e MCS in stru ction . Details If th is switch is en abled, ou tpu t from mon itor comman ds execu ted with th e MCS in stru ction is displayed on th e system termin al. Oth erwise, ou tpu t is su ppressed. For example, wh en th is switch is disabled, a LOAD comman d in voked with th e MCS in stru ction does n ot ou tpu t .PROGRAM in formation lin es or error messages. By defau lt, th is switch is disabled, su ppressin g ou tpu t from comman ds in voked with th e MCS in stru ction . Related Keywords DISABLE mon itor comman d DISABLE program in stru ction E NABLE mon itor comman d E NABLE program in stru ction MCP.ME SSAGE system switch MCS program in stru ction ME SSAGE S system switch SWITCH mon itor comman d SWITCH program in stru ction SWITCH real-valu ed fu n ction V+ Lan gu age Referen ce Gu ide Page 5 3 3 ME SSAGE S system switch MESSAGES system switch Syntax ... MES S AGES Function E n able or disable ou tpu t to th e system termin al from TYPE in stru ction s. Details If th is switch is en abled, ou tpu t from TYPE in stru ction s is displayed on th e system termin al. Oth erwise, ou tpu t is su ppressed. By defau lt, th is switch is en abled, allowin g ou tpu t to occu r. Related Keywords DISABLE mon itor comman d DISABLE program in stru ction E NABLE mon itor comman d E NABLE program in stru ction MCS.ME SSAGE system switch SWITCH mon itor comman d SWITCH program in stru ction SWITCH real-valu ed fu n ction TYPE program in stru ction V+ Lan gu age Referen ce Gu ide Page 5 3 4 $ MID strin g fu n ction $MID string function Syntax $ MI D ( strin g, first_ ch ar, n u m_ ch ars) Function Retu rn a su bstrin g of th e specified strin g. Parameters strin g Strin g variable, con stan t, or expression from wh ich th e su bstrin g is extracted. first_ ch ar Option al real-valu ed expression th at specifies th e first ch aracter of th e su bstrin g. n u m_ ch ars Real-valu ed expression th at specifies th e n u mber of ch aracters to be copied to th e su bstrin g. Details If first_ ch ar is omitted or h as a valu e less th an or equ al to 1 , th e su bstrin g starts with th e first ch aracter of strin g. If first_ ch ar is larger th an th e len gth of th e in pu t strin g, th e fu n ction retu rn s an empty strin g. If th ere are fewer th an n u m_ ch ars ch aracters from th e specified startin g ch aracter position to th e en d of th e in pu t strin g, th e ou tpu t strin g con sists of on ly th e ch aracters u p to th e en d of th e in pu t strin g. Th at is, n o error resu lts an d th e ou tpu t strin g is n ot exten ded to th e requ ested len gth . E xample Th e in stru ction s below resu lt in th e strin g variable $ su bstrin g con tain in g th e strin g cd, sin ce cd is th e 2 -ch aracter strin g th at starts at ch aracter position 3 of th e strin g abcde con tain ed in th e strin g variable $ strin g: $stri ng = "abcdef" $substri ng = $MID($stri ng, 3, 2) Related Keyword $ UNPACK strin g fu n ction V+ Lan gu age Referen ce Gu ide Page 5 3 5 MIN real-valu ed fu n ction MIN real-valued function Syntax MI N ( valu e, ..., valu e) Function Retu rn th e min imu m valu e con tain ed in th e list of valu es. Parameter valu e E ach valu e in th e list can be specified as a real-valu ed con stan t, variable, or expression . Details Th e list of valu es provided is scan n ed for th e smallest valu e, an d th at valu e is retu rn ed by th e fu n ction . Th e sign of each valu e is con sidered. Th u s, for example, th e valu e -1 0 0 is con sidered smaller th an -1 0 . E xample Th e program in stru ction : min.value = MIN(1000, x, y, z) sets min .valu e to th e smallest valu e of th e variables x, y, an d z, or to th e valu e 1 0 0 0 if all th ree variables h ave valu es greater th an 1 0 0 0 . Related Keyword MAX real-valu ed fu n ction V+ Lan gu age Referen ce Gu ide Page 5 3 6 MMPS keyword MMPS keyword Syntax S PEED valu e MMPS ALW AYS Function Specify th e u n its for a SPE E D in stru ction as millimeters per secon d. NOTE: To specify u n its in in ch es per secon d, u se th e IPS con version factor. Usage Considerations MMPS can be u sed on ly as a parameter for a SPE E D program in stru ction . Th e speed settin g specified is scaled by th e mon itor speed in effect wh en th e robot motion occu rs. Speeds specified with th e MMPS parameter apply to straigh t-lin e motion s. Join t-in terpolated motion s do n ot main tain th e specified tool speed. Details Th is is an option al parameter for th e SPE E D program in stru ction , wh ich specifies th e u n its to be u sed for th e speed valu e. Th at is, wh en MMPS is specified in a SPE E D in stru ction , th e speed valu e is in terpreted as millimeters/secon d (for straigh t-lin e motion s). See th e description of th e SPE E D program in stru ction for fu rth er details on settin g motion speeds with th e IPS con version factor. E xample Set th e defau lt program speed for straigh t-lin e motion s to 1 0 millimeters per secon d (assu min g th e mon itor speed is set to 1 0 0 ): SPEED 10 MMPS ALWAYS Related Keywords IPS keyword SPE E D program in stru ction V+ Lan gu age Referen ce Gu ide Page 5 3 7 MOD operator MOD operator Syntax ... valu e MOD valu e ... Function Compu te th e modu lu s of two valu es. Details Th e MOD operator operates on two valu es, resu ltin g in a valu e th at is th e remain der after dividin g th e first valu e by th e secon d valu e. (Th e secon d valu e can n ot be zero.) For details on h ow operators are evalu ated with in expression s, see th e Order of E valu ation . E xamples Retu rn 1 (5 /2 is 2 with a remain der of 1 ): 5 MOD 2 Retu rn 0 (8 1 /2 7 is 3 with a remain der of 0 ): 81 MOD 27 V+ Lan gu age Referen ce Gu ide Page 5 3 8 MONITORS system switch MONITOR S system switch Syntax ... MONI TORS Function E n able or disable selectin g of mu ltiple mon itor win dows. Usage Considerations Th is switch is u sed with systems con figu red for mu ltiple V+ system processors (requ ires th e option al V+ E xten sion s software). Details Wh en en abled, mon itor win dows for th e au xiliary CPUs can be selected from th e adept pu lldown men u on th e top-level men u bar. Wh en disabled, win dows for th e au xiliary CPUs h ave th eir n ames dimmed an d can n ot be selected. Defau lt is OFF. V+ Lan gu age Referen ce Gu ide Page 5 3 9 MOVE an d MOVE S program in stru ction MOVE and MOVES program instruction Syntax MOVE location MOVES location Function In itiate a robot motion to th e position an d orien tation described by th e given location . Usage Considerations MOVE cau ses a join t-in terpolated motion . MOVE S cau ses a straigh t-lin e motion , du rin g wh ich n o ch an ges in con figu ration are permitted. Th ese in stru ction s can be execu ted by an y program task as lon g as th e task h as attach ed a robot. Th e in stru ction s apply to th e robot selected by th e task. If th e V+ system is n ot con figu red to con trol a robot, execu tin g th ese in stru ction s cau ses an error. Parameter location Tran sformation , precision poin t, location fu n ction , or compou n d tran sformation th at specifies th e destin ation to wh ich th e robot is to move. Details Th e MOVE in stru ction cau ses a join t-in terpolated motion . Th at is, in termediate set poin ts between th e in itial an d fin al robot location s are compu ted by in terpolatin g between th e in itial an d fin al join t position s. An y ch an ges in con figu ration requ ested by th e program (for example, by a LE FTY in stru ction ) are execu ted du rin g th e motion . Th e MOVE S in stru ction cau ses a straigh t-lin e motion . Du rin g su ch a motion th e tool is moved alon g a straigh t-lin e path an d is smooth ly rotated to its fin al orien tation . No ch an ges in con figu ration are allowed du rin g straigh t-lin e motion s. E xamples MOVE #pick Move by join t-in terpolated motion to th e location described by th e precision poin t #pick. MOVE S ref:place Move alon g a straigh t-lin e path to th e location described by th e compou n d tran sformation ref:place. V+ Lan gu age Referen ce Gu ide Page 5 4 0 MOVE an d MOVE S program in stru ction Related Keywords APPRO program in stru ction APPROS program in stru ction DE PART program in stru ction DE PARTS program in stru ction MOVE F program in stru ction MOVE SF program in stru ction MOVE T program in stru ction MOVE ST program in stru ction SE LE CT program in stru ction SE LE CT real-valu ed fu n ction V+ Lan gu age Referen ce Gu ide Page 5 4 1 MOVE an d MOVE S program in stru ction MOVE and MOVES program instruction Syntax MOVE location MOVES location Function In itiate a robot motion to th e position an d orien tation described by th e given location . Usage Considerations MOVE cau ses a join t-in terpolated motion . MOVE S cau ses a straigh t-lin e motion , du rin g wh ich n o ch an ges in con figu ration are permitted. Th ese in stru ction s can be execu ted by an y program task as lon g as th e task h as attach ed a robot. Th e in stru ction s apply to th e robot selected by th e task. If th e V+ system is n ot con figu red to con trol a robot, execu tin g th ese in stru ction s cau ses an error. Parameter location Tran sformation , precision poin t, location fu n ction , or compou n d tran sformation th at specifies th e destin ation to wh ich th e robot is to move. Details Th e MOVE in stru ction cau ses a join t-in terpolated motion . Th at is, in termediate set poin ts between th e in itial an d fin al robot location s are compu ted by in terpolatin g between th e in itial an d fin al join t position s. An y ch an ges in con figu ration requ ested by th e program (for example, by a LE FTY in stru ction ) are execu ted du rin g th e motion . Th e MOVE S in stru ction cau ses a straigh t-lin e motion . Du rin g su ch a motion th e tool is moved alon g a straigh t-lin e path an d is smooth ly rotated to its fin al orien tation . No ch an ges in con figu ration are allowed du rin g straigh t-lin e motion s. E xamples MOVE #pick Move by join t-in terpolated motion to th e location described by th e precision poin t #pick. MOVE S ref:place Move alon g a straigh t-lin e path to th e location described by th e compou n d tran sformation ref:place. V+ Lan gu age Referen ce Gu ide Page 5 4 2 MOVE an d MOVE S program in stru ction Related Keywords APPRO program in stru ction APPROS program in stru ction DE PART program in stru ction DE PARTS program in stru ction MOVE F program in stru ction MOVE SF program in stru ction MOVE T program in stru ction MOVE ST program in stru ction SE LE CT program in stru ction SE LE CT real-valu ed fu n ction V+ Lan gu age Referen ce Gu ide Page 5 4 3 MOVE F program in stru ction MOVEF program instruction Syntax MOVEF location , depart_ clr, appro_ clr, depart_ tqe, h oriz_ accel_ tqe, h oriz_ decel_ tqe, appro_ tqe, model MOVES F location , depart_ clr, appro_ clr, depart_ tqe, h oriz_ accel_ tqe, h oriz_ decel_ tqe, appro_ tqe, model Function In itiate a th ree-segmen t pick-an d-place robot motion to th e specified destin ation , movin g th e robot at th e fastest allowable speed. Usage Considerations Th ese in stru ction s are available for certain Adept SCARA robots th at su pport optimized moves. l l MOVE F cau ses a join t-in terpolated motion du rin g th e h orizon tal motion segmen t. MOVE SF cau ses a straigh t-lin e motion du rin g th e h orizon tal motion segmen t. For th e en tire motion , n o ch an ges in con figu ration are permitted. Un like th e DE PART, DE PARTS, APPRO, an d APPROS in stru ction s, wh ich move th e robot alon g th e tool-Z axis, th e departu re an d approach motion segmen ts in itiated by th ese in stru ction s move on ly join t 3 (th e lin ear Z axis), an d th ose motion s are in depen den t of th e TOOL tran sformation . Before th ese in stru ction s can be execu ted, th e SFUTIL u tility program mu st be u sed to compu te th e coefficien ts for th e dyn amic model of th e robot. Th ese in stru ction s can be execu ted by an y program task, as lon g as th e task h as attach ed a robot. Th e in stru ction s apply to th e robot selected by th e task. If th e V+ system is n ot con figu red to con trol a robot, an attempt to execu te on e of th ese in stru ction s cau ses an error. V+ Lan gu age Referen ce Gu ide Page 5 4 4 MOVE F program in stru ction Parameters location Tran sformation , precision poin t, location fu n ction , or compou n d tran sformation th at specifies th e destin ation to wh ich th e robot is to move. depart_ clr Option al real-valu ed expression th at specifies th e min imu m clearan ce distan ce (in millimeters) th at join t 3 is to be moved relative to its in itial location du rin g th e first segmen t of th e motion . A positive distan ce retracts (lifts u p) join t 3 from th e in itial location . A n egative distan ce exten ds (drops down ) join t 3 from th e in itial location . Th e distan ce zero elimin ates th e first segmen t of th e pick an d place motion . Un like th e DE PART an d DE PARTS in stru ction s, wh ich specify th e fu ll len gth of th e vertical excu rsion , th is parameter specifies th e min imu m desired clearan ce h eigh t before th e h orizon tal motion is in itiated. Based u pon th e dyn amic ch aracteristics of join t 3 an d th e h orizon tal motion , th e V+ system au tomatically compu tes th e total len gth of th e departu re motion . For man y h igh -speed motion s, th e min imu m clearan ce h eigh t sh ou ld be set to a fraction (for example, 1 /6 th ) of th e distan ce th at is n ormally specified as th e depart h eigh t. appro_ clr Option al real-valu ed expression th at specifies th e min imu m clearan ce distan ce (in millimeters) th at join t 3 is to be posed above th e fin al destin ation at th e time th e h orizon tal motion is con clu ded. A positive distan ce in dicates th at join t 3 sh ou ld be posed above th e fin al destin ation . A n egative distan ce places join t 3 below its fin al destin ation . Th e distan ce zero elimin ates th e fin al segmen t of th e pick an d place motion so th at th e robot moves directly to th e destin ation from th e departu re poin t. As with th e depart_ clr parameter, th e approach clearan ce h eigh t specifies th e min imu m clearan ce distan ce, rath er th an th e total len gth of th e vertical excu rsion . depart_ tqe Option al real-valu ed expression th at specifies th e percen tage of maximu m torqu e th at sh ou ld be u tilized to accelerate join t 3 du rin g th e departu re motion . Th is parameter mu st be specified if depart_ clr is n on zero. However, th is parameter is ign ored if depart_ clr is zero. V+ Lan gu age Referen ce Gu ide Page 5 4 5 MOVE F program in stru ction If th is parameter is specified, its valu e mu st be in th e ran ge 3 0 .0 to 1 0 0 .0 , wh ere 1 0 0 .0 in dicates th at all th e available torqu e sh ou ld be applied. h oriz_ accel_ tqe Real-valu ed expression th at specifies th e percen tage of maximu m torqu e th at sh ou ld be u tilized to accelerate th e robot du rin g th e start of th e secon d (h orizon tal) motion segmen t. Du rin g th e secon d motion segmen t, all th e join ts of th e robot are moved from th eir depart position s to th eir approach position s. Th u s, in gen eral, th is parameter con trols th e torqu e applied to accelerate all th e axes du rin g th e major segmen t of th e motion . However, in man y cases, th e secon d motion segmen t is primarily a h orizon tal sweepin g motion . Th u s, typically, th is parameter con trols th e maximu m torqu e applied to accelerate join ts 1 an d 2 du rin g th e pick-an d-place motion . Th e valu e of th is parameter mu st be in th e ran ge 3 0 .0 to 1 0 0 .0 , wh ere 1 0 0 .0 in dicates th at all th e available torqu e sh ou ld be applied. h oriz_ decel_ tqe Real-valu ed expression th at specifies th e percen tage of maximu m torqu e th at sh ou ld be u tilized to decelerate th e robot du rin g th e en d of th e secon d (h orizon tal) motion segmen t. Th is parameter is th e deceleration cou n terpart of th e h oriz_ accel_ tqe parameter. Th e valu e of th is parameter mu st be in th e ran ge 3 0 .0 to 1 0 0 .0 , wh ere 1 0 0 .0 in dicates th at all th e available torqu e sh ou ld be applied. appro_ tqe Option al real-valu ed expression th at specifies th e percen tage of maximu m torqu e th at sh ou ld be u tilized to decelerate join t 3 du rin g th e motion from th e approach position to th e fin al destin ation . Th is valu e mu st be specified if appro_ clr is n on zero. However, th is parameter is ign ored if appro_ clr is zero. If th is parameter is specified, its valu e mu st be in th e ran ge 3 0 .0 to 1 0 0 .0 , wh ere 1 0 0 .0 in dicates th at all th e available torqu e sh ou ld be applied. model Real-valu ed expression (in terpreted as an in teger) th at specifies wh ich set of dyn amic coefficien ts sh ou ld be u sed in th e dyn amic model to predict th e performan ce of th e robot du r- V+ Lan gu age Referen ce Gu ide Page 5 4 6 MOVE F program in stru ction in g th e pick-an d-place motion . Th e dyn amic model is evalu ated to determin e th e fastest speed at wh ich th e robot can be moved to th e destin ation with ou t violatin g th e specified torqu e limits. As with most mech an ical systems, th e valu es of th e dyn amic coefficien ts are a fu n ction of th e robot toolin g an d payload. Th erefore, a differen t set of coefficien t valu es mu st be specified each time th e toolin g or payload ch an ges. Up to six sets of dyn amic coefficien ts can be stored per robot. Th u s, th e valu e of model can ran ge from 1 to 6 . Details Th e MOVE F an d MOVE SF in stru ction s in itiate th e execu tion of a th ree-segmen t pick-an dplace motion , an d au tomatically compu te th e fastest speed, acceleration , an d deceleration rates for each motion segmen t. Th e th ree-segmen t motion is rou gh ly equ ivalen t to execu tin g a DE PART motion , followed by an APPRO motion , followed by a fin al MOVE to th e destin ation . For simplicity, th e depart motion an d th e move from th e approach poin t to th e fin al destin ation affect on ly th e position of th e lin ear Z axis of th e SCARA robot. However, th e secon d segmen t, wh ich moves from th e depart position to th e approach position , is a gen eral join t-in terpolated (for MOVE F) or straigh t-lin e motion (for MOVE SF). Th u s th at segmen t can affect all th e axes of th e robot. In order to au tomatically compu te th e fastest speed, acceleration , an d deceleration rates at wh ich to move th e robot, th ese in stru ction s an alyze a dyn amic model of th e robot th at is bu ilt in to th e V+ system. Th e model allows th e system to predict th e motor torqu es requ ired to move th e robot an d to select th e motion times th at drive th e robot in th e sh ortest amou n t of time with ou t violatin g th e maximu m torqu e specification s. For application s th at are sen sitive to speed, th is allows application programs to be written th at operate th e robot at n ear optimu m cycle times with ou t th e n eed of special, man u al, speed tu n in g. Alth ou gh th e dyn amic model of th e robot is fixed by th e design of th e robot, th e coefficien ts for th e model depen d on th e robot, its toolin g, an d its payload. In order to simplify th e determin ation of th e coefficien t valu es, Adept provides a u tility program (SFUTIL) to au tomatically compu te th e coefficien t valu es. Th e u tility program does th is by movin g th e robot with in a small section of th e workspace an d an alyzin g th e resu ltin g dyn amic respon se. Th u s, th e SFUTIL program mu st be execu ted prior to u sin g th e MOVE F an d MOVE SF in stru ction s, an d it mu st be ru n on ce for each set of coefficien ts th at is requ ired. Sin ce th e motion times are compu ted au tomatically by th ese in stru ction s, th e settin gs of th e ACCE L an d DURATION in stru ction s are ign ored du rin g th e pick-an d-place motion . However, as a con ven ien ce du rin g system setu p, th e SPE E D mon itor comman d an d th e SPE E D program in stru ction can be u sed to scale down th e motion speeds. If th e combin ation of th e mon itor SPE E D an d th e program SPE E D is 1 0 0 .0 or greater, th e MOVE F an d MOVE SF in stru ction s drive th e robot to th e maximu m allowable torqu e levels (th at is, as specified by th e V+ Lan gu age Referen ce Gu ide Page 5 4 7 MOVE F program in stru ction in stru ction parameters). However, if th e combin ed speed is below 1 0 0 .0 , th e du ration of each of th e motion segmen ts is proportion ally in creased. Wh ile debu ggin g an application , th is allows you to see th e exact motion th at is performed, bu t at a redu ced speed. Note th at u n like oth er mu ltiple-segmen t path s gen erated by V+, redu cin g th e valu e set by th e SPE E D program in stru ction does n ot cau se th e path gen erated by MOVE F or MOVE SF in stru ction s to be differen t from th at followed at fu ll speed. E xample Th e in stru ction below gen erates a th ree-part motion to th e destin ation pick. Th e robot begin s by retractin g th e Z axis 1 0 millimeters, u sin g 9 9 % of th e torqu e available in motor 3 . Upon reach in g th e depart clearan ce h eigh t, th e robot immediately start movin g to an approach position 1 5 millimeters above pick. Du rin g th is secon d segmen t, 1 0 0 % of th e motor torqu es is applied to accelerate th e robot. However, to redu ce th e deceleration impu lse imparted to th e robot, on ly 9 0 % of available torqu e is u sed to stop th e h orizon tal motion . Fin ally, after th e approach clearan ce position is ach ieved, th e Z axis is decelerated u sin g 9 8 % of available torqu e to come to rest at th e fin al destin ation . To compu te th e motion speeds, th e system u tilizes th e dyn amic coefficien ts th at were stored in to model set n u mber 1 by th e SFUTIL u tility program. MOVEF pick, 10, 15, 99, 100, 90, 98, 1 NOTE: Th e torqu e valu es 9 9 an d 9 8 are u sed on ly to clarify th e relation sh ip between th e example in stru ction an d th e text above. For an actu al application , th ese torqu e valu es are likely to be set to 1 0 0 . Related Keywords APPRO program in stru ction APPROS program in stru ction DE PART program in stru ction DE PARTS program in stru ction MOVE F program in stru ction MOVE SF program in stru ction MOVE T program in stru ction MOVE ST program in stru ction SE LE CT program in stru ction SE LE CT real-valu ed fu n ction V+ Lan gu age Referen ce Gu ide Page 5 4 8 MOVE F program in stru ction MOVEF program instruction Syntax MOVEF location , depart_ clr, appro_ clr, depart_ tqe, h oriz_ accel_ tqe, h oriz_ decel_ tqe, appro_ tqe, model MOVES F location , depart_ clr, appro_ clr, depart_ tqe, h oriz_ accel_ tqe, h oriz_ decel_ tqe, appro_ tqe, model Function In itiate a th ree-segmen t pick-an d-place robot motion to th e specified destin ation , movin g th e robot at th e fastest allowable speed. Usage Considerations Th ese in stru ction s are available for certain Adept SCARA robots th at su pport optimized moves. l l MOVE F cau ses a join t-in terpolated motion du rin g th e h orizon tal motion segmen t. MOVE SF cau ses a straigh t-lin e motion du rin g th e h orizon tal motion segmen t. For th e en tire motion , n o ch an ges in con figu ration are permitted. Un like th e DE PART, DE PARTS, APPRO, an d APPROS in stru ction s, wh ich move th e robot alon g th e tool-Z axis, th e departu re an d approach motion segmen ts in itiated by th ese in stru ction s move on ly join t 3 (th e lin ear Z axis), an d th ose motion s are in depen den t of th e TOOL tran sformation . Before th ese in stru ction s can be execu ted, th e SFUTIL u tility program mu st be u sed to compu te th e coefficien ts for th e dyn amic model of th e robot. Th ese in stru ction s can be execu ted by an y program task, as lon g as th e task h as attach ed a robot. Th e in stru ction s apply to th e robot selected by th e task. If th e V+ system is n ot con figu red to con trol a robot, an attempt to execu te on e of th ese in stru ction s cau ses an error. V+ Lan gu age Referen ce Gu ide Page 5 4 9 MOVE F program in stru ction Parameters location Tran sformation , precision poin t, location fu n ction , or compou n d tran sformation th at specifies th e destin ation to wh ich th e robot is to move. depart_ clr Option al real-valu ed expression th at specifies th e min imu m clearan ce distan ce (in millimeters) th at join t 3 is to be moved relative to its in itial location du rin g th e first segmen t of th e motion . A positive distan ce retracts (lifts u p) join t 3 from th e in itial location . A n egative distan ce exten ds (drops down ) join t 3 from th e in itial location . Th e distan ce zero elimin ates th e first segmen t of th e pick an d place motion . Un like th e DE PART an d DE PARTS in stru ction s, wh ich specify th e fu ll len gth of th e vertical excu rsion , th is parameter specifies th e min imu m desired clearan ce h eigh t before th e h orizon tal motion is in itiated. Based u pon th e dyn amic ch aracteristics of join t 3 an d th e h orizon tal motion , th e V+ system au tomatically compu tes th e total len gth of th e departu re motion . For man y h igh -speed motion s, th e min imu m clearan ce h eigh t sh ou ld be set to a fraction (for example, 1 /6 th ) of th e distan ce th at is n ormally specified as th e depart h eigh t. appro_ clr Option al real-valu ed expression th at specifies th e min imu m clearan ce distan ce (in millimeters) th at join t 3 is to be posed above th e fin al destin ation at th e time th e h orizon tal motion is con clu ded. A positive distan ce in dicates th at join t 3 sh ou ld be posed above th e fin al destin ation . A n egative distan ce places join t 3 below its fin al destin ation . Th e distan ce zero elimin ates th e fin al segmen t of th e pick an d place motion so th at th e robot moves directly to th e destin ation from th e departu re poin t. As with th e depart_ clr parameter, th e approach clearan ce h eigh t specifies th e min imu m clearan ce distan ce, rath er th an th e total len gth of th e vertical excu rsion . depart_ tqe Option al real-valu ed expression th at specifies th e percen tage of maximu m torqu e th at sh ou ld be u tilized to accelerate join t 3 du rin g th e departu re motion . Th is parameter mu st be specified if depart_ clr is n on zero. However, th is parameter is ign ored if depart_ clr is zero. V+ Lan gu age Referen ce Gu ide Page 5 5 0 MOVE F program in stru ction If th is parameter is specified, its valu e mu st be in th e ran ge 3 0 .0 to 1 0 0 .0 , wh ere 1 0 0 .0 in dicates th at all th e available torqu e sh ou ld be applied. h oriz_ accel_ tqe Real-valu ed expression th at specifies th e percen tage of maximu m torqu e th at sh ou ld be u tilized to accelerate th e robot du rin g th e start of th e secon d (h orizon tal) motion segmen t. Du rin g th e secon d motion segmen t, all th e join ts of th e robot are moved from th eir depart position s to th eir approach position s. Th u s, in gen eral, th is parameter con trols th e torqu e applied to accelerate all th e axes du rin g th e major segmen t of th e motion . However, in man y cases, th e secon d motion segmen t is primarily a h orizon tal sweepin g motion . Th u s, typically, th is parameter con trols th e maximu m torqu e applied to accelerate join ts 1 an d 2 du rin g th e pick-an d-place motion . Th e valu e of th is parameter mu st be in th e ran ge 3 0 .0 to 1 0 0 .0 , wh ere 1 0 0 .0 in dicates th at all th e available torqu e sh ou ld be applied. h oriz_ decel_ tqe Real-valu ed expression th at specifies th e percen tage of maximu m torqu e th at sh ou ld be u tilized to decelerate th e robot du rin g th e en d of th e secon d (h orizon tal) motion segmen t. Th is parameter is th e deceleration cou n terpart of th e h oriz_ accel_ tqe parameter. Th e valu e of th is parameter mu st be in th e ran ge 3 0 .0 to 1 0 0 .0 , wh ere 1 0 0 .0 in dicates th at all th e available torqu e sh ou ld be applied. appro_ tqe Option al real-valu ed expression th at specifies th e percen tage of maximu m torqu e th at sh ou ld be u tilized to decelerate join t 3 du rin g th e motion from th e approach position to th e fin al destin ation . Th is valu e mu st be specified if appro_ clr is n on zero. However, th is parameter is ign ored if appro_ clr is zero. If th is parameter is specified, its valu e mu st be in th e ran ge 3 0 .0 to 1 0 0 .0 , wh ere 1 0 0 .0 in dicates th at all th e available torqu e sh ou ld be applied. model Real-valu ed expression (in terpreted as an in teger) th at specifies wh ich set of dyn amic coefficien ts sh ou ld be u sed in th e dyn amic model to predict th e performan ce of th e robot du r- V+ Lan gu age Referen ce Gu ide Page 5 5 1 MOVE F program in stru ction in g th e pick-an d-place motion . Th e dyn amic model is evalu ated to determin e th e fastest speed at wh ich th e robot can be moved to th e destin ation with ou t violatin g th e specified torqu e limits. As with most mech an ical systems, th e valu es of th e dyn amic coefficien ts are a fu n ction of th e robot toolin g an d payload. Th erefore, a differen t set of coefficien t valu es mu st be specified each time th e toolin g or payload ch an ges. Up to six sets of dyn amic coefficien ts can be stored per robot. Th u s, th e valu e of model can ran ge from 1 to 6 . Details Th e MOVE F an d MOVE SF in stru ction s in itiate th e execu tion of a th ree-segmen t pick-an dplace motion , an d au tomatically compu te th e fastest speed, acceleration , an d deceleration rates for each motion segmen t. Th e th ree-segmen t motion is rou gh ly equ ivalen t to execu tin g a DE PART motion , followed by an APPRO motion , followed by a fin al MOVE to th e destin ation . For simplicity, th e depart motion an d th e move from th e approach poin t to th e fin al destin ation affect on ly th e position of th e lin ear Z axis of th e SCARA robot. However, th e secon d segmen t, wh ich moves from th e depart position to th e approach position , is a gen eral join t-in terpolated (for MOVE F) or straigh t-lin e motion (for MOVE SF). Th u s th at segmen t can affect all th e axes of th e robot. In order to au tomatically compu te th e fastest speed, acceleration , an d deceleration rates at wh ich to move th e robot, th ese in stru ction s an alyze a dyn amic model of th e robot th at is bu ilt in to th e V+ system. Th e model allows th e system to predict th e motor torqu es requ ired to move th e robot an d to select th e motion times th at drive th e robot in th e sh ortest amou n t of time with ou t violatin g th e maximu m torqu e specification s. For application s th at are sen sitive to speed, th is allows application programs to be written th at operate th e robot at n ear optimu m cycle times with ou t th e n eed of special, man u al, speed tu n in g. Alth ou gh th e dyn amic model of th e robot is fixed by th e design of th e robot, th e coefficien ts for th e model depen d on th e robot, its toolin g, an d its payload. In order to simplify th e determin ation of th e coefficien t valu es, Adept provides a u tility program (SFUTIL) to au tomatically compu te th e coefficien t valu es. Th e u tility program does th is by movin g th e robot with in a small section of th e workspace an d an alyzin g th e resu ltin g dyn amic respon se. Th u s, th e SFUTIL program mu st be execu ted prior to u sin g th e MOVE F an d MOVE SF in stru ction s, an d it mu st be ru n on ce for each set of coefficien ts th at is requ ired. Sin ce th e motion times are compu ted au tomatically by th ese in stru ction s, th e settin gs of th e ACCE L an d DURATION in stru ction s are ign ored du rin g th e pick-an d-place motion . However, as a con ven ien ce du rin g system setu p, th e SPE E D mon itor comman d an d th e SPE E D program in stru ction can be u sed to scale down th e motion speeds. If th e combin ation of th e mon itor SPE E D an d th e program SPE E D is 1 0 0 .0 or greater, th e MOVE F an d MOVE SF in stru ction s drive th e robot to th e maximu m allowable torqu e levels (th at is, as specified by th e V+ Lan gu age Referen ce Gu ide Page 5 5 2 MOVE F program in stru ction in stru ction parameters). However, if th e combin ed speed is below 1 0 0 .0 , th e du ration of each of th e motion segmen ts is proportion ally in creased. Wh ile debu ggin g an application , th is allows you to see th e exact motion th at is performed, bu t at a redu ced speed. Note th at u n like oth er mu ltiple-segmen t path s gen erated by V+, redu cin g th e valu e set by th e SPE E D program in stru ction does n ot cau se th e path gen erated by MOVE F or MOVE SF in stru ction s to be differen t from th at followed at fu ll speed. E xample Th e in stru ction below gen erates a th ree-part motion to th e destin ation pick. Th e robot begin s by retractin g th e Z axis 1 0 millimeters, u sin g 9 9 % of th e torqu e available in motor 3 . Upon reach in g th e depart clearan ce h eigh t, th e robot immediately start movin g to an approach position 1 5 millimeters above pick. Du rin g th is secon d segmen t, 1 0 0 % of th e motor torqu es is applied to accelerate th e robot. However, to redu ce th e deceleration impu lse imparted to th e robot, on ly 9 0 % of available torqu e is u sed to stop th e h orizon tal motion . Fin ally, after th e approach clearan ce position is ach ieved, th e Z axis is decelerated u sin g 9 8 % of available torqu e to come to rest at th e fin al destin ation . To compu te th e motion speeds, th e system u tilizes th e dyn amic coefficien ts th at were stored in to model set n u mber 1 by th e SFUTIL u tility program. MOVEF pick, 10, 15, 99, 100, 90, 98, 1 NOTE: Th e torqu e valu es 9 9 an d 9 8 are u sed on ly to clarify th e relation sh ip between th e example in stru ction an d th e text above. For an actu al application , th ese torqu e valu es are likely to be set to 1 0 0 . Related Keywords APPRO program in stru ction APPROS program in stru ction DE PART program in stru ction DE PARTS program in stru ction MOVE F program in stru ction MOVE SF program in stru ction MOVE T program in stru ction MOVE ST program in stru ction SE LE CT program in stru ction SE LE CT real-valu ed fu n ction V+ Lan gu age Referen ce Gu ide Page 5 5 3 MOVE T program in stru ction MOVET program instruction Syntax MOVET location , h an d_ open in g MOVES T location , h an d_ open in g Function In itiate a robot motion to th e position an d orien tation described by th e given location an d simu ltan eou sly operate th e h an d. Usage Considerations Th ese in stru ction s are u su ally en tered in to programs with th e V+ editor teach modes (see E DIT mon itor comman d). l l MOVE T cau ses a join t-in terpolated motion . MOVE ST cau ses a straigh t-lin e motion , du rin g wh ich n o ch an ges in con figu ration are permitted. Th ese in stru ction s can be execu ted by an y program task as lon g as th e task h as attach ed a robot. Th e in stru ction s apply to th e robot selected by th e task. If th e V+ system is n ot con figu red to con trol a robot, execu tin g th ese in stru ction s cau ses an error. Parameters location Tran sformation , precision poin t, location fu n ction , or compou n d tran sformation th at specifies th e destin ation to wh ich th e robot is to move. h an d_ open in g Real-valu ed expression th at specifies wh eth er th e h an d is to be closed (valu e zero) or open ed (valu e n on zero). Details Th ese in stru ction s are similar to MOVE an d MOVE S, respectively. On e differen ce in th ese in stru ction s is th at th e h an d open in g is con trolled du rin g th e robot motion . Th e pn eu matic-con trol system receives an open sign al if h an d open in g is greater th an zero. Oth erwise, it receives a close sign al. Th e h an d open in g is ch an ged to h an d open in g millimeters du rin g th e motion if a servo-con trolled h an d is u sed. An oth er differen ce in th ese in stru ction s is th at th ey can be en tered in to programs with th e editor teach modes. Wh ile in T teach mode, every time th e RE C/DONE bu tton on th e man u al V+ Lan gu age Referen ce Gu ide Page 5 5 4 MOVE T program in stru ction con trol is pressed a MOVE T in stru ction is en tered in th e program bein g edited. Th e specified location variable is set equ al to th e location of th e robot at th at in stan t an d th e h an d open in g is recorded similarly. MOVE ST in stru ction s can be en tered in th e same way u sin g th e editor TS teach mode. E xamples Move by join t-in terpolated motion to th e location described by th e tran sformation part1 , open in g th e h an d du rin g th e motion : MOVET part1, 1 Move alon g a straigh t-lin e path to th e location described by th e tran sformation part[7 ], closin g th e h an d du rin g th e motion : MOVEST part[7], 0 Related Keywords APPRO program in stru ction APPROS program in stru ction DE PART program in stru ction DE PARTS program in stru ction MOVE F program in stru ction MOVE SF program in stru ction MOVE T program in stru ction MOVE ST program in stru ction SE LE CT program in stru ction SE LE CT real-valu ed fu n ction V+ Lan gu age Referen ce Gu ide Page 5 5 5 MOVE T program in stru ction MOVET program instruction Syntax MOVET location , h an d_ open in g MOVES T location , h an d_ open in g Function In itiate a robot motion to th e position an d orien tation described by th e given location an d simu ltan eou sly operate th e h an d. Usage Considerations Th ese in stru ction s are u su ally en tered in to programs with th e V+ editor teach modes (see E DIT mon itor comman d). l l MOVE T cau ses a join t-in terpolated motion . MOVE ST cau ses a straigh t-lin e motion , du rin g wh ich n o ch an ges in con figu ration are permitted. Th ese in stru ction s can be execu ted by an y program task as lon g as th e task h as attach ed a robot. Th e in stru ction s apply to th e robot selected by th e task. If th e V+ system is n ot con figu red to con trol a robot, execu tin g th ese in stru ction s cau ses an error. Parameters location Tran sformation , precision poin t, location fu n ction , or compou n d tran sformation th at specifies th e destin ation to wh ich th e robot is to move. h an d_ open in g Real-valu ed expression th at specifies wh eth er th e h an d is to be closed (valu e zero) or open ed (valu e n on zero). Details Th ese in stru ction s are similar to MOVE an d MOVE S, respectively. On e differen ce in th ese in stru ction s is th at th e h an d open in g is con trolled du rin g th e robot motion . Th e pn eu matic-con trol system receives an open sign al if h an d open in g is greater th an zero. Oth erwise, it receives a close sign al. Th e h an d open in g is ch an ged to h an d open in g millimeters du rin g th e motion if a servo-con trolled h an d is u sed. An oth er differen ce in th ese in stru ction s is th at th ey can be en tered in to programs with th e editor teach modes. Wh ile in T teach mode, every time th e RE C/DONE bu tton on th e man u al V+ Lan gu age Referen ce Gu ide Page 5 5 6 MOVE T program in stru ction con trol is pressed a MOVE T in stru ction is en tered in th e program bein g edited. Th e specified location variable is set equ al to th e location of th e robot at th at in stan t an d th e h an d open in g is recorded similarly. MOVE ST in stru ction s can be en tered in th e same way u sin g th e editor TS teach mode. E xamples Move by join t-in terpolated motion to th e location described by th e tran sformation part1 , open in g th e h an d du rin g th e motion : MOVET part1, 1 Move alon g a straigh t-lin e path to th e location described by th e tran sformation part[7 ], closin g th e h an d du rin g th e motion : MOVEST part[7], 0 Related Keywords APPRO program in stru ction APPROS program in stru ction DE PART program in stru ction DE PARTS program in stru ction MOVE F program in stru ction MOVE SF program in stru ction MOVE T program in stru ction MOVE ST program in stru ction SE LE CT program in stru ction SE LE CT real-valu ed fu n ction V+ Lan gu age Referen ce Gu ide Page 5 5 7 MULTIPLE program in stru ction MULTIPLE program instruction Syntax MULTI PLE ALWAYS Function Allow fu ll rotation s of th e robot wrist join ts. Usage Considerations On ly th e n ext robot motion is affected if th e ALWAYS parameter is n ot specified. Th is is th e defau lt state of th e V+ system. MULTIPLE ALWAYS is assu med wh en ever program execu tion is in itiated an d wh en a n ew execu tion cycle begin s. Th e MULTIPLE in stru ction can be execu ted by an y program task as lon g as th e robot selected by th e task is n ot attach ed by an y oth er task. Th e in stru ction applies to th e robot selected by th e task. If th e V+ system is n ot con figu red to con trol a robot, execu tin g th e MULTIPLE in stru ction cau ses an error. Parameter ALWAYS Option al qu alifier th at establish es MULTIPLE as th e defau lt con dition . Th at is, if ALWAYS is specified, MULTIPLE will remain in effect con tin u ou sly u n til disabled by a SINGLE in stru ction . If ALWAYS is n ot specified, th e MULTIPLE in stru ction applies on ly to th e n ext robot motion . Details Wh ile MULTIPLE is in effect, fu ll rotation s of th e wrist join ts are u sed, as requ ired, du rin g motion plan n in g an d execu tion . Th e MULTIPLE settin g is ign ored if NOOVE RLAP is in effect. Related Keywords CONFIG real-valu ed fu n ction NOOVE RLAP program in stru ction OVE RLAP program in stru ction SE LE CT program in stru ction SE LE CT real-valu ed fu n ction SINGLE program in stru ction V+ Lan gu age Referen ce Gu ide Page 5 5 8 NE TWORK real-valu ed fu n ction NETWOR K real-valued function Syntax NETW ORK ( compon en t, code) Function Retu rn n etwork statu s an d IP address in formation Usage Considerations For th e MV-series con trollers, th e AWC modu le in corporates a 1 0 BASE -T E th ern et in terface, elimin atin g th e n eed for an AdeptNet board. Th is h ardware ch an ge does n ot affect th e software con figu ration . V+ E th ern et su pport h as n ot ch an ged. Th e Adept SmartCon troller in clu des a 1 0 /1 0 0 BASE -T E th ern et in terface. Th e AdeptTCP/IP an d AdeptNFS licen ses are su pported by AWC-based con trollers an d SmartCon troller systems. Th e NFS licen se gives you th e capability of sh arin g files over a n etwork. For more in formation , see th e AdeptNet User's Gu ide. Parameters compon en t Real-valu ed expression th at iden tifies th e compon en t of th e AdeptNet system th at is of in terest. 1 = TCP 2 = NF S 3 = FTP code Real-valu ed expression th at fu rth er iden tifies th e in formation desired. Th is valu e is ign ored for NFS an d FTP. For TCP: 0 = Retu rn statu s valu e as described later (defau lt). 1 = Retu rn AD1 * 2 5 6 + AD2 2 = Retu rn AD3 * 2 5 6 + AD4 wh ere ADn is th e n th byte of th e IP address Details Th is fu n ction retu rn s on e of th e followin g valu es if statu s is requ ested (th at is, if th e code argu men t is omitted or set to 0 ): Valu e 0 Mean in g Hardware n ot presen t, or licen se n ot in stalled V+ Lan gu age Referen ce Gu ide Page 5 5 9 NE TWORK real-valu ed fu n ction -1 Hardware presen t an d licen se detected 1 Driver is ru n n in g V+ Lan gu age Referen ce Gu ide Page 5 6 0 NE XT program in stru ction NEXT program instruction Syntax NEXT cou n t Function Bran ch to th e E ND statemen t of th e n th n ested loop, perform th e loop test, an d loop if appropriate. Usage Considerations Th is in stru ction can be u sed with th e FOR, WHILE , an d DO con trol stru ctu res. Parameter cou n t Option al in teger specifyin g th e n u mber of n ested stru ctu res to bran ch to th e E ND of (expression s an d variables are n ot acceptable). Details Wh en a NE XT in stru ction is processed with cou n t = 1 , execu tion con tin u es at th e E ND of th e con trol stru ctu re. If cou n t > 1 , execu tion con tin u es at th e E ND of cou n t n u mber of n ested con trol stru ctu res. E xample If error = 1 , bran ch to th e E ND of th e in n ermost con trol stru ctu re. If error = 2 , bran ch to th e E ND of th e ou termost con trol stru ctu re: 45 46 47 48 49 50 51 52 53 54 55 56 57 FOR i = 1 to 20 FOR j = 1 to 10 FOR k = 10 to 50 IF error == 1 THEN NEXT END IF error == 2 THEN NEXT 3 END END END END ;branch to step 54 ;branch to step 56 Related Keywords DO program in stru ction E XIT program in stru ction V+ Lan gu age Referen ce Gu ide Page 5 6 1 NE XT program in stru ction FOR program in stru ction WHILE program in stru ction V+ Lan gu age Referen ce Gu ide Page 5 6 2 NOFLIP program in stru ction NOFLIP program instruction Syntax NOFLI P Function Requ est a ch an ge in th e robot con figu ration du rin g th e n ext motion so th at th e pitch an gle of th e robot wrist h as a positive valu e. Usage Considerations Con figu ration ch an ges can n ot be made du rin g straigh t-lin e motion s. If th e selected robot does n ot su pport a n o-flip con figu ration , th is in stru ction is ign ored by th e robot. Th e NOFLIP in stru ction can be execu ted by an y program task as lon g as th e robot selected by th e task is n ot attach ed by an y oth er task. Th e in stru ction applies to th e robot selected by th e task. If th e V+ system is n ot con figu red to con trol a robot, execu tin g th e NOFLIP in stru ction cau ses an error. For more details, see th e description of th e FLIP program in stru ction . Related Keywords CONFIG real-valu ed fu n ction FLIP program in stru ction SE LE CT program in stru ction SE LE CT real-valu ed fu n ction V+ Lan gu age Referen ce Gu ide Page 5 6 3 NONULL program in stru ction NONULL program instruction Syntax NONULL ALWAYS Function In stru ct th e V+ system n ot to wait for position errors to be n u lled at th e en d of con tin u ou spath motion s. Usage Considerations On ly th e n ext robot motion is affected if th e ALWAYS parameter is n ot specified. NULL ALWAYS is assu med wh en ever program execu tion is in itiated an d wh en a n ew execu tion cycle begin s. Th e NONULL in stru ction can be execu ted by an y program task as lon g as th e robot selected by th e task is n ot attach ed by an y oth er task. Th e in stru ction applies to th e robot selected by th e task. If th e V+ system is n ot con figu red to con trol a robot, execu tin g th e NONULL in stru ction cau ses an error. Parameter ALWAYS Option al qu alifier th at establish es NONULL as th e defau lt con dition . Th at is, wh en ALWAYS is in clu ded in a NONULL in stru ction , NONULL remain s in effect con tin u ou sly u n til disabled by a NULL in stru ction . If ALWAYS is n ot specified, th e NONULL in stru ction applies on ly to th e n ext robot motion . Details Wh en NONULL is in effect an d a BRE AK in th e robot motion occu rs, V+ does n ot wait for th e servos to sign al th at all movin g join ts h ave reach ed th eir specified position s before it begin s th e n ext motion . Th at is, at th e en d of th e allotted time, V+ assu mes th at th e join ts h ave all reach ed th eir fin al position s an d starts comman din g th e n ext motion . Like COARSE mode, th is mode allows faster motion if h igh fin al-position accu racy is n ot requ ired. However, sin ce n o position -error ch eckin g is don e, large position errors can occu r. Related Keywords COARSE program in stru ction CONFIG real-valu ed fu n ction V+ Lan gu age Referen ce Gu ide Page 5 6 4 NONULL program in stru ction DE LAY.IN.TOL program in stru ction FINE program in stru ction NULL program in stru ction SE LE CT program in stru ction SE LE CT real-valu ed fu n ction V+ Lan gu age Referen ce Gu ide Page 5 6 5 NOOVE RLAP program in stru ction NOOVER LAP program instruction Syntax NOOVERLAP ALWAYS Function Gen erate a program error if a su bsequ en t motion is plan n ed th at cau ses a selected mu ltitu rn axis to move more th an ±1 8 0 degrees to avoid a limit stop. Usage Considerations NOOVE RLAP applies to th e operation of th e followin g robots/join ts: l For Adept Viper an d PUMA robots: join ts 1 , 4 , an d th e fin al join t l For all SCARA robots: join t 4 l For Adept Qu attro robots: tool rotation OVE RLAP ALWAYS is assu med wh en ever program execu tion is in itiated an d wh en a n ew execu tion cycle begin s. Th e NOOVE RLAP in stru ction can be execu ted by an y program task as lon g as th e robot selected by th e task is n ot attach ed by an y oth er task. Th e in stru ction applies to th e robot selected by th e task. If th e V+ system is n ot con figu red to con trol a robot, execu tin g th e NOOVE RLAP in stru ction cau ses an error. Parameter ALWAYS Option al qu alifier th at establish es NOOVE RLAP as th e defau lt con dition . Th at is, if ALWAYS is specified, NOOVE RLAP remain s in effect con tin u ou sly u n til disabled by an OVE RLAP in stru ction . If ALWAYS is n ot specified, th e NOOVE RLAP in stru ction applies on ly to th e n ext robot motion . Details Wh en NOOVE RLAP is set, an d th e tran sformation destin ation of a join t-in terpolated or straigh t-lin e motion requ ires th at a mu ltiple-tu rn axis rotate more th an ±1 8 0 degrees to avoid a limit stop, a program error will occu r (an d th e motion will n ot be performed). If th e destin ation is specified as a precision poin t, th is test is n ot performed. In gen eral, given a tran sformation destin ation , a mu ltiple-tu rn axis n ormally attempts to move to a n ew position by movin g in th e direction th at requ ires less th an 1 8 0 degrees of V+ Lan gu age Referen ce Gu ide Page 5 6 6 NOOVE RLAP program in stru ction motion . Th e on ly con dition s th at force an axis to make a larger ch an ge are if SINGLE is specified, or if a software limit stop wou ld be violated. Wh en NOOVE RLAP is set, th e settin g of SINGLE or MULTIPLE mode is ign ored. As with oth er u ser program errors, th e error con dition gen erated as a resu lt of th e NOOVE RLAP test can be trapped by a stan dard RE ACTE su brou tin e if desired. Related Keywords MULTIPLE program in stru ction OVE RLAP program in stru ction SE LE CT program in stru ction SE LE CT real-valu ed fu n ction SINGLE program in stru ction V+ Lan gu age Referen ce Gu ide Page 5 6 7 NORMAL tran sformation fu n ction NOR MAL transformation function Syntax NORMAL ( tran sformation _ valu e) Function Correct a tran sformation for an y math ematical rou n d-off errors. Usage Considerations For most robot programs, tran sformation n ormalizin g n ever h as to be performed. Parameter tran sformation _ valu e Tran sformation , tran sformation valu ed fu n ction , or compou n d tran sformation wh ose valu e is to be n ormalized. Details Use th is fu n ction after a len gth y series of compu tation s th at modifies a tran sformation valu e. For in stan ce, a procedu ral motion th at in cremen tally ch an ges th e orien tation of a tran sformation sh ou ld occasion ally n ormalize th e resu ltan t valu e. With in a tran sformation , th e orien tation of th e robot is represen ted by th ree perpen dicu lar u n it vectors. Becau se of th e small in accu racies th at occu r in compu ter compu tation s, after bein g in cremen tally modified man y times, th ese vectors can become n on perpen dicu lar or n ot of u n it len gth . Th e NORMAL fu n ction retu rn s a tran sformation valu e th at is essen tially th e same as th e in pu t argu men t bu t h as th e orien tation portion of th e valu e corrected for an y small bu ildu p of compu tation al errors th at may h ave occu rred. V+ Lan gu age Referen ce Gu ide Page 5 6 8 NOT operator NOT operator Syntax ... NOT valu e ... Function Perform logical n egation of a valu e. Usage Considerations Th e word " n ot" can n ot be u sed as a program n ame or variable n ame. Details Th e NOT operator operates on a sin gle valu e, con vertin g it from logically tru e to false, an d vice versa. If th e sin gle valu e is zero, a -1 .0 (TRUE ) is retu rn ed. Oth erwise, a 0 .0 (FALSE ) valu e is retu rn ed. Refer to th e V+ Lan gu age User's Gu ide for th e order in wh ich operators are evalu ated with in expression s. E xamples IF NOT initialized THEN CALL appl.setup() initialized = TRUE END ;If the variable "initialized" has a ;FALSE value, the instructions in the ;IF structure will be executed. V+ Lan gu age Referen ce Gu ide Page 5 6 9 NOT.CALIBRATE D system parameter NOT.CALIBR ATED system parameter Syntax ... NOT.CALI BRATED Function In dicate (or assert) th e calibration statu s of th e robots con n ected to th e system. Usage Considerations Th e cu rren t valu e of th e NOT.CALIBRATE D parameter can be determin ed with th e PARAME TE R mon itor comman d or real-valu ed fu n ction . You can modify th e valu e of th is parameter at an y time; refer to th e n ext section for details. Th e parameter n ame can be abbreviated. Details Th e valu e of th is parameter, wh ich can ran ge from -1 to 3 2 7 6 7 , sh ou ld be in terpreted as a bit mask. Bits 1 th rou gh 1 5 correspon d to robots 1 th rou gh 1 5 , respectively. For example, th e followin g valu es h ave th e followin g in terpretation s: Valu e of parameter I n terpretation 0 All robots are calibrated. 1 Robot 1 is n ot calibrated. 3 Robots 1 an d 2 are n ot calibrated. 7 Robots 1 th rou gh 3 are n ot calibrated. On power-u p, th is parameter is set to in dicate th at all in stalled robots are n ot calibrated. If a robot is n ot con n ected or n ot defin ed, its NOT.CALIBRATE D bit is always off. Th e CALIBRATE comman d an d in stru ction attempt to calibrate an y en abled ROBOT th at h as its NOT.CALIBRATE D bit set. Wh en th e calibration operation completes, th e NOT.CALIBRATE d bits are u pdated as appropriate. For example, con sider a system th at h as on ly on e robot in stalled. If th e CALIBRATE comman d is issu ed, an d it su cceeds, NOT.CALIBRATE D is set to 0 . If th ree robots are con n ected, an d th e CALIBRATE comman d su cceeds in calibratin g robots 1 an d 2 , bu t n ot robot 3 , NOT.CALIBRATE D is set to 4 (bin ary 1 0 0 -robots 1 an d 2 calibrated, 3 n ot calibrated). V+ Lan gu age Referen ce Gu ide Page 5 7 0 NOT.CALIBRATE D system parameter Th e pu rpose of th is parameter is to allow on e of th e bits to be set to force th e correspon din g robot to be calibrated th e n ext time a CALIBRATE comman d or in stru ction is execu ted. Th is parameter can also be u sed to determin e th e calibration statu s of th e robot(s). Th e parameter valu e can be ch an ged at an y time. Th e followin g ru les describe h ow a n ew asserted valu e is treated: l l If th e n ew valu e asserts th at a robot is n ot calibrated, th e V+ system beh aves as if th e robot is n ot calibrated wh eth er or n ot th e servo software believes th at th e robot is n ot calibrated. If th e n ew valu e asserts th at a robot is calibrated, th e servo software is ch ecked an d V+ tracks th e calibrated/n ot calibrated state in dicated by th e servo software for th at robot. NOTE:It is u su ally n ot mean in gfu l to u se PARAME TE R NOT.CALIBRATE D to clear a bit. E xamples Mark all in stalled robots as u n calibrated: PARAMETER NOT.CALIBRATED = -1 Mark on ly robots 1 an d 2 as u n calibrated: PARAMETER NOT.CALIBRATED = 3 Related Keywords CALIBRATE mon itor comman d CALIBRATE program in stru ction PARAME TE R mon itor comman d PARAME TE R program in stru ction PARAME TE R real-valu ed fu n ction ROBOT system switch V+ Lan gu age Referen ce Gu ide Page 5 7 1 NULL program in stru ction NULL program instruction Syntax NULL ALWAYS Function In stru ct th e V+ system to wait for position errors to be n u lled at th e en d of con tin u ou s path motion s. Usage Considerations On ly th e n ext robot motion is affected if th e ALWAYS parameter is n ot specified. Th is is th e defau lt state of th e V+ system. NULL ALWAYS is assu med wh en ever program execu tion is in itiated an d wh en a n ew execu tion cycle begin s. Th e NULL in stru ction can be execu ted by an y program task as lon g as th e robot selected by th e task is n ot attach ed by an y oth er task. Th e in stru ction applies to th e robot selected by th e task. If th e V+ system is n ot con figu red to con trol a robot, execu tin g th e NULL in stru ction cau ses an error. Th e word " n u ll" can n ot be u sed as a program n ame or variable n ame. Parameter ALWAYS Option al qu alifier th at establish es NULL as th e defau lt con dition . Th at is, if ALWAYS is specified, NULL remain s in effect con tin u ou sly u n til disabled by a NONULL in stru ction . If ALWAYS is n ot specified, th e NULL in stru ction applies on ly to th e n ext robot motion . Details Wh en NULL is in effect an d a BRE AK in th e robot motion occu rs, V+ waits for th e servos to sign al th at all movin g join ts h ave reach ed th eir specified position s before it begin s th e n ext motion . Th e accu racy to wh ich th e electron ics verify th at all join ts h ave reach ed th eir destin ation position s is determin ed by th e COARSE an d FINE program in stru ction s. Related Keywords COARSE program in stru ction DE LAY.IN.TOL program in stru ction FINE program in stru ction NONULL program in stru ction V+ Lan gu age Referen ce Gu ide Page 5 7 2 NULL program in stru ction NULL program in stru ction SE LE CT program in stru ction SE LE CT real-valu ed fu n ction V+ Lan gu age Referen ce Gu ide Page 5 7 3 NULL tran sformation fu n ction NULL transformation function Syntax NULL Function Retu rn a n u ll tran sformation valu e-on e with all zero compon en ts. Usage Considerations Th e word " n u ll" can n ot be u sed as a program n ame or variable n ame. Details A n u ll tran sformation correspon ds to a n u ll vector (X = Y = Z = 0 ) an d n o rotation (yaw = pitch = roll = 0 ). Su ch a tran sformation is u sefu l, for example, with a SHIFT fu n ction to create a tran sformation represen tin g a tran slation with n o rotation . E xample Defin e a n ew tran sformation (n ew.loc) to be th e resu lt of sh iftin g an existin g tran sformation (old.loc) in th e World coordin ate direction s. new.loc = SHIFT(NULL BY x.shift,y.shift,z.shift):old.loc Determin e th e len gth of th e vector described by th e tran sformation test.loc. dist = DISTANCE(NULL, test.loc) Related Keywords CONFIG real-valu ed fu n ction NULL program in stru ction V+ Lan gu age Referen ce Gu ide Page 5 7 4 OFF real-valu ed fu n ction OFF real-valued function Syntax OFF Function Retu rn th e valu e u sed by V+ to represen t a logical false resu lt. Usage Considerations Th e word " off" can n ot be u sed as a program n ame or variable n ame. Details Th is n amed con stan t is u sefu l for situ ation s wh ere on an d off con dition s n eed to be specified. Th e valu e retu rn ed is 0 . Th is fu n ction is equ ivalen t to th e FALSE fu n ction . Related Keywords FALSE real-valu ed fu n ction ON real-valu ed fu n ction V+ Lan gu age Referen ce Gu ide Page 5 7 5 ON real-valu ed fu n ction ON real-valued function Syntax ON Function Retu rn th e valu e u sed by V+ to represen t a logical tru e resu lt. Usage Considerations Th e word " on " can n ot be u sed as a program n ame or variable n ame. Details Th is n amed con stan t is u sefu l for situ ation s wh ere on an d off con dition s n eed to be specified. Th e valu e retu rn ed is -1 . Th is fu n ction is equ ivalen t to th e TRUE fu n ction . Related Keywords OFF real-valu ed fu n ction TRUE real-valu ed fu n ction V+ Lan gu age Referen ce Gu ide Page 5 7 6 OPE N program in stru ction OPEN program instruction Syntax OPEN OPENI Function Open th e robot gripper. Usage Considerations OPE N cau ses th e h an d to open du rin g th e n ext robot motion . OPE NI cau ses a BRE AK in th e cu rren t con tin u ou s-path motion an d cau ses th e h an d to open immediately after th e cu rren t motion completes. Th e OPE N in stru ction can be execu ted by an y program task as lon g as th e robot selected by th e task is n ot attach ed by an y oth er task. Th e in stru ction applies to th e robot selected by th e task. Th e OPE NI in stru ction can be execu ted by an y program task as lon g as th e task h as attach ed a robot. Th e in stru ction applies to th e robot selected by th e task. If th e V+ system is n ot con figu red to con trol a robot, execu tin g th ese in stru ction s cau ses an error. Details Th ese in stru ction s cau se th e con trol valves for th e pn eu matic h an d to receive a sign al to open . If th e OPE N in stru ction is u sed, th e sign al is sen t wh en th e n ext robot motion begin s. NOTE: You can u se th e Robot Con figu ration Utility program to set th e digital sign als th at con trol th e pn eu matic h an d. Th e u tility program is on th e Adept Utility Disk. See th e man u al In stru ction s for Adept Utility Programs for in formation on u se of th e program. Th e OPE NI in stru ction differs from OPE N in th e followin g ways: l l l A BRE AK occu rs if a con tin u ou s-path robot motion is in progress. Th e sign al is sen t to th e con trol valves at th e con clu sion of th e cu rren t motion or immediately if n o motion is in progress. Robot motion s are delayed for a brief time to allow th e h an d actu ation to complete. Th e len gth of th e delay (in secon ds) is th e cu rren t settin g of th e HAND.TIME system parameter. V+ Lan gu age Referen ce Gu ide Page 5 7 7 OPE N program in stru ction E xamples Du rin g th e n ext robot motion , cau se th e pn eu matic con trol valves to assu me th e open state: OPEN Cau se th e pn eu matic con trol valves to assu me th e open state at th e con clu sion of th e cu rren t motion : OPENI Related Keywords CLOSE program in stru ction CLOSE I program in stru ction HAND.TIME system parameter RE LAX program in stru ction RE LAXI program in stru ction SE LE CT program in stru ction SE LE CT real-valu ed fu n ction V+ Lan gu age Referen ce Gu ide Page 5 7 8 OPE N program in stru ction OPEN program instruction Syntax OPEN OPENI Function Open th e robot gripper. Usage Considerations OPE N cau ses th e h an d to open du rin g th e n ext robot motion . OPE NI cau ses a BRE AK in th e cu rren t con tin u ou s-path motion an d cau ses th e h an d to open immediately after th e cu rren t motion completes. Th e OPE N in stru ction can be execu ted by an y program task as lon g as th e robot selected by th e task is n ot attach ed by an y oth er task. Th e in stru ction applies to th e robot selected by th e task. Th e OPE NI in stru ction can be execu ted by an y program task as lon g as th e task h as attach ed a robot. Th e in stru ction applies to th e robot selected by th e task. If th e V+ system is n ot con figu red to con trol a robot, execu tin g th ese in stru ction s cau ses an error. Details Th ese in stru ction s cau se th e con trol valves for th e pn eu matic h an d to receive a sign al to open . If th e OPE N in stru ction is u sed, th e sign al is sen t wh en th e n ext robot motion begin s. NOTE: You can u se th e Robot Con figu ration Utility program to set th e digital sign als th at con trol th e pn eu matic h an d. Th e u tility program is on th e Adept Utility Disk. See th e man u al In stru ction s for Adept Utility Programs for in formation on u se of th e program. Th e OPE NI in stru ction differs from OPE N in th e followin g ways: l l l A BRE AK occu rs if a con tin u ou s-path robot motion is in progress. Th e sign al is sen t to th e con trol valves at th e con clu sion of th e cu rren t motion or immediately if n o motion is in progress. Robot motion s are delayed for a brief time to allow th e h an d actu ation to complete. Th e len gth of th e delay (in secon ds) is th e cu rren t settin g of th e HAND.TIME system parameter. V+ Lan gu age Referen ce Gu ide Page 5 7 9 OPE N program in stru ction E xamples Du rin g th e n ext robot motion , cau se th e pn eu matic con trol valves to assu me th e open state: OPEN Cau se th e pn eu matic con trol valves to assu me th e open state at th e con clu sion of th e cu rren t motion : OPENI Related Keywords CLOSE program in stru ction CLOSE I program in stru ction HAND.TIME system parameter RE LAX program in stru ction RE LAXI program in stru ction SE LE CT program in stru ction SE LE CT real-valu ed fu n ction V+ Lan gu age Referen ce Gu ide Page 5 8 0 OR operator OR operator Syntax ... valu e OR valu e ... Function Perform th e logical OR operation on two valu es. Details Th e OR operator operates on two valu es, resu ltin g in th eir logical OR combin ation . For example, du rin g th e OR operation c = a OR b th e followin g fou r situ ation s can occu r: a b c FALSE FALSE -> FALSE FALSE TRUE -> TRUE TRUE FALSE -> TRUE TRUE TRUE -> TRUE Th at is, th e resu lt is TRUE if eith er (or both ) of th e two operan d valu es is logically TRUE . To review th e order of evalu ation for operators with in expression s, see th e section Order of E valu ation in th e V+ Lan gu age User's Gu ide. E xample In th e followin g sequ en ce, th e in stru ction s immediately followin g th e IF in stru ction are execu ted if eith er ready is TRUE (th at is, n on zero) or cou n t equ als 1 . Th e in stru ction s are n ot execu ted if both ready is FALSE an d cou n t is n ot equ al to 1 . IF ready OR (count = = 1) THE N . . . E ND V+ Lan gu age Referen ce Gu ide Page 5 8 1 OR operator Related Keywords AND operator BOR operator XOR operator V+ Lan gu age Referen ce Gu ide Page 5 8 2 OUTSIDE real-valu ed fu n ction OUTSIDE real-valued function Syntax OUTS I DE ( low, test, h igh ) Function Test a valu e to see if it is ou tside a specified ran ge. Parameters low Real valu e, expression , or variable specifyin g th e lower limit of th e ran ge to be tested. test Real valu e, expression , or variable to test again st th e ran ge. h igh Real valu e, expression , or variable specifyin g th e u pper limit of th e ran ge to be tested. Details Retu rn s TRUE (-1 ) if test is less th an low or greater th an h igh . Retu rn s FALSE (0 ) oth erwise. Related Keywords MAX real-valu ed fu n ction MIN real-valu ed fu n ction V+ Lan gu age Referen ce Gu ide Page 5 8 3 OVE RLAP program in stru ction OVER LAP program instruction Syntax OVERLAP ALWAYS Function Disable th e NOOVE RLAP limit-error ch eckin g eith er for th e n ext motion or for all su bsequ en t motion s. Usage Considerations OVE RLAP applies to th e operation of th e followin g robots/join ts: l For Adept Viper an d PUMA robots: join ts 1 , 4 , an d th e fin al join t l For all SCARA robots: join t 4 l For Adept Qu attro robots: tool rotation Th is is th e defau lt state of th e V+ system. OVE RLAP ALWAYS is assu med wh en ever program execu tion is in itiated an d wh en a n ew execu tion cycle begin s. Th e OVE RLAP in stru ction can be execu ted by an y program task as lon g as th e robot selected by th e task is n ot attach ed by an y oth er task. Th e in stru ction applies to th e robot selected by th e task. If th e V+ system is n ot con figu red to con trol a robot, execu tin g th e OVE RLAP in stru ction cau ses an error. Parameter ALWAYS Option al qu alifier th at establish es OVE RLAP as th e defau lt con dition . Th at is, if ALWAYS is specified, OVE RLAP remain s in effect con tin u ou sly u n til disabled by a NOOVE RLAP in stru ction . If ALWAYS is n ot specified, th e OVE RLAP in stru ction applies on ly to th e n ext robot motion . Details If OVE RLAP is specified, th e settin gs of SINGLE an d MULTIPLE affect th e robot motion . Wh en OVE RLAP is set, an d th e tran sformation destin ation of a join t-in terpolated or straigh tlin e motion requ ires th at a mu ltiple-tu rn axis rotate more th an ±1 8 0 degrees, th e motion is execu ted with ou t gen eratin g a program error. OVE RLAP disables th e limit-error ch eckin g of NOOVE RLAP. Th e OVE RLAP settin g is applied wh en ever program execu tion is in itiated an d wh en a n ew execu tion cycle begin s. V+ Lan gu age Referen ce Gu ide Page 5 8 4 OVE RLAP program in stru ction Related Keywords MULTIPLE program in stru ction NOOVE RLAP program in stru ction SE LE CT program in stru ction SE LE CT real-valu ed fu n ction SINGLE program in stru ction V+ Lan gu age Referen ce Gu ide Page 5 8 5 PACK program in stru ction PACK program instruction Syntax PACK strin g_ array[ in dex] , first_ ch ar, n u m_ ch ars = strin g PACK strin g_ var, first_ ch ar, n u m_ ch ars = strin g Function Replace a su bstrin g with in an array of (1 2 8 -ch aracter) strin g variables, or with in a (n on array) strin g variable. Parameters strin g_ array Strin g array variable th at is modified by th e su bstrin g on th e righ t-h an d side of th e equ al sign . E ach elemen t with in th e strin g array is assu med to be 1 2 8 ch aracters lon g (see below). in dex Option al in teger valu e th at iden tifies th e first array elemen t to be con sidered. Th e first_ ch ar valu e is in terpreted relative to th e elemen t specified by th is in dex. If n o in dex is specified, elemen t zero is assu med. strin g_ var Strin g variable th at is modified by th e su bstrin g on th e righ th an d side of th e equ al sign . first_ ch ar Real-valu ed expression th at specifies th e position of th e first ch aracter of th e su bstrin g with in th e strin g array. A valu e of 1 correspon ds to th e first ch aracter of th e specified strin g array elemen t. Th is valu e mu st be greater th an zero. Th e valu e of first_ ch ar can be greater th an 1 2 8 . In th at case th e array elemen t accessed follows th e elemen t specified in th e fu n ction call. For example, a valu e of 1 3 0 correspon ds to th e secon d ch aracter in th e array elemen t followin g th at specified by in dex. n u m_ ch ars Real-valu ed expression th at specifies th e n u mber of ch aracters to be copied from th e strin g to th e array. Th is valu e can ran ge from 0 to 1 2 8 . strin g Strin g variable, con stan t, or expression from wh ich th e su bstrin g is to be extracted. Th e strin g mu st be at least n u m_ ch ars lon g. V+ Lan gu age Referen ce Gu ide Page 5 8 6 PACK program in stru ction Details Th is in stru ction replaces a su bstrin g with in an array of strin gs or with in a strin g variable. Wh en an array of strin gs is bein g modified, th e su bstrin g is permitted to overlap two elemen ts of th e strin g array. For example, a 1 0 -ch aracter su bstrin g wh ose first ch aracter is to replace th e 1 2 7 th ch aracter in elemen t [3 ] su persedes th e last two ch aracters in elemen t [3 ] an d th e first eigh t ch aracters of elemen t [4 ]. If th e array elemen t to be modified is n ot defin ed, th e elemen t is created an d filled with ASCII NUL ch aracters (^H0 0 ) u p to th e specified start of th e su bstrin g. Similarly, if th e array elemen t to be modified is too sh ort, th e strin g is padded with ASCII NUL ch aracters to th e start of th e su bstrin g. In order to efficien tly access th e strin g array, th is fu n ction assu mes th at all of th e array elemen ts, from th e start of th e array u n til th e elemen t before th e elemen t accessed, are defin ed an d are 1 2 8 ch aracters lon g. For mu ltidimen sion al arrays, on ly th e righ t-most array in dex is in cremen ted to locate th e su bstrin g. Th u s, for example, elemen t [2 ,3 ] is followed by elemen t [2 ,4 ]. Wh en a strin g variable is modified, th e replacemen t is don e in a man n er similar to th at for an in dividu al array elemen t. However, an error resu lts if th e operation cau ses th e strin g to be lon ger th an 1 2 8 ch aracters. E xample Th e in stru ction below replaces 1 1 ch aracters with in th e strin g array $ list[ ]. Th e replacemen t is specified as startin g in array elemen t $ list[3 ]. However, sin ce th e first ch aracter replaced is to be n u mber 1 3 0 , th e 1 1 -ch aracter su bstrin g actu ally replaces th e secon d th rou gh 1 2 th ch aracters of $ list[4 ]. PACK $list[3], 130, 11 = $string Related Keywords $ MID strin g fu n ction $ UNPACK strin g fu n ction V+ Lan gu age Referen ce Gu ide Page 5 8 7 PANIC program in stru ction PANIC program instruction Syntax PANI C Function Simu late an extern al E -stop or pan ic bu tton press; stop all robots immediately, bu t do n ot tu rn off HIGH POWE R. Usage Considerations If th e V+ system is con trollin g more th an on e robot, all th e robots are stopped. Th is in stru ction h as n o effect on n on robot systems. Details Th is in stru ction performs th e followin g action s: l l l Immediately stops robot motion Stops execu tion of th e robot con trol program if th e robot is attach ed an d n o RE ACTE h as been execu ted to en able program processin g of error. Cau ses * PANIC comman d* to appear on th e mon itor screen Un like pressin g th e emergen cy stop bu tton on th e man u al con trol pen dan t, h igh power is left tu rn ed on after a PANIC in stru ction is processed. Related Keywords ABORT mon itor comman d ABORT program in stru ction E STOP program in stru ction E STOP mon itor comman d PANIC mon itor comman d V+ Lan gu age Referen ce Gu ide Page 5 8 8 PARAME TE R program in stru ction PAR AMETER program instruction Syntax PARAMETER parameter_ n ame = valu e PARAMETER parameter_ n ame[ in dex] = valu e Function Set th e valu e of a system parameter. Usage Considerations If th e specified parameter accepts an in dex qu alifier an d th e in dex is zero or omitted (with or with ou t th e brackets), all th e elemen ts of th e parameter array are assign ed th e valu e given . Parameters parameter_ n ame Name of th e parameter wh ose valu e is to be modified. in dex For parameters th at can be qu alified by an in dex, th is is an option al real valu e, variable, or expression th at specifies th e specific parameter elemen t of in terest (see above). valu e Real valu e, variable, or expression defin in g th e valu e to be assign ed to th e system parameter. Details Th is in stru ction sets th e given system parameter to th e valu e on th e righ t. Th e parameter n ame can be abbreviated to th e min imu m len gth th at iden tifies it u n iqu ely. NOTE: A regu lar assign men t statemen t can n ot be u sed to set th e valu e of a system parameter. Th e parameter n ames acceptable with th e stan dard V+ system are su mmarized in th e section Parameters in th e V+ Lan gu age User's Gu ide. Oth er system parameters are available wh en option s are in stalled. Refer to th e option docu men tation for details. For example, th e parameters associated with th e AdeptVision option s are described in th e section Description s of Vision Keywords in th e AdeptVision Referen ce Gu ide. E xample Set th e TE RMINAL system parameter to 4 : V+ Lan gu age Referen ce Gu ide Page 5 8 9 PARAME TE R program in stru ction PARAMETER TERMINAL = 4 Related Keywords BE LT.MODE system parameter HAND.TIME system parameter KE RMIT.RE TRY system parameter KE RMIT.TIME OUT system parameter NOT.CALIBRATE D system parameter PARAME TE R mon itor comman d SCRE E N.TIME OUT system parameter TE RMINAL system parameter V+ Lan gu age Referen ce Gu ide Page 5 9 0 PARAME TE R real-valu ed fu n ction PAR AMETER real-valued function Syntax PARAMETER ( parameter_ n ame) PARAMETER ( parameter_ n ame[ in dex] ) Function Retu rn th e cu rren t settin g of th e n amed system parameter. Parameters parameter_ n ame Name of th e system parameter wh ose valu e is to be retu rn ed. in dex For parameters th at can be qu alified by an in dex, th is is a (requ ired) real valu e, variable, or expression th at specifies th e specific parameter elemen t of in terest. Details Th is fu n ction retu rn s th e cu rren t settin g of th e given system parameter. Th e parameter n ame can be abbreviated to th e min imu m len gth th at iden tifies it u n iqu ely. Oth er system parameters are available wh en option s are in stalled. Refer to th e option docu men tation for details. For example, th e parameters associated with th e AdeptVision option s are described in th e section Description s of Vision Keywords in th e AdeptVision Referen ce Gu ide. E xamples Th e followin g example illu strates h ow th e cu rren t settin g of th e TE RMINAL parameter can be displayed on th e system termin al du rin g program execu tion : TYPE "The TERMINAL parameter is set to", PARAMETER(TERMINAL) Th e PARAME TE R fu n ction can also be u sed in an y expression to in clu de th e valu e of a parameter. For example, th e followin g program statemen t can be u sed to in crease th e time delay for h an d actu ation : PARAMETER HAND.TIME = PARAMETER(HAND.TIME) + 0.15 Note th at th e left-h an d occu rren ce of PARAME TE R is th e in stru ction n ame an d th e righ th an d occu rren ce is th e fu n ction n ame. V+ Lan gu age Referen ce Gu ide Page 5 9 1 PARAME TE R real-valu ed fu n ction Related Keywords BE LT.MODE system parameter HAND.TIME system parameter KE RMIT.RE TRY system parameter KE RMIT.TIME OUT system parameter NOT.CALIBRATE D system parameter PARAME TE R mon itor comman d PARAME TE R program in stru ction SCRE E N.TIME OUT system parameter TE RMINAL system parameter V+ Lan gu age Referen ce Gu ide Page 5 9 2 PAUSE program in stru ction PAUSE program instruction Syntax PAUS E Function Stop program execu tion bu t allow th e program to be resu med. Usage Considerations Un like HALT an d STOP, th e PAUSE in stru ction does n ot force FCLOSE or DE TACH on th e disk or serial commu n ication logical u n its. If th e program h as a file open an d you decide n ot to con tin u e execu tion of th e cu rren t program, you sh ou ld issu e a KILL comman d (with th e appropriate task n u mber) to close all files an d detach all logical u n its. Details Cau ses a BRE AK an d termin ates execu tion of th e application program, displayin g th e message (PAUSE D). E xecu tion can su bsequ en tly be con tin u ed by typin g proceed an d th e appropriate task n u mber, an d pressin g th e RE TURN key. Wh en debu ggin g a program, a PAUSE in stru ction can be in serted to stop program execu tion temporarily wh ile th e valu es of variables are ch ecked. NOTE: An y robot motion in progress wh en a PAUSE in stru ction is processed completes n ormally. Related Keywords HALT program in stru ction KILL mon itor comman d KILL program in stru ction PROCE E D mon itor comman d STOP program in stru ction V+ Lan gu age Referen ce Gu ide Page 5 9 3 PAYLOAD program in stru ction PAYLOAD program instruction Syntax PAYLOAD valu e, motor Function Adju st th e feedforward compen sation for a specified motor by settin g a percen tage of th e maximu m payload assu med for th at motor. Usage Considerations Th is in stru ction affects th e robot cu rren tly selected with a SE LE CT program in stru ction . A task does n ot h ave to be attach ed to th e robot to issu e th is in stru ction . With Adept robots, th is in stru ction is su pported on ly on motors 3 an d 4 of th e AdeptOn e, th e AdeptOn e-XL, th e AdeptTh ree, th e AdeptTh ree-XL, an d th e PackOn e robots. Th e in stru ction is u sefu l primarily for tu n in g motor 4 performan ce as a fu n ction of en d-effector in ertia. With AdeptMotion VME robots, th e in stru ction defau lts to n o effect an d mu st be en abled with th e SPE C u tility. For AdeptOn e robots con trolled by a SmartCon troller with an sE JI u n it, th e PAYLOAD in stru ction is implemen ted for motor 4 . Th e PAYLOAD in stru ction h as n o effect for oth er robots con trolled by a SmartCon troller. Parameters valu e An option al real-valu ed expression in terpreted as a percen tage of th e maximu m payload Th e ran ge is 0 % (n o payload) to 1 0 0 % (maximu m payload); a n egative valu e restores th e defau lt feedforward gain . If omitted, th e valu e -1 is u sed, wh ich is in terpreted as th e defau lt payload percen tage. motor An option al real-valu ed expression th at specifies to wh ich motor th is in stru ction applies. If th e parameter is omitted or zero, th e payload percen tage applies to all motors of th e selected robot. Details Th e PAYLOAD in stru ction takes effect immediately an d is n ot syn ch ron ized with robotmotion segmen ts. If th e PAYLOAD in stru ction is u sed to in dicate th at a very large payload is on th e robot motor wh en in fact a small payload is on th e robot motor, th e motor can oversh oot an y time th e comman ded acceleration is n on zero. Th e degree of oversh oot depen ds u pon th e ran ge V+ Lan gu age Referen ce Gu ide Page 5 9 4 PAYLOAD program in stru ction between min imu m an d maximu m acceleration feedforward, th e degree to wh ich th e payload is in error, an d th e size of th e acceleration an d deceleration du rin g th e motion bein g attempted. In particu lar, th is is a con cern for motor 4 of th e AdeptOn e, th e AdeptOn e-XL, th e AdeptTh ree, th e AdeptTh ree-XL, an d th e PackOn e robots. Take care to en su re th at th e valu e u sed with th e PAYLOAD in stru ction correctly reflects th e tru e payload. On th e AdeptOn e, th e AdeptOn e-XL, th e AdeptTh ree, th e AdeptTh ree-XL, th e PackOn e, an d th e Adept 5 5 0 robots: l On ly motor 3 drives join t 3 . l Motor 4 drives join t 4 with a small con tribu tion from motor 3 . You can u se th e PAYLOAD in stru ction to adju st feedforward gain s in a predetermin ed way, ju st as you can u se th e GAIN.SE T in stru ction to adju st feedback gain s in a predetermin ed way. Becau se GAIN.SE T does n ot affect th e feedforward, th ere is n o con flict or direct in teraction between th ese two in stru ction s. Th at is, th e order of th eir execu tion is u n importan t. Th e valu e parameter specifies a valu e of th e acceleration feedforward gain (in ertia estimate) th at is in terpolated between two factory preset valu es. Th ese are th e min imu m n o-load acceleration feedforward gain an d th e maximu m acceleration feedforward gain . A n egative valu e restores th e defau lt (n omin al) feedforward gain . To calcu late a percen tage for th e valu e parameter: 1 . Open th e SPE C u tility. For details, see th e section Loadin g an d E xecu tin g Adept Utility Programs in th e In stru ction s for Adept Utility Programs Gu ide. 2 . Select Edit robot specification s > Edit motor tu n in g parameters > Accel feedforward... 3 . Divide th e robot's maximu m payload valu e in to th e payload attach ed to th e robot arm an d th en mu ltiply by 1 0 0 . On AdeptMotion VME robots, th is in stru ction defau lts to n o effect. Usin g th e SPE C u tility program, you can en able it for a particu lar AdeptMotion VME motor by settin g th e maximu m an d min imu m acceleration feedforward valu es for th at motor to n on zero valu es (with th e maximu m greater th an th e min imu m). Th e PAYLOAD in stru ction assu mes th e u se of cu rren tmode (torqu e-mode) amplifiers. Th e ben efit of th e in stru ction depen ds u pon th e mech an ical design of th e mech an ism. Motors with low gear ratios an d h igh variation s in payload ben efit more. Motors with h igh gear ratios an d low variation s in payload ben efit less. Th e in stru ction is n ot u sefu l with velocity-mode amplifiers. Related Keywords ACCE L program in stru ction ACCE L real-valu ed fu n ction DURATION program in stru ction DURATION real-valu ed fu n ction V+ Lan gu age Referen ce Gu ide Page 5 9 5 PAYLOAD program in stru ction SPE E D mon itor comman d SPE E D program in stru ction SPE E D real-valu ed fu n ction V+ Lan gu age Referen ce Gu ide Page 5 9 6 #PDE ST precision -poin t fu n ction #PDEST precision-point function Syntax #PDES T Function Retu rn a precision -poin t valu e represen tin g th e plan n ed destin ation location for th e cu rren t robot motion . Usage Considerations Th e #PDE ST fu n ction retu rn s in formation for th e robot selected by th e task execu tin g th e fu n ction . If th e V+ system is n ot con figu red to con trol a robot, u se of th e #PDE ST fu n ction does n ot gen erate an error becau se of th e absen ce of a robot. However, th e in formation retu rn ed by th e fu n ction may n ot be mean in gfu l. Th e n ame " pdest" can n ot be u sed for a variable or a program. Details Th e #PDE ST fu n ction can be u sed to determin e th e robot's destin ation before its motion was in terru pted. Th e #PDE ST fu n ction is equ ivalen t to th e DE ST tran sformation fu n ction an d can be u sed in terch an geably with DE ST, depen din g u pon th e type of location in formation th at is desired. Please refer to th e description of th e DE ST fu n ction for more in formation on th e u se of both th e #PDE ST an d DE ST fu n ction s. Related Keywords DE ST tran sformation fu n ction HE RE tran sformation fu n ction SE LE CT program in stru ction SE LE CT real-valu ed fu n ction V+ Lan gu age Referen ce Gu ide Page 5 9 7 PE NDANT real-valu ed fu n ction PENDANT real-valued function Syntax PENDANT ( select) Function Retu rn in pu t from th e man u al con trol pen dan t. Usage Considerations Th e man u al con trol pen dan t may or may n ot n eed to be attach ed u sin g an ATTACH in stru ction prior to u sin g th is fu n ction , depen din g on th e valu e of th e select parameter. See Details below. Parameter select Real-valu ed expression wh ose valu e selects wh at type of pen dan t in formation is retu rn ed (see below). Details Th e valu e retu rn ed depen ds u pon th e select parameter as follows: select> 0 Immediately retu rn s a valu e th at reflects th e actu al state of th e key with th e given key n u mber at th e in stan t th e fu n ction is called. Th e state of th e key depen ds u pon th e key mode settin g for th at key. See th e KE YMODE program in stru ction for in formation abou t settin g key modes an d see th e section Programmin g th e MCP in th e V+ Lan gu age User's Gu ide, for a table of th e key n u mbers. Th e valu e retu rn ed is mean in gfu l on ly if th e pen dan t is con n ected. (Th e pen dan t logical u n it does n ot n eed to be attach ed for th is mode of operation .) If a key is in keyboard mode, th e valu e ON (-1 ) in dicates th at th e key is pressed. Th e valu e OFF (0 ) in dicates th at th e key is n ot pressed. If a key is in level mode, th e valu e ON (-1 ) in dicates th at th e pen dan t is attach ed in USE R mode an d th at th e key is pressed. Th e valu e OFF (0 ) in dicates th at th e pen dan t is n ot in USE R mode, or th at th e key is n ot pressed. If a key is in toggle mode, th e valu e ON (-1 ) in dicates th at th e key is on an d th e valu e OFF (0 ) in dicates th at th e key is off. If th e pen dan t is n ot in USE R mode, th e valu e retu rn ed still accu rately reflects th e state of th e toggled key. V+ Lan gu age Referen ce Gu ide Page 5 9 8 PE NDANT real-valu ed fu n ction NOTE: Wh en select is equ al to 3 6 (in dicatin g th e SLOW key), th e valu e retu rn ed in dicates th e cu rren t state of slow mode, as in dicated by th e LE D on th e key. (Th e SLOW key is always in toggle mode an d is n ot affected by th e KE YMODE comman d.) select = 0 Retu rn s th e key n u mber of th e n ext keyboard mode key pressed. Program execu tion is su spen ded u n til a keyboard mode key is pressed. If n o key is programmed in th is mode, an error occu rs. Th e pen dan t logical u n it mu st be attach ed for th is mode of operation . (See th e ATTACH program in stru ction .) select = -1 Retu rn s th e key n u mber of th e n ext special mode key pressed. Program execu tion is su spen ded u n til a key of th e requ ested mode is pressed. If n o key is programmed in th is mode, an error occu rs. Th e pen dan t logical u n it mu st be attach ed for th is mode of operation . (See th e ATTACH program in stru ction .) select = -2 Retu rn s th e cu rren t valu e from th e speed poten tiometer, in th e ran ge of -1 2 8 (decimal) to 1 2 7 (decimal). (Th e pen dan t logical u n it does n ot n eed to be attach ed for th is mode of operation .) If n o pen dan t is con n ected to th e con troller, a valu e of 0 is always retu rn ed. select = -3 Retu rn s th e cu rren t display mode active on th e man u al con trol. Th is can be u sed, for example, to determin e th e state of th e man u al con trol before attemptin g to write to it. (Th e pen dan t logical u n it does n ot n eed to be attach ed for th is mode of operation .) Th e display modes sh ou ld be in terpreted as follows: Display mode I n terpretation 1 Fu n ction display (e.g., DISP) 2 Backgrou n d display 3 E rror display 4 USE R mode V+ Lan gu age Referen ce Gu ide Page 5 9 9 PE NDANT real-valu ed fu n ction select = -4 Retu rn s th e version n u mber of th e man u al con trol software. Th is is th e same as th e valu e retu rn ed by th e real-valu ed fu n ction ID(1 ,2 ). Th e valu e -1 is retu rn ed if th e man u al con trol pen dan t is n ot con n ected to th e system. E xamples Th is example sets th e man u al con trol soft keys to keyboard mode, an d th en waits for on e of th em to be pressed (also see th e section Soft Sign als in th e V+ Lan gu age User's Gu ide). ATTACH (1) KEYMODE 1,5 = 0 key = PENDANT(0) TYPE "Soft key #", key, DETACH (1) ;Attach the pendant LUN ;Set soft keys to keyboard mode ;Wait and return next key hit " pressed" ;Detach the pendant LUN Th is example sets th e DONE key to level mode an d loops u n til th e key is pressed. ATTACH (1) KEYMODE 8 = 2 WAIT PENDANT(8) DETACH (1) ;Attach the pendant LUN ;Set DONE key (8) to level mode ;Pause until DONE key is pressed ;Detach the pendant LUN Related Keywords ATTACH program in stru ction KE YMODE program in stru ction V+ Lan gu age Referen ce Gu ide Page 6 0 0 #PHE RE precision -poin t fu n ction #PHER E precision-point function Syntax #PHERE Function Retu rn a precision -poin t valu e represen tin g th e cu rren t location of th e cu rren tly selected robot. Usage Considerations Th e fu n ction #PHE RE is con sidered to be a precision -poin t n ame. Th u s, th e # ch aracter mu st precede th e fu n ction n ame wh en ever it is u sed. PHE RE is a reserved word in V+ an d can n ot be u sed for a variable or program n ame. Details Th e PHE RE real-valu ed fu n ction is equ ivalen t to th e program in stru ction HE RE #pp. Example: Th e followin g example sh ows #PHE RE bein g u sed to set a precision poin t valu e, in th is case #pp. SET #pp = #PHERE Revision History V+ Release Modification version 1 6 .0 Added th e PHE RE program in stru ction to V+. Related Keyword HE RE program in stru ction V+ Lan gu age Referen ce Gu ide Page 6 0 1 PI real-valu ed fu n ction PI real-valued function Syntax PI Function Retu rn th e valu e of th e math ematical con stan t pi (3 .1 4 1 5 9 3 ). NOTE: TYPE , PROMPT, an d similar in stru ction s display th e resu lt of th e above example as a sin gle-precision valu e. However, pi is actu ally stored an d man ipu lated as a dou ble-precision valu e. Th e LISTR mon itor comman d displays real valu es to fu ll precision . Usage Considerations Th e word " pi" can n ot be u sed as a program n ame or variable n ame. V+ Lan gu age Referen ce Gu ide Page 6 0 2 #PLATCH precision -poin t fu n ction #PLATCH precision-point function Syntax #PLATCH ( select) Function Retu rn a precision -poin t valu e represen tin g th e location of th e robot at th e occu rren ce of th e last extern al trigger or AdeptForce gu arded-mode trigger. Usage Considerations Th e fu n ction n ame #PLATCH is con sidered to be a precision -poin t n ame. Th u s, th e # ch aracter mu st precede all u ses of th e fu n ction . #PLATCH( ) retu rn s in formation for th e robot selected by th e task execu tin g th e fu n ction . If th e V+ system is n ot con figu red to con trol a robot, u se of th e #PLATCH fu n ction does n ot gen erate an error becau se of th e absen ce of a robot. However, th e in formation retu rn ed by th e fu n ction may n ot be mean in gfu l. Parameter select Option al in teger, expression , or real variable specifyin g: 0 E xtern al trigger (defau lt) 1 AdeptForce gu arded mode-trigger Details #PLATCH( ) retu rn s a precision -poin t valu e th at represen ts th e location of th e robot wh en th e last trigger occu rred. Th e LATCHE D real-valu ed fu n ction sh ou ld be u sed to determin e wh en an extern al trigger h as occu rred an d a valid location h as been recorded. Operation of th e extern al trigger can be con figu red with th e Adept con troller con figu ration program (in th e file CONFIG_ C.V2 on th e Utility Disk). Th is trigger may origin ate from th e vision processor or a digital in pu t sign al. See th e AdeptForce VME User's Gu ide for details of th e AdeptForce option . Related Keywords LATCH tran sformation fu n ction LATCHE D real-valu ed fu n ction V+ Lan gu age Referen ce Gu ide Page 6 0 3 POS real-valu ed fu n ction POS real-valued function Syntax POS ( search _ strin g, su b_ strin g, start) Function Retu rn th e startin g ch aracter position of a su bstrin g in a strin g. Parameters search _ strin g Strin g expression to be search ed for th e occu rren ce of a su bstrin g. su b_ strin g Strin g expression con tain in g th e su bstrin g to be search ed for with in th e search strin g. start Option al expression in dicatin g th e ch aracter position with in th e search strin g wh ere search in g is to begin . Details Retu rn s th e ch aracter position in search _ strin g wh ere su b_ strin g begin s. If th e su bstrin g does n ot occu r with in th e search strin g, a valu e of 0 is retu rn ed. If start is provided, it in dicates th e ch aracter position with in search _ strin g wh ere search in g will begin . A valu e of 1 in dicates th e first ch aracter. If start is omitted or less th an 1 , search in g begin s with th e first ch aracter. If start is greater th an th e len gth of search _ strin g, a valu e of 0 is retu rn ed. Wh en ch eckin g for a match in g su bstrin g, u ppercase an d lowercase letters are con sidered to be th e same. E xamples POS("file.ext", ".") POS("file", ".") POS("abcdefgh", "DE") POS("1-2-3-4", "-", 5) ;Returns ;Returns ;Returns ;Returns 5 0 4 6 V+ Lan gu age Referen ce Gu ide Page 6 0 4 POWE R system switch POWER system switch Syntax ... POW ER Function Con trol or mon itor th e statu s of h igh power. Usage Considerations DANGER: Do n ot u se th e POWE R switch to en able power from with in a program u n less you r system is su bject to E u ropean certification . With E u ropean certification , special safety featu res are bu ilt-in to th e system to preven t th e robot from bein g activated with ou t warn in g. See Details for addition al in formation . On ly CPU #1 can en able an d disable power. Usin g th is switch to tu rn on h igh power is poten tially dan gerou s wh en performed from a program becau se th e robot can be activated with ou t direct operator action . Tu rn in g on h igh power from th e termin al can be h azardou s if you do n ot h ave a clear view of th e robot workspace or do n ot h ave immediate access to an E mergen cy Stop bu tton . Details E n ablin g th is switch is equ ivalen t to pu sh in g th e COMP/PWR bu tton on th e man u al con trol pen dan t to tu rn on h igh power. If th ere is n o error con dition th at preven ts power from comin g on , th e en ablin g process proceeds to th e secon d step, in wh ich you mu st press th e HIGH POWE R bu tton on th e CIP. (Systems n ot su bject to E u ropean certification do n ot requ ire th e secon d step.) Disablin g th is switch requ ests th e robot to perform a con trolled deceleration an d power-down sequ en ce. Th is sequ en ce con sists of: 1 . Deceleratin g all robots accordin g to th e u ser-specified parameters. (See th e followin g Note.) 2 . Tu rn in g on th e brakes. 3 . Waitin g for th e u ser-specified brake-delay in terval. (See th e followin g Note.) 4 . Tu rn in g off th e amplifiers an d power. 5 . Assertin g th e backplan e E mergen cy Stop sign al an d deassertin g th e High Power E n able (HPE ) sign al. V+ Lan gu age Referen ce Gu ide Page 6 0 5 POWE R system switch NOTE: User-specified parameters are set u sin g th e SPE C u tility program. Robot man u factu rers set th ese parameters for some robots; if so, you can n ot ch an ge th em. Note th at DISABLE POWE R may take an arbitrarily lon g time du e to lon g deceleration times an d lon g brake tu rn -on delays. (Use th e E STOP comman d or program in stru ction wh en you desire an immediate sh u tdown .) Th e valu e of th is switch can be ch ecked at an y time with th e SWITCH real-valu ed fu n ction to determin e if h igh power is on or off. To disable power from a robot program with ou t gen eratin g an error con dition , th e program mu st eith er be in DRY.RUN mode or DE TACH th e robot from program con trol. See th e DRY.RUN switch or DE TACH program in stru ction for details. E xample Th e followin g program segmen t detach es th e robot, tu rn s h igh power off, an d waits for you to tu rn h igh power back on . DETACH ;Detach robot from program DISABLE POWER ;Turn off power TYPE "Press the COMP/PWR button to continue" ATTACH ;Wait for power on and attach TYPE "Robot program continuing..." Related Keywords DISABLE mon itor comman d DISABLE program in stru ction E NABLE mon itor comman d E NABLE program in stru ction E STOP program in stru ction SWITCH mon itor comman d SWITCH program in stru ction SWITCH real-valu ed fu n ction V+ Lan gu age Referen ce Gu ide Page 6 0 6 #PPOINT precision - poin t fu n ction #PPOINT precision- point function Syntax #PPOI NT ( j1 _ valu e, j2 _ valu e, j3 _ valu e, j4 _ valu e, j5 _ valu e, j6 _ valu e, j7 _ valu e, j8 _ valu e, j9 _ valu e, j1 0 _ valu e, j1 1 _ valu e, j1 2 _ valu e) Function Retu rn a precision -poin t valu e composed from th e given compon en ts. Usage Considerations Th e #PPOINT fu n ction n ame is con sidered to be a precision -poin t n ame. Th u s, th e # ch aracter mu st precede all u ses of th e fu n ction . Parameters j1 _ valu e j2 _ valu e Option al real-valu ed expression s for th e respective robot join t position s. (If more valu es are specified th an th e n u mber of robot join ts, th e extra valu es are ign ored.) j3 _ valu e ... j1 2 _ valu e Details Retu rn s a precision -poin t valu e composed from th e given compon en ts, wh ich are th e position s of th e first th rou gh last robot join ts, respectively. A zero valu e is assu med for an y parameter th at is omitted. E xamples Assu me th at you wan t to perform a coordin ated motion of join ts 2 an d 3 of a robot with 4 join ts, startin g from its cu rren t location . Th e followin g program segmen t performs su ch a motion : HERE #ref ;Define current location DECOMPOSE x = #ref ;Fill array with components ;Move to new precision point defined with modified components MOVE #PPOINT(x[0], x[1]+a, x[2]-a/2, x[3]) V+ Lan gu age Referen ce Gu ide Page 6 0 7 #PPOINT precision - poin t fu n ction Th e followin g steps lead to th e same fin al location , bu t th e robot join ts are n ot moved simu ltan eou sly with th is meth od. DRIVE 2, a, 100 DRIVE 3, -a/2, 100 ;Drive joint 2 ;Drive joint 3 Related Keywords DE COMPOSE program in stru ction TRANS tran sformation fu n ction V+ Lan gu age Referen ce Gu ide Page 6 0 8 PRIORITY real-valu ed fu n ction PR IOR ITY real-valued function Syntax PRI ORI TY Function Retu rn th e cu rren t reaction lock-ou t priority for th e program. Usage Considerations Th e n ame " priority" can n ot be u sed as a program n ame or variable n ame. Th is fu n ction retu rn s th e reaction lock-ou t priority, n ot th e program priority of th e execu tin g program. Details Th e reaction lock-ou t priority for each program task is set to zero wh en execu tion of th e task is in itiated. Th e priority can be ch an ged by th e program at an y time with th e LOCK in stru ction , or th e priority is set au tomatically wh en a reaction occu rs as prescribed by a RE ACT or RE ACTI in stru ction . Th e PRIORITY fu n ction can be u sed to determin e th e cu rren t settin g of th e reaction lock-ou t priority for th e task execu tin g th e fu n ction . E xample Th is example raises th e priority, performs some operation th at requ ires a reaction rou tin e to be locked ou t, an d th en restores it to its previou s valu e. save = PRIORITY ;Save the current priority IF save < 10 THEN LOCK 10 END ;Raise priority to at least 10 ; Access data shared by a reaction routine. LOCK save ;Set priority to original value Related Keywords LOCK program in stru ction RE ACT program in stru ction RE ACTI program in stru ction V+ Lan gu age Referen ce Gu ide Page 6 0 9 .PROGRAM program in stru ction .PR OGR AM program instruction Syntax .PROGRAM program_ n ame( argu men t_ list) ;commen t Function Defin e th e argu men ts th at are passed to a program wh en it is in voked. Usage Considerations Th is in stru ction is in serted au tomatically by th e V+ editors wh en a n ew program is edited. Th is special in stru ction mu st be th e first lin e of every program. Th e .PROGRAM statemen t can n ot be deleted from a program. Parameters program_ n ame Name of th e program in wh ich th is in stru ction is fou n d. argu men t_ list Option al list of variable n ames, separated by commas. E ach variable can be an y on e of th e data types available with V+ (belt, precision poin t, real-valu e, strin g, an d tran sformation ). E ach variable can be a simple variable or an array with all of its in dexes left blan k. ;commen t Option al commen t th at is displayed wh en th e program is loaded from a disk file an d wh en th e DIRE CTORY comman d is processed. (Th e semicolon [;] sh ou ld be omitted if n o commen t is in clu ded.) Details Th e V+ editors au tomatically en ter a .PROGRAM lin e wh en you edit a n ew program. Th ey also preven t you from deletin g th e lin e or ch an gin g th e program n ame. You can , h owever, edit th e lin e to add, delete, or modify th e argu men t list. (Th e RE NAME mon itor comman d mu st be u sed to ch an ge th e program n ame.) Th e variables in th e argu men t list are con sidered au tomatic variables for th e n amed program. (See th e AUTO in stru ction .) Wh en a program begin s execu tion (for example, via an E XE CUTE comman d or in stru ction or a CALL in stru ction ), th e argu men ts in th e .PROGRAM in stru ction are associated with th ose in th e E XE CUTE or CALL. Th is association allows valu es to be passed between a program an d its caller. V+ Lan gu age Referen ce Gu ide Page 6 1 0 .PROGRAM program in stru ction See th e description of th e CALL in stru ction for an explan ation of h ow th e program argu men ts receive th eir valu es from a callin g program an d retu rn th eir valu es to th e callin g program. Th e followin g ru les apply to an y program argu men t th at is u n defin ed wh en th e program execu tes: l l Real-valu ed scalar parameters can be assign ed a valu e with in a program if th ey are u n defin ed. Location , strin g, an d belt (scalar or array) parameters, an d real-valu ed array parameters, can n ot be assign ed a valu e with in a program if th ey are u n defin ed. (AUTO variables can be u sed to work arou n d th is restriction , as sh own in th e example below.) NOTE: If a program attempts to assign a valu e to on e of th ese u n defin ed variables, th e error * Un defin ed valu e* resu lts. In th at case, th e error refers to th e variable on th e left side of th e assign men t in stru ction . l l If an u n defin ed parameter is passed on to an oth er program in a CALL in stru ction , an d th e type (real-valu ed or location ) of th e variable is ambigu ou s, th e parameter is assu med to be real-valu ed. E lemen ts of an u n defin ed array parameter can n ot be passed by referen ce in a CALL in stru ction . Th e DE FINE D real-valu ed fu n ction can be u sed with in a program to ch eck wh eth er a program parameter is defin ed. Th e example below sh ows h ow a program can be written to accommodate u n defin ed parameters. A commen t can be in clu ded on th e .PROGRAM lin e, wh ich is displayed wh en th e program is loaded from th e disk an d by th e DIRE CTORY comman d. E xamples Defin e a program th at expects n o argu men ts to be passed to it: .PROGRAM get() Defin e a program th at expects a strin g-valu ed argu men t an d eith er a location or real-valu ed argu men t (th e type of th e secon d argu men t is determin ed by its u se in th e program): .PROGRAM test($n, dx) Th e followin g program segmen t sh ows h ow a program can be written to deal with u n defin ed parameters. Th e example sh ows part of th e program example, wh ich h as a real-valu ed parameter an d a strin g parameter. .PROGRAM example(real, $string) AUTO $internal.var ; Check for undefined real-valued scalar parameter. IF NOT DEFINED(real) THEN ;If parameter is undefined real = 1 ;assignment of desired END ;default value is okay V+ Lan gu age Referen ce Gu ide Page 6 1 1 .PROGRAM program in stru ction ;Check for undefined string parameter. IF DEFINED($string) THEN ;If parameter is defined, $internal.var = $string ;use the parameter value ELSE ;Otherwise, $internal.var = "default" ;use default value END ;(Program continues...) .END Refer to th e DE FINE Dfu n ction for more details an d for testin g n on real argu men ts. Related Keywords CALL program in stru ction CALLP program in stru ction CALLS program in stru ction E XE CUTE mon itor comman d E XE CUTE program in stru ction PRIME mon itor comman d SSTE P mon itor comman d XSTE P mon itorcomman d V+ Lan gu age Referen ce Gu ide Page 6 1 2 PROMPT program in stru ction PR OMPT program instruction Syntax PROMPT ou tpu t_ strin g, variable_ list Function Display a strin g on th e system termin al an d wait for operator in pu t. Parameters ou tpu t_ strin g Option al strin g expression th at is ou tpu t to th e system termin al. Th e cu rsor is left at th e en d of th e strin g. variable_ list A list of real-valu ed variables, or a sin gle strin g variable, th at receives th e data. Details Displays th e text of th e ou tpu t strin g on th e system termin al, an d waits for you to type in a lin e termin ated by pressin g th e RE TURN key. Th e in pu t lin e can be processed in eith er of two ways: 1 . If a list of real-valu ed variables is specified as th e variable list, th e lin e is assu med to con tain a list of n u mbers separated by space ch aracters an d/or commas. E ach n u mber is con verted from text to its in tern al represen tation , an d its valu e is stored in th e n ext variable con tain ed in th e variable list. If more valu es are read th an th e n u mber of variables specified, th e extra valu es are ign ored. If fewer valu es are read, th e remain in g variables are set to zero. If data is read th at is n ot a n u mber, an error occu rs an d program execu tion stops. E ach PROMPT in stru ction sh ou ld requ est on ly on e valu e to avoid con fu sion an d to redu ce th e possibility of error. 2 . If a sin gle strin g variable is specified as th e variable list, th e en tire in pu t lin e is stored in th e strin g variable. Th e program mu st th en process th e strin g appropriately. If you press th e RE TURN key, or press CTRL+C, an empty lin e is read. Th is resu lts in all th e real variables bein g set to zero, or th e strin g variable bein g assign ed an empty strin g. If you press CTRL+Z, an en d-of-file error con dition resu lts. If th ere is n o RE ACTE in stru ction active, program execu tion is termin ated an d an error message is displayed. Th u s, CTRL+Z can be a u sefu l way to abort program execu tion at a PROMPT. E xamples Con sider th e in stru ction : V+ Lan gu age Referen ce Gu ide Page 6 1 3 PROMPT program in stru ction PROMPT "Enter the number of parts: ", part.count Th e resu lt of execu tin g th is in stru ction is th e display of th e message Enter the number of parts: on th e system termin al to ask you to type in th e desired valu e. After you type a n u mber an d press th e RE TURN key, th e variable part.cou n t is set equ al to th e valu e typed, an d program execu tion resu mes. Con sider ch an gin g th e above in stru ction to: PROMPT "Enter the number of parts: ", $input E ven if you en ter ch aracters th at are n ot valid for n u meric in pu t, V+ does n ot ou tpu t an error message. Th e application program can u se th e variou s strin g fu n ction s to extract n u meric valu es from th e in pu t strin g. If you wan t to in clu de format specification s in th e strin g ou tpu t to th e termin al (su ch as /Cn to skip lin es), you can u se eith er th e $ E NCODE fu n ction or th e TYPE in stru ction . For example, th e in stru ction PROMPT $ENCODE(/B,/C1,/X10)+"Enter the number of parts: ", $input beeps th e termin al, spaces down a lin e, spaces over ten spaces, ou tpu ts th e strin g, an d waits for you r in pu t. (Note th at a + sign h as to be u sed between th e $ E NCODE fu n ction an d th e qu oted strin g becau se th e en tire ou tpu t_ strin g parameter mu st be a sin gle strin g expression .) Th e followin g pairs of in stru ction s are equ ivalen t to th e previou s example: TYPE /B, /C1, /X10, /S PROMPT "Enter the number of parts: ", $input or TYPE /B, /C1, /X10, "Enter the number of parts: ", /S PROMPT , $input Note th at /S mu st be in clu ded in th e TYPE in stru ction s as sh own to h ave th e prompt strin g ou tpu t on on e lin e, an d to h ave th e cu rsor remain on th at lin e. Related Keywords GE TC real-valu ed fu n ction RE AD program in stru ction TYPE program in stru ction V+ Lan gu age Referen ce Gu ide Page 6 1 4 RANDOM real-valu ed fu n ction R ANDOM real-valued function Syntax RANDOM Function Retu rn a pseu doran dom n u mber. Usage Considerations Th e word " ran dom" can n ot be u sed as a program n ame or variable n ame. Details Retu rn s a pseu doran dom n u mber in th e ran ge 0 .0 to 1 .0 , in clu sive. Th u s, each time th e RANDOM fu n ction is evalu ated, it retu rn s a differen t valu e. Th e n u mbers gen erated by th is fu n ction are pseu doran dom becau se th e sequ en ce repeats after th is fu n ction h as been called 2 24 (1 6 ,7 7 7 ,2 1 6 ) times. V+ Lan gu age Referen ce Gu ide Page 6 1 5 RE ACT program in stru ction R EACT program instruction Syntax REACT sign al_ n u m, program, priority Function In itiate con tin u ou s mon itorin g of a specified digital sign al an d au tomatically trigger a su brou tin e call if th e sign al properly tran sition s. Usage Considerations Th e RE ACT (an d RE ACTI) in stru ction can be execu ted by an y of th e program tasks. Th at is, each task can h ave its own , in depen den t reaction defin ition . An y of th e first twelve extern al in pu t sign als (1 0 0 1 to 1 0 1 2 ) can be simu ltan eou sly mon itored. Reaction s are triggered by sign al tran sition s an d n ot levels. Th u s, if a sign al is goin g to be mon itored for a tran sition from off to on an d th e sign al is already on wh en a RE ACT (or RE ACTI) in stru ction is execu ted, th en th e reaction does n ot occu r u n til th e sign al goes off an d th en on again . A sign al mu st remain stable for at least 1 8 millisecon ds to assu re detection of a tran sition . NOTE:If software sign als are bein g u sed to trigger reaction s, th e WAIT in stru ction (with n o argu men t) sh ou ld be u sed as requ ired to en su re th at th e sign al state remain s con stan t for th e requ ired time period. Th e requ ested sign al mon itorin g is en abled as soon as a RE ACT (or RE ACTI) in stru ction is execu ted. Becau se of th e way V+ processes program in stru ction s, th is can resu lt in an effect on th e motion in itiated by th e motion in stru ction precedin g th e RE ACT (or RE ACTI) in stru ction in th e program. (See th e section Motion Con trol E xamples in th e V+ Lan gu age User's Gu ide for a discu ssion of robot motion processin g.) V+ Lan gu age Referen ce Gu ide Page 6 1 6 RE ACT program in stru ction Parameters sign al_ n u m Real-valu ed expression represen tin g th e sign al to be mon itored. Th e sign al n u mber mu st be in th e ran ge 1 0 0 1 to 1 0 1 2 (extern al in pu t sign als) or 2 0 0 1 to 2 0 0 8 (in tern al software sign als). (Th e software sign als can th u s be u sed by on e program task to in terru pt an oth er task.) If th e sign al n u mber is positive, V+ looks for a tran sition from off to on ; if sign al_ n u m is n egative, V+ looks for a tran sition from on to off. program Name of th e su brou tin e th at is to be called wh en th e sign al tran sition s properly. priority Option al real-valu ed expression th at in dicates th e relative importan ce of th is reaction as explain ed below. Th e valu e of th is expression is in terpreted as an in teger valu e an d can ran ge from 1 to 1 2 7 . See th e LOCK in stru ction for addition al details on priority valu es. Th e defau lt valu e is 1 . Details Wh en th e specified sign al tran sition is detected, V+ reacts by ch eckin g th e priority specified with th e RE ACT in stru ction again st th e program priority settin g at th at time. (Th e program priority is always set to 0 wh en execu tion begin s. It can be ch an ged with th e LOCK in stru ction .) If th e RE ACT priority is greater th an th e program priority, th e n ormal program execu tion sequ en ce is in terru pted an d th e equ ivalen t of a CALL program in stru ction is execu ted. Also, th e program priority is temporarily raised to th e RE ACT priority, lockin g ou t an y reaction s of equ al or lower importan ce. Wh en a RE TURN in stru ction is execu ted in a reaction su brou tin e, th e program priority is restored to th e valu e it h ad before th e reaction program was in voked. If th e RE ACT priority is less th an or equ al to th e program priority wh en th e sign al tran sition is detected, th e reaction is qu eu ed an d does n ot occu r u n til th e program priority is lowered. Th erefore, depen din g u pon th e relative priorities, th ere can be a con siderable delay between th e time a sign al tran sition is n oticed by V+ an d th e time th e reaction program is actu ally in voked. If mu ltiple reaction s are pen din g becau se of a priority lockou t, th e reaction with th e h igh est priority is serviced first wh en th e lockin g priority is lowered. If mu ltiple pen din g reaction s h ave th e same priority, th e on e associated with th e h igh est sign al n u mber is processed first. Th e su brou tin e call to program is performed su ch th at wh en a RE TURN in stru ction is en cou n tered, th e n ext in stru ction to be execu ted is th e on e th at follows th e last in stru ction processed before th e reaction program was in itiated. If th ere is a sequ en ce of in stru ction s th at you do n ot wan t in terru pted by a reaction program, you sh ou ld u se th e LOCK in stru ction to raise th e program priority du rin g th at sequ en ce. V+ Lan gu age Referen ce Gu ide Page 6 1 7 RE ACT program in stru ction Th e sign al mon itorin g con tin u es u n til on e of th e followin g occu rs: l An IGNORE in stru ction is execu ted for th e sign al. l A reaction occu rs (in wh ich case IGNORE sign al_ n u m is au tomatically performed). l A RE ACT (or RE ACTI) in stru ction is execu ted th at refers to th e same sign al. Th at is, if th e sign al specified in a RE ACT in stru ction is already bein g mon itored by a previou s RE ACT or RE ACTI in stru ction , th e old in stru ction is can celed wh en th e n ew RE ACT in stru ction is execu ted. E xample Th e in stru ction below mon itors th e extern al in pu t sign al iden tified by th e valu e of th e variable test. If th e desired sign al tran sition occu rs (as specified by th e sign of th e valu e of test), program execu tion bran ch es to program delay as soon as th e program priority drops to 0 (sin ce n o priority is specified in th e in stru ction ). (Th e program priority is raised to 1 [th e defau lt valu e] wh en th e su brou tin e is in voked; th e program priority retu rn s to 0 wh en th e program retu rn s.) REACT test, delay Related Keywords IGNORE program in stru ction LOCK program in stru ction PRIORITY real-valu ed fu n ction RE ACTE program in stru ction RE ACTI program in stru ction SIG.INS real-valu ed fu n ction V+ Lan gu age Referen ce Gu ide Page 6 1 8 RE ACTE program in stru ction R EACTE program instruction Syntax REACTE program_ n ame Function In itiate th e mon itorin g of errors th at occu r du rin g execu tion of th e cu rren t program task. Usage Considerations Th e main pu rpose for th e RE ACTE in stru ction is to allow for an orderly sh u tdown of th e system if an u n expected error occu rs. If a robot h ardware error occu rs, for example, a RE ACTE program can set extern al ou tpu t sign al lin es to sh u t down extern al equ ipmen t. Usin g th e RE ACTE in stru ction for oth er pu rposes requ ires extreme cau tion . Th e RE ACTE in stru ction can be execu ted by an y of th e program tasks. Th at is, each task can h ave its own , in depen den t RE ACTE defin ition . (A task can n ot directly trap errors cau sed by an oth er task, bu t tasks can sign al each oth er via global variables or software sign als.) Th e E RROR real-valu ed fu n ction mu st be called before a RE ACTE with n o program n ame, sin ce th e RE ACTE clears th e previou s errors See th e list below for oth er con sideration s. Parameter program_ n ame Option al n ame of th e program th at is to be called wh en a program error occu rs. If n o program is specified, th e previou s RE ACTE is can celed, an d an y pen din g error message is discarded. Details If an error occu rs after a RE ACTE in stru ction h as been execu ted, th e specified program is in voked, rath er th an stoppin g n ormal program execu tion . (Th e program is in voked as th ou gh by th e CALL program in stru ction .) Th e E RROR real-valu ed fu n ction can be u sed with in th e error-h an dlin g program to determin e wh at error cau sed th e program to be in voked. Th ere are several special con sideration s th at mu st be kept in min d wh en u sin g th is facility: l l l Th e program priority is raised to 2 5 4 wh en th e error-h an dlin g program is in voked, lockin g ou t all reaction programs. E xecu tion of th e program task stops if an error occu rs wh ile th e system is processin g a previou s error. Th ere mu st be room on th e u ser program stack for on e more su brou tin e. Th erefore, V+ Lan gu age Referen ce Gu ide Page 6 1 9 RE ACTE program in stru ction th e error * Too man y su brou tin e calls* can n ot be processed. (See th e STACK mon itor comman d.) l l l l Th e error-h an dlin g program can con tain a RE TURN in stru ction . Wh en it is execu ted, th e program tries to re-execu te th e in stru ction th at cau sed th e error. Note th at th is may cau se an en dless loop if th e error con tin u es to occu r. Before th e error-h an dlin g program is en tered, a DE TACH in stru ction for th e robot (logical u n it n u mber 0 ) is effectively execu ted. Th u s, an ATTACH in stru ction mu st be execu ted for th e robot before program con trol of th e robot can resu me. If a STOP, HALT, or PAUSE in stru ction is execu ted with in th e error-h an dlin g program, th e origin al error message is ou tpu t u n less th e error-h an dlin g program con tain s a RE ACTE in stru ction with n o argu men t. Un like RE ACT an d RE ACTI, execu tion of th e RE ACTE error-h an dlin g program is n ever deferred becau se of priority con sideration s. E xample In itiate mon itorin g of errors so th at th e program error.trap is execu ted if an y error sh ou ld occu r du rin g execu tion of th e cu rren t program task: REACTE error.trap Related Keywords E RROR real-valu ed fu n ction RE ACT program in stru ction RE ACTI program in stru ction RE TURNE program in stru ction V+ Lan gu age Referen ce Gu ide Page 6 2 0 RE ACTI program in stru ction R EACTI program instruction Syntax REACTI sign al_ n u m, program, priority Function In itiate con tin u ou s mon itorin g of a specified digital sign al. Au tomatically stop th e cu rren t robot motion if th e sign al tran sition s properly an d option ally trigger a su brou tin e call. Usage Considerations For most application s, th e RE ACTI in stru ction sh ou ld be u sed on ly in a robot con trol program. (See below for more in formation .) Wh en a RE ACTI triggers, th e robot th at is stopped is th e on e selected by th e task at th e time of th e trigger, regardless of wh ich robot was selected at th e time th e RE ACTI in stru ction was execu ted. Also see th e con sideration s listed for th e RE ACT program in stru ction . Parameters sign al_ n u m Real-valu ed expression represen tin g th e sign al to be mon itored. Th e sign al n u mber mu st be in th e ran ge 1 0 0 1 to 1 0 1 2 (extern al in pu t sign als) or 2 0 0 1 to 2 0 0 8 (in tern al software sign als). (Th e software sign als can th u s be u sed by a secon dary program to in terru pt th e robot con trol program, an d vice versa.) If th e sign al n u mber is positive, V+ looks for a tran sition from off to on ; if sign al is n egative, V+ looks for a tran sition from on to off. program Option al n ame of th e su brou tin e th at is called wh en th e sign al tran sition s properly. priority Option al real-valu ed expression th at in dicates th e relative importan ce of th is reaction as explain ed below. Th e valu e of th is expression is in terpreted as an in teger valu e an d can ran ge from 1 to 1 2 7 . If th is argu men t is omitted, it defau lts to 1 . See th e LOCK in stru ction for addition al details on priority valu es. Details Wh en th e specified sign al tran sition is detected, V+ reacts by immediately stoppin g th e cu rren t robot motion . If a program is specified, V+ th en con tin u es processin g th e reaction ju st as it wou ld for a RE ACT in stru ction . (See th e description of th e RE ACT in stru ction for a fu ll explan ation of th is processin g). V+ Lan gu age Referen ce Gu ide Page 6 2 1 RE ACTI program in stru ction Wh en RE ACTI is u sed by a program task th at is n ot actu ally con trollin g th e robot, care mu st be exercised to make su re th e robot con trol program does n ot n u llify th e in ten ded effect of th e reaction su brou tin e. Th at is, if you r application h as on e program task mon itorin g th e sign al an d a differen t program task con trollin g th e robot, you sh ou ld keep th e followin g poin ts in min d wh en plan n in g for processin g of th e reaction : l l Th e robot motion in process at th e time of th e reaction is stopped, as if a BRAKE in stru ction were execu ted, bu t execu tion of th e robot con trol program is n ot directly affected. If a reaction su brou tin e is specified, th at rou tin e is execu ted by th e task th at is mon itorin g th e reaction (n ot by th e task con trollin g th e robot). Th e sign al mon itorin g con tin u es u n til on e of th e followin g occu rs: l An IGNORE in stru ction is execu ted for th e sign al. l A reaction occu rs (in wh ich case IGNORE sign al_ n u m is au tomatically performed). l A RE ACTI (or RE ACT) in stru ction is execu ted th at refers to th e same sign al. Th at is, if th e sign al specified in a RE ACTI in stru ction is already bein g mon itored by a previou s RE ACTI or RE ACT in stru ction , th e old in stru ction is can celed wh en th e n ew RE ACTI in stru ction is execu ted. If you do n ot wan t th e robot motion to stop u n til th e reaction program is actu ally called, you sh ou ld u se a RE ACT in stru ction an d pu t a BRAKE in stru ction in th e reaction program. E xample Th e in stru ction below in itiates mon itorin g of extern al in pu t sign al #1 0 0 1 . Th e robot motion is stopped immediately if th e sign al ever ch an ges from on to off (sin ce th e sign al is specified as a n egative valu e). A bran ch to program alarm th en occu rs wh en th e program priority falls below 1 0 (if it is n ot already at or below th at level). REACTI -1001, alarm, 10 Related Keywords IGNORE program in stru ction LOCK program in stru ction PRIORITY real-valu ed fu n ction RE ACT program in stru ction RE ACTE program in stru ction SIG.INS real-valu ed fu n ction V+ Lan gu age Referen ce Gu ide Page 6 2 2 RE AD program in stru ction R EAD program instruction Syntax READ ( lu n , record_ n u m, mode) var_ list Function Read a record from an open file or from an attach ed device th at is n ot file orien ted. For an AdeptNet device, read a strin g from an attach ed an d open TCP con n ection . Usage Considerations Th e logical u n it referen ced by th is in stru ction mu st h ave been attach ed previou sly. For file-orien ted devices, a file mu st already h ave been open ed with an FOPE N_ in stru ction . V+ Lan gu age Referen ce Gu ide Page 6 2 3 RE AD program in stru ction Parameters lu n Real-valu ed expression th at iden tifies th e device to be accessed. (See th e ATTACH in stru ction for a description of u n it n u mbers.) record_ n u m Option al real-valu ed expression th at specifies th e record to read for file-orien ted devices open ed in ran dom-access mode (see th e FOPE N_ in stru ction s). For n on file-orien ted devices or for sequ en tial access of a file, th is parameter sh ou ld be 0 or omitted. Records are n u mbered from on e to a maximu m of 1 6 ,7 7 7 ,2 1 6 . Wh en accessin g th e TCP device with a server program, th is parameter is an option al real variable th at retu rn s th e clien t h an dle n u mber. Th e h an dle can be u sed to iden tify th e clien t accessin g a mu ltiple-clien t server. mode Option al real-valu ed expression th at specifies th e mode of th e read operation . Cu rren tly, th e mode is u sed on ly for th e termin al an d serial I/O logical u n its. Th e valu e is in terpreted as a sequ en ce of bit flags as detailed below. (All bits are assu med to be clear if n o mode valu e is specified.) Bit 1 (LSB) Wait (0 ) vs. No-wait (1 ) (mask valu e = 1 ) If th is bit is clear, program execu tion is su spen ded u n til th e read operation is completed. If th e bit is set an d th e requ ested data is n ot available, program execu tion con tin u es immediately an d th e IOSTAT fu n ction retu rn s th e error code for * No data received* (-5 2 6 ). NOTE: For a n o-wait RE AD to access a serial lin e, th e lin e mu st be con figu red to u se DDCMP. Bit 2 E ch o (0 ) vs. No-ech o (1 ) (mask valu e = 2 ) If th is bit is clear, in pu t from th e termin al is ech oed back to th e sou rce. If th e bit is set, ch aracters are n ot ech oed back to th e sou rce. (Th is mode bit is ign ored for th e serial lin es.) var_ list E ith er a list of real-valu ed in pu t variables or a list of strin g variables, wh ich receives th e data (see followin g details). Details Th is is a gen eral-pu rpose data in pu t in stru ction th at reads a record from a specified logical u n it. A record can con tain an arbitrary list of ch aracters bu t mu st n ot exceed 5 1 2 ch aracters V+ Lan gu age Referen ce Gu ide Page 6 2 4 RE AD program in stru ction in len gth . For files th at are open ed in fixed-len gth record mode, th is in stru ction con tin u es to read ch aracters u n til it h as read exactly th e n u mber of ch aracters specified du rin g th e correspon din g FOPE N_ in stru ction . For variable-len gth record mode (with most devices), th is in stru ction reads ch aracters u n til th e first carriage-retu rn (CR) an d lin e-feed (LF) ch aracter sequ en ce (or Ctrl+Z) is en cou n tered. Th u s, for example, if you perform a variable-len gth record mode read from th e disk, you receive all th e ch aracters u n til a CR an d LF are en cou n tered. Th e special ch aracter Ctrl+Z (2 6 decimal) in dicates th e logical en d of th e file, wh ich is reported as an error by th e IOSTAT fu n ction . No in pu t ch aracters can be read beyon d th at poin t. RE AD operation s from th e termin al, th e man u al con trol pen dan t, an d th e serial lin es are always assu med to be in variable-len gth record mode. E xcept as n oted below, th e records are termin ated by CR an d LF (wh ich are n ot retu rn ed as part of th e record). Th u s, a RE AD from th ese devices is n ot complete u n til a CR an d LF are received as in pu t. For example, if you perform a RE AD from th e termin al, you receive all th e ch aracters u n til th e RE TURN key is pressed. NOTE:Wh en a CR is received from th e system termin al, V+ au tomatically adds a LF. Similarly, th e pen dan t's DONE key is in terpreted as CR an d LF. Th e GE TC real-valu ed fu n ction can be u sed in stead of th e RE AD in stru ction if you wan t to receive th e CR an d LF ch aracters at th e en d of a record. Wh en a RE AD in stru ction accesses a serial lin e con figu red to u se DDCMP, th e record may con tain arbitrary data, in clu din g CR an d LF ch aracters. If bit 1 is set in th e mode valu e, a read operation th at is n ot complete does n ot cau se th e program to wait, bu t retu rn s immediately with th e error * No data received* (error code -5 2 6 ). Th en , addition al RE AD in stru ction s mu st be execu ted, u n til on e is complete, in order to obtain th e data in th e variable list. Th e IOSTAT fu n ction can be u sed to determin e wh en su ch a RE AD is complete. On ce a record h as been read, it is processed in on e of th e followin g two ways: 1 . If th e var_ list parameter is a list of real-valu ed variables, th e record is assu med to con tain a list of n u mbers separated by space ch aracters an d/or commas. E ach n u mber is con verted from text to its in tern al represen tation , an d its valu e is stored in th e n ext variable con tain ed in th e variable list. If more valu es are read th an th e n u mber of variables specified, th e extra valu es are ign ored. If fewer valu es are read, th e remain in g variables are set to zero. If data is read th at is n ot a n u mber, an error occu rs an d program execu tion stops (or an error reaction occu rs). 2 . If th e var_ list parameter is a list of strin g variables, th e en tire record is stored in th e strin g variables as follows. Th e first 1 2 8 bytes in th e record are copied to th e first V+ Lan gu age Referen ce Gu ide Page 6 2 5 RE AD program in stru ction strin g variable. If th ere are more th an 1 2 8 bytes in th e record, th e secon d strin g variable is filled with th e n ext 1 2 8 bytes. Th is con tin u es u n til th e en tire record h as been processed or all th e strin g variables h ave been filled. If th ere is n ot en ou gh data to fill all th e strin g variables, th e u n u sed strin g variables are set to th e empty strin g (" " ). If th ere is too mu ch data for th e n u mber of strin g variables specified, an error is reported by th e IOSTAT real-valu ed fu n ction . Wh en a RE AD is performed in variable-len gth record mode, th e strin gs con tain all th e ch aracters u p to, bu t n ot in clu din g, th e termin atin g CR an d LF, wh ich are discarded. An y error in th e specification of th is in stru ction (su ch as attemptin g to read from an in valid u n it) cau ses a program error an d h alts program execu tion . However, errors associated with performin g th e actu al read operation (su ch as en d of file or device n ot ready) do n ot h alt program execu tion sin ce th ese errors may occu r in th e n ormal operation of a program. Th ese n ormal errors can be detected by u sin g th e IOSTAT fu n ction after performin g th e read. In gen eral, it is good practice always to test wh eth er each read operation completed su ccessfu lly by testin g th e valu e from IOSTAT. Wh en accessin g th e AdeptNet device, th e record_ n u m parameter allows a server to commu n icate with mu ltiple clien ts on a sin gle logical u n it. In th is con text, th e parameter provides a h an dle n u mber th at you can u se to iden tify th e clien t from wh ich th e RE AD data was received. Han dles are allocated wh en a clien t con n ects to th e server an d are deallocated wh en th e clien t discon n ects. In order to determin e wh en th e clien t con n ection or discon n ection is don e, you mu st u se th e IOSTAT real-valu ed fu n ction after th e RE AD. Refer to th e docu men tation for IOSTAT. Th e RE AD in stru ction with TCP/IP reads data u n til eith er th e in pu t strin g is fu ll or th e bu ffer is empty, at wh ich poin t th e in stru ction retu rn s. RE AD with TCP/IP does n ot allow fixed-len gth records an d does n ot termin ate wh en en cou n terin g a delimiter. E xample Read a lin e of text from th e disk an d store th e record in th e strin g variable $ disk.in pu t: READ (5) $disk.input For an example of u sin g th e RE AD in stru ction with th e TCP device, refer to th e E xample section for th e IOSTAT real-valu ed fu n ction . Related Keywords ATTACH program in stru ction FOPE N_ program in stru ction FSE E K program in stru ction V+ Lan gu age Referen ce Gu ide Page 6 2 6 RE AD program in stru ction GE TC real-valu ed fu n ction IOSTAT real-valu ed fu n ction PROMPT program in stru ction V+ Lan gu age Referen ce Gu ide Page 6 2 7 RE ADY program in stru ction R EADY program instruction Syntax READY Function Move th e robot to th e RE ADY location above th e workspace, wh ich forces th e robot in to a stan dard con figu ration . Usage Considerations Before execu tin g th is in stru ction with th e DO mon itor comman d (DO RE ADY), make su re th at th e robot will n ot strike an yth in g wh ile movin g to th e RE ADY location . Th e RE ADY in stru ction can be execu ted by an y program task as lon g as th e task h as attach ed a robot. Th e in stru ction applies to th e robot selected by th e task. If th e V+ system is n ot con figu red to con trol a robot, execu tin g th e RE ADY in stru ction cau ses an error. Details Th is in stru ction always su cceeds, regardless of wh ere th e robot is located at th e time. An Adept SCARA robot h as th e followin g con figu ration wh en it is at th e RE ADY location : l Join t 2 is at 9 0 degrees l Th e axis of join t 3 is in th e World X-Z plan e (th at is, Y = 0 ) l l If th e option al join t 5 is in stalled, it is poin ted straigh t down (AdeptOn e an d AdeptTh ree on ly) Th e align men t keyway in th e en d-effector flan ge is directed alon g th e positive X axis (th at is, th e tool X axis is parallel to th e world X axis) Th e followin g table lists th e join t position s for th e RE ADY location s for th e AdeptOn e an d AdeptTh ree SCARA robots. Join t AdeptOn e Rt-h an ded AdeptTh ree Rt-h an ded 1 -4 1 .4 ° -4 2 .3 ° 2 9 0 .0 ° 9 0 .0 ° 3 2 5 .0 mm 2 5 .0 mm V+ Lan gu age Referen ce Gu ide Page 6 2 8 RE ADY program in stru ction 4 4 8 .6 ° 4 7 .7 ° 5 0 .0 ° 0 .0 ° For devices con trolled by AdeptMotion or SmartMotion , th e RE ADY location depen ds u pon th e device modu le bein g u sed. Related Keyword SE LE CT program in stru ction SE LE CT real-valu ed fu n ction V+ Lan gu age Referen ce Gu ide Page 6 2 9 RE LAX an d RE LAXI program in stru ction R ELAX and R ELAXI program instruction Syntax RELAX RELAXI Function Limp th e pn eu matic h an d. Usage Considerations RE LAX cau ses th e h an d to limp du rin g th e n ext robot motion . RE LAXI cau ses a BRE AK in th e cu rren t con tin u ou s-path motion an d cau ses th e h an d to limp immediately after th e cu rren t motion completes. Th e RE LAX in stru ction can be execu ted by an y program task as lon g as th e robot selected by th e task is n ot attach ed by an y oth er task. Th e in stru ction applies to th e robot selected by th e task. Th e RE LAXI in stru ction can be execu ted by an y program task as lon g as th e task h as attach ed a robot. Th e in stru ction applies to th e robot selected by th e task. If th e V+ system is n ot con figu red to con trol a robot, execu tin g th ese in stru ction s cau ses an error. Details Th ese in stru ction s tu rn off both th e open an d close pn eu matic con trol solen oid valves, cau sin g th e pn eu matic h an d to become limp. If th e RE LAX in stru ction is u sed, th e sign al is sen t wh en th e n ext robot motion begin s. NOTE: Use th e SPE C Utility program to set th e digital sign als th at con trol th e pn eu matic h an d. See th e In stru ction s for Adept Utility Programs for in formation on u se of th e program. Th e RE LAXI in stru ction differs from RE LAX in th e followin g ways: l l l A BRE AK occu rs if a con tin u ou s-path robot motion is in progress. Th e sign als are sen t to th e con trol valves at th e con clu sion of th e cu rren t motion or immediately if n o motion is in progress. Robot motion s are delayed for a brief time to allow th e h an d actu ation to complete. V+ Lan gu age Referen ce Gu ide Page 6 3 0 RE LAX an d RE LAXI program in stru ction Th e len gth of th e delay (in secon ds) is th e cu rren t settin g of th e HAND.TIME system parameter. Related Keywords CLOSE program in stru ction CLOSE I program in stru ction HAND.TIME system parameter OPE N program in stru ction OPE NI program in stru ction SE LE CT program in stru ction SE LE CT real-valu ed fu n ction V+ Lan gu age Referen ce Gu ide Page 6 3 1 RE LAX an d RE LAXI program in stru ction R ELAX and R ELAXI program instruction Syntax RELAX RELAXI Function Limp th e pn eu matic h an d. Usage Considerations RE LAX cau ses th e h an d to limp du rin g th e n ext robot motion . RE LAXI cau ses a BRE AK in th e cu rren t con tin u ou s-path motion an d cau ses th e h an d to limp immediately after th e cu rren t motion completes. Th e RE LAX in stru ction can be execu ted by an y program task as lon g as th e robot selected by th e task is n ot attach ed by an y oth er task. Th e in stru ction applies to th e robot selected by th e task. Th e RE LAXI in stru ction can be execu ted by an y program task as lon g as th e task h as attach ed a robot. Th e in stru ction applies to th e robot selected by th e task. If th e V+ system is n ot con figu red to con trol a robot, execu tin g th ese in stru ction s cau ses an error. Details Th ese in stru ction s tu rn off both th e open an d close pn eu matic con trol solen oid valves, cau sin g th e pn eu matic h an d to become limp. If th e RE LAX in stru ction is u sed, th e sign al is sen t wh en th e n ext robot motion begin s. NOTE: Use th e SPE C Utility program to set th e digital sign als th at con trol th e pn eu matic h an d. See th e In stru ction s for Adept Utility Programs for in formation on u se of th e program. Th e RE LAXI in stru ction differs from RE LAX in th e followin g ways: l l l A BRE AK occu rs if a con tin u ou s-path robot motion is in progress. Th e sign als are sen t to th e con trol valves at th e con clu sion of th e cu rren t motion or immediately if n o motion is in progress. Robot motion s are delayed for a brief time to allow th e h an d actu ation to complete. V+ Lan gu age Referen ce Gu ide Page 6 3 2 RE LAX an d RE LAXI program in stru ction Th e len gth of th e delay (in secon ds) is th e cu rren t settin g of th e HAND.TIME system parameter. Related Keywords CLOSE program in stru ction CLOSE I program in stru ction HAND.TIME system parameter OPE N program in stru ction OPE NI program in stru ction SE LE CT program in stru ction SE LE CT real-valu ed fu n ction V+ Lan gu age Referen ce Gu ide Page 6 3 3 RE LE ASE program in stru ction R ELEASE program instruction Syntax RELEAS E task Function Allow th e n ext available program task to ru n . Parameter task Option al argu men t specifyin g th e task to wh ich to release con trol. Th e ran ge of acceptable valu es is from -1 to th e n u mber of tasks con figu red for th e cu rren t system. If th e specified task does n ot exist, th e cu rren t task resu mes. Details If a task is omitted, th e in stru ction releases con trol to th e h igh est priority task with in th e time slice th at is ready to ru n an d is n ot in th e same rou n d-robin grou p as th e cu rren t task. For more in formation on task sch edu lin g, see th e section Sch edu lin g of Program E xecu tion Tasks in th e V+ Lan gu age User's Gu ide. If task = -1 , th e in stru ction releases con trol to an oth er task, an d V+ scan s as follows: l l l If th e cu rren t task is explicitly sch edu led in th is time slice, begin scan n in g with th e n ext lower priority task in th is slice. Wh en th e en d of th e slice is reach ed, wrap arou n d to th e begin n in g of th is slice an d search u n til th e cu rren t task is fou n d again . Ign ore th e cu rren t task an d an y task in th e cu rren t task's rou n d-robin grou p. If th e cu rren t task is n ot sch edu led in th is slice, scan th is slice from th e top to th e bottom. Ign ore an y task in th e cu rren t task's rou n d-robin grou p. If n o ready task is fou n d in th e cu rren t slice, search ah ead in all oth er slices u n til a task is fou n d th at is ready to ru n . Accept tasks in th e cu rren t task's rou n d-robin grou p. If n o oth er ready task is fou n d, resu me th e cu rren t task. If task >= 0 , con trol is released to th e specified task, provided th at task is ready to ru n . If th e task is n ot ready to ru n , th e cu rren t task con tin u es execu tin g. Th is release bypasses th e n ormal time slice an d priority ch eckin g. NOTE: If two h igh -priority tasks issu e RE LE ASE (with n o task parameter) in th e same time slice, th ey pass con trol back an d forth to each oth er, effectively lockin g ou t an y lower-priority tasks in th e slice. V+ Lan gu age Referen ce Gu ide Page 6 3 4 RE LE ASE program in stru ction Th is in stru ction can be u sed in place of th e WAIT in stru ction (with n o argu men ts) in cases wh ere oth er tasks mu st be given an opportu n ity to ru n , bu t a delay u n til th e n ext 1 6 -millisecon d cycle is n ot desired. If th e even t flag is already set, WAIT.E VE NT h as n o effect an d th e cu rren t task keeps ru n n in g. If th e even t flag is n ot set, th e cu rren t task will n ot keep ru n n in g an d some oth er task mu st ru n . RE LE ASE resu mes th e cu rren t task if n o oth er task is fou n d. WAIT.E VE NT begin s scan n in g forward from th e h igh est priority task in th e cu rren t time slice. Rou n d-robin grou ps are treated as a sin gle task. If an y member of a grou p is selected du rin g th e scan , th en th e grou p is selected. Th e grou p is scan n ed to fin d th e task in th e grou p followin g th e on e wh ich ran most recen tly an d th at task is ru n . It may or may n ot be th e task th at was actu ally fou n d by RE LE ASE . If you wan t to release a task an d allow th e n ext task in th e grou p to ru n , issu e a RE LE ASE TASK () in stru ction . Related Keywords WAIT program in stru ction WAIT.E VE NT program in stru ction V+ Lan gu age Referen ce Gu ide Page 6 3 5 RE SE T program in stru ction R ESET program instruction Syntax RES ET Function Tu rn off all th e extern al ou tpu t sign als. Details Th e RE SE T program in stru ction is u sefu l in th e in itialization portion of a program to en su re th at all th e extern al ou tpu t sign als are in a kn own state. DANGER: Before issu in g th is in stru ction , make su re all devices con n ected to th e ou tpu t sign als can safely be tu rn ed off. Be especially carefu l of sign als th at start an action wh en th ey are tu rn ed off. Related Keywords BITS mon itor comman d BITS program in stru ction BITS real-valu ed fu n ction IO mon itor comman d RE SE T mon itor comman d SIG real-valu ed fu n ction SIG.INS real-valu ed fu n ction SIGNAL mon itor comman d SIGNAL program in stru ction V+ Lan gu age Referen ce Gu ide Page 6 3 6 RE TURN program in stru ction R ETUR N program instruction Syntax RETURN Function Termin ate execu tion of th e cu rren t su brou tin e, an d resu me execu tion of th e su spen ded program at its n ext step. A program may h ave been su spen ded by issu in g a CALL, CALLP, or CALLS in stru ction , or by th e triggerin g of a RE ACT, RE ACTE , or RE ACTI con dition . Details A RE TURN in stru ction in a main program h as th e same effect as a STOP in stru ction . A RE TURN in stru ction is assu med if program execu tion reach es th e last step of a su brou tin e. However, it is n ot good programmin g style to u se th is featu re-an explicit RE TURN in stru ction sh ou ld be in clu ded as th e last lin e of each su brou tin e. Th e effect of a RE TURN in stru ction in an error reaction su brou tin e differs sligh tly. In th at case, if th e reaction su brou tin e was in voked becau se of a program error (as opposed to an asyn ch ron ou s servo error or PANIC bu tton press), th e statemen t th at cau sed th e error is execu ted again . Th at is, th e error may occu r again immediately. Th e RE TURNE in stru ction sh ou ld be u sed in error reaction su brou tin es to avoid th at situ ation . If a RE TURN in stru ction is u sed to exit from a reaction rou tin e, th e program reaction priority is restored to wh atever it was before th e reaction rou tin e started execu tion . Related Keywords CALL program in stru ction CALLP program in stru ction CALLS program in stru ction LOCK program in stru ction RE ACT program in stru ction RE ACTE program in stru ction RE ACTI program in stru ction RE TURNE program in stru ction V+ Lan gu age Referen ce Gu ide Page 6 3 7 RE TURNE program in stru ction R ETUR NE program instruction Syntax RETURNE Function Termin ate execu tion of an error reaction su brou tin e an d resu me execu tion of th e last-su spen ded program at th e step followin g th e in stru ction th at cau sed th e su brou tin e to be in voked. Details Th e RE TURNE in stru ction is in ten ded for u se in error reaction su brou tin es. Th at is, su brou tin es th at are in voked, th rou gh th e RE ACTE mech an ism, as a resu lt of an error du rin g program execu tion . If a RE TURNE in stru ction is u sed to exit from an error reaction rou tin e, th e program reaction priority is restored to wh atever it was before th e error reaction rou tin e started execu tion . Wh en a RE TURNE in stru ction is execu ted in an error reaction su brou tin e, th en execu tion con tin u es with th e statemen t followin g th e on e execu tin g wh en th e error occu rred. (Note th at in th is situ ation , a RE TURN in stru ction resu lts in th e statemen t th at gen erated th e error bein g execu ted again , possibly cau sin g an immediate repeat of th e error.) NOTE: Becau se of th e forward processin g ability of V+, th e in stru ction th at is th e sou rce of an error may n ot be th e on e execu tin g wh en th e error is actu ally registered. For example, wh en a MOVE in stru ction is processed, th e robot begin s movin g, bu t du rin g th e motion several addition al in stru ction s may be processed. If an en velope or similar error occu rs after th is forward processin g, th e RE TURNE is based on th e in stru ction processin g wh en th e error occu rs, n ot th e MOVE in stru ction . It may be h elpfu l to n ote th at th e RE TURNE in stru ction beh aves similarly to th e PROCE E D comman d. Th e RE TURN in stru ction beh aves similarly to th e RE TRY comman d (except th at with RE TURN an in terru pted robot motion is n ot restarted). A RE TURNE in stru ction in a program th at is n ot execu ted in respon se to an error h as th e same effect as a RE TURN in stru ction . RE TURNE , h owever, takes sligh tly lon ger to execu te th an does RE TURN. Related Keywords RE ACTE program in stru ction RE TURN program in stru ction V+ Lan gu age Referen ce Gu ide Page 6 3 8 RIGHTY program in stru ction R IGHTY program instruction Syntax RI GHTY Function Requ est a ch an ge in th e robot con figu ration du rin g th e n ext motion so th at th e first two lin ks of th e robot resemble a h u man 's righ t arm. Usage Considerations Con figu ration ch an ges can n ot be made du rin g straigh t-lin e motion s. If th e selected robot does n ot su pport a righ t-h an ded con figu ration , th is in stru ction is ign ored by th e robot. Th e RIGHTY in stru ction can be execu ted by an y program task as lon g as th e robot selected by th e task is n ot attach ed by an y oth er task. Th e in stru ction applies to th e robot selected by th e task. If th e V+ system is n ot con figu red to con trol a robot, execu tin g th e RIGHTY in stru ction cau ses an error. See LE FTY/RIGHTY. Related Keywords CONFIG real-valu ed fu n ction LE FTY program in stru ction SE LE CT program in stru ction SE LE CT real-valu ed fu n ction V+ Lan gu age Referen ce Gu ide Page 6 3 9 ROBOT system switch R OBOT system switch Syntax ... ROBOT [in dex] Function E n able or disable on e robot or all robots. Usage Considerations Th e ROBOT system switch es may be modified on ly wh en both of th e followin g con dition s are satisfied: 1 . Th e POWE R system switch is OFF. 2 . Wh en th e V+ system was booted from disk, at least on e robot started u p with ou t reportin g a fatal error. Th e maximu m n u mber of robots su pported depen ds on you r con troller con figu ration . Some con trollers do n ot allow a robot to be calibrated u n less all robots with lower in dex n u mbers are en abled. Parameter in dex Option al real valu e, variable, or expression (in terpreted as an in teger) th at specifies th e robot to be en abled or disabled. Th e valu e sh ou ld be 1 th rou gh 1 5 (correspon din g to robots 1 th rou gh 1 5 , respectively). If th e in dex is omitted or zero in an E NABLE or DISABLE comman d or in stru ction , th e settin gs for all robots are altered. Oth erwise, on ly th e settin g for th e specified robot is affected. Details Wh en th e V+ system starts u p (after bootin g from disk), all th e robots th at started u p with ou t reportin g a fatal error are en abled by defau lt, an d all th e correspon din g ROBOT switch es are en abled. After start u p, th e ROBOT switch es can be u sed to selectively disable robots. For example, th is can aid in th e debu ggin g of in dividu al robots. Th e ROBOT switch es may be modified on ly for robots th at are presen t an d th at started u p with ou t a fatal error. Wh en a robot is disabled by u se of th e ROBOT switch , th at robot is bypassed wh en : l Power is en abled for all robots with th e COMP/PWR bu tton on th e man u al con trol pen dan t or with th e POWE R system switch . V+ Lan gu age Referen ce Gu ide Page 6 4 0 ROBOT system switch l All th e robots are calibrated via th e CALIBRATE mon itor comman d or program in stru ction . Motion in stru ction s sh ou ld n ot be execu ted for a robot th at h as been disabled. Th e settin gs of th ese switch es can be ch ecked at an y time with th e SWITCH mon itor comman d or real-valu ed fu n ction to determin e wh ich robots are en abled. Related Keywords DISABLE mon itor comman d DISABLE program in stru ction E NABLE mon itor comman d E NABLE program in stru ction SWITCH mon itor comman d SWITCH program in stru ction SWITCH real-valu ed fu n ction V+ Lan gu age Referen ce Gu ide Page 6 4 1 ROBOT.OPR program in stru ction R OBOT.OPR program instruction Syntax ROBOT.OPR (fu n ction _ code) exp1 , exp2 , ..., expn Function E xecu te operation s th at are specific to th e cu rren tly selected robot or robot modu le. Usage Considerations ROBOT.OPR is a gen eral-pu rpose in stru ction wh ose in terpretation varies from on e robot type to an oth er. Th e in stru ction is ign ored if th ere is n o robot attach ed. An error is reported if th e robot is trackin g a belt or if ALTE R is active. Parameters fu n ction _ code Option al real valu e th at specifies a fu n ction for th e selected robot modu le. exp1 , exp2 , ..., expn Option al expression s wh ose in terpretation is determin ed by th e selected robot modu le. NOTE: An * In valid argu men t* error is retu rn ed if th e " fu n ction _ code" valu e u sed is n ot valid. Th e same error is retu rn ed if an " exp" valu e exceeds its allowable ran ge. Th e valid " fu n ction _ code" an d " exp" valu es are described in th e device modu le docu men tation for you r robot. See th e Adept Robot Device Modu les men u in th e Adept Docu men t Library to access th e device modu le for you r robot. Details Th is in stru ction execu tes operation s th at are specific to th e cu rren tly selected robot or robot modu le. If th e selected robot does n ot su pport an y special operation s, th is in stru ction h as n o effect. Th e followin g table sh ows th e " fu n ction " an d " exp" valu es for th e su pported robot modu les. For addition al details abou t th e applicability an d u se of th is in stru ction , refer to th e docu men tation for you r specific robot modu le. See th e Adept Robot Device Modu les men u to access th e docu men tation for th e device modu le for you r robot. NOTE: On ly device modu les for n on -Adept robots are docu men ted. V+ Lan gu age Referen ce Gu ide Page 6 4 2 ROBOT.OPR program in stru ction S u pported Robot Modu les Robot Modu le fu n ction _ code exp1 , exp2 ,...expn V+ Lan gu age Referen ce Gu ide Page 6 4 3 Description ROBOT.OPR program in stru ction 1 . Th e Adept Qu attro s6 5 0 Robot device modu le (QPL) is n ot pu blish ed, becau se th is is an Adept Robot. V+ Lan gu age Referen ce Gu ide Page 6 4 4 ROBOT.OPR program in stru ction 0 en ables selection of th e primary an d slaved axes exp1 Nu mber of th e primary Z/Th eta axes (1 N). exp2 (Option al) Nu mber of th e secon dary Z/Th eta axes (1 -N). exp3 (Option al) Nu mber of th e th ird Z/Th eta axes (1 -N). exp4 (Option al) Nu mber of th e fou rth Z/Th eta axes (1 -N). NOTE: " N" is th e n u mber of con figu red Z/Th eta pairs, wh ich can be 1 to 4 . Th ere is n o ch eck for an axis pair bein g specified more th an on ce. V+ Lan gu age Referen ce Gu ide Page 6 4 5 ROBOT.OPR program in stru ction 1 en ables defin ition of th e position offset valu es th at are added to th e comman ded Z an d RZ position s for each slave axis exp1 Z offset for first slaved axes. exp2 (Option al) RZ offset for first slaved axes. exp3 (Option al) Z offset for secon d slaved axes. exp4 (Option al) RZ offset for secon d slaved axes. exp5 (Option al) Z offset for th ird slaved axes. exp6 (Option al) RZ offset for th ird slaved axes. NOTE: Th e offsets for th e fou rth set of slaved axes can n ot be set. V+ Lan gu age Referen ce Gu ide Page 6 4 6 ROBOT.OPR program in stru ction DLT (modu le ID 2 7 ) For th is robot, th is in stru ction sets th e Cartesian acceleration parameters to on e of th ree sets of valu es. Th e pu rpose of th is operation is to adju st th e dyn amic performan ce of th e robot depen din g u pon th e payload bein g carried. NOTE: Wh en u tilizin g ROBOT.OPR to ch an ge th e acceleration valu es, th e robot mu st be attach ed an d stopped wh en th is in stru ction is execu ted, to en su re n o adverse in teraction s with an y cu rren t motion execu tion . 0 sets th e Cartesian acceleration parameters to on e of th ree sets of valu es. exp1 Nu mber of th e set of Cartesian acceleration parameters to u tilize (1 -3 ). Th e parameters are in ten ded to be u sed as follows: Parameter S et Nu mber I n ten ded Payload 1 0 -1 0 0 gm 2 1 0 1 -3 0 0 gm 3 3 0 1 -5 0 0 gm V+ Lan gu age Referen ce Gu ide Page 6 4 7 ROBOT.OPR program in stru ction Adept Qu attro s6 5 0 Robot1 For th is robot, th is in stru ction sets th e Cartesian acceleration parameters to on e of two sets of valu es. Th e pu rpose of th is operation is to adju st th e dyn amic performan ce of th e robot depen din g u pon th e payload bein g carried. NOTE: Wh en u tilizin g ROBOT.OPR to ch an ge th e acceleration valu es, th e robot mu st be attach ed an d stopped wh en th is in stru ction is execu ted, to en su re n o adverse in teraction s with an y cu rren t motion execu tion . 0 (mu st be set to 0 ) exp1 Nu mber of th e set of Cartesian acceleration parameters to u tilize (1 or 2 ). (Parameter set #1 is applied wh en th e V+ system is booted from disk.) Parameter I n ten ded S et Payload Nu mber 1 0 -1 0 0 0 gm 2 10002 0 0 0 gm 1 . Th e Adept Qu attro s6 5 0 Robot device modu le (QPL) is n ot pu blish ed, becau se th is is an Adept Robot. Related Keyword ROBOT.OPR real-valu ed fu n ction V+ Lan gu age Referen ce Gu ide Page 6 4 8 ROBOT.OPR real-valu ed fu n ction R OBOT.OPR real-valued function Syntax ROBOT.OPR (mode, in dex) Function Retu rn s robot-specific data for th e cu rren tly selected robot. Parameters mode, in dex Th e valu es of th ese two parameters select wh at robot-specific data is retu rn ed. Details Th e followin g table sh ows th e mode an d in dex in formation for th e su pported robot modu les. For addition al details abou t th e applicability an d u se of th is in stru ction , refer to th e docu men tation for you r specific robot modu le. See th e Adept Robot Device Modu les men u to access th e docu men tation for th e device modu le for you r robot. NOTE: On ly device modu les for n on -Adept robots are docu men ted. S u pported Robot Modu les Robot Modu le Mode I n dices Description V+ Lan gu age Referen ce Gu ide Page 6 4 9 ROBOT.OPR real-valu ed fu n ction XY3 (modu le ID 2 1 ) 1 1 -5 Th e n u mber of th e primary ZTh eta pair, followed by th e n u mber of th e first slave pair, th e secon d slave pair, an d th e th ird slave pair. Th e first zero valu e in dicates th e en d of th e list of active slave pairs. 2 Always 0 3 Z offset for th e first slaved ZTh eta 4 RZ offset for th e first slaved ZTh eta 5 Z offset for th e secon d slaved ZTh eta 6 RZ offset for th e secon d slaved ZTh eta 7 Z offset for th e th ird slaved ZTh eta 8 RZ offset for th e th ird slaved ZTh eta 1 1 Nu mber of th e set of acceleration parameters th at is in effect. Th e valu e 0 in dicates n o set h as been explicitly selected, an d th e defau lt parameters (set #1 ) are in effect. 2 1 Maximu m tool-flan ge rotation an gle (i.e., maximu m deflection from 0 degrees). 2 Adept Qu attro s6 5 0 Robot1 1, 2 Size of th e tool-flan ge rotation " ambigu ity" zon e at each en d of th e ran ge of tool-flan ge rotation . 1 Th e Adept Qu attro s6 5 0 Robot device modu le (QPL) is n ot pu blish ed, becau se th is is an Adept robot. Related Keywords ROBOT.OPR program in stru ction SE LE CT program in stru ction SE LE CT real-valu ed fu n ction V+ Lan gu age Referen ce Gu ide Page 6 5 0 RUNSIG program in stru ction R UNSIG program instruction Syntax RUNSIG sign al_ n u m Function Tu rn on (or off) th e specified digital sign al as lon g as execu tion of th e in vokin g program task con tin u es. Usage Considerations On ly on e RUNSIG sign al can be in effect for each program task. Parameter sign al_ n u m Option al real-valu ed expression th at specifies on e of th e digital ou tpu t sign als (or an in tern al software sign al) th at is to be con trolled. Th e sign al is set to on du rin g program execu tion if th e valu e is positive. A n egative valu e resu lts in th e sign al bein g set to off du rin g program execu tion , an d tu rn ed on wh en execu tion stops. If n o sign al is specified, an y RUNSIG in effect for th e task is can celed. Details Th is in stru ction cau ses th e specified digital sign al to be tu rn ed on (or off) as soon as th e in stru ction is execu ted. Th e sign al is tu rn ed off (or on ) as soon as execu tion of th e in vokin g program task stops (or th e STOP in stru ction is execu ted). Th is in stru ction is u sefu l in an application wh ere au xiliary equ ipmen t mu st be stopped if an error occu rs du rin g program execu tion . On ly on e sign al can be activated by a RUNSIG in stru ction at an y on e time (for each program task). An error con dition resu lts u n less a program can cels th e first RUNSIG before attemptin g to in itiate a secon d. If program execu tion is in terru pted after a RUNSIG in stru ction h as been execu ted, th e specified sign al retu rn s to th e selected state again if a PROCE E D or RE TRY comman d is issu ed. If an SSTE P or XSTE P comman d is issu ed, th e sign al retu rn s to th e specified state du rin g execu tion of th e in stru ction th at is in voked. Similarly, processin g of a DO comman d temporarily activates th e RUNSIG sign al for th e correspon din g program task. (Th e E XE CUTE comman d an d in stru ction can cel an y previou s RUNSIG for th e specified program task.) V+ Lan gu age Referen ce Gu ide Page 6 5 1 RUNSIG program in stru ction E xample Tu rn on th e digital sign al iden tified by th e valu e of th e variable ru n .sign al (assu min g th e valu e is positive): RUNSIG run.signal Th e sign al remain s on th rou gh ou t execu tion of th e cu rren t program. Th e sign al goes off wh en execu tion en ds. Related Keywords IO mon itor comman d RE SE T mon itor comman d SIG real-valu ed fu n ction SIG.INS real-valu ed fu n ction SIGNAL mon itor comman d SIGNAL program in stru ction V+ Lan gu age Referen ce Gu ide Page 6 5 2 RX, RY, RZ tran sformation fu n ction s R X, R Y, R Z transformation functions Syntax RX ( an gle) RY ( an gle) RZ ( an gle) Function Retu rn a tran sformation describin g a rotation . Parameter an gle Real-valu ed expression th at represen ts th e rotation an gle in degrees. Details Th ese fu n ction s gen erate a tran sformation wh ose valu e con sists of a rotation abou t th e axis associated with th e fu n ction n ame an d a zero displacemen t (X, Y, Z = 0 ). E xample Produ ce a tran sformation th at describes a pu re 3 0 -degree rotation abou t th e World X axis: RX(30) Related Keyword DX real-valu ed fu n ction DY real-valu ed fu n ction DZ real-valu ed fu n ction V+ Lan gu age Referen ce Gu ide Page 6 5 3 RX, RY, RZ tran sformation fu n ction s R X, R Y, R Z transformation functions Syntax RX ( an gle) RY ( an gle) RZ ( an gle) Function Retu rn a tran sformation describin g a rotation . Parameter an gle Real-valu ed expression th at represen ts th e rotation an gle in degrees. Details Th ese fu n ction s gen erate a tran sformation wh ose valu e con sists of a rotation abou t th e axis associated with th e fu n ction n ame an d a zero displacemen t (X, Y, Z = 0 ). E xample Produ ce a tran sformation th at describes a pu re 3 0 -degree rotation abou t th e World X axis: RX(30) Related Keyword DX real-valu ed fu n ction DY real-valu ed fu n ction DZ real-valu ed fu n ction V+ Lan gu age Referen ce Gu ide Page 6 5 4 RX, RY, RZ tran sformation fu n ction s R X, R Y, R Z transformation functions Syntax RX ( an gle) RY ( an gle) RZ ( an gle) Function Retu rn a tran sformation describin g a rotation . Parameter an gle Real-valu ed expression th at represen ts th e rotation an gle in degrees. Details Th ese fu n ction s gen erate a tran sformation wh ose valu e con sists of a rotation abou t th e axis associated with th e fu n ction n ame an d a zero displacemen t (X, Y, Z = 0 ). E xample Produ ce a tran sformation th at describes a pu re 3 0 -degree rotation abou t th e World X axis: RX(30) Related Keyword DX real-valu ed fu n ction DY real-valu ed fu n ction DZ real-valu ed fu n ction V+ Lan gu age Referen ce Gu ide Page 6 5 5 SCALE tran sformation fu n ction SCALE transformation function Syntax S CALE ( tran sformation BY scale_ factor) Function Retu rn a tran sformation valu e equ al to th e tran sformation parameter with th e position scaled by th e scale factor. Parameters tran sformation Tran sformation expression th at is to be scaled. scale_ factor Real-valu ed expression th at is u sed to scale th e tran sformation parameter valu e. Details Th e valu e retu rn ed is equ al to th e valu e of th e in pu t tran sformation parameter valu e except th at th e X, Y, an d Z position compon en ts are mu ltiplied by th e scale factor parameter. Th e rotation compon en ts h ave th eir valu es u n ch an ged. E xample If th e tran sformation x h as th e valu e: (200, 150, 100, 10, 20, 30) th en execu tin g th e in stru ction : SET y = SCALE(x BY 1.25) resu lts in th e tran sformation y receivin g th e valu e: (250, 187.5, 125, 10, 20, 30) Related Keyword SHIFT tran sformation fu n ction V+ Lan gu age Referen ce Gu ide Page 6 5 6 SCALE .ACCE L system switch SCALE.ACCEL system switch Syntax ... S CALE.ACCEL [robot_ n u m] Function E n able or disable th e scalin g of acceleration an d deceleration as a fu n ction of program speed, as lon g as th e program speed is below a preset th resh old. Parameter robot_ n u m Option al real valu e, variable, or expression (in terpreted as an in teger) th at in dicates th e n u mber of th e robot affected. If th e in dex is omitted or zero in an E NABLE or DISABLE comman d or in stru ction , th e settin gs for all robots are altered. Oth erwise, on ly th e settin g for th e specified robot is affected. Details Th is switch is en abled wh en th e V+ system is in itialized. If robot_ n u m is omitted or zero in an E NABLE or DISABLE comman d or in stru ction , th e settin gs for all robots are altered. Oth erwise, on ly th e settin g for th e specified robot is affected. If robot_ n u m is omitted or zero wh en th e switch is accessed with th e SWITCH real-valu ed fu n ction , th e settin g of th e switch for robot #1 is retu rn ed. Wh en th is switch is en abled an d th e program speed is below th e preset th resh old valu e, th e effective acceleration an d deceleration for th at robot are calcu lated as follows: effective acceleration = program_speed * acceleration_setting effective deceleration = program_speed * deceleration_setting wh ere acceleration _ settin g an d deceleration _ settin g are valu es set by th e ACCE L in stru ction . NOTE: Th e SPE C u tility can be u sed to set th e speed th resh old below wh ich th e acceleration an d deceleration rates are scaled based on program speed. Th e SPE C parameter is: Upper speed limit for SCALE.ACCEL (%) For example, if program speed 5 0 % is specified an d th e th resh old valu e is 1 5 0 , th e effective acceleration an d deceleration are 5 0 % of th e cu rren t settin gs. If th e program speed is h igh er th an 1 5 0 % with th e th resh old set to 1 5 0 , th e cu rren t acceleration an d deceleration are u sed with ou t modification . V+ Lan gu age Referen ce Gu ide Page 6 5 7 SCALE .ACCE L system switch All robot modu les h ave th e SCALE .ACCE L speed th resh old set by defau lt to a very large valu e, effectively forcin g th e scalin g of acceleration s an d deceleration for all speeds wh en th is switch is en abled. CAUTI ON: For program speeds over 1 0 0 %, if th e defau lt settin g for th e SCALE .ACCE L limit is u sed an d SCALE .ACCE L is en abled, th e robot is driven at mu ch h igh er rates of acceleration an d deceleration , as compared to V+ 1 1 .0 . If th e SCALE .ACCE L switch is disabled for a robot, acceleration s an d deceleration s are n ot scaled based on th e program speed. In th is case, acceleration s an d deceleration s are h igh er th an n ormal at redu ced speeds. Th is is particu larly n oticeable at very slow speeds. As a resu lt, robot motion s may appear to be more rou gh or jerky. E xample Tu rn off acceleration scalin g for robot #2 : DISABLE SCALE.ACCEL[2] Related Keywords ACCE L program in stru ction ACCE L real-valu ed fu n ction SPE E D mon itor comman d SPE E D program in stru ction SCALE .ACCE L.ROT system switch V+ Lan gu age Referen ce Gu ide Page 6 5 8 SCALE .ACCE L.ROT system switch SCALE.ACCEL.R OT system switch Syntax ... S CALE.ACCEL.ROT [robot_ n u m] Function Specify wh eth er or n ot th e SCALE .ACCE L switch takes in to accou n t th e Cartesian rotation al speed du rin g straigh t-lin e motion s. Parameter robot_ n u m Option al real valu e, variable, or expression (in terpreted as an in teger) th at in dicates th e n u mber of th e robot affected. If th e in dex is omitted or zero in an E NABLE or DISABLE comman d or in stru ction , th e settin gs for all robots are altered. Oth erwise, on ly th e settin g for th e specified robot is affected. Details If SCALE .ACCE L.ROT is en abled for a selected robot, th e lesser of th e Cartesian lin ear an d rotation al speeds is u sed to scale acceleration an d deceleration du rin g straigh t-lin e motion s. If SCALE .ACCE L.ROT is disabled for a selected robot, on ly th e Cartesian lin ear speed is con sidered wh en SCALE .ACCE L is in effect. Th e SCALE .ACCE L.ROT switch is en abled for all robots by defau lt wh en th e V+ system is in itialized. E xample Cau se SCALE .ACCE L n ot to u se Cartesian rotation al speed for robot #2 : DISABLE SCALE.ACCEL.ROT[2] Related Keywords ACCE L program in stru ction ACCE L real-valu ed fu n ction SCALE .ACCE L system switch SPE E D mon itor comman d SPE E D program in stru ction V+ Lan gu age Referen ce Gu ide Page 6 5 9 SCRE E N.TIME OUT system parameter SCR EEN.TIMEOUT system parameter Syntax ... S CREEN.TI MEOUT Function E stablish th e time-ou t period for blan kin g th e screen of th e graph ics mon itor. Usage Considerations If you are con n ected to th e con troller th rou gh AdeptWin dows PC software, th e SCRE E N.TIME OUT parameter is ign ored. Details Th e SCRE E N.TIME OUT parameter sets th e n u mber of secon ds of in activity it takes to trigger screen blan kin g. Th at is, wh en th e poin tin g device, keyboard, an d graph ics screen h ave been idle for th e specified time, th e mon itor screen is blan ked. Th e screen is refresh ed at th e n ext occu rren ce of an y of th e followin g even ts: l Th e poin ter device is moved l An y key on th e keyboard is pressed. l An y graph ics or text is written to th e screen . l An y bu tton on th e poin ter device is clicked. NOTE: Becau se th e system can be waitin g for in pu t from you , take care wh en wakin g u p th e screen . For example, pressin g th e Sh ift key or movin g th e mou se does n ot actu ally gen erate an y in pu t, an d th u s th ey are safe to u se to restore th e screen . Th e valu e of th is parameter is in terpreted as an in teger. It can ran ge from 0 to 1 6 3 8 3 , in clu sive. Screen blan kin g is disabled if th is parameter is set to 0 . Th is parameter is set to 0 wh en th e V+ system is in itialized. E xample Set th e time-ou t limit to 6 0 0 secon ds (1 0 min u tes): PARAMETER SCREEN.TIMEOUT = 600 Related Keyword PARAME TE R mon itor comman d V+ Lan gu age Referen ce Gu ide Page 6 6 0 SCRE E N.TIME OUT system parameter PARAME TE R program in stru ction PARAME TE R real-valu ed fu n ction V+ Lan gu age Referen ce Gu ide Page 6 6 1 SE E program in stru ction SEE program instruction Syntax S EE ( lu n ) prog_ spec, step Function In voke th e screen -orien ted program editor to allow a program to be created, viewed, or modified. Usage Considerations Programs th at are bein g edited in read-write mode can n ot be execu ted. If an active program attempts to CALL a program th at is bein g th u s edited, th e execu tin g program is termin ated with an error. Programs th at are bein g execu ted can n ot be edited in read-write access mode. Th is restriction also applies to su spen ded programs in th e stack of an execu tin g program task. Programs th at are execu tin g an d read-on ly programs are au tomatically edited in read-on ly mode. In th at mode programs can be viewed, bu t n o comman ds are accepted th at modify th e program. Protected programs can n ot be edited at all. See th e Details section of th e DIRE CTORY comman d for an explan ation of protected an d read-on ly programs. Program ou tpu t to th e specified logical u n it is blocked du rin g an edit session (see below). Th e editor in voked with th is in stru ction does n ot access (or affect) th e u ser-specified in formation retain ed by th e comman d SE E editor. V+ Lan gu age Referen ce Gu ide Page 6 6 2 SE E program in stru ction Parameters lu n Real valu e, variable, or expression (in terpreted as an in teger) th at iden tifies th e serial lin e con n ected to th e termin al to be u sed for editin g, or th e graph ics win dow to be u sed for editin g. (See th e ATTACH in stru ction for a description of u n it n u mbers.) NOTE: Th e logical u n it mu st h ave been attach ed by th e program. If a graph ics win dow is specified, th e win dow mu st be open an d mu st satisfy th e size con strain ts described below. prog_ spec Strin g variable, con stan t, or expression th at specifies th e n ame of th e program to be edited. Un like th e SE E mon itor comman d, a program n ame mu st be specified. If th e program is to be accessed in read-on ly mode, th e strin g specifyin g th e program n ame mu st en d with /R. step Option al n u mber specifyin g th e program step at wh ich editin g is to begin . If th e step n u mber is omitted, editin g begin s at th e secon d step of th e program. Details Th is in stru ction is u sed to start an editin g session with th e V+ screen editor. Th e in stru ction SE E editor can be u sed at th e same time as th e comman d SE E editor. Th u s, for example, it is possible for more th an on e person to be editin g programs on th e V+ system at th e same time. For details on th e SE E editor, in clu din g description s of all th e comman ds it accepts, see th e section Basic SE E E ditor Operation s in th e V+ Lan gu age User's Gu ide. Th e SE E program in stru ction differs from th e SE E mon itor comman d in th e followin g ways: 1 . For a system th at h as a graph ics system processor, th e SE E mon itor comman d always in itiates editin g with th e Mon itor win dow an d th e system keyboard. Th e SE E program in stru ction can be u sed to in itiate editin g of a program in a differen t graph ics win dow, or with a termin al con n ected to on e of th e USE R serial ports. 2 . For a system th at does n ot h ave a graph ics system processor, th e SE E mon itor comman d always in itiates editin g with th e system termin al. Th e SE E program in stru ction can be u sed to in itiate editin g of a program with a termin al con n ected as th e system termin al or to on e of th e USE R serial ports. 3 . A program n ame mu st be specified in th e SE E in stru ction . V+ Lan gu age Referen ce Gu ide Page 6 6 3 SE E program in stru ction 4 . A step n u mber can be specified with th e SE E program in stru ction . 5 . Th e program debu gger can n ot be in voked du rin g a session in voked with th e SE E in stru ction . 6 . Wh en in itiated with th e SE E program in stru ction , u ser-specified settin gs (su ch as exten ded-comman d settin gs an d macros) are n ot retain ed between editin g session s. (User-specified settin gs en tered du rin g a session in itiated with th e SE E in stru ction do n ot affect th e correspon din g in formation accessed by th e SE E mon itor comman d.) If th e lu n parameter refers to a graph ics win dow, th e win dow mu st be at least 7 lin es (1 0 5 pixels) h igh , an d can n ot be h igh er th an 6 4 lin es (9 6 0 pixels). Th e win dow mu st be 8 2 ch aracters (6 5 6 pixels) wide. Related Keywords DE BUG mon itor comman d E DIT mon itor comman d SE E mon itor comman d V+ Lan gu age Referen ce Gu ide Page 6 6 4 SE LE CT program in stru ction SELECT program instruction Syntax S ELECT device_ type = u n it Function Select a u n it of th e n amed device for access by th e cu rren t task. Usage Considerations Th e SE LE CT in stru ction n eeds to be u sed on ly if th ere are mu ltiple devices of th e same type con n ected to you r system con troller. Th is option is available on ly if you r Adept system is equ ipped with th e V+ E xten sion s option . Th e SE LE CT in stru ction affects on ly th e task in wh ich th e in stru ction is execu ted. Th e in stru ction SE LE CT ROBOT can be execu ted on ly if th ere is n o robot attach ed to th e cu rren t task. (If th ere is an y dou bt abou t wh eth er or n ot a robot is attach ed, a program sh ou ld execu te a DE TACH in stru ction before execu tin g th e SE LE CT in stru ction .) Parameters device_ type Keyword th at iden tifies th e type of device th at is to be selected. Valid device types are ROBOT, VISION, an d FORCE (wh ich mu st be specified with ou t qu otation marks). Th e device-type keyword can be abbreviated. u n it Real valu e, variable, or expression (in terpreted as an in teger) th at specifies th e particu lar u n it to be selected. Th e valu es th at are accepted depen d on th e con figu ration of th e system. Details S ELECT ROBOT In a mu ltiple-robot system, th is program in stru ction selects th e robot with wh ich th e cu rren t task is to commu n icate. (Th e SE LE CT mon itor comman d specifies wh ich robot th e V+ mon itor is to access.) Th e program in stru ction specifies wh ich robot receives motion in stru ction s (for example, APPROACH an d MOVE ) an d retu rn s robot-related in formation (for example, for th e HE RE fu n ction ). E ach time a program task begin s execu tion , robot #1 is au tomatically selected. If a robot is selected, in formation abou t th e robot (for example, its cu rren t position ) can be accessed. In order for a program to move a robot, h owever, th e robot mu st be selected an d attach ed (with th e ATTACH in stru ction ). V+ Lan gu age Referen ce Gu ide Page 6 6 5 SE LE CT program in stru ction As an example, if robot #2 is selected by a SE LE CT in stru ction , all motion in stru ction s execu ted by th e cu rren t task are directed to th at robot (u n til an oth er SE LE CT in stru ction is issu ed). Also, all robot-related fu n ction s (su ch as HE RE ) retu rn in formation abou t robot #2 . NOTE: As a con ven ien ce, wh en task #0 is execu ted, robot #1 is au tomatically selected an d attach ed wh en program execu tion begin s. In order for an y task to ch an ge its selected robot, n o robot can be attach ed by th e task. More th an on e task can h ave a particu lar robot selected, bu t on ly on e task can h ave a robot attach ed. If a robot is already attach ed to a differen t task, an ATTACH waits or gen erates an error (depen din g on th e mode parameter for th e ATTACH in stru ction ). S ELECT VI S I ON In a system with mu ltiple vision systems, th is in stru ction selects th e vision system with wh ich th e cu rren t task is to commu n icate. (Th e SE LE CT mon itor comman d specifies wh ich vision system th e V+ mon itor is to access.) Th is program in stru ction specifies wh ich vision system receives vision in stru ction s (for example, E NABLE VISION) an d also wh ich system retu rn s vision -related in formation (for example, from th e VSTATUS fu n ction ). Th e vision system cu rren tly selected by th e mon itor is au tomatically selected wh en a program begin s execu tion . S ELECT FORCE In a system with mu ltiple force sen sors, th is mon itor comman d or program in stru ction selects th e force sen sor with wh ich th e cu rren t task is to commu n icate. Th e SE LE CT mon itor comman d specifies wh ich force sen sor th e V+ mon itor is to access. Th e program in stru ction specifies wh ich force sen sor receives force in stru ction s (for example, FORCE .RE AD) an d retu rn s force sen sor-related in formation (for example, for th e LATCH fu n ction ). E ach time a program task begin s execu tion , force sen sor #1 is au tomatically selected. E xample S ELECT ROBOT Example Program Th e followin g program selects robot #3 an d moves it. Th is program is n ormally n ot execu ted by task #0 , sin ce th at task is attach ed to robot #1 by defau lt. .PROGRAM test() SELECT ROBOT = 3 ;Select robot 3 ATTACH (0,1) ;Get control of robot 3 without waiting IF IOSTAT(0) < 0 THEN TYPE /B, "Error attaching robot: ", $ERROR(IOSTAT(0)) PAUSE END MOVE x ;Move robot 3 to location "x" MOVE y ;Move robot 3 to location "y" V+ Lan gu age Referen ce Gu ide Page 6 6 6 SE LE CT program in stru ction DETACH ;Detach robot 3 .END S ELECT VI S I ON Example Program Th e followin g program segmen t selects vision system #2 an d accesses th at system. .PROGRAM vision.2() SELECT VISION = 2 ENABLE VISION VSTATUS(1,0) status IF status[0] == 0 THEN VPICTURE(1) END .END ;Select vision system #2 ;Enable that vision system ;Get status information ;If vision system is idle, ;take a picture S ELECT FORCE Example Program Th e followin g program selects force sen sor #2 an d reads th e cu rren t forces from it. .PROGRAM test() SELECT FORCE = 2 ;Select force sensor 2 FORCE.READ f ;Read sensor 2 forces TYPE "Current forces on sensor", SELECT(FORCE), /S TYPE "are ", /F0.1, f[0], /X1, f[1], /X1, f[2] .END Related Keywords ATTACH program in stru ction SE LE CT real-valu ed fu n ction V+ Lan gu age Referen ce Gu ide Page 6 6 7 SE LE CT real-valu ed fu n ction SELECT real-valued function Syntax S ELECT ( device_ type, mode) Function Retu rn th e u n it n u mber th at is cu rren tly selected by th e cu rren t task for th e device n amed. Parameters device_ type Keyword th at iden tifies th e type of device th at is to be selected. Valid device types are ROBOT, VISION, an d FORCE (wh ich mu st be specified with ou t qu otation marks). Th e device-type keyword can be abbreviated. mode Option al real valu e, variable, or expression (in terpreted as an in teger) th at specifies th e mode for th e fu n ction . If th is parameter is omitted or h as th e valu e 0 , th e fu n ction retu rn s th e n u mber of th e u n it cu rren tly selected, or 0 if n o u n it is selected. If mode h as th e valu e -1 , th e fu n ction retu rn s th e total n u mber of u n its available for th e specified device. Details Th is fu n ction retu rn s eith er th e n u mber of th e specified device th at is cu rren tly selected, or th e total n u mber of devices con n ected to th e system con troller. Mu ltiple devices of th e same type are su pported on ly if you r system in clu des th e option al V+ E xten sion s software. If th e V+ system is n ot con figu red to con trol a robot, th e selected robot is always #1 , an d th e total n u mber of robots is zero. SE LE CT(ROBOT) retu rn s th e n u mber of th e cu rren tly selected robot. SE LE CT(ROBOT,-1 ) retu rn s th e maximu m robot n u mber in a V+ system. SE LE CT(VISION) retu rn s th e n u mber of th e cu rren tly selected vision system. SE LE CT(FORCE ) retu rn s th e n u mber of th e cu rren tly selected force sen sor. A particu lar FORCE sen sor is associated with on e VFI (VME Force In terface), wh ich in tu rn h as a n u mber associated with it th rou gh th e system con figu ration . With th e defau lt con figu ration , FORCE sen sor n u mber 1 correspon ds to th e VFI con figu red as servo board n u mber 8 . S ELECT VI S I ON In a system with mu ltiple vision systems, th is in stru ction selects th e vision system with wh ich th e cu rren t task is to commu n icate. (Th e SE LE CT mon itor comman d specifies wh ich V+ Lan gu age Referen ce Gu ide Page 6 6 8 SE LE CT real-valu ed fu n ction vision system th e V+ mon itor is to access.) Th is program in stru ction specifies wh ich vision system receives vision in stru ction s (for example, E NABLE VISION) an d also wh ich system retu rn s vision -related in formation (for example, from th e VSTATUS fu n ction ). Vision system #1 is au tomatically selected each time a program begin s execu tion . You can u se th e followin g modes for a SE LE CT(VISION,mode) fu n ction . Mode Description -1 Retu rn s th e maximu m possible vision system n u mber. 0 Retu rn s th e n u mber of th e cu rren tly selected vision system or zero. n>0 Retu rn s TRUE if vision system n is presen t. Oth erwise, th e valu e FALSE is retu rn ed. E xamples Retu rn th e u n it n u mber of th e robot selected for th e cu rren t task: our.robot = SELECT(ROBOT) Retu rn th e u n it n u mber of th e force sen sor selected for th e cu rren t task: our.force = SELECT(FORCE) Retu rn th e total n u mber of robots con n ected to th e con troller: num.robots = SELECT(ROBOT,-1) Retu rn th e total n u mber of vision systems in stalled in th e con troller: num.vision = SELECT(VISION,-1) Related Keywords SE LE CT mon itor comman d SE LE CT program in stru ction V+ Lan gu age Referen ce Gu ide Page 6 6 9 SE T program in stru ction SET program instruction Syntax S ET location _ var = location _ valu e Function Set th e valu e of th e location variable on th e left equ al to th e location valu e on th e righ t of th e equ al sign . Parameters location _ var Sin gle location variable or compou n d tran sformation th at en ds with a tran sformation variable. location _ valu e Location valu e of th e same type as th e location variable on th e left of th e equ al sign , defin ed by a variable or fu n ction (or compou n d tran sformation ). Details An error message is gen erated if th e righ t-h an d side is n ot defin ed or is n ot th e same type of location represen tation (th at is, tran sformation or precision poin t). If a compou n d tran sformation is specified to th e left of th e equ al sign , on ly its righ t-most relative tran sformation is defin ed. An error con dition resu lts if an y oth er tran sformation in th e compou n d tran sformation is n ot already defin ed. If a tran sformation variable is specified on th e left-h an d side, th e righ t-h an d side can con tain a tran sformation , a compou n d tran sformation , or a tran sformation fu n ction . E xamples Set th e valu e of th e tran sformation pick equ al to th e location of corn er plu s th e location of sh ift relative to corn er: SET pick = corner:shift Set th e valu e of th e precision poin t #place equ al to th at of th e precision poin t #post: SET #place = #post Set th e valu e of th e tran sformation part to th e cu rren t robot location , relative to th e tran sformation pallet. SET pallet:part = HERE Set th e valu e of loc1 to X = 5 5 0 ,Y = 4 5 0 , Z = 7 5 0 , y = 0 , p = 1 8 0 , r = 4 5 : V+ Lan gu age Referen ce Gu ide Page 6 7 0 SE T program in stru ction SET loc1 = TRANS(550, 450, 750, 0, 180, 45) Related Keywords HE RE mon itor comman d HE RE program in stru ction POINT mon itor comman d V+ Lan gu age Referen ce Gu ide Page 6 7 1 SE T.E VE NT program in stru ction SET.EVENT program instruction Syntax S ET.EVENT task, flag, processor Function Set an even t associated with th e specified task. Parameters task Option al real valu e, variable, or expression (in terpreted as an in teger) th at specifies th e task for wh ich th e even t is to be set. Th e valid ran ge is 0 to 2 7 , in clu sive. If th is parameter is omitted, th e n u mber of th e cu rren t task is u sed. NOTE: All 2 8 tasks are available on ly in systems equ ipped with th e option al V+ E xten sion . flag Not u sed, defau lts to 1 . processor Option al real valu e, variable, or expression th at specifies th e V+ processor ru n n in g th e task to be sign aled. Th e defau lt valu e is 0 wh ich in dicates th e local processor. Th e maximu m valu e depen ds on th e software an d h ardware con figu ration . (Th is option is available on ly if you r Adept system is equ ipped with th e V+ E xten sion s option .) Details Th is in stru ction sets th e even t associated with th e specified task. For example, if a task h ad been su spen ded by a WAIT.E VE NT 1 in stru ction , execu tin g th e SE T.E VE NT in stru ction for th at task cau ses it to resu me execu tion (du rin g th e n ext available time slice for wh ich it is eligible). Related Keywords CLE AR.E VE NT program in stru ction GE T.E VE NT real-valu ed fu n ction INT.E VE NT program in stru ction WAIT.E VE NT program in stru ction V+ Lan gu age Referen ce Gu ide Page 6 7 2 #SE T.POINT precision poin t fu n ction #SET.POINT precision point function Syntax #S ET.POI NT Function Retu rn th e comman ded join t-an gle position s compu ted by th e trajectory gen erator du rin g th e last trajectory-evalu ation cycle. Usage Considerations Th e n ame " set.poin t" can n ot be u sed as a program or variable n ame. Details For each trajectory-evalu ation cycle, join t-an gle position s are compu ted, con verted to en coder cou n ts, an d sen t to th e servos as th e comman ded motor position s. You can u se th is fu n ction to captu re th ese position s. V+ Lan gu age Referen ce Gu ide Page 6 7 3 SE T.SPE E D system switch SET.SPEED system switch Syntax ... S ET.S PEED Function Con trol wh eth er or n ot th e mon itor speed can be ch an ged from th e man u al con trol pen dan t. Th e mon itor speed can n ot be ch an ged wh en th e switch is disabled. Details Primin g a program from th e man u al con trol pen dan t n ormally sets th e mon itor speed. Th e speed is n ot ch an ged wh en th e SE T.SPE E D switch is disabled. Th erefore, you can n ot affect th e program speed from th e pen dan t. Related Keywords DISABLE mon itor comman d DISABLE program in stru ction E NABLE mon itor comman d E NABLE program in stru ction SPE E D mon itor comman d SWITCH mon itor comman d SWITCH program in stru ction SWITCH real-valu ed fu n ction V+ Lan gu age Referen ce Gu ide Page 6 7 4 SE TBE LT program in stru ction SETBELT program instruction Syntax S ETBELT %belt_ var = expression Function Set th e en coder offset of th e specified belt variable equ al to th e valu e of th e expression . Usage Considerations Th is option is available on ly if you r Adept system is equ ipped with th e V+ E xten sion s option . Th e BE LT switch mu st be en abled for th is in stru ction to be execu ted. Th e SE TBE LT in stru ction is gen erally u sed in con ju n ction with th e BE LT real-valu ed fu n ction to set th e effective belt position to zero. (See Details section an d WARNING below.) SE TBE LT can n ot be execu ted wh ile th e robot is movin g relative to th e specified belt variable. Th e belt variable referen ced mu st h ave been defin ed already u sin g a DE FBE LT in stru ction . Parameters %belt_ var Name of belt variable associated with th e en coder offset to be set. expression Real-valu ed expression th at specifies a sign ed 2 4 -bit en coder offset valu e. Details Wh en compu tin g th e position of a belt associated with a belt variable, V+ su btracts th e offset valu e from th e cu rren t belt position valu e an d u ses th e differen ce, modu lo 1 6 ,7 7 7 ,2 1 6 . Th e expression valu e is n ormally a sign ed n u mber in th e ran ge -8 ,3 8 8 ,6 0 8 to 8 ,3 8 8 ,6 0 7 . If th e n u mber is ou tside th is ran ge, its valu e modu lo 1 6 ,7 7 7 ,2 1 6 is u sed. Th e SE TBE LT in stru ction is gen erally u sed in con ju n ction with th e BE LT real-valu ed fu n ction to set th e effective belt position to zero. Th is mu st be don e each time th e robot will perform a sequ en ce of motion s relative to th e belt, an d mu st be don e sh ortly before th e first motion of su ch a sequ en ce. W ARNI NG: It is importan t to execu te SE TBE LT each time th e robot is goin g to track th e belt, to make su re th e differen ce between th e cu rren t belt position (as retu rn ed by th e BE LT fu n ction ) an d th e belt position of th e specified belt variable does n ot exceed 8 ,3 8 8 ,6 0 7 (^H7 FFFFF) du rin g active belt trackin g. Un predictable robot motion may resu lt if th e differen ce does exceed th is valu e wh ile trackin g th e belt. V+ Lan gu age Referen ce Gu ide Page 6 7 5 SE TBE LT program in stru ction Th e SE TBE LT in stru ction can be u sed to syn ch ron ize robot motion with th e en coder valu e latch ed by an extern al sign al or by th e AdeptVision system. See th e LATCHE D real-valu ed fu n ction an d th e DE VICE real-valu ed fu n ction for more in formation . E xample Th e followin g example waits for a digital sign al an d th en sets th e belt position to zero. Th at is don e by settin g th e belt offset equ al to th e cu rren t belt position . Fin ally, th e robot is moved on to th e belt. WAIT sig(1001) SETBELT %belt1 = BELT(%belt1) MOVES %belt1:pickup Related Keywords BE LT real-valu ed fu n ction BE LT system switch DE FBE LT program in stru ction DE VICE real-valu ed fu n ction LATCHE D real-valu ed fu n ction WINDOW program in stru ction WINDOW real-valu ed fu n ction V+ Lan gu age Referen ce Gu ide Page 6 7 6 SE TDE VICE program in stru ction SETDEVICE program instruction Syntax S ETDEVI CE ( type, u n it, error, comman d) p1 , p2 , ... Function In itialize a device or set device parameters. (Th e actu al operation performed depen ds on th e device referen ced.) Usage Considerations Th e syn tax con tain s option al parameters th at apply on ly to specific device types an d comman ds. V+ Lan gu age Referen ce Gu ide Page 6 7 7 SE TDE VICE program in stru ction Parameters type Real valu e, variable, or expression (in terpreted as an in teger) th at in dicates th e type of device bein g referen ced. Th e followin g types are cu rren tly available: 0 = Belt en coder 1 = (Not u sed) 2 = Force Processor Board (for Adept u se on ly) 3 = Robot device (i.e., servo, for Adept u se on ly) 4 = Vision 5 = 1 3 9 4 bu s (for Adept u se on ly) u n it Real valu e, variable, or expression (in terpreted as an in teger) th at in dicates th e device u n it n u mber. Th e valu e mu st be in th e ran ge 0 to (max -1 ), wh ere max is th e maximu m n u mber of devices of th e specified type. Th e valu e sh ou ld be 0 if th ere is on ly on e device of th e given type. error Option al real variable th at receives a stan dard system error n u mber th at in dicates if th is in stru ction su cceeded or failed. If th is parameter is omitted, an y device error stops program execu tion . If an error variable is specified, th e program mu st explicitly ch eck it to detect errors. comman d Real valu e, variable, or expression th at specifies wh ich device comman d or parameters are bein g set by th is in stru ction . Some comman ds are stan dard an d recogn ized by all devices. Oth er comman ds apply on ly to particu lar device types. p1 , p2 , ... Option al real valu es, variables, or expression s, th e valu es of wh ich are sen t to th e device as data for a comman d. Th e n u mber of parameters specified an d th eir mean in gs depen d u pon th e particu lar device type bein g accessed. Details SE TDE VICE is a gen eral-pu rpose in stru ction for in itializin g extern al devices. It in itializes th e software an d allows variou s parameters associated with th e device to be set. Two stan dard SE TDE VICE comman ds are recogn ized by all devices: comman d = 0 I n itialize device Th is comman d sh ou ld be issu ed on ce before accessin g th e device with an y oth er comman d. Normally, n o addition al parameters are requ ired, bu t some device types may permit th em. comman d = 1 Reset device Th is comman d resets th e device. Normally n o addition al parameters are requ ired, bu t some device types may permit th em. V+ Lan gu age Referen ce Gu ide Page 6 7 8 SE TDE VICE program in stru ction See th e su pplemen tary docu men tation for specific devices for details an d examples. For in formation on u sin g th e SE TDE VICE in stru ction to access extern al en coders, see th e section E xtern al E n coder Device in th e V+ Lan gu age User's Gu ide. Related Keywords DE VICE program in stru ction DE VICE real-valu ed fu n ction DE VICE S program in stru ction V+ Lan gu age Referen ce Gu ide Page 6 7 9 SHIFT tran sformation fu n ction SHIFT transformation function Syntax S HI FT ( tran sformation BY x_ sh ift, y_ sh ift, z_ sh ift) Function Retu rn a tran sformation valu e resu ltin g from sh iftin g th e position of th e tran sformation parameter by th e given sh ift amou n ts. Parameters tran sformation Tran sformation expression th at is to be sh ifted. x_ sh ift Option al real-valu ed expression s th at are added to th e respective position compon en ts of th e tran sformation parameter. y_ sh ift z_ sh ift Details Th e valu e retu rn ed is equ al to th e valu e of th e in pu t tran sformation parameter valu e except th at th e th ree sh ift parameter valu es are added to th e X, Y, an d Z position compon en ts. If an y sh ift parameter is omitted, its valu e is assu med to be zero. E xample If th e tran sformation x h as th e valu e: (200, 150, 100, 10, 20, 30) th en execu tin g th e in stru ction : SET y = SHIFT(x BY 5,-5,10) resu lts in th e tran sformation y receivin g th e valu e: (205, 145, 110, 10, 20, 30) Related Keywords SCALE tran sformation fu n ction TRANS tran sformation fu n ction V+ Lan gu age Referen ce Gu ide Page 6 8 0 SIG real-valu ed fu n ction SIG real-valued function Syntax S I G ( sign al_ n u m, ..., sign al_ n u m) Function Retu rn s th e logical AND of th e states of th e in dicated digital sign als. Parameter sign al_ n u m Real-valu ed expression th at evalu ates to a digital I/O or in tern al sign al n u mber. A n egative valu e in dicates n egative logic for th at sign al. Details Retu rn s a TRUE (-1 ) or FALSE (0 ) valu e obtain ed by performin g a logical AND of th e states of all th e in dicated digital sign als. Th at is, SIG will retu rn TRUE if all th e specified sign al states are TRUE . Oth erwise, SIG will retu rn FALSE . Th e magn itu de of each sign al_ n u m parameter determin es wh ich digital or in tern al sign al is to be con sidered. Sign als 1 - 8 an d 3 3 - 5 1 2 are digital ou tpu ts. Sign als 1 0 0 1 - 1 0 1 2 an d 1 0 3 3 - 1 5 1 2 are digital in pu ts. Sign als 2 0 0 1 to 2 5 1 2 are in tern al (software) in pu ts or ou tpu ts. On ly digital sign als th at are actu ally in stalled can be u sed. You can u se th e IO mon itor comman d (or th e SIG.INS fu n ction ) to ch eck you r cu rren t digital I/O con figu ration . Sign als 3 0 0 1 an d 3 0 0 2 refer to th e robot selected by th e cu rren t task. Sign al 3 0 0 1 is th e state of th e h an d-close solen oid. Sign al 3 0 0 2 is th e state of th e h an d-open solen oid. If th e sign of a sign al_ n u m parameter is positive, th e sign al is in terpreted as bein g TRUE if it h as a h igh valu e. If th e sign of a sign al_ n u m parameter is n egative, th e sign al is in terpreted as bein g TRUE if it h as a low valu e. NOTE: SIG(0 ) retu rn s a valu e of TRUE . E xample Assu me th at th e followin g digital I/O sign als are in stalled an d h ave th e in dicated valu es. l In pu t sign al 1 0 0 1 is On l In pu t sign al 1 0 0 4 is Off l In pu t sign al 3 3 is Off Th e followin g SIG fu n ction referen ces retu rn th e in dicated valu es: V+ Lan gu age Referen ce Gu ide Page 6 8 1 SIG real-valu ed fu n ction SIG(1001) SIG(1004) SIG(-1004) SIG(1001,1004) SIG(1001,-1004) ;Returns ;Returns ;Returns ;Returns ;Returns -1.0 0.0 -1.0 0.0 -1.0 (TRUE) (FALSE) (TRUE) (FALSE) (TRUE) Related Keywords BITS mon itor comman d BITS program in stru ction BITS real-valu ed fu n ction IO mon itor comman d RE SE T mon itor comman d RUNSIG program in stru ction SIGNAL mon itor comman d SIGNAL program in stru ction V+ Lan gu age Referen ce Gu ide Page 6 8 2 SIG.INS real-valu ed fu n ction SIG.INS real-valued function Syntax S I G.I NS ( sign al_ n u m) Function Retu rn an in dication of wh eth er a digital I/O sign al is in stalled in th e system, or wh eth er a software sign al is available in th e system. Parameter sign al_ n u m Real-valu ed expression th at defin es th e n u mber of th e digital I/O or software sign al to ch eck. (Th e absolu te valu e is u sed, so n egative sign al n u mbers are allowed.) Details Th is fu n ction retu rn s TRUE (-1 ) if th e specified digital I/O or software sign al is available for u se by th e system. Oth erwise, FALSE (0 .0 ) is retu rn ed. Th e fu n ction always retu rn s TRUE if sign al_ n u mber is zero. Th is fu n ction can be u sed to make su re th e digital I/O sign als are in stalled as expected by th e application program. E xample Th e followin g program segmen t ch ecks wh eth er digital I/O sign al #1 2 is in stalled as an in pu t sign al (referen ced as sign al #1 0 1 2 ). A message is displayed on th e system termin al if th e sign al is n ot con figu red correctly: in.sig = 1012 IF NOT SIG.INS(in.sig) THEN TYPE "Digital I/O signal ", in.sig, "is not installed" END Related Keywords BITS mon itor comman d BITS program in stru ction BITS real-valu ed fu n ction IO mon itor comman d RE SE T mon itor comman d RUNSIG program in stru ction V+ Lan gu age Referen ce Gu ide Page 6 8 3 SIG.INS real-valu ed fu n ction SIG.INS real-valu ed fu n ction SIGNAL mon itor comman d SIGNAL program in stru ction V+ Lan gu age Referen ce Gu ide Page 6 8 4 SIGN real-valu ed fu n ction SIGN real-valued function Syntax S I GN ( valu e) Function Retu rn th e valu e 1 , with th e sign of th e valu e parameter. Parameter valu e Real-valu ed expression . Details Th is fu n ction retu rn s -1 .0 if th e valu e of th e parameter is less th an zero. If th e parameter valu e is greater th an or equ al to zero, +1 .0 is retu rn ed. E xample SIGN(0) SIGN(0.123) SIGN(-5.462) SIGN(1.3125E+2) ;Returns ;Returns ;Returns ;Returns 1.0 1.0 -1.0 1.0 V+ Lan gu age Referen ce Gu ide Page 6 8 5 SIGNAL program in stru ction SIGNAL program instruction Syntax S I GNAL sign al_ n u m, ..., sign al_ n u m Function Tu rn on or off extern al digital ou tpu t sign als or in tern al software sign als. Parameter sign al_ n u m Real-valu ed expression th at evalu ates to a digital ou tpu t or in tern al sign al n u mber. A positive valu e in dicates tu rn on ; a n egative valu e in dicates tu rn off. (SIGNAL ign ores parameters with a zero valu e.) Details Th e magn itu de of a sign al_ n u m parameter determin es wh ich digital or in tern al sign al is to be con sidered. On ly digital ou tpu t sign als (n u mbered from 1 to 8 an d 3 3 to 5 1 2 ) an d in tern al (software) sign als (n u mbered from 2 0 0 1 to 2 5 1 2 ) can be specified. On ly digital sign als th at are actu ally in stalled an d con figu red as ou tpu ts can be u sed. To ch eck you r cu rren t digital I/O con figu ration , u se th e IO mon itor comman d. Sign als 3 0 0 1 an d 3 0 0 2 refer to th e robot selected by th e cu rren t task. Sign al 3 0 0 1 is th e state of th e h an d-close solen oid. Sign al 3 0 0 2 is th e state of th e h an d-open solen oid. If th e sign of th e sign al_ n u m parameter is positive, th e sign al is tu rn ed on . If th e sign of th e sign al_ n u m parameter is n egative, th e sign al is tu rn ed off. NOTE: All V+ digital ou tpu t in stru ction s do n ot wait for a 1 6 millisecon d V+ cycle, th ey are tu rn ed on immediately. However, digital in pu ts are ch ecked every 1 6 millisecon ds by th e V+ operatin g system. Allowin g th e possibility to tu rn on an d off a sign al before th e system can read th e ou tpu t. E xamples Tu rn off th e extern al ou tpu t sign al specified by th e valu e of th e variable reset (assu min g th e valu e of reset is positive), an d tu rn on extern al ou tpu t sign al #4 : SIGNAL -reset, 4 Tu rn extern al ou tpu t sign al #1 off, extern al ou tpu t sign al #4 on , an d in tern al software sign al #2 0 1 0 on : SIGNAL -1, 4, 2010 V+ Lan gu age Referen ce Gu ide Page 6 8 6 SIGNAL program in stru ction Related Keywords BITS mon itor comman d BITS program in stru ction BITS real-valu ed fu n ction IO mon itor comman d NOOVE RLAP program in stru ction OVE RLAP program in stru ction RE SE T mon itor comman d RUNSIG program in stru ction SIG real-valu ed fu n ction SIG.INS real-valu ed fu n ction SIGNAL mon itor comman d V+ Lan gu age Referen ce Gu ide Page 6 8 7 SIN real-valu ed fu n ction SIN real-valued function Syntax S I N ( valu e) Function Retu rn th e trigon ometric sin e of a given an gle. Usage Considerations Th e an gle parameter mu st be measu red in degrees. Th e parameter is in terpreted as modu lo 3 6 0 degrees, bu t excessively large valu es may cau se a loss of accu racy in th e retu rn ed valu e. Parameter valu e Real-valu ed expression th at defin es th e an gu lar valu e to be con sidered. Details Retu rn s th e trigon ometric sin e of th e argu men t, wh ich is assu med to h ave u n its of degrees. Th e resu ltin g valu e is always in th e ran ge of -1 .0 to +1 .0 , in clu sive. E xamples SIN(0.123) SIN(-5.462) SIN(30) ;Returns 2.146753E-03 ; R e t u r n s -0.09518556 ; R e t u r n s .5 NOTE: TYPE , PROMPT, an d similar in stru ction s ou tpu t th e resu lts of th e above examples as sin gle-precision valu es. However, th ey are actu ally stored an d man ipu lated as dou bleprecision valu es. Th e LISTR mon itor comman d displays real valu es to fu ll precision . V+ Lan gu age Referen ce Gu ide Page 6 8 8 SINGLE program in stru ction SINGLE program instruction Syntax S I NGLE ALWAYS Function Limit rotation s of th e robot wrist join t to th e ran ge -1 8 0 degrees to +1 8 0 degrees. Usage Considerations On ly th e n ext robot motion is affected if th e ALWAYS parameter is n ot specified. MULTIPLE ALWAYS is assu med wh en ever program execu tion is in itiated an d wh en a n ew execu tion cycle begin s. Th e SINGLE in stru ction can be execu ted by an y program task as lon g as th e robot selected by th e task is n ot attach ed by an y oth er task. Th e in stru ction applies to th e robot selected by th e task. If th e V+ system is n ot con figu red to con trol a robot, execu tin g th e SINGLE in stru ction cau ses an error. Parameter ALWAYS Option al qu alifier th at establish es SINGLE as th e defau lt con dition . Th at is, if ALWAYS is specified, SINGLE remain s in effect con tin u ou sly u n til disabled by a MULTIPLE in stru ction . If ALWAYS is n ot specified, th e SINGLE in stru ction applies on ly to th e n ext robot motion . Details Wh en movin g to a tran sformation -specified location , th e robot n ormally moves th e wrist join t th e min imu m distan ce n ecessary to ach ieve th e requ ired orien tation . In some cases, th is action can move th e wrist close to a limit stop so th at a su bsequ en t straigh t-lin e motion h its th e stop. Specifyin g SINGLE cau ses su bsequ en t motion (s) to force th e wrist back to n ear th e cen ter of its ran ge, so th at straigh t-lin e motion s will n ot fail in th is way. SINGLE is common ly specified du rin g an APPRO to pick u p an object wh ose position an d orien tation were u n kn own at robot programmin g time. On ce th e object is acqu ired, th e wrist motion can be kept to a min imu m. Th e SINGLE settin g is ign ored if NOOVE RLAP is in effect. Related Keywords CONFIG real-valu ed fu n ction V+ Lan gu age Referen ce Gu ide Page 6 8 9 SINGLE program in stru ction MULTIPLE program in stru ction NOOVE RLAP program in stru ction OVE RLAP program in stru ction SE LE CT program in stru ction SE LE CT real-valu ed fu n ction V+ Lan gu age Referen ce Gu ide Page 6 9 0 SOLVE .ANGLE S program in stru ction SOLVE.ANGLES program instruction Syntax S OLVE.ANGLES o.jts[ o.idx] , o.flags, error = tran s, i.jts[ i.idx] ,i.flags Function Compu te th e robot join t position s (for th e cu rren t robot) th at are equ ivalen t to a specified tran sformation . Usage Considerations Sin ce th e compu tation performed by th is in stru ction is a fu n ction of th e geometry of th e robot (lin k dimen sion s, n u mber of axes, tool offsets, base offsets), robots with differen t geometric parameters yields differen t resu lts. In fact, sin ce robots of th e same gen eral type may differ sligh tly in th eir dimen sion s, th is in stru ction may retu rn sligh tly differen t resu lts wh en execu ted on two differen t robot systems of th e same type. Th e SOLVE .ANGLE S in stru ction retu rn s in formation for th e robot selected by th e task execu tin g th e in stru ction . If th e V+ system is n ot con figu red to con trol a robot, execu tin g th is in stru ction does n ot gen erate an error becau se of th e absen ce of a robot. However, th e in formation retu rn ed may n ot be mean in gfu l. V+ Lan gu age Referen ce Gu ide Page 6 9 1 SOLVE .ANGLE S program in stru ction Parameters o.jts Real-valu ed array in wh ich th e compu ted join t an gles are retu rn ed. Th e first specified elemen t of th e array con tain s th e position for join t #1 , th e secon d elemen t con tain s th e valu e for join t #2 , etc. For rotatin g join ts, th e join t position s are in degrees. For tran slation al join ts, th e join t position s are in millimeters. If a compu ted join t position is ou tside th e workin g ran ge for th e join t, th e limit stop closest to th e in itial join t position (as in dicated by i.jts[ ]) is retu rn ed. o.idx Option al real valu e, variable, or expression (in terpreted as an in teger) th at iden tifies th e array elemen t to receive th e position for join t #1 . If n o in dex is specified, array elemen t zero con tain s th e position for join t #1 . o.flags Real variable th at receives a bit-flag valu e th at in dicates th e con figu ration of th e robot correspon din g to th e compu ted join t position s. Th e bit flags are in terpreted as follows: Bit Flag Description Bit 1 (LSB) RIGHTY (mask valu e = 1 ) If th is bit is set, th e position h as th e robot in a righ t-arm con figu ration . Oth erwise, th e position h as th e robot in a left-arm con figu ration . Bit 2 BE LOW (mask valu e = 2 ) If th is bit is set, th e position h as th e robot con figu red with th e elbow below th e lin e from th e sh ou lder to th e wrist. Oth erwise, th e robot elbow is above th e sh ou lder-wrist lin e. (Th is bit is always 0 wh en a SCARA robot is in u se.) Bit 3 FLIP (mask valu e = 4 ) If th is bit is set, th e position h as th e robot con figu red with th e pitch axis of th e wrist set to a n egative an gle. Oth erwise, th e pitch an gle of th e V+ Lan gu age Referen ce Gu ide Page 6 9 2 SOLVE .ANGLE S program in stru ction robot wrist h as a positive valu e. (Th is bit is always 0 wh en th e robot does n ot h ave a th ree-axis wrist, wh ich is th e case for a SCARA robot.)robot wrist h as a positive valu e. (Th is bit is always 0 wh en th e robot does n ot h ave a th ree-axis wrist, wh ich is th e case for a SCARA robot.)robot wrist h as a positive valu e. (Th is bit is always 0 wh en th e robot does n ot h ave a th ree-axis wrist, wh ich is th e case for a SCARA robot.) error Real variable th at receives a bit-flag valu e th at in dicates wh eth er an y join t position s were compu ted to be ou tside of th eir workin g ran ge, or wh eth er th e XYZ position of th e destin ation was ou tside th e workin g en velope of th e robot. Th e bit flags are in terpreted as follows: Bit Flag Description V+ Lan gu age Referen ce Gu ide Page 6 9 3 SOLVE .ANGLE S program in stru ction Bits 1 - 1 2 Join t/Motor ou t of ran ge If set, th e compu ted valu e for th e join t or motor was fou n d to be ou tside of its limit stops: Bit Join t/ Motor # Mask Valu e 1 1 ^H1 2 2 ^H2 3 3 ^H4 V+ Lan gu age Referen ce Gu ide Page 6 9 4 SOLVE .ANGLE S program in stru ction 4 4 ^H8 5 5 ^H1 0 6 6 ^H2 0 7 7 ^H4 0 8 8 ^H8 0 9 9 ^H1 0 0 10 10 ^H2 0 0 11 11 ^H4 0 0 12 12 ^H8 0 0 Bit 1 3 Collision (mask valu e = ^H1 0 0 0 ) Wh en th is bit is tu rn ed on , a collision h as been detected. Bit 1 4 Too close (mask valu e = ^H2 0 0 0 ) Th e XYZ position of th e destin ation can n ot be reach ed becau se it was too close to th e colu mn of th e robot. Bit 1 5 Too far (mask valu e = ^H4 0 0 0 ) Th e XYZ position of th e destin ation can n ot be reach ed becau se it was too far away from th e robot. Bit 1 6 Join t vs. motor (mask valu e = ^H8 0 0 0 ) If set, a motor is limitin g. Oth erwise, a join t is limitin g. tran s Tran sformation variable, fu n ction , or compou n d tran sformation th at defin es th e robot location of in terest. i.jts Real array th at con tain s th e join t position s represen tin g th e startin g location for th e robot. Th ese valu es are referen ced: (1 ) for mu ltiple-tu rn join ts to min imize join t rotation s, an d (2 ) wh en a compu ted join t position is ou t of ran ge to determin e wh ich limit stop to retu rn . Th e first specified elemen t of th e array mu st con tain th e position for V+ Lan gu age Referen ce Gu ide Page 6 9 5 SOLVE .ANGLE S program in stru ction join t #1 . Th e secon d elemen t mu st con tain th e valu e for join t #2 , etc. For rotatin g join ts, th e join t position s are assu med to be in degrees. For tran slation al join ts, th e join t position s are assu med to be in millimeters. i.idx Option al real valu e, variable, or expression (in terpreted as an in teger) th at iden tifies th e array elemen t th at con tain s th e position valu e for join t #1 . If n o in dex is specified, elemen t zero mu st con tain th e position for join t #1 . i.flags Real valu e, variable, or expression wh ose valu e is in terpreted as bit flags th at in dicate: (1 ) th e in itial con figu ration of th e robot, (2 ) an y ch an ges in con figu ration th at are to be made, an d (3 ) special operatin g modes. Th e bit flags are in terpreted as follows: Bit Flag Description Bit 1 : (LSB) RIGHTY (mask valu e = 1 ) If th is bit is set, th e robot is assu med in itially to be in a righ t-arm con figu ration . Oth erwise, th e robot is assu med to be in a left-arm con figu ration . Bit 2 : BE LOW (mask valu e = ^H2 ) If th is bit is set, th e robot is assu med in itially to h ave its elbow below th e lin e from th e sh ou lder to th e wrist. Oth erwise, th e robot is assu med to h ave its elbow above th at lin e. (Th is bit is ign ored for robots, like th e SCARA con figu ration s, th at do n ot h ave an elbow th at moves in a vertical plan e.) Bit 3 : FLIP (mask valu e = ^H4 ) If th is bit is set, th e robot is assu med in itially to h ave th e pitch axis of th e wrist set to a n egative valu e. Oth erwise, th e pitch an gle is assu med to be set to a positive valu e. Th is bit is ign ored if th e robot does n ot h ave a th ree-axis wrist. V+ Lan gu age Referen ce Gu ide Page 6 9 6 SOLVE .ANGLE S program in stru ction Bit 9 : Ch an ge RIGHTY/LE FTY (mask valu e = ^H1 0 0 ) If th is bit is set, th e in stru ction attempts to compu te a set of join t position s correspon din g to th e RIGHTY/LE FTY con figu ration specified by bit 1 0 . Bit 1 0 : Ch an ge to RIGHTY (mask valu e = ^H2 0 0 ) Wh en bit 9 is set an d th is bit is set, th e in stru ction attempts to compu te join t position s for a righ t-arm con figu ration . If bit 9 is set an d th is bit is 0 , th e in stru ction attempts to compu te a set of join t position s for a left-arm con figu ration . Bit 1 1 : Ch an ge BE LOW/ABOVE (mask valu e = ^H4 0 0 ) If th is bit is set, th e in stru ction attempts to compu te a set of join t position s correspon din g to th e BE LOW/ABOVE con figu ration specified by bit 1 2 . Th is bit is ign ored for robots, like th e SCARA con figu ration s, th at do n ot h ave an elbow th at moves in a vertical plan e. Bit 1 2 : Ch an ge to BE LOW (mask valu e = ^H8 0 0 ) Wh en bit 1 1 is set an d th is bit is set, th e in stru ction attempts to compu te join t position s for an elbow-down con figu ration . If bit 1 1 is set an d th is bit is 0 , th e in stru ction attempts to compu te join t position s for an elbowu p con figu ration . Th is bit is ign ored for robots, like th e SCARA con figu ration s, th at do n ot h ave an elbow th at moves in a vertical plan e. V+ Lan gu age Referen ce Gu ide Page 6 9 7 SOLVE .ANGLE S program in stru ction Bit 1 3 : Ch an ge FLIP/NOFLIP (mask valu e = ^H1 0 0 0 ) If th is bit is set, th e in stru ction attempts to compu te a set of join t position s correspon din g to th e FLIP/NOFLIP con figu ration specified by bit 1 4 . Th is bit is ign ored if th e robot does n ot h ave a th ree-axis wrist. Bit 1 4 : Ch an ge to FLIP (mask valu e = ^H2 0 0 0 ) Wh en bit 1 3 is set an d th is bit is set, th e in stru ction attempts to compu te join t position s for a FLIP wrist con figu ration . If bit 1 3 is set an d th is bit is 0 , th e in stru ction attempts to compu te join t position s for a NOFLIP wrist con figu ration . Th is bit is ign ored if th e robot does n ot h ave a th ree-axis wrist. Bit 2 1 : Avoid degen eracy (mask valu e = ^H1 0 0 0 0 0 ) Wh en th is bit is set, if th e compu ted valu e of join t #2 is with in 1 0 degrees of h avin g th e ou ter lin k straigh t ou t (th at is, join t 2 between -1 0 an d +1 0 degrees in valu e), an ou t-of-ran ge error for join t 2 is sign aled. Bit 2 2 : Sin gle-tu rn join t 4 (mask valu e = ^H2 0 0 0 0 0 ) Wh en th is bit is set, th e compu ted valu e of join t 4 is restricted to th e ran ge of 1 8 0 to +1 8 0 degrees. Bit 2 3 : Straigh t-lin e motion (mask valu e = ^H4 0 0 0 0 0 ) Wh en th is bit is set, th e join t position s retu rn ed mu st correspon d to th e same con figu ration as th ose in itially specified. Th at is, n o ch an ge in robot con figu ration is allowed. V+ Lan gu age Referen ce Gu ide Page 6 9 8 SOLVE .ANGLE S program in stru ction Details Th is in stru ction compu tes th e join t position s th at are equ ivalen t to a specified tran sformation valu e u sin g th e geometric data of th e robot con n ected to th e system. Th e specified tran sformation is in terpreted to be th e position an d location of th e en d of th e robot tool in th e World coordin ate system, takin g in to con sideration th e cu rren t TOOL tran sformation an d BASE offsets. E xample Th e in stru ction s below do n ot perform an y u sefu l fu n ction bu t are in ten ded to illu strate h ow th e SOLVE .ANGLE S in stru ction operates. After execu tion of th ese in stru ction s, both th e jts2 an d jts arrays con tain approximately th e same valu es. An y differen ces in th e valu es are du e to compu tation al rou n d-off errors: HERE #cpos DECOMPOSE jts = #cpos SOLVE.TRANS new.t, error = jts SOLVE.ANGLES jts2, flags, error = new.t, jts, SOLVE.FLAGS(jts) Related Keywords DE COMPOSE program in stru ction SE LE CT program in stru ction SE LE CT real-valu ed fu n ction SOLVE .FLAGS real-valu ed fu n ction SOLVE .TRANS program in stru ction V+ Lan gu age Referen ce Gu ide Page 6 9 9 SOLVE .FLAGS real-valu ed fu n ction SOLVE.FLAGS real-valued function Syntax S OLVE.FLAGS ( join ts[ in dex] ) Function Retu rn bit flags represen tin g th e robot con figu ration specified by an array of join t position s. Usage Considerations Th e SOLVE .FLAGS fu n ction retu rn s in formation for th e robot selected by th e task execu tin g th e fu n ction . If th e V+ system is n ot con figu red to con trol a robot, u se of th e SOLVE .FLAGS fu n ction cau ses an error. Parameters join ts Real array th at con tain s th e robot join t position s. Th e first specified elemen t of th e array mu st con tain th e position for join t #1 , th e secon d elemen t mu st con tain th e valu e for join t #2 , etc. For rotatin g join ts, th e join t position s are assu med to h ave u n its of degrees. For tran slation al join ts, th e join t position s are assu med to h ave u n its of millimeters. in dex Option al real valu e, variable, or expression (in terpreted as an in teger) th at iden tifies th e array elemen t th at con tain s th e position for join t #1 . If n o in dex is specified, elemen t zero mu st con tain th e position for join t #1 . Details Th is fu n ction retu rn s bit flags th at in dicate th e con figu ration of th e robot (for example, RIGHTY or LE FTY) for a given set of join t position s. Th is fu n ction is u sefu l for providin g th e con figu ration data requ ired by th e SOLVE .ANGLE S program in stru ction . Th e bits of th e valu e retu rn ed by th is fu n ction are in terpreted as follows: Bit 1 ( LS B) RI GHTY ( mask valu e = 1 ) If th is bit is set, th e position h as th e robot in a righ t-arm con figu ration . Oth erwise, th e position is for a left-arm con figu ration . Bit 2 BELOW ( mask valu e = 2 ) V+ Lan gu age Referen ce Gu ide Page 7 0 0 SOLVE .FLAGS real-valu ed fu n ction If th is bit is set, th e position h as th e robot con figu red with th e elbow below th e lin e from th e sh ou lder to th e wrist. Oth erwise, th e robot elbow is above th e sh ou lder-wrist lin e. (Th is bit is always 0 wh en a SCARA robot is in u se.) Bit 3 FLI P ( mask valu e = 4 ) If th is bit is set, th e position h as th e robot con figu red with th e pitch axis of th e wrist set to a n egative an gle. Oth erwise, th e wrist pitch an gle h as a positive valu e. (Th is bit is always 0 wh en th e robot does n ot h ave a th ree-axis wrist, as is th e case for a fou r-axis SCARA robot.) Related Keywords ABOVE program in stru ction BE LOW program in stru ction DE COMPOSE program in stru ction LE FTY program in stru ction RIGHTY program in stru ction FLIP program in stru ction NOFLIP program in stru ction SE LE CT program in stru ction SE LE CT real-valu ed fu n ction SOLVE .ANGLE S program in stru ction SOLVE .TRANS program in stru ction V+ Lan gu age Referen ce Gu ide Page 7 0 1 SOLVE .TRANS program in stru ction SOLVE.TR ANS program instruction Syntax S OLVE.TRANS tran sform, error = join ts[ in dex] Function Compu te th e tran sformation equ ivalen t to a given set of join t position s for th e cu rren t robot. Usage Considerations Sin ce th e compu tation performed by th is in stru ction is a fu n ction of th e geometry of th e robot (lin k dimen sion s, n u mber of axes, tool offsets, base offsets), robots with differen t geometric parameters yield differen t resu lts. In fact, sin ce robots of th e same gen eral type may differ sligh tly in th eir dimen sion s, th is in stru ction may retu rn sligh tly differen t resu lts wh en execu ted on two differen t robot systems of th e same type. Th e SOLVE .TRANS in stru ction refers to th e robot selected by th e task execu tin g th e in stru ction . If th e V+ system is n ot con figu red to con trol a robot, execu tin g th e SOLVE .TRANS in stru ction does n ot gen erate an error becau se of th e absen ce of a robot. However, th e in formation retu rn ed may n ot be mean in gfu l. Parameters tran sform Tran sformation variable or tran sformation array elemen t in wh ich th e resu lt is stored. error Real variable th at is set to a V+ error code if a compu tation al error occu rred du rin g processin g of th e in stru ction . Th is variable is set to 0 if n o error occu rs. (Th e on ly error th at is cu rren tly reported is arith metic overflow [-4 0 9 ], so th is parameter can be con sidered as retu rn in g a TRUE or FALSE valu e.) join ts Real-valu ed array th at con tain s th e join t position s th at are to be con verted to an equ ivalen t tran sformation . Th e first specified elemen t of th e array mu st con tain th e position for join t #1 , th e secon d elemen t mu st con tain th e valu e for join t #2 , etc. For rotatin g join ts, th e join t position s are assu med to h ave u n its of degrees. For tran slation al join ts, th e join t position s are assu med to h ave u n its of millimeters. in dex Option al in teger valu e th at iden tifies th e array elemen t th at con tain s th e position for join t #1 . If n o in dex is specified, elemen t zero mu st con tain th e position for join t #1 . V+ Lan gu age Referen ce Gu ide Page 7 0 2 SOLVE .TRANS program in stru ction Details Th is in stru ction con verts a set of join t position s to an equ ivalen t tran sformation valu e u sin g th e geometric data of th e robot con n ected to th e system. Th e compu ted tran sformation represen ts th e position an d orien tation of th e en d of th e tool in th e World coordin ate system takin g in to con sideration th e cu rren t TOOL tran sformation an d BASE offsets. E xample Th e series of in stru ction s below compu tes th e position an d orien tation to wh ich th e robot is moved if its cu rren t location is altered by rotatin g join t #1 by 1 0 degrees: HERE #cpos DECOMPOSE joints[1] = #cpos joints[1] = joints[1]+10 SOLVE.TRANS new.trans, error = joints[1] Related Keywords DE COMPOSE program in stru ction SE LE CT program in stru ction SE LE CT real-valu ed fu n ction SOLVE .ANGLE S program in stru ction SOLVE .FLAGS real-valu ed fu n ction V+ Lan gu age Referen ce Gu ide Page 7 0 3 SPE E D program in stru ction SPEED program instruction Syntax S PEED speed_ factor, r_ speed_ factor u n its ALWAYS Function Set th e n omin al speed for su bsequ en t robot motion s. Usage Considerations SPE E D 1 0 0 ,1 0 0 ALWAYS is assu med wh en ever program execu tion is started an d wh en a n ew execu tion cycle begin s. Motion speed h as differen t mean in gs for join t-in terpolated motion s an d straigh t-lin e motion s. Th e speed of robot motion s is determin ed by a combin ation of th e program speed settin g an d th e mon itor speed settin g. Th e SPE E D in stru ction can be execu ted by an y program task as lon g as th e robot selected by th e task is n ot attach ed by an y oth er task. Th e in stru ction applies to th e robot selected by th e task. If th e V+ system is n ot con figu red to con trol a robot, execu tin g th e SPE E D in stru ction cau ses an error. Parameters speed_ factor Real valu e, variable, or expression wh ose valu e is u sed as a n ew speed factor. Th e valu e 1 0 0 is con sidered n ormal fu ll speed, 5 0 is 1 /2 of fu ll speed, an d so on . If IPS or MMPS is specified for u n its, th e valu e is con sidered th e lin ear tool tip speed. r_ speed_ factor Option al real valu e, variable, or expression wh ose valu e is u sed as a n ew straigh t-lin e motion rotation al speed factor. Th e valu e 1 0 0 is con sidered n ormal fu ll speed, 5 0 is 1 /2 of fu ll speed, etc. u n its Option al keyword—eith er IPS (for in ch es per secon d), MMPS (for millimeters per secon d), or MONITOR—th at determin es h ow to in terpret th e speed_ factor parameter. ALWAYS Option al qu alifier. If specified, th e program speed_ factor will be in effect u n til th e n ext SPE E D in stru ction ch an ges program speed. Oth erwise, it is in effect on ly for th e n ext motion in stru ction (in clu din g APPROach es an d DE PARTs). V+ Lan gu age Referen ce Gu ide Page 7 0 4 SPE E D program in stru ction Details If th e u n its parameter is omitted, th is in stru ction determin es th e program speed—th e n omin al robot motion speed, assu min g th at th e mon itor speed factor is 1 0 0 %. If MONITOR is specified for u n its, th e mon itor speed is set. In th is case, th e parameter r_ speed_ factor is ign ored an d ALWAYS is assu med. Th e speed at wh ich motion s are actu ally performed is determin ed by combin in g th e valu es specified in th is in stru ction with th e cu rren t program speed settin g. Mon itor speed ch an ges take place immediately, in clu din g th e remain in g portion of a cu rren tly execu tin g move. If IPS or MMPS is specified in th e u n its parameter, speed_ factor is in terpreted as th e absolu te tool-tip speed for straigh t-lin e motion s. In th is case, th e speed_ factor parameter h as n o direct mean in g for join t-in terpolated motion s. Th e effects of ch an gin g program speed an d mon itor speed differ sligh tly for con tin u ou s-path motion s. As th e robot moves th rou gh a series of poin ts, th e robot comes as close to th e poin ts as possible wh ile main tain in g th e program speed an d specified acceleration s. As program speed in creases, th e robot makes coarser approximation s to th e actu al poin t in order to main tain th e program speed an d acceleration s. Wh en th e mon itor speed is in creased, th e path of th e robot relative to th e comman ded destin ation poin ts is n ot altered bu t th e acceleration s are in creased. For application s wh ere path followin g is importan t, th e path can be defin ed with th e mon itor speed set to a low valu e, an d th en accu rately replayed at a h igh er mon itor speed. Speed can n ot be less th an 0 .0 0 0 0 0 1 (1 .0 E -6 ). Wh en th e Mon itor speed is set, its valu e is limited to a maximu m of 1 0 0 %. No error is reported if a h igh er speed settin g is specified. Wh en th e program speed is set, its valu e is limited to a maximu m th at depen ds on th e robot bein g con trolled. No error is reported if a h igh er speed settin g is specified. Th e maximu m speed valu e for th e cu rren t robot is retu rn ed by th e real-valu ed fu n ction SPE E D(8 ). (Th at valu e is establish ed with a SPE C data item.) Du rin g straigh t-lin e motion s, if a tool with a large offset is attach ed to th e robot, th e robot join t an d flan ge speeds can be very large wh en rotation s abou t th e tool tip are made. Th e r_ speed_ factor parameter permits con trol of th e maximu m tool rotation speeds du rin g straigh t-lin e motion s. If a rotation al speed factor (r_ speed_ factor) is specified, it is in terpreted as a percen tage of maximu m Cartesian rotation speed to be u sed du rin g straigh t-lin e motion s. If th e r_ speed_ factor parameter is n ot specified, on e of th e followin g resu lts occu rs: 1 . If th e u n its parameter is also omitted, th e rotation al speed is set to th e valu e of speed_ factor. 2 . If th e u n its parameter is specified, th e rotation al speed is n ot ch an ged. V+ Lan gu age Referen ce Gu ide Page 7 0 5 SPE E D program in stru ction Wh en IPS or MMPS are specified, th e speed_ factor is con verted in tern ally to th e correspon din g n omin al speed. If th e SPE E D real-valu ed fu n ction is th en u sed to read th e program speed, th e valu e retu rn ed is a percen tage speed factor an d n ot an absolu te speed settin g. Remember, th e fin al robot speed is a combin ation of th e mon itor speed (SPE E D mon itor comman d), th e program speed (SPE E D in stru ction ), an d th e acceleration or deceleration (ACCE L program in stru ction ). E xamples Set th e program speed to 5 0 % for th e n ext motion (assu min g th e mon itor speed is 1 0 0 ): SPEED 50 Set th e n omin al tool tip speed to 2 0 in ch es per secon d (assu min g th e mon itor speed is 1 0 0 ) for straigh t-lin e motion s. Rotation s abou t th e tool tip is limited to 4 0 % of maximu m. Th e settin gs remain s in effect u n til ch an ged by an oth er SPE E D in stru ction . SPEED 20, 40 IPS ALWAYS Set th e mon itor speed to 5 0 % of n ormal: SPEED 50 MONITOR Related Keywords ACCE L program in stru ction DURATION program in stru ction IPS keyword MMPS keyword PAYLOAD program in stru ction SCALE .ACCE L system switch SE LE CT program in stru ction SE LE CT real-valu ed fu n ction SPE E D mon itor comman d SPE E D real-valu ed fu n ction V+ Lan gu age Referen ce Gu ide Page 7 0 6 SPE E D real-valu ed fu n ction SPEED real-valued function Syntax S PEED ( select) Function Retu rn on e of th e system motion speed factors. Usage Considerations Th e SPE E D fu n ction retu rn s in formation for th e robot selected by th e task execu tin g th e fu n ction . If th e V+ system is n ot con figu red to con trol a robot, u se of th e SPE E D fu n ction does n ot gen erate an error becau se of th e absen ce of a robot. However, th e in formation retu rn ed by th e fu n ction may n ot be mean in gfu l. Parameter select Real-valu ed expression wh ose valu e determin es wh ich speed factor sh ou ld be retu rn ed (see below). Details Th is fu n ction retu rn s th e system motion speed factor correspon din g to th e select parameter valu e. Th e acceptable parameter valu es, an d th e correspon din g speed valu es retu rn ed, are: S elect S peed valu e retu rn ed 1 Mon itor speed (set by SPE E D mon itor comman d) 2 Perman en t program speed (set by a SPE E D ... ALWAYS program in stru ction ) 3 Temporary program speed for th e last or cu rren t motion 4 Temporary program speed to be u sed for th e n ext motion 5 Perman en t program rotation speed 6 Temporary program rotation speed for th e last or cu rren t straigh t-lin e motion 7 Temporary program rotation speed to be u sed for th e n ext straigh t-lin e V+ Lan gu age Referen ce Gu ide Page 7 0 7 SPE E D real-valu ed fu n ction motion 8 Th e maximu m allowable settin g for program speed Note th at th e valu e retu rn ed sh ou ld be in terpreted as a percen tage of n ormal speed, even if th e program speed was set by a SPE E D program in stru ction th at specified a speed settin g. (See th e SPE E D program in stru ction .) E xample Th e followin g program segmen t makes on e motion at 1 /2 of th e perman en t program speed: new.speed = SPEED(2)/2 SPEED new.speed MOVE pick.up ;Compute 1/2 the permanent speed ;Move at the new speed next time ;Perform the actual motion Note th at th e followin g in stru ction sequ en ce is equ ivalen t: SPEED SPEED(2)/2 MOVE pick.up ;Reduce speed for the next motion ;Perform the actual motion Related Keywords ACCE L real-valu ed fu n ction DURATION real-valu ed fu n ction SE LE CT program in stru ction SE LE CT real-valu ed fu n ction SPE E D mon itor comman d SPE E D program in stru ction V+ Lan gu age Referen ce Gu ide Page 7 0 8 SPIN program in stru ction SPIN program instruction Syntax S PI N speeds[in dex] Function Rotate on e or more join ts of th e selected robot at a specified speed. Usage Considerations Th is in stru ction cu rren tly can be u sed on ly with th e Join ts (JTS) robot device modu le. Th e acceleration an d deceleration factors u sed for SPIN can be ch an ged in th e n ormal way, u sin g th e V+ ACCE L in stru ction . Becau se SPIN u ses a con stan t acceleration rate, th e option al profile parameter of th e ACCE L in stru ction is ign ored by th e SPIN in stru ction . V+ limits th e acceleration rate an d deceleration rate to be less th an or equ al to th e maximu m valu es th at are defin ed for th e robot. (Th ese maximu m valu es are specified by th e system design er u sin g th e SPE C u tility program.) Th e SPE E D program in stru ction does n ot affect SPIN. However, th e SPE E D mon itor comman d does modify th e SPIN speed. V+ Lan gu age Referen ce Gu ide Page 7 0 9 SPIN program in stru ction Parameters speeds[ ] Th e option al speeds[ ] array con tain s th e rate at wh ich each join t of th e selected robot is to be rotated. Th e rates are in u n its of degrees/secon d or millimeters/secon d. Join ts can be rotated in eith er th e positive or n egative direction . V+ limits th e spin speeds to be less th an or equ al to th e 1 0 0 % join t-speed valu es th at are defin ed for th e robot. Oth er facts abou t th e speeds[ ] array: l l l in dex If th e array is omitted, all valu es defau lt to zero. If th e array is specified, all th e expected elemen ts mu st be defin ed. Sparse arrays gen erate an * Un defin ed valu e* error message. For all array types (AUTO, etc.), th e h igh est elemen t in dex mu st be equ al to or greater th an wh at is requ ired. Option al in teger valu e th at iden tifies wh ich array elemen t is applied to join t1 . Zero is assu med if omitted. Join t 2 u ses th e valu e from elemen t [in dex+1 ], an d so on . CAUTI ON: It is importan t to execu te SE TBE LT each time th e robot is goin g to track th e belt, to make su re th e differen ce between th e cu rren t belt position (as retu rn ed by th e BE LT fu n ction ) an d th e belt position of th e specified belt variable does n ot exceed 8 ,3 8 8 ,6 0 7 (^H7 FFFFF) du rin g active belt trackin g. Un predictable robot motion may resu lt if th e differen ce does exceed th is valu e wh ile trackin g th e belt. Details Th e SPIN in stru ction u ses a con stan t acceleration rate to accelerate each join t u p to its specified speed. On ce each join t h as reach ed its specified speed, it con tin u es to rotate at a con stan t speed u n til on e of th e followin g occu rs: l An oth er SPIN in stru ction is execu ted th at ch an ges on e or more of th e SPIN rates. l A SPIN in stru ction is execu ted th at decelerates all of th e join ts to a stop. l An error occu rs (PANIC, BRAKE , join t limit stop en cou n tered, etc.) th at decelerates all join ts to a stop. To u se th e SPIN in stru ction to stop all of th e join ts, th e SPIN in stru ction mu st be execu ted with eith er n o speeds array specified or with all of th e array elemen ts set to 0 . V+ Lan gu age Referen ce Gu ide Page 7 1 0 SPIN program in stru ction If a SPIN operation h as been abn ormally termin ated by a PANIC stop or oth er error con dition , th e spin operation can be resu med by issu in g a RE TRY mon itor comman d. SPIN movemen ts can n ot be blen ded with th e stan dard motion in stru ction s (su ch as MOVE , MOVE S, APPRO, DE PART). Th erefore, a BRE AK is implicitly execu ted before a SPIN in stru ction to allow an y stan dard motion to complete. (If th ere is more th an on e SPIN in stru ction in a sequ en ce, th en an implicit BRE AK is execu ted on ly before th e first SPIN in stru ction .) Also, SPIN trajectories mu st be stopped with a SPIN in stru ction , BRAKE , etc., prior to execu tin g a regu lar motion in stru ction . If a SPIN trajectory is bein g execu ted, an d a regu lar motion in stru ction is execu ted, th e followin g error message is gen erated: *Illegal while joints SPIN'ing* Th e SPIN in stru ction can be u sed to move on ly a join t th at h as been con figu red with th e con tin u ou s-rotation capability. If a SPIN in stru ction attempts to move a join t th at h as n ot been so con figu red, or if th e robot is cu rren tly trackin g a belt or movin g u n der ALTE R con trol, th e followin g error message is gen erated: *SPIN motion not permitted* If an y join ts of th e selected robot can n ot rotate con tin u ou sly, th eir correspon din g spin rates sh ou ld always be specified as 0 . Wh en a SPIN in stru ction is execu ted, th e valu e of th e DE ST fu n ction is n ot mean in gfu l an d th e valu e of th e #PDE ST fu n ction retu rn s th e specified join t speeds in stead of th e fin al join t an gles. Con tin u ou s-Tu rn Axes In order for a join t to rotate con tin u ou sly, th e followin g con dition s mu st be satisfied: (1 ) th e robot device modu le mu st be design ed to su pport on e or more con tin u ou s-tu rn join ts, (2 ) th e en coder roll-over valu e for th e join t mu st be n on zero, an d (3 ) th e join t stop limits mu st be set to valu es su bstan tially greater th an th e roll-over valu e. Cu rren tly, on ly th e join ts (JTS) robot device modu le h as been design ed to su pport con tin u ou s-tu rn join ts, an d an y of its join ts may be con figu red for con tin u ou s tu rn in g. To set th e roll-over valu e for a join t, th e SPE C u tility program mu st be ru n . V+ u ses th e roll-over valu e in th e followin g man n er: At selected times V+ compares th e absolu te valu e of th e comman ded position of th e join t to its roll-over valu e an d, if th e comman ded position exceeds th e roll-over valu e, th e roll-over valu e is su btracted from (or added to) th e comman ded position . Th is test for join t roll-over is performed at th e followin g times: (1 ) at th e en d of a con tin u ou s-path motion ; (2 ) wh en ever th e robot is in FRE E /JOINT/WORLD/TOOL man u al con trol modes; (3 ) wh en ever robot power is disabled; an d (4 ) wh en ever a join t is bein g moved via a SPIN in stru ction . V+ Lan gu age Referen ce Gu ide Page 7 1 1 SPIN program in stru ction E xample Assign spin speeds for all join ts of th e cu rren tly selected robot wh ich is assu med to h ave fou r axes: temp.speeds[1] = 0.5 temp.speeds[2] = 0.25 temp.speeds[3] = 0 temp.speeds[4] = 1.0 SPIN temp.speeds[1] ;Turn J1 at 30 rpm ;Turn J2 at 15 rpm ;Do not turn J3 ;Turn J4 at 1 rps (30 rpm) ;Start the motion V+ Lan gu age Referen ce Gu ide Page 7 1 2 SQR real-valu ed fu n ction SQR real-valued function Syntax S QR ( valu e) Function Retu rn th e squ are of th e parameter. Parameter valu e Real-valu ed expression wh ose valu e is to be squ ared. Details Th is is a con ven ien ce fu n ction th at compu tes th e squ are of a valu e. Th at is, th e resu lt is equ al to (valu e * valu e). E xamples SQR(0.123) SQR(4) SQR(-5.462) SQR(1.3125E+2) ;Returns ;Returns ;Returns ;Returns 0.015129 16 29.83344 17226.56 NOTE: TYPE , PROMPT, an d similar in stru ction s ou tpu t th e resu lts of th e above examples as sin gle-precision valu es. However, th ey are actu ally stored an d man ipu lated as dou bleprecision valu es. Th e LISTR mon itor comman d displays real valu es to fu ll precision . V+ Lan gu age Referen ce Gu ide Page 7 1 3 SQRT real-valu ed fu n ction SQR T real-valued function Syntax S QRT ( valu e) Function Retu rn th e squ are root of th e parameter. Parameter valu e Real-valu ed expression defin in g th e valu e wh ose squ are root is to be compu ted. Details Retu rn s th e squ are root of th e argu men t if th e argu men t is greater th an zero. An error resu lts if th e argu men t is less th an zero. Th e squ are root of a n u mber is defin ed to be th e n u mber th at, wh en mu ltiplied by itself, yields th e origin al n u mber. E xamples SQRT(0.123) SQRT(4) SQRT(-5.462) SQRT(1.3125E+2) ;Returns ;Returns ;Returns ;Returns 0.3507136 2.0 *Negative square root* 11.45644 NOTE: TYPE , PROMPT, an d similar in stru ction s ou tpu t th e resu lts of th e above examples as sin gle-precision valu es. However, th ey are actu ally stored an d man ipu lated as dou bleprecision valu es. Th e LIST an d LISTR mon itor comman d displays real valu es to fu ll precision . V+ Lan gu age Referen ce Gu ide Page 7 1 4 STATE real-valu ed fu n ction STATE real-valued function Syntax S TATE ( select) Function Retu rn a valu e th at provides in formation abou t th e robot system state. Usage Considerations Th e STATE fu n ction retu rn s in formation for th e robot selected by th e task execu tin g th e fu n ction . V+ Lan gu age Referen ce Gu ide Page 7 1 5 STATE real-valu ed fu n ction Parameter select Real valu e, variable, or expression (in terpreted as an in teger) th at selects th e category of state in formation retu rn ed. Th e in formation categories are listed below. For details on a category, click th e category n ame to view its description . Robot State (select=1 ) S ystem S ettin gs Cu rren t man u al con trol mode (select=3 ) Con troller In terface Pan el Settin gs an d h ardware statu s (select=4 ) Settin gs of Con troller switch es on th e CIP (select=5 ) Trajectory gen erator execu tion rate (select=1 3 ) Servo code execu tion rate (select=1 4 ) Nu mber of robot selected by Man u al Con trol Pen dan t (select=8 ) Robot Motion I n formation Cu rren t or previou s robot motion (select=2 ) Statu s of Real-time path -modification facility (alter mode) for cu rren t motion = (select=6 an d select= 7 ) Time u n til completion of robot motion (select=9 ) Percen tage of cu rren t motion completed (select=1 0 ) Acceleration profile (select=1 1 ) Nu mber of motion bein g execu ted by th e selected robot (select=1 5 ) Determin e wh eth er cu rren t or previou s motion is optimized (select=1 9 ) Plan n ed execu tion time of cu rren t motion (select=2 0 -2 7 ) Details Wh en select = 1 , th e fu n ction valu e retu rn s in formation abou t th e overall robot state as follows: V+ Lan gu age Referen ce Gu ide Page 7 1 6 STATE real-valu ed fu n ction Valu e I n terpretation ( wh en select = 1 ) 0 Resettin g system after robot power h as been tu rn ed off. 1 A fatal error h as occu rred an d robot power can n ot be tu rn ed on . 2 Waitin g for u ser to tu rn on robot power. 3 Robot power was ju st tu rn ed on ; in itialization is occu rrin g. 4 In dicates th at Man u al con trol mode is active (see Select=3 ). 5 A CALIBRATE comman d or in stru ction is execu tin g. 6 Not u sed. 7 Robot is u n der program con trol. 8 Robot power is on ; robot is n ot calibrated an d can n ot be moved. 9 Selected robot is stopped waitin g for th e STE P bu tton on th e man u al con trol pen dan t (MCP) to be pu sh ed. Th is can be tru e on ly wh en th e MCP.NO.POT system switch is en abled. NOTE : Becau se th e V+ task execu tin g th e motion in stru ction will be blocked at th e motion in stru ction wh en th is STATE con dition occu rs, it is n ot u sefu l to ch eck STATE (1 ) from th e same V+ task. Th erefore, a differen t V+ task sh ou ld u se th e SE LE CT program in stru ction to specify th e desired robot an d th en ch eck STATE (1 ). 10 Fron t pan el power ligh t is blin kin g slowly (1 Hz), waitin g to be pressed. Robot power will be tu rn ed on wh en th e blin kin g bu tton is pressed. 11 Fron t pan el power ligh t is blin kin g rapidly (4 Hz). Robot power will be tu rn ed on wh en : (a) th e HTR (h old to ru n ) bu tton is pressed an d h eld, an d (b) th e COMP/PWR bu tton on th e MCP is pressed. NOTE : Pressin g th e fron t pan el power ligh t wh en it is blin kin g rapidly will cau se robot power to be tu rn ed off fu lly. Th e n ormal process will be requ ired to tu rn power back on . Wh en select = 2 , th e fu n ction valu e retu rn s in formation abou t th e cu rren t or previou s robot motion as follows. Th ese modes can ch an ge on ly wh en th e robot is u n der program con trol-th at is, wh en STATE (1 ) = 7 . Valu e I n terpretation ( wh en select = 2 ) V+ Lan gu age Referen ce Gu ide Page 7 1 7 STATE real-valu ed fu n ction 0 No motion in stru ction s execu ted yet. 1 Normal trajectory evalu ation is in progress (in clu din g n ormal acceleration , deceleration an d segmen t tran sition s). 2 Motion stopped at a plan n ed location .1 3 Position error is bein g n u lled at u n plan n ed fin al location . 4 Motion stopped at an u n plan n ed location du e to a belt win dow violation .2 5 Deceleratin g du e to a triggered RE ACTI or BRAKE in stru ction . 6 Stopped du e to a triggered RE ACTI or BRAKE in stru ction .2 7 Deceleratin g du e to a h ardware error, pan ic bu tton , or E STOP in stru ction . 8 Stopped du e to a h ardware error, pan ic bu tton , or E STOP in stru ction .2 9 Deceleratin g du e to a stop-on -force con dition . 10 Stopped du e to a stop-on -force con dition . 11 Nu llin g at completion of a SPIN motion . 12 Stopped after completion of a SPIN in stru ction . 1A RE TRY com m an d h as n o effect. 2A RE TRY com m an d com pletes th e previou s motion . Wh en select = 3 , th e fu n ction valu e retu rn s in formation abou t th e cu rren t man u al con trol mode as follows: Valu e 0 I n terpretation ( select = 3) Man u al mode with ou t selection . V+ Lan gu age Referen ce Gu ide Page 7 1 8 STATE real-valu ed fu n ction 1 Free-join t mode. 2 In dividu al join t con trol. 3 World coordin ates con trol. 4 Tool coordin ates con trol. 5 Compu ter con trol en abled. Wh en select = 4 , th e fu n ction valu e retu rn s in formation abou t th e Con troller In terface Pan el's (CIP) con trol settin gs an d oth er h ardware statu s to be read by programs. In terpret th e valu e as a set of bit flags, each of wh ich in dicates a correspon din g con dition . Bit mask I n terpretation wh en bit set ( select = 4 ) ^H1 Con troller in terface pan el (CIP) is con n ected. ^H2 Not u sed. ^H4 E STOP circu it is open 1. ^H8 HIGH POWE R bu tton is pu sh ed.2 ^H1 0 E STOP ch an n el 1 relay is open . ^H2 0 E STOP ch an n el 2 relay is open . ^H4 0 User MANUAL switch state. ^H8 0 Fron t pan el DIO overtemp detected. 1 If V+ is detectin g a h ardware E STOP con dition Bit 4 is n on -zero. 2Th e HIGH POWE R V+ Lan gu age Referen ce Gu ide Page 7 1 9 STATE real-valu ed fu n ction bu tton will n ot fu n ction if its ligh t bu lb is bu rn ed ou t or missin g. Wh en select = 5 , th e fu n ction valu e in dicates th e settin gs of th e con troller switch es on th e Con troller In terface Pan el (CIP). For in formation on th is pan el, refer to th e Adept SmartCon troller User's Gu ide or th e MV Con troller User's Gu ide. Valu e I n terpretation ( select = 5) 1 Au tomatic mode, Network off. 2 Man u al mode, Network off. 3 Au tomatic mode, Network on . 4 Man u al mode, Network on . Wh en select = 6 , th e fu n ction retu rn s an in dication of wh eth er or n ot th e real-time path modification facility (alter mode) is en abled. If zero is retu rn ed, alter mode is disabled for th e cu rren t motion . If a n on zero valu e is retu rn ed, alter is en abled, an d th e low byte of th is valu e con tain s bits th at correspon d to th e mode specified in th e ALTON in stru ction th at in itiated th e path modification . Wh en select = 7 , th e fu n ction retu rn s an in dication of wh eth er or n ot th e real-time path modification facility (alter mode) is en abled for th e n ext plan n ed motion . If zero is retu rn ed, alter mode is disabled for th e n ext motion . If a n on zero valu e is retu rn ed, alter is en abled, an d th e low byte of th is valu e con tain s bits th at correspon d to th e mode specified in th e ALTON in stru ction th at in itiated th e path modification . (Th is option is available on ly if you r Adept system is equ ipped with th e V+ Advan ced Trajectory Con trol Licen se.) Wh en select = 8 , th e n u mber of th e robot selected by th e man u al con trol pen dan t is retu rn ed. Wh en select = 9 , th e fu n ction retu rn s th e time (in secon ds) left u n til completion of th e cu rren t motion . Zero in dicates th at n o motion is in progress. For con tin u ou s-path motion s, th e valu e of STATE (9 ) decreases du rin g each motion u n til th e tran sition to th e n ext motion , an d th en th e valu e su dden ly ch an ges to th e time left in th e n ext motion . Th at is, STATE (9 ) does n ot reach 0 before it is reset to reflect th e n ext motion . Wh en select = 1 0 , th e fu n ction retu rn s th e percen tage of th e cu rren t motion th at h as completed. Th e valu e 1 0 0 in dicates th at n o motion is in progress. For con tin u ou s-path motion s, th e valu e of STATE (1 0 ) in creases du rin g each motion u n til th e tran sition to th e n ext motion , an d th en th e valu e su dden ly ch an ges to close to 0 to reflect th e start of th e n ext motion . Th at is, STATE (1 0 ) does n ot reach 1 0 0 before it is reset to reflect th e n ext motion . V+ Lan gu age Referen ce Gu ide Page 7 2 0 STATE real-valu ed fu n ction Wh en select = 1 1 , th e fu n ction retu rn s detailed in formation on wh ich portion of th e acceleration profile is cu rren tly bein g gen erated for th e selected robot. Valu e I n terpretation ( select = 11) 0 Idle, n ot evalu atin g trajectory 1 Rampin g u p acceleration for n ew segmen t 2 Con stan t acceleration section 3 Rampin g down acceleration 4 Con stan t velocity section 5 Rampin g u p acceleration du rin g th e tran sition section between motion s 6 Con stan t acceleration du rin g th e tran sition section between motion s 7 Rampin g down acceleration du rin g th e tran sition section between motion s 8 Rampin g u p deceleration 9 Con stan t deceleration 10 Rampin g down deceleration 11 Nu llin g fin al errors Wh en select = 1 2 , th e fu n ction retu rn s a flag th at is set to n on zero wh en an ALTE R program in stru ction is execu ted for th e cu rren tly selected robot, an d cleared after th e trajectory gen erator processes th e posted ALTE R data. Th is flag can be u sed to coordin ate th e execu tion of ALTE R in stru ction s with th e processin g of th e data by th e trajectory gen erator. Wh en select = 1 3 , th e fu n ction retu rn s th e trajectory gen erator execu tion rate in h ertz. Th at is, if th e trajectory gen erator is execu ted on ce each major V+ cycle, th is fu n ction retu rn s th e valu e 6 2 .5 . V+ Lan gu age Referen ce Gu ide Page 7 2 1 STATE real-valu ed fu n ction Wh en select = 1 4 , th e fu n ction retu rn s th e servo code execu tion rate for an y servos th at are local to th e con troller wh ich in clu des all VME servos for AWC systems, an d th e belt servo for SC-CX con trollers. It will n ot retu rn th e execu tion rate for servos on th e SmartServo n etwork. Th e execu tion rate is in h ertz. Th at is, if th e servos are execu ted each 1 msec, th is fu n ction retu rn s valu e 1 0 0 0 (1 kHz). Wh en select = 1 5 , th e fu n ction retu rn s th e n u mber of th e motion th at is bein g execu ted by th e selected robot. Th is n u mber is zeroed wh en a program th at is attach ed to th e robot first begin s execu tin g. Th e cou n ter is reset to 1 at th e start of each E XE CUTE cycle. Th e valu e is in cremen ted each time th e trajectory gen erator begin s evalu atin g a n ew motion (or tran sition s to a n ew con tin u ou s-path motion ). Th e valu e of STATE (1 5 ) ran ges from 0 to ^HFFFF. After reach in g ^HFFFF, th e valu e rolls back to 0 . Th e followin g in stru ction s affect th e valu e of STATE (1 5 ): ALIGN, APPRO, APPROS, DE PART, DE PARTS, DRIVE , JMOVE , MOVE , MOVE S, MOVE F, MOVE SF, MOVE T, MOVE ST, RE ADY In stru ction s th at affect on e or more su bsequ en t motion s (e.g., ACCE L, AMOVE , ABOVE , BE LOW, DURATION, FLIP, LE FTY, NOFLIP, MULTIPLE , RIGHTY, SINGLE , SPE E D, SPIN, TOOL, UNIDIRE CT, ...) do n ot affect th e valu e of STATE (1 5 ), becau se th ose in stru ction s do n ot actu ally in itiate a motion . NOTE: Fu n ction s do n ot affect th e valu e of STATE (1 5 ), becau se a fu n ction does n ot cau se a motion . Location -valu ed fu n ction s (e.g., DE ST, FRAME , INVE RSE , SCALE , SHIFT, TRANS, etc.) simply compu te location valu es. Wh en select = 1 9 , th e fu n ction retu rn s a flag th at in dicates if th e cu rren t motion (or th e previou sly execu ted motion if th e robot is stopped) is an optimized move (i.e., MOVE F or MOVE SF). Th e possible valu es retu rn ed by th is fu n ction are: Valu e I n terpretation ( select = 19) 0 Not a MOVE F/MOVE SF motion . 1 Depart segmen t of MOVE F/MOVE SF 2 Horizon tal segmen t of MOVE F/MOVE SF 3 Fin al segmen t of MOVE F/MOVE SF V+ Lan gu age Referen ce Gu ide Page 7 2 2 STATE real-valu ed fu n ction Wh en select = 2 0 th rou gh 2 7 , th e fu n ction retu rn s detailed in formation on th e plan n ed execu tion time of th e cu rren t motion (or th e previou sly execu ted motion if th e robot is stopped). Note, u n like STATE (9 ) th at retu rn s th e remain in g motion execu tion time corrected for th e mon itor speed settin g, th e valu es retu rn ed by STATE (2 0 ) th rou gh STATE (2 7 ) are th e plan n ed valu es an d are n ot affected by th e settin g of th e mon itor speed valu e. Th e valu es retu rn ed by th ese fu n ction s (in u n its of secon ds) are: S TATE( x) I n formation retu rn ed 20 Acceleration ramp u p time 21 Con stan t acceleration time 22 Acceleration ramp down time 23 Con stan t velocity time 24 Deceleration ramp u p time 25 Con stan t deceleration time 26 Deceleration ramp down time 27 Total motion time (su m of STATE (2 0 ) th rou gh STATE (2 6 )) E xample Th e followin g example sh ows h ow th e STATE fu n ction can be u sed to determin e wh eth er or n ot a RE ACTI was triggered du rin g a robot motion : REACTI 1001 ;Setup the reaction MOVES final ;Start the robot motion BREAK ;Wait for the motion to complete CASE STATE(2) OF ;Decide what happened VALUE 2: TYPE "Motion completed normally" VALUE 6: TYPE "Motion stopped by REACTI" VALUE 8: TYPE "Motion stopped by panic button" END V+ Lan gu age Referen ce Gu ide Page 7 2 3 STATE real-valu ed fu n ction Related Keywords SE LE CT program in stru ction SE LE CT real-valu ed fu n ction STATUS mon itor comman d STATUS real-valu ed fu n ction V+ Lan gu age Referen ce Gu ide Page 7 2 4 STATUS real-valu ed fu n ction STATUS real-valued function Syntax S TATUS ( program_ n ame) Function Retu rn statu s in formation for an application program. Usage Considerations Th e u se of STATUS with a n u ll program n ame to determin e th e task n u mber is obsolete. Th e TASK real-valu ed fu n ction is more efficien t an d sh ou ld be u sed in stead. Parameter program_ n ame Strin g con stan t, variable, or expression th at specifies th e n ame of th e application program of in terest. Letters in th e n ame can be u ppercase or lowercase. Th e strin g can be empty ( ) in order n ot to specify a program n ame (see below), bu t th e parameter can n ot be omitted. Details Th is fu n ction retu rn s in formation abou t th e execu tion statu s of th e specified program. If n o program n ame is specified (th at is, th e parameter strin g is empty [ ]), th e task n u mber of th e program con tain in g th e fu n ction call is retu rn ed. Th is allows a program to determin e wh ich system task it is execu tin g as. (Tasks an d task n u mbers are described in th e section Sch edu lin g of Program E xecu tion Tasks in th e V+ Lan gu age User's Gu ide.) If a program n ame is specified as th e fu n ction parameter, th e statu s of th at program is retu rn ed as follows: Valu e retu rn ed Program statu s -1 Not execu tin g. -2 Not defin ed. -3 In terlocked becau se of write. V+ Lan gu age Referen ce Gu ide Page 7 2 5 STATUS real-valu ed fu n ction -4 Not execu table. -5 In terlocked becau se of read. A program is con sidered write-in terlocked wh en it is bein g copied, deleted, ren amed, or edited in read-write mode. A program is con sidered read-in terlocked wh en it is execu tin g (by on e or more tasks) or is bein g edited in read-on ly mode. A program is con sidered n ot execu table wh en it con tain s a stru ctu re error or a bad lin e. NOTE: If a program is bein g execu ted by mu ltiple tasks, th e STATUS fu n ction retu rn s -5 . Th ere is n o way to u se th e STATUS fu n ction to determin e wh en th e program ceases to be execu ted by on e of th ose tasks. Th e STATUS fu n ction does n ot retu rn -1 u n til all th e tasks stop execu tin g th e program. Th e fu n ction retu rn s a n ot defin ed statu s if an in valid program n ame is specified (for example, if th e n ame does n ot start with a letter). E xample Th e followin g program segmen t demon strates h ow th e STATUS fu n ction can be u sed to decide wh eth er or n ot to in itiate execu tion of an application program: IF STATUS("pc.main") == -1 THEN EXECUTE 1 pc.main END NOTE: Th e STATUS fu n ction does n ot retu rn -1 if th e program is bein g execu ted by an y program task. Th u s, th is example may n ot be appropriate for some situ ation s. (See th e example sh own for th e E XE CUTE in stru ction for an oth er tech n iqu e for in itiatin g execu tion of an oth er program task.) Related Keywords DE FINE D real-valu ed fu n ction STATE real-valu ed fu n ction STATUS mon itor comman d TE STP mon itor comman d V+ Lan gu age Referen ce Gu ide Page 7 2 6 STOP program in stru ction STOP program instruction Syntax S TOP Function Termin ate execu tion of th e cu rren t program cycle. Usage Considerations STOP does n ot h alt program execu tion if th ere are more program cycles to execu te. Th e PROCE E D comman d can n ot be u sed to resu me program execu tion after a STOP in stru ction cau ses th e program to h alt. If program execu tion is h alted by a STOP in stru ction , FCLOSE an d/or DE TACH are forced on all attach ed I/O devices. Details Cou n ts on e more program cycle as complete an d on e less remain in g. If th e resu lt is th at n o more cycles are remain in g, program execu tion h alts. If more cycles are remain in g, th e in tern al robot motion parameters are rein itialized, an d program execu tion con tin u es with th e first step of th e main program (even if th e STOP occu rred with in a su brou tin e or reaction program). Termin ates execu tion of th e cu rren t program u n less more program loops (see th e E XE CUTE comman d an d in stru ction ) are to be completed, in wh ich case execu tion of th e program con tin u es at its first step. Th u s, th e STOP in stru ction is u sed to mark th e en d of a program execu tion pass. Note th at th e HALT in stru ction h as a differen t effect-it can cels all remain in g cycles. A RE TURN in stru ction in a main program h as th e same effect as a STOP in stru ction . A main program is on e th at is in voked by an E XE CUTE comman d or in stru ction , or a PRIME or XSTE P comman d, wh ereas a su brou tin e is a program th at is in voked by a CALL, CALLP, or CALLS in stru ction (or a reaction ) with in an oth er program. Related Keywords ABORT mon itor comman d ABORT program in stru ction E XE CUTE program in stru ction HALT program in stru ction PAUSE program in stru ction V+ Lan gu age Referen ce Gu ide Page 7 2 7 STOP program in stru ction RE TURN program in stru ction V+ Lan gu age Referen ce Gu ide Page 7 2 8 STRDIF real-valu ed fu n ction STR DIF real-valued function Syntax S TRDI F ( $ a, $ b) Function Compare two strin gs byte by byte for th e pu rpose of sortin g. Th is fu n ction always compares bytes exactly. It ign ores th e settin g of th e UPPE R system switch . Parameters $a A strin g con stan t, variable, or expression th at con tain s th e bytes to be compared with th ose in $ b. $b A strin g con stan t, variable, or expression th at con tain s th e bytes to be compared with th ose in $ a. Details Th is fu n ction compares strin gs byte by byte, u sin g th e u n sign ed byte valu es with ou t an y case con version . Th at is, th e fu n ction ign ores th e settin g of th e UPPE R system switch . Th e two strin gs can h ave differen t len gth s. Th e retu rn ed valu es an d th eir mean in gs are as follows: Retu rn ed valu e I n terpretation -1 $ a is less th an $ b. 0 $ a is exactly th e same as $ b. 1 $ a is greater th an $ b. Note th at th e valu e is FALSE (0 ) if th e strin gs are th e same. E xample Sort two n ames in alph abetical order: $name[0] = "Michael" $name[1] = "MARK" CASE STRDIF($name[0],$name[1]) OF VALUE -1, 0: V+ Lan gu age Referen ce Gu ide Page 7 2 9 STRDIF real-valu ed fu n ction $list[0] = $list[1] = VALUE 1: $list[0] = $list[1] = END TYPE "Names in $name[0] $name[1] $name[1] $name[0] alphabetic order: ", $list[0], " ", $list[1] Related Keyword UPPE R system switch V+ Lan gu age Referen ce Gu ide Page 7 3 0 SWITCH program in stru ction SWITCH program instruction Syntax S W I TCH switch _ n ame = valu e S W I TCH switch _ n ame[ in dex] = valu e Function E n able or disable a system switch based on a valu e. Usage Considerations If th e specified switch accepts an in dex qu alifier an d th e in dex is zero or omitted (with or with ou t th e brackets), all th e elemen ts of th e switch array are set accordin g to th e valu e given . Parameters switch _ n ame Name of th e switch wh ose settin g is to be modified. Th e switch n ame can be abbreviated to th e min imu m len gth th at iden tifies it u n iqu ely. in dex For switch es th at can be qu alified by an in dex, th is is an option al real valu e, variable, or expression th at specifies th e specific switch elemen t of in terest (see above). valu e Real valu e, variable, or expression th at determin es wh eth er th e switch is to be en abled or disabled. Th e switch is en abled if th e valu e is TRUE (n on zero). Th e switch is disabled if th e valu e is FALSE (zero). Details Sets th e given system switch to th e settin g implied by th e valu e on th e righ t of th e equ al sign . Th e switch n ame can be abbreviated to th e min imu m len gth th at iden tifies it u n iqu ely. For details on switch n ames, see th e section Switch es in th e V+ Lan gu age User's Gu ide. Oth er system switch es are available wh en option s are in stalled. Refer to th e option docu men tation for details. For example, th e switch es associated with th e AdeptVision option s are described in th e AdeptVision Referen ce Gu ide. V+ Lan gu age Referen ce Gu ide Page 7 3 1 SWITCH program in stru ction E xample Th e followin g program statemen ts sh ow h ow th e SWITCH real-valu ed fu n ction an d in stru ction can be u sed to save th e settin g of a system switch , an d later restore it, respectively: old.upper = SWITCH(UPPER) . . . ;Save the current setting SWITCH UPPER = old.upper ;Restore the initial setting ;Instructions that may change the ;setting of the UPPER switch. Related Keywords DISABLE mon itor comman d DISABLE program in stru ction E NABLE mon itor comman d E NABLE program in stru ction SWITCH mon itor comman d SWITCH real-valu ed fu n ction V+ Lan gu age Referen ce Gu ide Page 7 3 2 SWITCH real-valu ed fu n ction SWITCH real-valued function Syntax S W I TCH ( switch _ n ame) S W I TCH ( switch _ n ame[ in dex] ) Function Retu rn an in dication of th e settin g of a system switch . Parameters switch _ n ame Name of th e system switch of in terest (see below). in dex For switch es th at can be qu alified by an in dex, th is is a (requ ired) real valu e, variable, or expression th at specifies th e specific switch elemen t of in terest. Details Th is fu n ction retu rn s FALSE (0 .0 ) if th e specified switch is disabled. Oth erwise, TRUE (-1 ) is retu rn ed. Th e switch n ame can be abbreviated to th e min imu m len gth th at iden tifies it u n iqu ely. For details on switch n ames, see th e section Switch es in th e V+ Lan gu age User's Gu ide. Oth er system switch es are available wh en option s are in stalled. Refer to th e option docu men tation for details. For example, th e switch es associated with th e AdeptVision option s are described in th e AdeptVision Referen ce Gu ide. E xample Th is program segmen t ch ecks wh eth er th e DRY.RUN switch is en abled. If it is, a message is displayed on th e system termin al: IF SWITCH(DRY.RUN) THEN TYPE "DRY RUN mode is enabled" END Related Keywords DISABLE mon itor comman d DISABLE program in stru ction E NABLE mon itor comman d V+ Lan gu age Referen ce Gu ide Page 7 3 3 SWITCH real-valu ed fu n ction E NABLE program in stru ction SWITCH mon itor comman d SWITCH program in stru ction V+ Lan gu age Referen ce Gu ide Page 7 3 4 $ SYMBOL strin g fu n ction $SYMBOL string function Syntax $ S YMBOL ( poin ter) Function Determin e th e u ser symbol th at is referen ced by a poin ter previou sly obtain ed with th e SYMBOL.PTR real-valu ed fu n ction . Usage Considerations Th e poin ter valu e mu st h ave been obtain ed with th e SYMBOL.PTR real-valu ed fu n ction . Parameter poin ter Real variable th at iden tifies th e symbol to be referen ced. Details Th is fu n ction can be u sed to determin e th e u ser symbol (th at is, program or variable n ame) th at is poin ted to by a poin ter previou sly determin ed with th e SYMBOL.PTR real-valu ed fu n ction . A n u ll strin g is retu rn ed if th e poin ter valu e is zero or in valid, or if th e symbol h as been deleted sin ce th e poin ter was defin ed. E xample After th e SYMBOL.PTR fu n ction h as been u sed to set th e valu es of elemen ts of th e array my.pgm.ptr[ ] (for example, see th e diction ary page for th e CALLP in stru ction ), th e followin g in stru ction can be u sed to display th e program n ame th at is referen ced by on e of th e poin ters: TYPE "Program", index, " is ", $SYMBOL(my.pgm.ptr[index]) Related Keyword CALLP program in stru ction SYMBOL.PTR real-valu ed fu n ction V+ Lan gu age Referen ce Gu ide Page 7 3 5 SYMBOL.PTR real-valu ed fu n ction SYMBOL.PTR real-valued function Syntax S YMBOL.PTR ( strin g, type) Function Determin e th e valu e of a poin ter to a u ser symbol in V+ memory. Usage Considerations Th e valu e retu rn ed by th e fu n ction is mean in gfu l on ly to th e CALLP in stru ction an d th e $ SYMBOL strin g fu n ction . Parameters strin g Strin g con stan t, variable, or expression th at defin es th e symbol to be referen ced. type Option al real valu e, variable, or expression th at specifies th e type of symbol to be referen ced. Cu rren tly th e on ly valu e su pported is zero, wh ich specifies th at th e strin g parameter defin es a program n ame. Th e valu e zero applies if th e parameter is omitted. Details Th e SYMBOL.PTR fu n ction can be u sed to obtain a poin ter to a u ser symbol (th at is, a program or variable n ame) in V+ memory. Su ch a poin ter can th en be u sed elsewh ere in th e program by th e CALLP in stru ction an d th e $ SYMBOL fu n ction . Refer to th e description s of th ose keywords for more in formation . Th e fu n ction retu rn s th e valu e zero if th e specified symbol is n ot defin ed. E xample Refer to th e diction ary page for th e CALLP in stru ction . Related Keywords CALLP program in stru ction $ SYMBOL strin g fu n ction V+ Lan gu age Referen ce Gu ide Page 7 3 6 $ SYS.INFO strin g fu n ction $SYS.INFO string function Syntax $ strin g = $ S YS .I NFO( mode,stg) Function Th is fu n ction provides gen eral system in formation . For example, it provides access to th e ActiveVR log data. Usage Considerations Th e AVR.LOG switch mu st be disabled before callin g th e $ SYS.INFO fu n ction u sin g mode 1 . Input Parameters mode Determin es th e type of in formation retu rn ed based on th e followin g mode valu es: Valu e Description 0 Retu rn s th e fu ll file specification (device>su bdirectory_ path \filen ame.exten sion ) for th e disk file from wh ich th e V+ program modu le specified by $ strin g was loaded. If th e modu le is u n defin ed or was n ot loaded from a file, an empty strin g valu e is retu rn ed. 1 Retu rn in formation from th e ActiveVR log. Th is mode is su pported on ly in V+ version 1 6 .0 or later. See Details for more in formation . If th e mode is in valid, $ SYS.INFO retu rn s an empty strin g rath er th an gen eratin g an execu tion error. $ strin g An option al strin g valu ed expression . Details Retu rn s th e in formation requ ested by th e mode an d $ strin g in pu t parameters. If th e mode is in valid, $ SYS.INFO retu rn s an empty strin g rath er th an gen eratin g an execu tion error. V+ Lan gu age Referen ce Gu ide Page 7 3 7 $ SYS.INFO strin g fu n ction Mode 1 $ SYS.INFO(1 ,$ strin g) retu rn s an en try from th e ActiveVR log. Th e en try retu rn ed is iden tified by th e $ strin g parameter, wh ich sh ou ld be defin ed as follows: $string = $ENCODE(item) wh ere th e valu e of item is in terpreted as follows: item = 0 th e total n u mber of en tries in th e log(N) item > 0 requ est th e respective en try in th e log. item = 1 requ est th e oldest log en try item = N requ ests th e latest en try in th e log. Th e retu rn ed valu e is an empty strin g if an y error occu rs. Oth erwise, it is an ASCII strin g con tain in g on e or th ree n u meric valu es. If item #0 was requ ested, th e strin g con tain s a sin gle in teger valu e. If a log en try was requ ested, th e strin g con tain s timestamps an d th e logged in stru ction in th e same format as th e trace messages displayed wh en AVR.TRACE is en abled. Th at is, th e strin g for th e log en try h as th e format: "tstart tend trace" wh ere: tstart ASCII strin g sh owin g th e timestamp, in millisecon ds, wh en in stru ction execu tion started. ten d ASCII strin g sh owin g th e timestamp, in millisecon ds, wh en in stru ction execu tion completed. trace ASCII strin g sh owin g th e in stru ction th at was execu ted. NOTE: Becau se of th e way V+ processes motion in stru ction s, th e valu e of ten d-tstart does n ot in dicate h ow lon g it took to perform a motion . It in dicates h ow lon g th e in stru ction h ad to wait for an y previou s motion to complete. Related Keywords AVR system switch AVR.LOG system switch AVR.LOGSIZE system parameter AVR.TRACE system switch V+ Lan gu age Referen ce Gu ide Page 7 3 8 TAS real-valu ed fu n ction TAS real-valued function Syntax TAS ( variable, n ew_ valu e) Function Retu rn th e cu rren t valu e of a real-valu ed variable an d assign it a n ew valu e. Th e two action s are don e in divisibly so th at n o oth er program task can modify th e variable at th e same time. Usage Considerations Th e V+ system does n ot en force an y protection sch eme for global variables th at are sh ared by mu ltiple program tasks. It is th e programmer's respon sibility to keep track of th e u sage of su ch global variables. Th e TAS real-valu ed fu n ction (or th e similar CAS fu n ction ) can be u sed to implemen t logical in terlocks on access to sh ared variables. Th is fu n ction can also be u sed to work arou n d a restriction on th e simu ltan eou s access of global arrays by mu ltiple program tasks -- program execu tion can fail if two or more tasks attempt to in crease th e size of an array at th e same time. For a detailed description of th is, see th e " Global Array Access Restriction " section of th e in formation abou t Arrays, in th e V+ Lan gu age User's Gu ide. Parameters variable Name of th e real-valu ed variable to be tested an d assign ed th e n ew valu e given . (If th e variable is n ot defin ed wh en th e fu n ction is execu ted, th e fu n ction retu rn s th e valu e 0 .) n ew_ valu e Real valu e, variable, or expression th at defin es th e n ew valu e to be assign ed to th e specified variable. Details Becau se th e differen t program tasks execu te simu ltan eou sly, time-sh arin g th e system processor, it is possible for an y task to be in terru pted by an oth er in th e middle of performin g some compu tation or storin g data in to variables. Wh en data is sh ared by two or more tasks, th e programs mu st implemen t an in terlock sch eme to preven t th e data from bein g accessed wh en it is on ly partially u pdated. Th e TAS fu n ction can be u sed to allow mu ltiple V+ tasks to modify sh ared data stru ctu res. Th at is, th e fu n ction provides a way for a task to lock ou t oth ers wh ile th e lockin g task modifies th e data stru ctu res. Note th at with ou t th e TAS fu n ction , a mu ch more complicated pollin g sch eme wou ld be n eeded to admin ister th e con trol variable (i.e., to preven t more th an on e program from settin g th e con trol variable simu ltan eou sly). V+ Lan gu age Referen ce Gu ide Page 7 3 9 TAS real-valu ed fu n ction As an example of th e u se of sh ared variables, con sider th is V+ program th at in cremen ts an d decremen ts a global variable: .PROGRAM tas_test() AUTO i FOR i = 1 TO 1E+06 counter = counter+1 counter = counter-1 END .END If th e variable cou n ter starts at 0 , an d th e program tas_ test is ru n simu ltan eou sly in tasks 1 an d 2 , on e migh t expect th at cou n ter will h ave th e valu e 0 after execu tion completes. In fact, it u su ally will n ot h ave th at valu e! Sin ce th e two tasks are modifyin g th e same variable at th e same time, th e valu e gets corru pted. Th at can be fixed by modifyin g th e program to employ an in terlock as follows: .PROGRAM tas_test() AUTO i FOR i = 1 TO 1E+06 ; Wait for access to the shared variable to be ; unlocked, and set the lock for our access. WHILE TAS(locked,TRUE) DO WAIT END ; Access the shared variable. counter = counter+1 counter = counter-1 ; Release access to the shared variable. locked = FALSE END .END Now, wh en th e program is execu ted simu ltan eou sly in two (or more) tasks. Th e valu e of th e variable cou n ter will always en d u p th e same as before th e program starts. Th at's becau se each task blocks th e oth er task(s) wh ile accessin g th e sh ared variable. (Th e global variable locked does n ot n eed to be in itialized before th e program is execu ted, becau se th e TAS fu n ction retu rn s FALSE if th e variable is n ot defin ed. Th u s, th e lock implicitly starts ou t bein g off.) NOTES : Th e lock sh ou ld be released as soon as possible, becau se th e oth er task cou ld be waitin g for it to be released. Take care to make su re th e lock is always released after it gets applied. Oth erwise th e oth er task cou ld be blocked forever, an d th e cu rren t task wou ld also be blocked th e n ext time it tries to acqu ire th e lock. V+ Lan gu age Referen ce Gu ide Page 7 4 0 TAS real-valu ed fu n ction E xample Th e followin g example sh ows th e key aspects of u sin g th e TAS real-valu ed fu n ction to en su re exclu sive access by an application program to data th at is also u sed by an oth er program task. (Th e same in stru ction sequ en ce mu st be u sed in an y oth er application program th at wan ts to access th e data.) Th e real-variable data.locked h as th e valu e FALSE wh en th e data is n ot in terlocked, an d th e valu e TRUE wh en th e data is in terlocked. Th is variable is set to TRUE with th e TAS fu n ction , so th at we can detect if th e oth er program task h as already set it to TRUE . Sin ce TAS tests an d sets th e valu e in divisibly, th ere is n o ch an ce of both programs settin g data.locked to TRUE simu ltan eou sly with ou t th e con flict bein g detected. Use of th e " semaph ore" variable data.locked in volves th e th ree steps sh own below. ; Step1: ; ; ; Look for the lock variable to have the "unlocked" setting and simultaneously apply the "lock" setting (TRUE). This continuously until another task sets the lock variable to setting (FALSE), at which time this task asserts the lock (FALSE), loop will cycle the "unlocked" for itself. WHILE TAS(data.locked,TRUE) DO ;Wait for the lock to be released WAIT ;Sleep this task until the next cycle END ; Step 2: Perform desired operations accessing the shared data ... ... ; Step 3: Release the lock on the shared data structure. data.locked = FALSE Th e WHILE loop cau ses program execu tion to be blocked u n til th e variable data.locked is fou n d to h ave th e valu e FALSE . Th u s, th e program is blocked if th e oth er program h as locked th e semaph ore variable in order to access th e sh ared data. Note th at th e TAS fu n ction will set th e variable data.locked to TRUE each time th e fu n ction is execu ted, bu t th at will h ave n o effect if th e variable already h as th at valu e. On ce th e program gain s exclu sive access to th e sh ared data, it can safely access th e data. Th e last in stru ction releases th e data for access by th e application execu tin g as th e oth er program task. Related Keyword CAS real-valu ed fu n ction IOTAS real-valu ed fu n ction V+ Lan gu age Referen ce Gu ide Page 7 4 1 TASK real-valu ed fu n ction TASK real-valued function Syntax TAS K ( select, task_ n u m) Function Retu rn in formation abou t a program execu tion task. Parameters select Option al real-valu ed expression th at h as a valu e of 0 , 1 , or 2 an d selects th e category of task in formation retu rn ed (see below). Th e valu e 0 is assu med if th e parameter is omitted. task_ n u m Option al in teger valu e th at specifies wh ich system program task is to be accessed (see below). Details Th is fu n ction retu rn s variou s in formation abou t th e system program execu tion tasks. (See th e V+ Lan gu age User's Gu ide for an explan ation of execu tion tasks.) Th e select parameter determin es th e type of in formation th at is retu rn ed as follows: select = 0 Task n u mber: Th e fu n ction retu rn s th e n u mber of th e task execu tin g th e cu rren t program. select = 1 Task ru n state: Retu rn s th e ru n state for th e task specified by th e task_ n u m parameter. Th e valu e retu rn ed sh ou ld be in terpreted as follows: Valu e I n terpretation -1 In valid task n u mber. 0 Idle. 1 Stopped du e to program completion . 2 Stopped du e to program execu tion error (for example, u n defin ed valu e). V+ Lan gu age Referen ce Gu ide Page 7 4 2 TASK real-valu ed fu n ction 3 4 select = 2 Stopped du e to ABORT, breakpoin t, pan ic bu tton pressed, robot error, sin gle-step execu tion , or watch poin t. E xecu tin g. Task statu s bits: Retu rn s an in teger valu e th at sh ou ld be in terpreted as a set of bit flags th at in dicate th e followin g in formation abou t th e task specified by th e task_ n u m parameter: Bit # Bit mask 1 1 Debu gger is accessin g task 2 2 Task h as robot attach ed I n dication if bit is set E xamples Display th e task n u mber th e program is ru n n in g in : TY P E "Thi s program i s runni ng as task number :", TA S K () Th e followin g program segmen t demon strates h ow th e TASK fu n ction can be u sed to decide wh eth er to in itiate execu tion of a program (n amed pc.job.2 ) with task #2 : IF TASK(1,2) <> 4 THEN IF STATUS("pc.job.2") == -1 THEN EXECUTE 2 pc.job.2() ELSE TYPE /B, "Can't start task #2" END END ;If task #2 not executing ;and if program is okay ;start it up ;But if program not okay ;output error message Related Keywords STATE real-valu ed fu n ction STATUS mon itor comman d STATUS real-valu ed fu n ction V+ Lan gu age Referen ce Gu ide Page 7 4 3 TE RMINAL system parameter TER MINAL system parameter Syntax ... TERMI NAL Function Determin e h ow V+ will in teract with th e system termin al. Usage Considerations Th e cu rren t valu e of th e TE RMINAL parameter can be determin ed with th e PARAME TE R mon itor comman d or real-valu ed fu n ction . Th e valu e of th e TE RMINAL parameter can be modified on ly with th e PARAME TE R mon itor comman d or program in stru ction . Th e acceptable parameter valu es are 0 th rou gh 4 . Th e defau lt valu e is 4 on V+ system disks su pplied by Adept. Th e parameter n ame can be abbreviated. Details Th e possible TE RMINAL parameter valu es are described below: Parameter valu e Termin al type Treatmen t of DEL & BS Cu rsoru p comman d 0 TTY \<ech o\ Non e 1 CRT E rase <VT> 2 CRT E rase <SUB> 3 CRT E rase 7 e<FF> 4 CRT E rase <E SC>M 0 For TTY ( h ardcopy) termin als. For TTY (h ardcopy) termin als, wh en th e BACKSPACE , DE L, or RUBOUT key is pressed to begin a typin g correction , a backslash ch aracter (\) is displayed alon g with th e ch aracter th at h as been deleted. Su bsequ en t ch aracter deletion s cau se ju st th e deleted ch aracter to be V+ Lan gu age Referen ce Gu ide Page 7 4 4 TE RMINAL system parameter displayed. Wh en a n on deletin g key is pressed, an oth er backslash is displayed alon g with th e n ew ch aracter. Th u s, after th e correction is completed, all th e ch aracters between th e backslash es will h ave been deleted. An oth er ch aracteristic of th is settin g is th at th e WHE RE 1 an d IO comman ds display th eir in formation on ly on ce. If a CRT termin al is u sed with th e appropriate on e of th e followin g settin gs, th e WHE RE 1 an d IO comman ds con tin u ou sly u pdate th e display of in formation u n til you press CTRL+C. For all CRT termin als, wh en th e BACK SPACE , DE L, or RUBOUT key is pressed, th e last ch aracter in pu t is deleted an d erased from th e screen . 1 . For CRT termin als th at accept an ASCII VT ch aracter (1 1 decimal) as th e comman d to move th e cu rsor u p on e lin e. (For example, u se th is valu e for Soroc bran d termin als.) 2 . For CRT termin als th at accept an ASCII SUB ch aracter (2 6 decimal) as th e comman d to move th e cu rsor u p on e lin e. (For example, u se th is valu e for ADDS bran d termin als.) 3 . For CRT termin als th at accept an ASCII 7 e ch aracter (1 2 6 decimal) followed by an ASCII FF ch aracter (1 2 decimal) as th e comman d to move th e cu rsor u p on e lin e. (For example, u se th is valu e for Hazeltin e bran d termin als.) 4 . For ANSI-compatible CRT termin als th at accept an ASCII E SC ch aracter (2 7 decimal) followed by an ASCII M ch aracter (1 1 5 decimal) as th e comman d to move th e cu rsor u p on e lin e. (For example, u se th is valu e for VT1 0 0 -compatible termin als, su ch as th e Wyse termin al available from Adept.) Th is valu e sh ou ld be u sed wh en th e Adept graph ics system is in u se. E xample Set system termin al type to VT1 0 0 /Wyse: PARAMETER TERMINAL = 4 Related Keywords IO mon itor comman d PARAME TE R mon itor comman d PARAME TE R program in stru ction PARAME TE R real-valu ed fu n ction PROMPT program in stru ction TYPE program in stru ction WHE RE mon itor comman d V+ Lan gu age Referen ce Gu ide Page 7 4 5 TIME program in stru ction TIME program instruction Syntax TI ME time_ strin g Function Set th e date an d time. Parameter time_ strin g Strin g expression wh ose valu e specifies th e date an d time to be set. Th e valu e of th e strin g mu st h ave on e of th ese formats (see below): dd-mmm-yy hh:mm:ss dd-mmm-yy hh:mm dd-mmm-yyyy hh:mm:ss dd-mmm-yyyy hh:mm Details Th e system clock is set equ al to th e valu e of th e strin g expression . Th e system clock is main tain ed au tomatically an d sh ou ld be ch an ged on ly wh en its settin g is in correct (e.g., th e con troller is moved to a differen t time zon e). Th e system clock is u sed in th e followin g situ ation s: l l l l l Th e date an d time are displayed wh en th e V+ system is booted from disk. Wh en ever a n ew disk file is created, th e date an d time are recorded with th e file n ame. (Th e FDIRE CTORY comman d displays th e dates an d times for files.) Th e date an d time are appen ded to th e message in dicatin g th at an application program h as termin ated execu tion . Th e date an d time are displayed by th e TIME mon itor comman d. Th e date an d time are available to an application program by u se of th e $ TIME () an d $ TIME 4 () strin g fu n ction s. Th e in dividu al elemen ts of th e date an d time specification are defin ed as follows: Elemen t Description dd Th e day of th e mon th (1 to 3 1 ) mmm Th e mon th , specified as a 3 -letter abbreviation (JAN, FE B, MAR, APR, MAY, JUN, JUL, AUG, SE P, OCT, NOV, or DE C) yy Th e year, wh ere 8 0 to 9 9 represen t 1 9 8 0 th rou gh 1 9 9 9 , respectively, V+ Lan gu age Referen ce Gu ide Page 7 4 6 TIME program in stru ction Elemen t Description an d 0 0 to 7 9 represen t 2 0 0 0 th rou gh 2 0 7 9 , respectively. yyyy Th e year (1 9 8 0 to 2 0 7 9 ) hh Th e h ou r of th e day (0 to 2 3 ) mm Min u tes past th e h ou r (0 to 5 9 ) ss Secon ds past th e min u te (0 to 5 9 ; 0 assu med if :ss omitted) E xample TIME "23-JUN-99 16:10:25" Related Keywords TIME mon itor comman d TIME real-valu ed fu n ction $ TIME strin g fu n ction $ TIME 4 strin g fu n ction V+ Lan gu age Referen ce Gu ide Page 7 4 7 TIME real-valu ed fu n ction TIME real-valued function Syntax TI ME ( strin g, select) Function Retu rn an in teger valu e represen tin g eith er th e fou r-digit date or th e time specified in th e given strin g parameter. Parameters strin g Option al strin g variable, con stan t, or expression th at specifies th e date an d time in th e format described below. (See below for details.) select Real valu e, variable, or expression (in terpreted as an in teger) th at selects th e valu e to be retu rn ed. An error resu lts if select is n ot on e of th e followin g: select Retu rn ed Defin ed ss 1 date (year-1 9 8 0 )* 5 1 2 + mon th * 3 2 + day 2 time h ou r* 2 0 4 8 + min u te* 3 2 + secon d/2 3 secon ds time past th e min u te Details Th is fu n ction can be u sed to en code th e date an d time in to compact (u n sign ed 1 6 -bit) in teger formats. After th e in teger date an d time valu es are obtain ed, th ey can be arith metically compared to oth er date an d time valu es to determin e before an d after con dition s. NOTE: You sh ou ld n ot try to man ipu late th e en coded in teger valu es to perform date or time arith metic. For example, you sh ou ld n ot attempt to add days to an en coded date valu e. If th e strin g parameter is su pplied, both th e date an d th e time mu st be specified in th e strin g. Th e valu e of th e strin g mu st h ave on e of th e followin g formats: dd-mmm-yy hh:mm:ss dd-mmm-yy hh:mm dd-mmm-yyyy hh:mm:ss dd-mmm-yyyy hh:mm V+ Lan gu age Referen ce Gu ide Page 7 4 8 TIME real-valu ed fu n ction (Th e fu n ction retu rn s th e valu e -1 if th e in pu t strin g does n ot h ave an acceptable format [see th e example below].) Th e in dividu al date an d time elemen ts are defin ed as follows: Elemen t Description dd Th e day of th e mon th (1 to 3 1 ) mmm Th e mon th , specified as a 3 -letter abbreviation (JAN, FE B, MAR, APR, MAY, JUN, JUL, AUG, SE P, OCT, NOV, or DE C) yy Th e year, wh ere 8 0 to 9 9 represen t 1 9 8 0 th rou gh 1 9 9 9 , respectively, an d 0 0 to 7 9 represen t 2 0 0 0 th rou gh 2 0 7 9 , respectively. yyyy Th e year (1 9 8 0 to 2 0 7 9 ) hh Th e h ou r of th e day (0 to 2 3 ) mm Min u tes past th e h ou r (0 to 5 9 ) ss Secon ds past th e min u te (0 to 5 9 ; 0 assu med if :ss omitted) If th e strin g parameter is n ot su pplied an d th e select parameter is 1 , th e cu rren t date of th e system clock is retu rn ed. In addition , th e cu rren t time of th e system clock is stored in th e (in tern al) admin istrative data for th e program task. If th e strin g parameter is n ot su pplied an d th e select parameter is 2 or 3 , th e selected time valu e is retu rn ed for th e system-clock time previou sly saved. E xample Th e followin g program segmen t sh ows h ow th e TIME real-valu ed fu n ction can be u sed to make su re you en ter a valid date an d time after a prompt: PROMPT "Enter the date and time (dd-mmm-yy hh:mm:ss): ", $time WHILE (TIME($time,1) == -1) DO ;Make sure it's valid TYPE /B, " Cannot interpret date/time." PROMPT "Try again (dd-mmm-yy hh:mm:ss): ", $time END TIME $time ;Set system time Related Keywords TIME mon itor comman d TIME program in stru ction $ TIME strin g fu n ction V+ Lan gu age Referen ce Gu ide Page 7 4 9 TIME real-valu ed fu n ction $ TIME 4 strin g fu n ction V+ Lan gu age Referen ce Gu ide Page 7 5 0 $ TIME strin g fu n ction $TIME string function Syntax $ TI ME ( date, time) Function Retu rn a strin g valu e con tain in g eith er th e cu rren t system date an d time or th e specified date an d time. Parameters date Option al in teger valu e represen tin g th e year, mon th , an d day (see below). Th e valu e is in terpreted as follows (mon th ran ges from 1 to 1 2 ): date = (year-1980)*512 + month*32 + day time Option al in teger valu e represen tin g th e h ou r, min u tes, an d secon ds past midn igh t (see below). Th e valu e is in terpreted as follows (h ou r ran ges from 0 to 2 3 ): time = hour*2048 + minute*32 + second/2 NOTE: Th is fu n ction always retu rn s a strin g con tain in g both th e date an d th e time. Th at can resu lt in an erron eou s date strin g if th e date parameter is omitted wh en th e time parameter is specified. Details If both th e date an d time parameters are omitted, th is fu n ction retu rn s th e cu rren t system date an d time in th e format described below. (An empty strin g is retu rn ed if th e system clock h as n ot been in itialized.) If th e date an d time parameters are specified, th eir valu es are con verted to an ASCII strin g in th e format described below, an d th e strin g is retu rn ed. Th is operation is u sed to decode th e ou tpu t valu es gen erated by th e TIME real-valu ed fu n ction . Th e date an d time are ou tpu t in th e format dd-mmm-yy h h :mm:ss, in wh ich th e in dividu al elemen ts are defin ed as follows: Elemen t Description dd Th e day of th e mon th (1 to 3 1 ) mmm Th e mon th , specified as a 3 -letter abbreviation (JAN, FE B, MAR, APR, MAY, JUN, JUL, AUG, SE P, OCT, NOV, or DE C) V+ Lan gu age Referen ce Gu ide Page 7 5 1 $ TIME strin g fu n ction Elemen t Description yy Th e year, wh ere 8 0 to 9 9 represen t 1 9 8 0 th rou gh 1 9 9 9 , respectively, an d 0 0 to 7 9 represen t 2 0 0 0 th rou gh 2 0 7 9 , respectively. hh Th e h ou r of th e day (0 to 2 3 ) mm Min u tes past th e h ou r (0 to 5 9 ) ss Secon ds past th e min u te (0 to 5 9 ) NOTE: Th e $ TIME () fu n ction con verts passed argu men ts (in stead of th e system time) wh en eith er th e date or th e time parameter is su pplied. However, th e fu n ction always tries to gen erate a strin g represen tation of both parameters. You get th e date 0 1 -Jan -8 0 if you do n ot provide a date valu e. Th e time su bstrin g is 0 0 :0 0 :0 0 if you do n ot specify a time valu e. Th e followin g expression s can be u sed to retu rn on ly th e date an d th e time, respectively: $date = $MID($TIME(date,),1,9) $time = $MID($TIME(,time),11,8) Related Keywords TIME mon itor comman d TIME program in stru ction TIME real-valu ed fu n ction $ TIME 4 strin g fu n ction V+ Lan gu age Referen ce Gu ide Page 7 5 2 $ TIME 4 strin g fu n ction $TIME4 string function Syntax $ TI ME4 ( date, time) Function Retu rn a strin g valu e con tain in g eith er th e cu rren t system fou r-digit date an d time or th e specified fou r-digit date an d time. Parameters date Option al in teger valu e represen tin g th e year, mon th , an d day (see below). Th e valu e is in terpreted as follows (mon th ran ges from 1 to 1 2 ): date = (year-1980)*512 + month*32 + day time Option al in teger valu e represen tin g th e h ou r, min u tes, an d secon ds past midn igh t (see below). Th e valu e is in terpreted as follows (h ou r ran ges from 0 to 2 3 ): time = hour*2048 + minute*32 + second/2 NOTE: Th is fu n ction always retu rn s a strin g con tain in g both th e date an d th e time. Th at can resu lt in an erron eou s date strin g if th e date parameter is omitted wh en th e time parameter is specified. Details If both th e date an d time parameters are omitted, th is fu n ction retu rn s th e cu rren t system date an d time in th e format described below. (An empty strin g is retu rn ed if th e system clock h as n ot been in itialized.) If th e date an d time parameters are specified, th eir valu es are con verted to an ASCII strin g in th e format described below, an d th e strin g is retu rn ed. Th is operation is u sed to decode th e ou tpu t valu es gen erated by th e TIME real-valu ed fu n ction . Th e date an d time are ou tpu t in th e format dd-mmm-yyyy h h :mm:ss, in wh ich th e in dividu al elemen ts are defin ed as follows: Elemen t Description dd Th e day of th e mon th (1 to 3 1 ) mmm Th e mon th , specified as a 3 -letter abbreviation (JAN, FE B, MAR, APR, MAY, JUN, JUL, AUG, SE P, OCT, NOV, or DE C) V+ Lan gu age Referen ce Gu ide Page 7 5 3 $ TIME 4 strin g fu n ction Elemen t Description yyyy Th e year (1 9 8 0 to 2 0 7 9 ) hh Th e h ou r of th e day (0 to 2 3 ) mm Min u tes past th e h ou r (0 to 5 9 ) ss Secon ds past th e min u te (0 to 5 9 ) NOTE: Th e $ TIME 4 () fu n ction con verts passed argu men ts (in stead of th e system time) wh en eith er th e date or th e time parameter is su pplied. However, th e fu n ction always tries to gen erate a strin g represen tation of both parameters. You get th e date 0 1 -Jan -8 0 if you do n ot provide a date valu e. Th e time su bstrin g is 0 0 :0 0 :0 0 if you do n ot specify a time valu e. Th e followin g expression s can be u sed to retu rn on ly th e date an d th e time, respectively: $date = $MID($TIME4(date,),1,11) $time = $MID($TIME4(,time),13,8) Related Keywords TIME mon itor comman d TIME program in stru ction TIME real-valu ed fu n ction $ TIME strin g fu n ction V+ Lan gu age Referen ce Gu ide Page 7 5 4 TIME R program in stru ction TIMER program instruction Syntax TI MER timer_ n u mber = time_ valu e Function Set th e specified system timer to th e given time valu e. Usage Considerations Times measu red by V+ are precise on ly to with in 1 millisecon d (0 .0 0 1 secon ds); sh orter times can n ot be measu red. Timers with n u mbers <= 0 are read-on ly an d can n ot be set with th is in stru ction . Parameters timer_ n u mber Real-valu ed expression in terpreted as th e (in teger) n u mber of th e timer to be set. Th e valu e mu st ran ge from 1 to 1 5 . time_ valu e Real-valu ed expression in terpreted as th e time, in secon ds, to wh ich th e timer is set. Th is parameter may specify fraction s of a secon d an d may be n egative. Details Wh en u sed as described in th e examples below, th e timers can be u sed to measu re an in terval of 5 9 6 h ou rs from wh en th ey were set by th e TIME R in stru ction . Timers h ave a resolu tion of on e millisecon d an d a maximu m cou n t of > 2 .E +0 0 9 . Use th e TIME R real-valu ed fu n ction to read th e in stan tan eou s valu e of a system timer. E xample Th e followin g examples sh ow two ways to wait for a certain amou n t of time, u sin g th e TIME R in stru ction an d real-valu ed fu n ction . E ach example first sets th e timer, an d th en waits u n til th e timer valu e h as ch an ged by th e delay period: TIMER 1 = 0 WAIT TIMER(1) > delay TIMER 1 = -delay WAIT TIMER(1) > 0 ;Set timer to zero ;Wait until timer > delay ;Set timer to -delay ;Wait until timer > zero Related Keyword TIME R real-valu ed fu n ction V+ Lan gu age Referen ce Gu ide Page 7 5 5 TIME R real-valu ed fu n ction TIMER real-valued function Syntax TI MER ( timer_ n u mber) Function Retu rn th e cu rren t time valu e of th e specified system timer. Usage Considerations Th e accu racy an d resolu tion of th e timers vary accordin g to wh ich timer is selected. DOUBLE variables sh ou ld be u sed to ach ieve maximu m resolu tion . See th e Details section below. V+ Lan gu age Referen ce Gu ide Page 7 5 6 TIME R real-valu ed fu n ction Parameter timer_ n u mber Real valu e, variable, or expression (in terpreted as an in teger) th at specifies th e n u mber of th e timer to be read. Th e valu e mu st be in th e ran ge -4 to 1 5 . Valu e Description 1 -1 5 Timers with a resolu tion of on e millisecon d an d a maximu m cou n t of > 2 .E +0 0 9 . Th ey can be u sed to measu re an in terval of u p to 5 9 6 h ou rs from wh en th ey were set by th e TIME R in stru ction . 0 Retu rn s th e n u mber of secon ds sin ce th e V+ system was started, with a resolu tion of 1 millisecon d an d a maximu m cou n t of abou t 2 .E +0 0 9 . It is valid on ly du rin g th e first 5 9 6 h ou rs of system operation an d sh ou ld gen erally n ot be u sed. -1 Retu rn s th e low 2 4 bits of th e time sin ce th e V+ system was started, in cou n ts of 1 6 millisecon ds. It can be u sed to compu te time in tervals of u p to 7 4 h ou rs. For addition al in formation , see th e Details section below. -2 Retu rn s th e low 2 4 bits of th e time sin ce th e V+ system was started, in cou n ts of 1 millisecon d. It can be u sed to compu te time in tervals of u p to 4 .6 h ou rs. For addition al in formation , see th e Details section below. -3 Retu rn s th e time in secon ds sin ce V+ was started as a 5 2 -bit dou ble-precision valu e. Th is timer h as a resolu tion of 1 millisecon d an d a maximu m cou n t of > 4 .E +0 1 5 . It can be u sed to compu te in tervals of > 1 0 0 ,0 0 0 years. It is u sed like timers -1 an d -2 except th at DOUBLE variables are requ ired an d n o BAND operation or scale factors are u sed. AUTO DOUBLE start_time, interval start_time = TIMER(-3) ... interval = TIMER(-3)-start_time V+ Lan gu age Referen ce Gu ide Page 7 5 7 TIME R real-valu ed fu n ction -4 Retu rn s th e dou ble-precision time of th e cu rren t robot-position or belt-en coder latch for th is task. Th e timer resolu tion is 1 microsecon d. Details Timers -1 an d -2 If you don 't wan t to u se timers 1 th rou gh 1 5 , or n eed more th an 1 5 timers, Timers -1 an d -2 may be u sed as follows: AUTO start_time, interval, scale scale = 62.5 ;Set scale = 1000 for TIMER(-2) start_time = TIMER(-1) ... interval = ((TIMER(-1)-start_time) BAND ^HFFFFFF)/scale In V+ 1 1 .2 an d later, timer -3 provides a better meth od for compu tin g su ch in tervals provided th at a DOUBLE valu e can be u sed. Th e type of V+ variable u sed in time compu tation s affects th e maximu m in terval th at can be compu ted with fu ll resolu tion : l l Stan dard RE AL variables h ave on ly 2 4 bits of resolu tion , wh ich limits th e time in terval to 1 6 ,7 7 7 ,2 1 6 (2 24) cou n ts. Th is limit correspon ds to abou t 4 .6 h ou rs for millisecon d timers an d 7 4 h ou rs for 1 6 -millisecon d timers. DOUBLE RE AL variables h ave 5 2 bits of precision so th e fu ll resolu tion of th e variou s timers is stored. E xample Th e followin g example sh ows h ow th e TIME R in stru ction an d real-valu ed fu n ction can be u sed to time th e execu tion of a su brou tin e: TIMER 1 = 0 ;Set timer to zero CALL test.routine() ;Call the subroutine TYPE "Elapsed time =", TIMER(1)," seconds" Related Keyword TIME R program in stru ction V+ Lan gu age Referen ce Gu ide Page 7 5 8 TOOL program in stru ction TOOL program instruction Syntax TOOLtran sformation _ valu e Function Set th e in tern al tran sformation u sed to represen t th e location an d orien tation of th e tool tip relative to th e tool mou n tin g flan ge of th e robot. Usage Considerations Th e TOOL in stru ction cau ses a BRE AK in con tin u ou s-path motion . Th e TOOL in stru ction can be execu ted by an y program task as lon g as th e robot selected by th e task is n ot attach ed by an y oth er task. Th e in stru ction applies to th e robot selected by th e task. If th e V+ system is n ot con figu red to con trol a robot, execu tin g th e TOOL in stru ction cau ses an error. Th e word " tool" can n ot be u sed as a program n ame or variable n ame. Parameter tran sformation _ valu e Option al tran sformation variable or fu n ction , or compou n d tran sformation expression , th at is th e n ew tool tran sformation . If th e tran sformation valu e is omitted, th e tool is set to NULL. Details Cau ses a BRE AK in th e robot con tin u ou s-path motion an d sets th e valu e of th e tool tran sformation equ al to th e tran sformation valu e given . Refer to th e mon itor TOOL comman d for a complete description of th e effect of th is in stru ction . (For in formation on h ow to defin e a tool tran sformation , see th e section Tool Tran sformation s in th e V+ Lan gu age User's Gu ide.) Related Keywords SE LE CT program in stru ction SE LE CT real-valu ed fu n ction TOOL mon itor comman d TOOL tran sformation fu n ction V+ Lan gu age Referen ce Gu ide Page 7 5 9 TOOL tran sformation fu n ction TOOL transformation function Syntax TOOL Function Retu rn th e valu e of th e tran sformation specified in th e last TOOL comman d or in stru ction . Usage Considerations Th e comman d LISTL TOOL can be u sed to display th e cu rren t tool settin g. Th e TOOL fu n ction retu rn s in formation for th e robot selected by th e task execu tin g th e fu n ction . If th e V+ system is n ot con figu red to con trol a robot, u se of th e TOOL fu n ction does n ot gen erate an error becau se of th e absen ce of a robot. However, th e in formation retu rn ed by th e fu n ction may n ot be mean in gfu l. Th e n ame " tool" can n ot be u sed as a program n ame or variable n ame. E xamples Display th e valu e of th e cu rren t TOOL tran sformation from th e system prompt: LISTL TOOL Save th e valu e of th e cu rren t TOOL: SET save.tool = TOOL Related Keywords SE LE CT program in stru ction SE LE CT real-valu ed fu n ction TOOL mon itor comman d TOOL tran sformation fu n ction V+ Lan gu age Referen ce Gu ide Page 7 6 0 TPS real-valu ed fu n ction TPS real-valued function Syntax TPS Function Retu rn th e n u mber of ticks of th e system clock th at occu r per secon d (Ticks Per Secon d). Usage Considerations Th e n ame " tps" can n ot be u sed as a program n ame or variable n ame. E xample Th e followin g example sh ows h ow an even t can be tested each system clock tick, with a time-ou t of 5 secon ds, u sin g th e TPS fu n ction an d th e WAIT in stru ction . FOR ticks = 1 TO 5*TPS ;Loop 5*ticks/sec times IF SIG(1001) THEN TYPE "Signal ON" HALT END WAIT ;Wait until next clock tick END TYPE "Time-out while waiting for signal 1001" V+ Lan gu age Referen ce Gu ide Page 7 6 1 TRACE system switch TR ACE system switch Syntax ... TRACE Function Con trol th e display of program steps on th e system termin al du rin g program execu tion . Usage Considerations Protected programs do n ot gen erate trace ou tpu t. TRACE applies on ly to program task #0 . Th u s, th is switch does n ot affect programs execu ted as oth er program tasks. Details Th is system switch en ables or disables a special mode of execu tion for program task #0 , in wh ich each program step is displayed on th e system termin al before it is execu ted. Th is is u sefu l wh ile developin g a program for ch eckin g th e logical flow of execu tion . In itially th is switch is disabled. Related Keywords DISABLE mon itor comman d DISABLE program in stru ction E NABLE mon itor comman d E NABLE program in stru ction E XE CUTE mon itor comman d SSTE P mon itor comman d SWITCH mon itor comman d SWITCH program in stru ction SWITCH real-valu ed fu n ction XSTE P mon itorcomman d V+ Lan gu age Referen ce Gu ide Page 7 6 2 TRANS tran sformation fu n ction TR ANS transformation function Syntax TRANS ( X_ valu e, Y_ valu e, Z_ valu e, y_ valu e, p_ valu e, r_ valu e) Function Retu rn a tran sformation valu e compu ted from th e given X, Y, Z position displacemen ts an d y, p, r orien tation rotation s. Parameters X_ valu e Y_ valu e Option al expression s for th e X, Y, an d Z displacemen t compon en ts, respectively. Z_ valu e y_ valu e p_ valu e Option al expression s for th e yaw, pitch , an d roll orien tation compon en ts, respectively. r_ valu e NOTE: If an y parameter is omitted, its valu e is taken to be zero. Details Th e in pu t parameter valu es are u sed to compu te a tran sformation valu e th at can be assign ed to a location variable or u sed in a compou n d tran sformation or motion requ est. E xamples If r s th e radiu s of a circle an d an gle is th e an gle of rotation abou t th e circle, th en th e tran sformation : TRANS(r*COS(angle), r*SIN(angle), 0, 0, 0, 0) yields poin ts on th at circle. If frame is a tran sformation defin in g th e position of th e cen ter of th e circle an d th e plan e in wh ich it lies, th e followin g program segmen t moves th e robot tool poin t arou n d th e circle in steps of 1 degree. FOR angle = 0 TO 360-1 MOVE frame:TRANS(r*COS(angle), r*SIN(angle), 0, 0, 0, 0) END V+ Lan gu age Referen ce Gu ide Page 7 6 3 TRANS tran sformation fu n ction Related Keywords DE COMPOSE program in stru ction DX real-valu ed fu n ction DY real-valu ed fu n ction DZ real-valu ed fu n ction #PPOINT precision -poin t fu n ction SE T program in stru ction SHIFT tran sformation fu n ction TRANSB tran sformation fu n ction V+ Lan gu age Referen ce Gu ide Page 7 6 4 $ TRANSB strin g fu n ction $TR ANSB string function Syntax $ TRANS B ( tran sformation ) Function Retu rn a 4 8 -byte strin g con tain in g th e bin ary represen tation of a tran sformation valu e. Parameter tran sformation Tran sformation variable or fu n ction (or compou n d tran sformation ) th at defin es th e valu e to be con verted to a strin g valu e. Details Th is fu n ction con verts th e given tran sformation valu e to th e bin ary represen tation of its twelve (in tern al) compon en ts. Th e twelve valu es defin in g th e tran sformation are th e compon en ts of a 3 -by-4 tran sformation matrix, stored by colu mn . E ach of th e twelve 3 2 -bit valu es is packed as fou r su ccessive 8 -bit ch aracters in a strin g, resu ltin g in a total of 4 8 ch aracters. (Th e IE E E sin gle-precision stan dard floatin g-poin t format is u sed for th e con version . See th e description of th e FLTB real-valu ed fu n ction for details of th e IE E E floatin g-poin t format.) Th e main u se of th is fu n ction is to con vert a tran sformation valu e to its bin ary represen tation in an ou tpu t record of a data file. Related Keywords $ FLTB strin g fu n ction FLTB real-valu ed fu n ction TRANSB tran sformation fu n ction V+ Lan gu age Referen ce Gu ide Page 7 6 5 TRANSB tran sformation fu n ction TR ANSB transformation function Syntax TRANS B ( strin g, first_ ch ar) Function Retu rn a tran sformation valu e represen ted by a 4 8 -byte strin g. Parameters strin g Strin g expression th at con tain s th e 4 8 bytes to be con verted. first_ ch ar Option al real-valu ed expression th at specifies th e position of th e first of th e 4 8 bytes in th e strin g. If first_ ch ar is omitted or h as a valu e of 0 or 1 , th e first 4 8 bytes of th e strin g are extracted. If first_ ch ar is greater th an 1 , it is in terpreted as th e ch aracter position for th e first byte. For example, a valu e of 2 mean s th at th e secon d th rou gh 4 9 th bytes are extracted. An error is gen erated if first_ ch ar specifies 4 8 bytes th at are beyon d th e en d of th e in pu t strin g. Details Forty-eigh t sequ en tial bytes of th e given strin g are in terpreted as bein g a set of twelve sin gle-precision (3 2 -bit) floatin g-poin t n u mbers in th e IE E E stan dard format. (See th e description of th e FLTB fu n ction for details of th e floatin g-poin t format.) Th e twelve valu es are in terpreted as th e compon en ts of a 3 -by-4 tran sformation matrix, stored by colu mn . Th e main u se of th is fu n ction is to con vert th e bin ary represen tation of a tran sformation valu e from an in pu t data record to valu es th at can be u sed in tern ally by V+. Related Keywords FLTB real-valu ed fu n ction TRANS tran sformation fu n ction $ TRANSB strin g fu n ction V+ Lan gu age Referen ce Gu ide Page 7 6 6 TRUE real-valu ed fu n ction TR UE real-valued function Syntax ... TRUE Function Retu rn th e valu e u sed by V+ to represen t a logical tru e resu lt. Usage Considerations Th e word " tru e" can n ot be u sed as a program n ame or variable n ame. Details Th is n amed con stan t is u sefu l for situ ation s wh ere tru e an d false con dition s n eed to be specified. Th e valu e retu rn ed is – 1 . E xample Th e followin g program loop execu tes con tin u ou sly u n til th e su brou tin e process retu rn s a TRUE valu e for th e real variable error: DO CALL process(error) UNTIL error == TRUE Th e program loop below will execu te in defin itely: WHILE TRUE DO CALL move.part() END Related Keywords FALSE real-valu ed fu n ction ON real-valu ed fu n ction V+ Lan gu age Referen ce Gu ide Page 7 6 7 $ TRUNCATE strin g fu n ction $TR UNCATE string function Syntax $ TRUNCATE ( strin g) Function Retu rn all ch aracters in th e in pu t strin g u n til an ASCII NUL (or th e en d of th e strin g) is en cou n tered. Parameter strin g Strin g variable, con stan t, or expression th at specifies th e strin g to be tru n cated. Details Th is fu n ction is similar to performin g a $ DE CODE operation with an ASCII NUL (^H0 0 ) specified as th e break ch aracter. $ TRUNCATE differs from su ch a $ DE CODE operation in two ways: l Th e in pu t can be a strin g expression . l Th e in pu t strin g is n ot modified. Becau se of its simplicity, th e $ TRUNCATE fu n ction execu tes mu ch faster th an th e $ DE CODE fu n ction . E xample Th e in stru ction below sets th e valu e of th e strin g variable $ su bstrin g equ al to abcdef. (Obviou sly, th is is an artificial situ ation , sin ce on e wou ld n ever wan t to perform a $ TRUNCATE operation wh en th e resu lt is apparen t from th e in pu t. However, it is presen ted to illu strate th at th is fu n ction can scan an arbitrary strin g expression an d retu rn th e first su bstrin g delimited by a NUL.) $substring = $TRUNCATE("abcdef"+$CHR(0)+"ghijk") Related Keyword $ DE CODE strin g fu n ction V+ Lan gu age Referen ce Gu ide Page 7 6 8 TYPE program in stru ction TYPE program instruction Syntax TYPE ou tpu t_ specification , ..., ou tpu t_ specification Function Display th e in formation described by th e ou tpu t specification s on th e system termin al. A blan k lin e is ou tpu t if n o argu men t is provided. Usage Considerations No ou tpu t is gen erated if th e ME SSAGE S system switch is disabled. Program execu tion n ormally waits for th e ou tpu t to be completed before con tin u in g. Th ere is an ou tpu t specification described below th at can be u sed to preven t waitin g if it is u n desirable for execu tion to be delayed. Th e ou tpu t from a sin gle TYPE in stru ction can n ot exceed 5 1 2 ch aracters. (Th e /S format con trol specifier described below can be u sed to ou tpu t lon ger messages.) Parameter An ou tpu t_ specification can con sist of an y of th e followin g compon en ts (in an y order) separated by commas: 1 . A strin g expression . 2 . A real-valu ed expression , wh ich is evalu ated to determin e a valu e to be displayed. 3 . Format-con trol in formation , wh ich determin es th e format of th e ou tpu t message. Details Th e followin g format-con trol specifiers can be u sed to con trol th e way in wh ich n u meric valu es are displayed. Th ese settin gs remain in effect for th e remain der of th e in stru ction , u n less an oth er specifier is u sed to ch an ge th eir effect. For all th ese display modes, if a valu e is too large to be displayed in th e specified field width , th e field is filled with asterisk ch aracters (* ). /D Use th e defau lt format, wh ich displays valu es to fu ll precision with a sin gle leadin g space. (Scien tific n otation is u sed for valu es greater th an or equ al to 1 ,0 0 0 ,0 0 0 .) NOTE: Th e followin g format specification s accept a zero as th e field width (n ). Th at cau ses th e actu al field size to vary to fit th e valu e, an d cau ses all leadin g spaces to be su ppressed. Th at is u sefu l wh en a valu e is displayed with in a lin e of text or at th e en d of a lin e. V+ Lan gu age Referen ce Gu ide Page 7 6 9 TYPE program in stru ction /E n .m Ou tpu t valu es in scien tific n otation (for example, -1 .2 3 4 E +2 ) in fields n spaces wide, with m digits th e fraction al parts. (If n is n ot 0 [see th e n ote above], its valu e mu st be at least five larger th an th e valu e of m.) /Fn .m Ou tpu t valu es in fixed-poin t n otation (for example, -1 2 3 .4 ) in fields n spaces wide, with m digits in th e fraction al parts. /Gn .m Ou tpu t valu es in F format with m digits in th e fraction al parts if th e valu es are larger th an 0 .0 1 an d will fit in fields n spaces wide. Oth erwise u se /E n .m format. /Hn Ou tpu t valu es as h exadecimal in tegers in fields n spaces wide. /In Ou tpu t valu es as decimal in tegers in fields n spaces wide. /On Ou tpu t valu es as octal in tegers in fields n spaces wide. Th e followin g specifiers can be u sed to con trol th e appearan ce of th e ou tpu t. /Cn Ou tpu t th e ch aracters carriage retu rn (CR) an d lin e feed (LF) n times. Th is will resu lt in n blan k lin es if th e con trol specifier is at th e begin n in g or en d of an ou tpu t specification ; oth erwise, n -1 blan k lin es will resu lt. /S Do n ot ou tpu t a carriage retu rn (CR) or lin e feed (LF) after displayin g th e cu rren t lin e. /Un Move th e cu rsor u p n lin es. Th is will work correctly on ly if th e TE RMINAL parameter is correctly set for th e termin al bein g u sed. /Xn Ou tpu t n spaces. Th e followin g specifiers can be u sed to perform con trol fu n ction s. /B Beep th e termin al (n on graph ics-based systems on ly). /N In itiate ou tpu t with ou t h avin g program execu tion wait for its completion . A secon d ou tpu t requ est will force program execu tion to wait for th e first ou tpu t if it h as n ot yet completed. E xample Assu me th at th e real variable i h as th e valu e 5 an d th at array elemen t poin t[5 ] h as th e valu e 1 2 .6 6 6 6 6 6 . Th en , th e in stru ction TYPE /B, "Point", i, " = " /F5.2, point[i] sou n ds a beep at th e system termin al (/B) an d display th e message Point 5 = 12.67 V+ Lan gu age Referen ce Gu ide Page 7 7 0 TYPE program in stru ction If poin t[5 ] h as th e valu e 1 0 0 0 , th e in stru ction displays Point 5 = ***** becau se th e valu e (1 0 0 0 .0 0 ) is too large to be displayed in th e specified format (/F5 .2 ). (Th e in stru ction can display an y valu e for poin t[5 ] if th e format specification were /F0 .5 .) Related Keywords $ E NCODE strin g fu n ction ME SSAGE S system switch PROMPT program in stru ction WRITE program in stru ction V+ Lan gu age Referen ce Gu ide Page 7 7 1 UNIDIRE CT program in stru ction UNIDIR ECT program instruction Syntax UNI DI RECT direction s[ in dex] Function Specify th at a join t is tu rn in g on ly in a sin gle direction . Usage Considerations Th is in stru ction cu rren tly applies on ly to th e JTS (join ts) robot device modu le. Th is in stru ction applies to th e robot selected by th e task. Parameter direction s A real-valu ed array th at con tain s direction al in formation for each con figu red join t in th e robot. Th e elemen t valu es are in terpreted as follows: Elemen t valu e I n terpretation 1 Th e join t is con figu red for u n idirection al travel in a positive join t-an gle direction . -1 Th e join t is con figu red for u n idirection al travel in a n egative join t-an gle direction . 0 in dex Th e join t h as n o special processin g for u n idirection al motion . Th is is th e defau lt state. Option al in teger valu e iden tifyin g th e array elemen t th at applies to join t #1 . Zero is assu med if th e in dex is omitted. Details For join ts th at are con figu red for con tin u ou s tu rn in g, th is in stru ction can be u sed to specify wh en th e join t is tu rn in g on ly in a sin gle direction . Specifyin g u n idirection al motion is importan t for syn ch ron izin g motion plan n in g an d th e au tomatic rollover correction performed by th e trajectory gen erator. If a join t is specified as cu rren tly movin g on ly in a positive direction , th e motion plan n in g rou tin es au tomatically correct th e specified destin ation join t an gle su ch th at th e ch an ge in join t V+ Lan gu age Referen ce Gu ide Page 7 7 2 UNIDIRE CT program in stru ction position (for an y sin gle motion ) is less th an th e rollover amou n t. Th is elimin ates th e problem th at can occu r if a u ser program is gen eratin g a series of in cremen tal motion s an d th e trajectory gen erator asyn ch ron ou sly corrects th e join t's position for rollover. On ce u n idirection al mode is set, it remain s in effect u n til an oth er UNIDIRE CT in stru ction is execu ted or th e system is rebooted. E xample Assu me th e followin g con dition s: 1 . Join t #2 is con figu red to roll over every 3 6 0 0 degrees. 2 . Th e join t h as been con figu red for positive u n idirection al motion with th ese in stru ction s: FOR jt = 1 TO ID(7,8) dir_array[jt] = 0 END dir_array[2] = 1 UNIDIRECT dir_array[1] ;Set joints 1, 2, ... ;to default state ;Joint 2 is unidirectional ;Apply the settings 3 . Th e previou s motion left th e join t position ed at 3 6 0 0 degrees. 4 . Th e trajectory gen erator rolls th e in tern al join t position back to 0 degrees. (Th e join t itself does n ot move.) 5 . Th e n ext motion attempts to move th e join t to 3 7 0 0 degrees. Given th ese con dition s, th e motion plan n er in terprets th e motion comman d in step 5 as th ou gh it were a comman d to th e position 1 0 0 degrees. By comparison , if th e join t is n ot con figu red for u n idirection al motion , th e motion plan n er in terprets th e requ est to move th e join t to 3 7 0 0 degrees (step 5 above) as a requ est for a 3 7 0 0 -degree motion . Th at is, th e join t moves 1 0 revolu tion s plu s 1 0 0 degrees. V+ Lan gu age Referen ce Gu ide Page 7 7 3 $ UNPACK strin g fu n ction $UNPACK string function Syntax $ UNPACK ( strin g_ array[ in dex] , first_ ch ar, n u m_ ch ars) Function Retu rn a su bstrin g from an array of 1 2 8 -ch aracter strin g variables. Parameters strin g_ array Strin g array variable from wh ich th e su bstrin g is to be extracted. It is assu med th at each strin g with in th e array is defin ed an d is 1 2 8 ch aracters lon g. in dex Option al in teger valu e(s) th at iden tifies th e first array elemen t to be con sidered. Th e first_ ch ar valu e is in terpreted relative to th e elemen t specified by th is in dex. If n o in dex is specified, elemen t zero is assu med. first_ ch ar Real-valu ed expression th at specifies th e position of th e first ch aracter of th e su bstrin g with in th e strin g array. A valu e of 1 correspon ds to th e first ch aracter of th e specified strin g array elemen t. Th is valu e mu st be greater th an zero. Th e valu e of first_ ch ar can be greater th an 1 2 8 . In th at case th e array elemen t accessed follows th e elemen t specified in th e fu n ction call. For example, a valu e of 1 3 0 correspon ds to th e secon d ch aracter in th e array elemen t followin g th at specified by in dex. n u m_ ch ars Real-valu ed expression th at specifies th e n u mber of ch aracters to be retu rn ed by th e fu n ction . Th is valu e can ran ge from 0 to 1 2 8 . Details Th is fu n ction extracts a su bstrin g from an array of strin gs. Su bstrin gs are permitted to overlap two strin g array elemen ts. For example, a 1 0 -ch aracter su bstrin g wh ose first ch aracter is th e 1 2 7 th ch aracter in elemen t [3 ] is composed of th e last two ch aracters in elemen t [3 ] followed by th e first eigh t ch aracters of elemen t [4 ]. In order to efficien tly access th e strin g array, th is fu n ction assu mes th at all of th e array elemen ts are defin ed an d are 1 2 8 ch aracters lon g. For mu ltidimen sion al arrays, on ly th e righ tmost array in dex is in cremen ted to locate th e su bstrin g. Th u s, for example, elemen t [2 ,3 ] is followed by elemen t [2 ,4 ]. V+ Lan gu age Referen ce Gu ide Page 7 7 4 $ UNPACK strin g fu n ction E xample Th e in stru ction below sets th e valu e of th e strin g variable $ su bstrin g equ al to a su bstrin g extracted from th e strin g array $ list. Th e su bstrin g is specified as startin g in elemen t $ list[3 ]. However, becau se th e first ch aracter is to be n u mber 1 3 0 , th e 1 1 -ch aracter su bstrin g actu ally con sists of th e secon d th rou gh 1 2 th ch aracters of $ list[4 ]: $substring = $UNPACK($list[3], 130, 11) Related Keywords $ MID strin g fu n ction PACK program in stru ction V+ Lan gu age Referen ce Gu ide Page 7 7 5 UNTIL program in stru ction UNTIL program instruction Syntax UNTI L expression Function In dicate th e en d of a DO ... UNTIL con trol stru ctu re an d specify th e expression th at is evalu ated to determin e wh en to exit th e loop. Th e loop con tin u es to be execu ted u n til th e expression valu e is n on zero. Usage Considerations UNTIL mu st be u sed in con ju n ction with a DO con trol stru ctu re. See th e description of th e DO in stru ction for details. Parameter expression Real-valu ed expression , con stan t, or relation th at is in terpreted as eith er TRUE (n on zero) or FALSE (zero). Details If th e expression in th e UNTIL statemen t is zero, program execu tion con tin u es with th e statemen t followin g th e match in g DO statemen t. If th e expression is n on zero, program execu tion con tin u es with th e statemen t followin g th e UNTIL statemen t. E xample Th e followin g example is a loop th at con tin u es to prompt you to en ter a n u mber u n til you en ter on e th at is greater th an or equ al to zero: DO PROMPT "Enter a positive number: ", number UNTIL number >= 0 Related Keyword DO program in stru ction E XIT program in stru ction NE XT program in stru ction WHILE program in stru ction V+ Lan gu age Referen ce Gu ide Page 7 7 6 UPPE R system switch UPPER system switch Syntax ... UPPER Function Con trol wh eth er or n ot th e case of each ch aracter is ign ored wh en strin g comparison s are performed. Usage Considerations Th e switch valu e is sh ared globally by all program tasks. If you ch an ge th e valu e in on e task, it affects comparison s in all oth er tasks. Th erefore, do n ot ch an ge th is switch du rin g n ormal program execu tion . Details Wh en th is switch is en abled an d two strin gs are compared u sin g th e operators <, <=, ==, <>, >=, or >, all lowercase ch aracters are treated as th ou gh th ey were u ppercase ch aracters. Th at is, wh en UPPE R is en abled, both of th e followin g comparison s yields a TRUE valu e: "a" == "A" and "A" == "A" Wh en UPPE R is disabled, th e case of ch aracters is con sidered du rin g strin g comparison s. Th en , for example, th e