RobotStudio event

Log position from SearchL

Hi
I would like to log the robotarget in a text file.
Here is the code I use but it saves it in binary. I would like to have it in ASCII.
I have also tested to convert it to string but roborttarget is to long.
Could sombody help me, please.

PROC main()
    Open "HOME:LOGNING",logningBin;
    MoveL p10,v100,z50,prob_ikp;
    MoveL p90,v100,z5,prob_ikp;
    SearchLStop,probe,pp80,RelTool(p90,0,0,50),v10,prob_ikp;
    pos01:=CPos(Tool:=prob_ikpWObj:=wobj0);
    p91:=CRobT(Tool:=prob_ikpWObj:=wobj0);
    WriteStrBin logning,"P1_A";
    WriteAnyBin logning,p91;
    ! Write logning,"Pos1"Pos:=pos01;
    !!str:=ValToStr(p91);
    !!WriteStrBin logning,str;
    MoveL p90,v50,z50,prob_ikp;

//Robert
master thesis at LiU

Comments

  • Yes a robtarget is probably more than 80 chars in length, but you can write out only the parts of the robtarget that you care about as follows (be sure to change your write/open instructions to not use binary access):


    VAR string strTemp;
    strTemp:=ValToStr(p91.trans)+ValToStr(p91.rot);
    Write logning, strTemp;
    Russell Drown