Error when passing arguments to AS subroutine using Duaro 2 robot

  • Hey all. I'm working with a Duaro 2 robot.

    I am trying to pass an argument to a program via a subroutine call from an AS program. The AS program I am calling looks like this:

    .PROGRAM PlaceWarmTray(.Arg1)

    <code here>


    I try to call it from my main program like this:

    CALL PlaceWarmTray(1)

    Every time I try to run the program, I get “Error Code 2018 Check the argument settings in macro pg” on the tablet. The confusing thing is, when I call the program from a tablet program and enter in an argument that way, it works just fine. It just doesn’t work when the program is called from an AS program. Has anyone run into this before?


  • Place your Ad here!
  • Your syntax maybe incorrect here.

    I've never come across the ELSEIF instruction as a valid syntax in any Kawasaki Robot.

    The Duaro may have some additional AS instruction to incorporate ELSEIF, but looking the AS Manual for Duaro, it doesn't appear to be there.

    The equivalent is CASE OF statement:

    CASE .arg1 OF

    VALUE 0:


    VALUE 1:


    VALUE 2:


    ANY :



    Try that and see if it makes any difference.

    *** With the ANY instruction make sure to include a space after and before the colon, otherwise it's treated as a label ***

  • I've never come across the ELSEIF instruction as a valid syntax in any Kawasaki Robot.

    YASKAWA EMPIRE strikes back:grinning_squinting_face::grinning_squinting_face::grinning_squinting_face:.

    This is a big difference between kawa and yaska: in AS language the if and else is a little poor, otherwise in Yaskawa(and even in STAUBLI) the elseif command is like the case of a SWITCH..CASE instruction.

  • For sure, many OEM's use different IF syntax (I'm encountering something similar with Fanuc at the moment) but it is what it is.

    What is puzzling me is the error.

    It is not a standard Kawasaki error I have come across and has no reference in the Kawasaki Troubleshooting Manual.

    If it was a file loaded in via KRTerm (PC to Controller) you would receive a different error.

    I think files transferred from tablet to controller use internal macro's and I think this error is a tablet generated error as it cannot compile it.

    I have tried to locate this error in the Duaro docs I have, but haven't found anything.

    Something to feedback to Kawasaki I think if indeed this is down to incorrect syntax.

  • Another thing, I have come across in the documents I have is the attached release notes relating to the addition of the CALL program function.

    If refers to the CALL program specifically and relates the argument towards a location only and not a real variable.

    Not being completely conversant with Duraro, I wonder whether this also has a bearing on this problem to.

    Be worthwhile checking this with Kawasaki and also the software version etc.

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