Array using robtarget

Hello! Been stuck with doing an array with 6 different robtargets. It is possible to do it this way:

    PERS num nPartCount := 0;
    PERS robtarget LeavePos{6} := 

And in my main I would write something like this:

nPartCount := nPartcount+1;

The last line is where I get the error message. I think it's an easy fix but I can't figure it out. Thanks in advance!


  • EricH
    EricH Germany
    Sure, this works. Last line just needs a movement order.

      MoveJ LeavePos{nPartCount},v100,z200,tool0;

  • Thanks! Didn't think about that at all. Very helpful!
  • lemster68
    lemster68 United States ✭✭✭
    Please do not do this: nPartCount := nPartcount+1;.  Simply written is expressed:  Incr nPartCount;
    Lee Justice
  • Didn't know you could do that, thanks. Will change it right away.
  • lemster68
    lemster68 United States ✭✭✭
    edited February 2020
    Just a pet peeve of mine, Incr and Decr are mathematical instructions.  :#   It will help make your code look smarter.
    Lee Justice