RobotStudio event

Dynamic Robtarget How p10+variable,v1000


Hello everybody
i have a question for robtarget i want to use dynamic robtarget in our system

for example :

PERS num activeprogram:=1;

pers robtarget drop:=[[1942.00,0.00,2110.00],[0.707107,0,0.707107,0],[0,0,0,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];

pers robtarget drop1:=[[1942.00,0.00,2110.00],[0.707107,0,0.707107,0],[0,0,0,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];

pers robtarget drop2:=[[1942.00,0.00,2110.00],[0.707107,0,0.707107,0],[0,0,0,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];

pers robtarget drop3:=[[1942.00,0.00,2110.00],[0.707107,0,0.707107,0],[0,0,0,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];

MoveL drop, v1000, z50, tool0;


when num activeprogram value change i want to change drop point value easy way how can i do this i try MoveL "drop"+(activeprogram), v1000, z50, tool0; but not work :(

 thanks for your help.




blackcoder2012-10-02 16:26:44

Comments

  • A few ways to do this. You are trying to late bind a robotarget name based on a program number. What you have shown is a mixture of string and number being stuffed into a robotarget data element. I would suggest making a simple Test or IF statement prior to your motion to dynamically load a generic target with your desired positional information from your various conditions. Other ways to do it.. More complicated I think these achieves your request simply.<?: prefix = o ns = "urn:schemas-microsoft-com:office:office" />

    TEST nActiveProgram

    CASE 1:

    !;

    pDrop:=pDrop1;

    CASE 2:       

    !;

    pDrop:=pDrop2;

    CASE 3:

    !;

    pDrop:=pDrop3;

    CASE 4:       

    !;

    pDrop:=pDrop4;

    DEFAULT:

    !ERROR

    ENDTEST