RobotStudio event

RAPID: Modify variable in an array from FlexPendant

I have a single robtarget (called A) and an array of robtargets (called B). I would like to put A into B -> this works nicely, until I would like to modify A via FlexPendant: I get the "Unable to modify position" error message. The ways I tried:

(1) Result: Error message while modifying via FlexPendant ("Unable to modify")
CONST robtarget A:=[...];
CONST robtarget B{1}:=[A];

(2) Result: Error in rapid code  (B cannot be declared as PERS)
CONST robtarget A:=[...];
PERS robtarget B{1}:=[A];

(3) Result: Error in rapid code (A should be CONST if we want to put it into an array)
PERS robtarget A:=[...];
CONST robtarget B{1}:=[A];


I have to put robtargets into an array, but I would like to provide the "Modify position via FlexPendant"  feature to the operators. Is this possible some way? 

Thank you for any help.

Comments

  • you can but they ALL need to be PERS, I don't think rapid let you modify CONST unless in manual.  Try this:

    VAR robtarget pTemp := [whatever, just make sure the position is clear]

    GetDataVal "pRobTargetB", pTemp;

    MoveL pTemp...

    After the changes have been made and saved run this

    SetDataVal "pRobTargetA", pTemp;

    pRobTargetB := pTemp;

    I hope this help!  Now this is set up without the array, so you may need to run a for loop to pull the robtarget out of the array before making pRobTargetB := pTemp