|20.06.2016|Seite1PMTeamKUKA机器人变量说明文档KUKAChina|20.06.2016|page2|20.06.2016|page3|20.06.2016|page4“variables”Inadditiontotheuseofconstants(digits,characters,etc.),memorylocationsarealsodefinedintherobotcontrollerinwhichthesevaluescanbestored.Thisstoredinformationcanthusberetrievedatvariouspointsintheprogramforevaluationandfurtherprocessing.Avariableisafixedmemoryarea,whosecontentscanbeaddressedviathevariablename.Example:...Part_counter=37...ContentofthevariableVariablenameKUKAChina|20.06.2016|page5()DECLINTpart_counterINI...EndExample:KUKAChina|20.06.2016|page6canhaveamaximumlengthof24characters.canconsistofletters(A-Z),numbers(0-9)andthesigns‘_’and‘$’.mustnotbeginwithanumber.mustnotbeakeyword.KUKAChina|20.06.2016|page7“A”TRUE1.4332ExampleASCIIcharacter1-255TRUE,FALSE+/-1.1E-38...+/-3.4E+38-231...(231-1)Rangeofvalues1characterLogicstateFloating-pointnumberIntegerMeaningCHARBOOLREALINTKeywordCharacterBooleanRealIntegerDatatypeKUKAChina|20.06.2016|page8()END;---Declarationsection---...;---Initializationsection---...;---Instructionsection---...KUKAChina|20.06.2016|page9•VariablesmustbedeclaredbeforetheINIline•InordertosetsyntaxbeforetheINIline,theDEFlinemustbeactivatedKUKAChina|20.06.2016|page10();---Declarationsection---DECLINTPART;---Initializationsection---INI;Initializationofaccelerationandvelocity;---Instructionsection---PART=58;Valueassignment,decimalPART='B111010'Valueassignment,binaryPART='H3A';Valueassignment,hexadecimal...ENDValueassignmentsaremadeintheprogramadvancerun!KUKAChina|20.06.2016|page11•...areonlyrecognizedintheirownprogram.•...arenotrecognizedinlocalsubprograms.DEFHP1()DECLINTCUBEINICUBE=0ENDVariablesdeclared...inthecorrespondingDATfile•...areonlyrecognizedintheirownprogram,i.e.inthemainprogramandinlocalsubprograms.DEFDATHP1()DECLINTCUBE=0...ENDDATinthe$CONFIG.DATfile•...arerecognizedineveryprogram.•...canbecalledduringprogramexecution.DEFDAT$CONFIGDECLINTCUBE=0...ENDDATKUKAChina|20.06.2016|page12()DeclCONSTREALPI=3.14159...ENDExample:YoucannotmanipulateConstantsintheSRC-file.Itcausesaerrormessage.KUKAChina|20.06.2016|page13|20.06.2016|page14|20.06.2016|page15(one-dimensional)Creation:DECLData_TypeVariable_Name[Numberofarrayelements]Work:Variable_Name[Index]=Value_AssignmentSyntax:Example:DEFMAIN_PROGRAM()DECLREALmeasurement[3]INImeasurement[1]=17.5measurement[2]=35.7measurement[3]=67.2...ENDKUKAChina|20.06.2016|page16=StartTOEndStatementENDFORDEFINIT_OUTPUTS()DECLINTCOUNTERINIFORCOUNTER=1TO10;Setoutput1-10toFALSE$OUT[x]=FALSEENDFOR...ENDSyntax:Example:X10?yesno$OUT[X]KUKAChina|20.06.2016|page17(1)[1][2][3][4]1*5=55DEFMAIN_PROGRAM()DECLINTCELL[4]DECLINTFI;ArrayindexINIFORFI=1TO4CELL[FI]=FI*5ENDFOR...ENDCELLFI=2KUKAChina|20.06.2016|page18(2)[1][2][3][4]2*5=10510DEFMAIN_PROGRAM()DECLINTCELL[4]DECLINTFI;ArrayindexINIFORFI=1TO4CELL[FI]=FI*5ENDFOR...ENDCELLFI=3KUKAChina|20.06.2016|page19(3)[1][2][3][4]3*5=1551015DEFMAIN_PROGRAM()DECLINTCELL[4]DECLINTFI;ArrayindexINIFORFI=1TO4CELL[FI]=FI*5ENDFOR...ENDCELLFI=4KUKAChina|20.06.2016|page20(4)CELL[1][2][3][4]4*5=205101520DEFMAIN_PROGRAM()DECLINTCELL[4]DECLINTFI;ArrayindexINIFORFI=1TO4CELL[FI]=FI*5ENDFOR...ENDFI=5KUKAChina|20.06.2016|page21()DECLINTMEAS_VALUE[2,4]DECLINTROW,COLUMNINI;---Pre-assignmentofanarray---FORROW=1TO2FORCOLUMN=1TO4MEAS_VALUE[ROW,COLUMN]=0ENDFORENDFOR...ENDRow1ColumnRow2123400000000KUKAChina|20.06.2016|page22[3,3,3]LevelKUKAChina|20.06.2016|page23()BOOLMATRIX[3,3,3]INTROW,COLUMN,LEVELINIFORLEVEL=1TO3FORCOLUMN=1TO3FORROW=1TO3MATRIX[ROW,COLUMN,LEVEL]=FALSEENDFORENDFORENDFOR...ENDThekeyword“DECL”mayalsobeomittedwhendeclaringsimpledatatypes.KUKAChina|20.06.2016|page24|20.06.2016|page25|20.06.2016|page26Astructureisacombinationofdifferentdatatypes.Astructureisinitializedwithanaggregate.Notalltheparametershavetobespecifiedinana