RobotStudio event

Tool Change Support

I tried out the readymade Tool Change Support on our new robot. They use arrays for storing the different workobjects for the toolstands.

I get this error when trying to run the code:

41442: Reference Error

Description
Task: T_ROB1.The reference in argument \WObj is not an entire persistent variable.Program ref: /TCUSER/GoToTcHomePos/MoveAbsJ/165.

Actions
It is not possible to use record component or array element in arg. \WObj. It is only possible to use entire persistent variables for Tool, WObj or Load in any motion instruction.

Saying that wobj's cannot be arrays? Why have ABB made a toolchange routine with he toolstands as arrays?



Here is what ABB do in the routine:

! Work object data for each tool stand
  PERS wobjdata TcStandWobj{TC_MAX_STANDS} := [[FALSE,TRUE,"",[[0,0,0],[1,0,0,0]],[[0,0,0],[1,0,0,0]]],
                                               [FALSE,TRUE,"",[[0,0,0],[1,0,0,0]],[[0,0,0],[1,0,0,0]]],
                                               [FALSE,TRUE,"",[[0,0,0],[1,0,0,0]],[[0,0,0],[1,0,0,0]]],
                                               [FALSE,TRUE,"",[[0,0,0],[1,0,0,0]],[[0,0,0],[1,0,0,0]]]];


Is this not possible?

Tagged:

Comments

  • soup
    soup ✭✭✭
    No idea -- but do you think the programmer expected the array data would be copied into a "PERS wobjdata currentWobj" for use of the work object instead of using the array data directly?
  • thv
    thv
    edited February 2018
    soup said:
    No idea -- but do you think the programmer expected the array data would be copied into a "PERS wobjdata currentWobj" for use of the work object instead of using the array data directly?


    No I do not hink that what you are thinking is the reason. Here is a snippet from their code, where they do a movement.

    ! Moves robot to tool stand position, ready position

    PROC GoToTcReadyPos(standno StandPos)

     

    TcCurrentTool := TcTool{StandPos};

     

    ! Check the tooldata

    TcCheckTool TcCurrentTool;

     

    MoveL RelTool(TcLockPos{StandPos},0,0,TcLockPosOffset{StandPos}),TcMoveSpeed,z10,TcCurrentTool\WObj:=TcStandWobj{StandPos};

     

    ENDPROC


    I would think ABB meant for us to use this out of the box, as stated in the manual.
    I have worked around by altering the code to copy the TcStandWobj{I} into a temporary Persistent wobj, but this feels, and according to manual are, wrong.


    Is it possible to use it as ABB coded it?

    Any ideas?


    Post edited by thv on
  • soup
    soup ✭✭✭
    Not sure work objects can't be stored in arrays -- I'd suggest posting just enough of the code to allow others to easily reproduce the error you're seeing.
  • Ive came across similar things before, For some reason Rapid wont let you use an Array WobJ on the current movement instruction. The best solution is to use a "WorkObjectCurrent".
    So perhaps try this:

    FUNC wobjdata CurrWobj()
      !
      wTemp:=TcStandWobj{StandPos};
      RETURN wTemp;
      !
    ENDFUNC

    and then in your main execution insert:

    !ASSIGN WORK OBJECT
    wCurrent:=CurrWobj();

    Then use wCurrent which is of type PERS as your current Wobj.

    Should work if i understand what you are trying to do correctly  :)
  • Ive came across similar things before, For some reason Rapid wont let you use an Array WobJ on the current movement instruction. The best solution is to use a "WorkObjectCurrent".
    So perhaps try this:

    FUNC wobjdata CurrWobj()
      !
      wTemp:=TcStandWobj{StandPos};
      RETURN wTemp;
      !
    ENDFUNC

    and then in your main execution insert:

    !ASSIGN WORK OBJECT
    wCurrent:=CurrWobj();

    Then use wCurrent which is of type PERS as your current Wobj.

    Should work if i understand what you are trying to do correctly  :)