Example: biology

TheURScriptProgrammingLanguagefore- Series

Robots A/Sandshallnotbereproducedinwholeorinpar twithoutpriorwrittenapprovalofUniversal Robots Robots Robots 2009 2021byUniversal Robots RobotslogoisaregisteredtrademarkofUniver sal Robots Introduction12. ConnectingtoURControl23. Numbers,Variables,andTypes34. MatrixandArrayExpressions45. Function77. RemoteProcedureCall(RPC)98. Scopingrules109. ProgramLabel1511. SecondaryPrograms1612. (type,A,B) (encoder_index,decoder_type,A,B) (encoder_index,range_id) (encoder_index) (encoder_index,count) (encoder_index,delta_tick_count) ()26 ScriptManuale-SeriesCopyright 2009 2021byUniversal Robots () () () (task_frame,selection_vector,wrench,type ,limits) () (damping) (scaling) (freeAxes=[1,1,1,1,1,1],feature=p[0,0,0, 0,0,0]) () () () () (pose_via,pose_to,a= ,v= ,r=0,mode=0) (q,a= ,v= ,t=0,r=0) (pose,a= ,v= ,t=0,r=0) (pose,a= ,v= ,r=0) (a=20) () (type) (offset,type) (alpha) (transLimit,rotLimit) (code,argument) (enabled,threshold= ) (qNear=[ , , , , , ]) (f,v_limit) (q,a,v,t= ,lookahead_time= , gai)

16.1.23.modbus_set_output_signal(signal_name,digital_value,is_secondary_program) 92 16.1.24.modbus_set_signal_update_frequency(signal_name,update_frequency) 92

Information

Domain:

Source:

Link to this page:

Please notify us if you found a problem with this document:

Other abuse

Advertisement

Transcription of TheURScriptProgrammingLanguagefore- Series

1 Robots A/Sandshallnotbereproducedinwholeorinpar twithoutpriorwrittenapprovalofUniversal Robots Robots Robots 2009 2021byUniversal Robots RobotslogoisaregisteredtrademarkofUniver sal Robots Introduction12. ConnectingtoURControl23. Numbers,Variables,andTypes34. MatrixandArrayExpressions45. Function77. RemoteProcedureCall(RPC)98. Scopingrules109. ProgramLabel1511. SecondaryPrograms1612. (type,A,B) (encoder_index,decoder_type,A,B) (encoder_index,range_id) (encoder_index) (encoder_index,count) (encoder_index,delta_tick_count) ()26 ScriptManuale-SeriesCopyright 2009 2021byUniversal Robots () () () (task_frame,selection_vector,wrench,type ,limits) () (damping) (scaling) (freeAxes=[1,1,1,1,1,1],feature=p[0,0,0, 0,0,0]) () () () () (pose_via,pose_to,a= ,v= ,r=0,mode=0) (q,a= ,v= ,t=0,r=0) (pose,a= ,v= ,t=0,r=0) (pose,a= ,v= ,r=0) (a=20) () (type) (offset,type) (alpha) (transLimit,rotLimit) (code,argument) (enabled,threshold= ) (qNear=[ , , , , , ]) (f,v_limit) (q,a,v,t= ,lookahead_time= , gain=300) (tick_count,absolute_encoder_resolution= 0) (q) (type)

2 (qd,a,t) (xd,a,t,aRot= a ) (a=20) (a) (a,aRot= a ) () (center,ticks_per_revolution,rotate_tool = False ,encoder_index=0) (direction,ticks_per_meter,encoder_index =0)43e-SeriesScriptManualCopyright 2009 2021byUniversal Robots () () (steps=0) () () () () () (q= current_joint_positions ,tcp= active_tcp ) (x,qnear,maxPositionError=1e-10,maxOrien tationError=1e-10,tcp= active_tcp ) (pose,qnear,maxPositionError=1E-10,maxOr ientationError=1e-10,tcp="active_tcp") (j) () () () () () () () () () () () () () () () (pose,qnear) (s,title= Popup ,warning=False,error=False,blocking=Fals e) () (d) (m,cog) (CoG) (m) (m,cog,inertia=[0,0,0,0,0,0])56 ScriptManuale-SeriesCopyright 2009 2021byUniversal Robots (pose) (t) (src,index) (op1,op2) (str) (src,target,start_from=0) (str) (src,index,len) () (s1,s2= ) (str) (val) (direction) ()6415.

3 (f) (f) (f) (x,y) (l) (f) (f) (d) (f) (v) (x) (p_from,p_to,alpha) (m) (v) (b,f) (a) (v) (p_from,p_to) (p_1,p_2) (p_from,p_to) (p_from) (p_to,p_from)75e-SeriesScriptManualCopyr ight 2009 2021byUniversal Robots (p_from,p_from_to) (base,exponent) (r) () (rotation_vector) (rpy_vector) (f) (v) (f) (f) (m) (T_from_to,w_from)8016. (enable,sensor_mass= ,sensor_measuring_offset=[ , , ],sensor_cog=[ , , ]) (enable,sensor_mass= ,sensor_measuring_offset=[ , , ],sensor_cog=[ , , ]) (n) (n) (n) (n) (n) (n) (n) (n) (n) (n) (n) (n) (n) (n) (IP,slave_number,signal_address,signal_t ype,signal_name,sequential_mode=False) (signal_name) (signal_name,is_secondary_program) (IP,slave_number,function_code,data) (signal_name,action) (signal_name,register_value,is_secondary _program)91 ScriptManuale-SeriesCopyright 2009 2021byUniversal Robots (signal_name,digital_value,is_secondary_ program) (signal_name,update_frequency) (address) (address) (address) (address) (address) (address) (address) (address) (type,url)

4 (variable_name,min_frequency,action= pause ) (port,range) (n,f) (n,b) (n,b) (n,b) (n,f) (n,b) (n,b) (enabled,baud_rate,parity,stop_bits, (voltage) (socket_name= socket_0 ) (name,socket_name= socket_0 ) (address,port,socket_name= socket_0 ) (number,socket_name= socket_0 ,timeout=2) (number,socket_name= socket_0 ,timeout=2) (number,socket_name= socket_0 ,timeout=2) (socket_name= socket_0 ,timeout=2) (socket_name= socket_0 ,prefix= ,suffix= ,interpret_escape= False ,timeout=2) (value,socket_name= socket_0 ) (value,socket_name= socket_0 ) (str,socket_name= socket_0 ) (str,socket_name= socket_0 ) (name,value,socket_name= socket_0 ) (address,value) (address,value) (address,value)110e-SeriesScriptManualCo pyright 2009 2021byUniversal Robots (address,value) (address,value) ()11117.)

5 (signal_name,runstate_choice) (port,domain) (port,action) (port,action) () (outputId,state) (outputId,state) (outputId,state) (outputId,state) (outputId,state) (port,domain) (port,action) (port,domain) (port,action)11918. (pose_via,pose_to,a,v,r,mode=0) (pose,a,v,r) (path_id,a,v,r) () (mode,tcp,doc=6) (nc_file,useFeedRate) (id=-1) (pcs) (s) 2009 2021byUniversal Robots 2009 2021byUniversal Robots IntroductionTheUniversalRobotcanbecontro lledattwolevels: ThePolyScopeortheGraphicalUserInterfaceL evel ScriptLevelAttheScriptLevel, ,types, IntroductionCopyright 2009 2021byUniversal Robots ,theURControlstartsupasadaemon( ,aservice) (runningatanotherPC) :ur-xx(ortheIPaddressfoundintheAboutDial og-BoxinPolyScopeiftherobotisnotinDNS).

6 \n . : Thescriptmuststartfromafunctiondefinitio norasecondaryfunctiondefinition(either"d ef"or"sec"keywords)inthefirstcolumn Allotherscriptlinesmustbeindentedbyatlea stonewhitespace Thelastlineofscriptmustbean"end"keywords tartinginthefirstcolumne-Series2 ScriptManual2. ConnectingtoURControlCopyright 2009 2021byUniversal Robots Numbers,Variables,andTypesInURScriptarit hmeticexpressionsyntaxisstandard:1+2-34* 5/6(1+2)*3/(4-5)"Hello"+","+"World!"Inbo oleanexpressions,booleanoperatorsarespel ledout:TrueorFalseand(1==2) 1>2or3!=4xor5<-6not42>=87and87<=42"Hello"!="World"and"abc"=="a bc"Variableassignmentisdoneusingtheequal sign=:foo=42bar=FalseorTrueand not Falsebaz=87-13 "Hello,World!

7 "l=[1,2,4]target=p[ , , , , , ] : none bool number-eitherintorfloat pose stringAposeisgivenasp[x,y,z,ax,ay,az],wh erex,y,zisthepositionoftheTCP,andax,ay,a zistheorientationoftheTCP, ( ), Numbers,Variables,andTypesCopyright 2009 2021byUniversal Robots [1,2,3,4,5]a=array[0]array[2]=10matrix=[ [1,2],[3,4],[5,6]]b=matrix[0,0]matrix[2, 1]=20 Matrixandarraycanbemanipulatedbymatrix-m atrix,array-array,matrix-array, snumberofcolumnsmatchesthesecondmatrix [[1,2],[3,4],[5,6]]*[[10,20,30],[40,50,6 0]] snumberofcolumnsmatchesthearrayslength, [[1,2],[3,4],[5,6]]*[10,20]Array-arrayop erationsarepossibleifbotharraysareofthes amelengthandsupports:addition,subtractio n,multiplication, [i]b[i]=c[i].

8 Mul=[1,2,3]*[10,20,30]div=[10,20,30]/[1, 2,3]add=[1,2,3]+[10,20,30]sub=[10,20,30] -[1,2,3]mod=[10,20,30]%[1,2,3] ,subtraction,multiplication, [i]+b=c[i]mul1=[1,2,3]*5mul2=5*[[1,2],[3 ,4],[5,6]]div1=[10,20,30]/10div2=10/[10, 20,30]e-Series4 ScriptManual4. MatrixandArrayExpressionsCopyright 2009 2021byUniversal Robots [1,2,3]+10add2=10+[1,2,3]sub1=[10,20,30] -5sub2=5-[[10,20],[30,40]]mod1=[11,22,33 ]%5mod2=121%[[10,20],[30,40]]ScriptManua l5e-Series4. MatrixandArrayExpressionsCopyright 2009 2021byUniversal Robots FlowofControlTheflowofcontrolofaprogrami schangedbyif-statements:ifa>3:a=a+1elifb <7:b=b*aelse:a=a+bendandwhile-loops:l=[1 ,2,3,4,5]i=0whilei<5:l[i]=l[i]*2i=i+ , FlowofControlCopyright 2009 2021byUniversal Robots FunctionAfunctionisdeclaredasfollows:def add(a,b):returna+bendThefunctioncanthenb ecalledlikethis:result=add(1,4)Itisalsop ossibletogivefunctionargumentsdefaultval ues:defadd(a=0,b=0):returna+bendIfdefaul tvaluesaregiveninthedeclaration,argument scanbeeitherinputorskippedasbelow:result =add(0,0)result=add()Whencallingafunctio n, , (includingarrays).

9 ()a=[50,100]fun(a)deffun(p1):p1[0]=25ass ert(p1[0]==25)..endassert(a[0]==50)..end ScriptManual7e-Series6. FunctionCopyright 2009 2021byUniversal Robots FunctionCopyright 2009 2021byUniversal Robots RemoteProcedureCall(RPC)RemoteProcedureC alls(RPC)aresimilartonormalfunctioncalls ,exceptthatthefunctionisdefinedandexecut edremotely. Ontheremotesite,theRPCfunctionbeingcalle dmustexistwiththesamenumberofparametersa ndcorrespondingtypes(togetherthefunction ssignature).Ifthefunctionisnotdefinedrem otely, (s).DuringanRPCcall, thecontrollerwaitsfortheremotefunctionto complete. TheXMLRPC standardisamongotherssupported byC++(xmlrpc-clibrary), ,takeasnapshotandretrieveanewtargetpose: camera=rpc_factory("xmlrpc"," ")if(!)

10 ("RGB")):popup("Camerawasnotinitialized" ) ()target= ()..Firsttherpc_factory(seeInterfacessec tion) ("RGB"). ,thecamerafirsttakesapicture, () , ().On return thetargetvariable is ("RGB"),takeSnapshot()andgetTarget() : RemoteProcedureCall(RPC)Copyright 2009 2021byUniversal Robots ScopingrulesAURS criptprogramisdeclaredasafunctionwithout parameters:defmyProg() : localqualifiertellsthecontrollertotreata variableinsideafunction,asbeingtrulyloca l,evenifaglobalvariablewiththesamenameex ists. globalqualifierforcesavariabledeclaredin sideafunction, , (alsocalledafreevariable), , ,eventhoughtheyhavethesamename:defmyProg ():globala=0defmyFun():locala= , ,thefirstaisaglobalvariable,sothevariabl einsidethefunctionisthesamevariabledecla redintheprogram:defmyProg():globala=0def myFun():a= ScopingrulesCopyright 2009 2021byUniversal Robots ,thefirstaisglobaldefined,thesecondlocal andthethirdimplicitlyglobalagain:defmyPr og():globala=0defmyFun():locala=1defmyFu n2():a= , (firstindentation)aretreatedasglobal,eve niftheglobalqualifierismissingorthelocal qualifierisused:defmyProg():a=0defmyFun( ):a= ScopingrulesCopyright 2009 2021byUniversal Robots :threadmyThread().


Related search queries