RobotStudio event

velocity and coordinate of a tool center point instantaneously

Options
hyacy
hyacy
edited May 2019 in RAPID Programming
Hello everyone,
I would like to write a code to read the speed and coordinates of TCp instantaneously whyle moving and transmit it to my computer 
could you help me please. I will be really happy

Comments

  • daniel72
    Options
    Hi,

    if you have Option PC-Interface you can send to pc via socket. PC will be a socket-client , Robot will act as a socket server

      Socketclose ComSocket;
      SocketCreate ComSocket;
      SocketConnect ComSocket, sPCIP, nPCPort  \Time:=10;

    You define a time interrupt of 10ms and in the trap you read TCP and send the valus as formatet string to the socket like this:


    TRAP SendPos()
    VAR pos tmppos;

    tmppos:=CPos();
    SocketSend ComSocket \Str:= NumToStr(tmppos.x,2)+ ";" + NumToStr(tmppos.y,2) + ";" + NumToStr(AOutput(aoTCPSpeed),2) + "!";
    Delete intno1;
    CONNECT intno1 WITH SendPos;
    ITimer \Single, nIntervall, intno1;
    ENDTRAP

    Note aoTCPSpeed must be declared as AnalogOut and linked to system-output "TCP-Speed"

    Alternativ you can install a fieldbus-communication card (like HILSCHER CIFX) in your pc.


    Good Luck

    Daniel





  • hyacy
    Options
    Thanks Daniel i will give you a feedback after trying it!
  • hyacy
    Options
    hi!
    i tryed this code but it ist not working . i dont really know how to work Robotstudio,  so this is what i get and i dont really know how to continue
  • hyacy
    Options
    so may be i didn't explain the problem very well so, i have this robot on the picture below , and i just want to get the tcp_Speed (velocity)on anlalog output , while the robot is moving; could you please show me the way from the beginin? I'm really new on this . thanks
  • DenisFR
    DenisFR ✭✭✭
    Options
    Hello,
    Is Signal Analyzer Online sufficient for you?
  • hyacy
    Options
    Hi Denis  yes i just Need it on Signal analyer