Help with INTP-322 Alarm code

  • Dear All,

    I wrote a Karel program that receives joint angles via TCP/IP protocol and moves the robot to desired position, which is working fine. Then I copied the same code and saved with other name. Now strange thing is that when I run the new program, it throws INTP-322 Alarm code with line number. Below is the code.


    Even I have checked the variables by writing them to user panel, all of them are initialized properly.

    Now my question is that why I am getting Alarm code, while the exactly same code is running without having any problems in other program.

    Could any one help me to understand and resolve this issue. By the way I am working with R-30iA controller.

    Thanks for your time in advance.


  • Place your Ad here!
  • The description for the error is "KAREL program error. The argument value of a built-in routine was wrong."

    Are you executing the program on the very same controller as the older version?
    Are the variable definitions in the same .KL file as the rest of the program? Have you copied them together with the rest of the source code?

  • Hello bidzej,

    First of all thanks for your reply.

    Yes I am running the both programs on the same controller. variables are also same. Basically It is the same code, the only difference is change in program name.


  • Interesting... Are all the variables local, or does anything come from another program (FROM: instruction after the definition)?
    I have no sensible idea why this could happen :hmmm: Would be best if you could post the whole code here...

  • Hello bidzej,

    yes, all the variables are local. Here is the sample code

    PROGRAM manlmode
    comm_port : FILE
    j : ARRAY[6] OF REAL
    stat : INTEGER
    jnt : JOINTPOS
    vel_ : REAL
    jnt1 : STRING[14]
    test : STRING[54]
    xj, yj, zj, rxj, ryj, rzj, id,vels : STRING[15]


    OPEN FILE comm_port('rw','S3:')



    READ comm_port (id::0::2)
    READ comm_port (xj::0::2)
    READ comm_port (yj::0::2)
    READ comm_port (zj::0::2)
    READ comm_port (rxj::0::2)
    READ comm_port (ryj::0::2)
    READ comm_port (rzj::0::2)
    READ comm_port (vels::0::2)
    WRITE('id:',id, CR)


    IF(cur_id = 2) THEN

    CNV_STR_REAL(xj, j[1])
    CNV_STR_REAL(yj, j[2])
    CNV_STR_REAL(zj, j[3])
    CNV_STR_REAL(rxj, j[4])
    CNV_STR_REAL(ryj, j[5])
    CNV_STR_REAL(rzj, j[6])



    DELAY (50)
    END manlmode

  • ok, try changing the definition of the variable j from ARRAY[6] OF REAL to ARRAY[9] OF REAL - the length of the array must be equal or greater than the number of joints in the system, and 9 is the default value...

  • I even tried that, but it didn't work. I still have the same alarm code :wallbash:. Its really very strange that old application is working but not new one. I need these two applications because user should able to select from one of these two applications to move the robot either in manual mode or in auto mode.


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