new to kuka

  • i am newbie to the forum ive been on for about 4 mobths now and find it very useful, i want to say thanks ahead for the knowledge you share, i have a question concerning KUKA KRC4 KSS01356 im actuallly new to the KUKA and was wondering if you could help me out with understanding HOW to use a DECL, Bool, variable, Real, because i have no clue what these are or where to start :respect:

  • Place your Ad here!
  • to run any program, drives must be on, messages cleared, program selected and START used...

    KSS01356 is "Start key required".

    This is clearly stated in the message itself but more detail is also available in form of system messages manual and on-screen help (menu help/messages/system messages)

    DECL keyword is used to declare variables. variables are memory locations suitable to hold specific type of information.

    1) read pinned topic: READ FIRST...

    2) if you have an issue with robot, post question in the correct forum section... do NOT contact me directly

    3) read 1 and 2

  • To use any of those you must be in expert mode... as far as I know there is no way to create variables (besides points that you teach) with the inline forms.
    Once you start getting into "real" KRL, you have access to a lot more of the robot functionality -- just be aware that this comes at a price; KUKA is very picky about syntax and debugging can be pretty challenging.
    That being said, to answer your question you use DECL to *declare* variables at the top of your src files or in your dat files. For src files, the declarations MUST be at the top of the function, before any motion commands or variable initialization or even wait commands. BOOL, REAL, INT, CHAR, etc. are all variable datatypes; just like in C or Java you have to specify the types of your variables before you use them, and then they are locked to those types of data (with some exceptions, such as setting CHARs to INTs, or implicitly converting between FRAMEs and E6POSes).
    You use them like this:

    Of course, you don't strictly need any of those sections, the only requirement is that if you have declarations, they must come before anything else. Initializations and movements and everything else can be mixed together (but often initializations are done just after the declaration section to increase readability).

    Often you will see code wrapped up in FOLDs. FOLDs are used to condense code into something human readable, like this:

    ;FOLD foldName
    ... ; code here

    When reading the code on the KUKA teach pendant, rather than displaying the code it will display "foldName." Other than that, folds do nothing. They are not required, and are treated as comments when the program executes (ie. the code inside the fold will execute, and the ;FOLD and ;ENDFOLD lines are ignored).

    Happy coding!

  • If you are as new to programming as I think you are, then maybe you should get acquainted with Pascal (programing language) to learn about variables, their scope, functions (passing parameters by value or reference), logical operators and control flow. You can learn this anywhere you have a computer and not near robot (which is likely on a noisy factory floor).

    Afterwards, if you haven't already, take a look at System Variables pdf.

  • How we use $AXIS_ACT and ptp {x,y,z,a,b,c,b,t} these variable.

    $AXIS_ACT (and $AXIS_ACT_MES) is a read-only variable, it reports the current position of the robot axes.

    DECL E6AXIS MyAxisVariable
    IF (MyAxisVariable.A1 < 10) AND (MyAxisVariable.A1 > 0) THEN
      PTP {A1 5}

    PTP commands use Structure variables of either AXIS or POS types. You can hard-code numbers inside the {}, but not variables. So:

  • thanks for share but what is code saying via variable and PTP commands, and some queries mentioned below....

    1. what is r.Temp

    2. my pos is current position.

    3. why you use legal comment.

    and what about step - 6, step - 8 and step 9 to 11.

    please explain me.


  • DECL E6AXIS MyAxisVariable

    1. why we use E with 6 axis.

    2. AXIS_ACT_MES what the mean of MES.

    and my other question is that if i program in my smart pad like...

    PTP {X100, Y30, Z10, A0, B6, C23}

    then by this single step, will robot go on this position ? like x100, y30 etc.:thinking_face:


  • DECL E6AXIS MyAxisVariable

    1. why we use E with 6 axis.

    E6AXIS is a structure extending AXIS struc with 6 external axes.

    2. AXIS_ACT_MES what the mean of MES.

    Short for MEaSured. $Axis_act returns programmed positions of axes (as they should be on path), this variable returns them measured (as they are). The difference between them most of the time is minuscule.

    You need spaces after component names like: PTP {X 100, Y 30, Z 10, A 0, B 6, C 23}.

    Also first movement in robot program cannot be ambiguous- if you are passing Cartesian position, it has to have all components, including Status and Turn (S & T); if it's an axial move, has to have all axes (A1..A6).

    Lastly, grab the programing manual and start reading it, otherwise you will just be asking us to rewrite it in post format.

  • 1. It's a REAL (floating point) variable.

    2. What is your question?

    3. I used Lega/Illegal to indicate which of the operations was legal in KRL, and which were not. The various steps were examples of different ways of using PTP commands with variables.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account
Sign up for a new account in our community. It's easy!
Register a new account
Sign in
Already have an account? Sign in here.
Sign in Now

Advertising from our partners