PC and FANUC robot TCP/IP Communication

  • Did you create a robot config?

    Hi Nation,

    Thanks for your response.

    No. and I do not know why "robot.ini" file is missing.

    I want to know about the following:

    Does the FANUC socket server support more than one socket client?

    I am sending positional data to the robot as a string from the socket client in the following format:

    PR_id, X, Y, Z, W, P, R

    (20,137.8,70.4,79.8,50.3,-15.0,-180.5,0.0)

    how to convert this string to XYZWPR. The converted value goes to PR[20] and the robot will move to that position.

    Is there an easier way to do this?

  • I'm no expert in this area, but as I understand it, for the command-line tools to work, you need to have built a virtual controller in RoboGuide that had the same software version, and all of the options, as the robot you're trying to compile code to.


    I encountered the same kind of issue, when I had only built a basic virtual controller with the right core version, but without adding the Fanuc options that the real robot had. The command-line tools would compile and decompile "generic" code, but would fail on any line that was tied to a specific Fanuc option.

    Hi SkyFire,


    Thanks for your reply,

    Actually my roboguide trial license has expired, this could be the reason for not having successful compilation. I do have a work cell with v8.30 in roboguide but the license has expired.

  • I am sending positional data to the robot as a string from the socket client in the following format:

    PR_id, X, Y, Z, W, P, R

    (20,137.8,70.4,79.8,50.3,-15.0,-180.5,0.0)

    Hi all,

    I have written a simple KAREL prog to convert xyzwpr data received through HTTP request like:

    http://192.168.1.1/KAREL/Mov_HTTP?id=100&x=214.384&y=-282.970&z=170.502&w=179.937&p=.712&r=89.751

    after compilation of the source file, I am getting the following error


    And when I run p-code file I get TP warning can not lock motion group, how to resolve this error/issue

    Here is the KAREL code:

  • Actually my roboguide trial license has expired, this could be the reason for not having successful compilation. I do have a work cell with v8.30 in roboguide but the license has expired.

    Even if you have a virtual controller built with the correct core software version, if that virtual controller lacks the options (say, iRVision) that the real robot has, this problem is liable to occur.


  • You get this kind of error, if your KAREL program, which you are compiling, is still running or it is paused.

    You can also try deleting Mov_HTTP.VR from MD.

  • Hi all,

    i have established socket communication between the robot's SM server and python App(SM client) but i am having trouble in handling data chunks coming from the Socket server. sample chunk:

    '--' will use as a delimiter that is used by the python app to split incoming data.I got the following list in the python application. The remaining data is missing.

    ['uframe_Data 411.096 215.795 -272.131\n .713 .059 -89.751\nN U T, 0, 0, 0', 'camframe_Data 332.167 77.494 -273.281\n .681 -.038 -89.856\nN U T, 0, 0, 0', 'utool_Data 0.000 0.000 115.000\n 0.000 0.000 0.000\nN']


    What is the correct way to receive all data from KAREL program that is responsible for handling Socket communication?

    i also tried following write commands

    Code
    DELAY 500                
    WRITE file_var('uframe_Data ')
    WRITE file_var(uframe ,CR)
    WRITE file_var('utool_Data ')
    WRITE file_var(utool ,CR)
    WRITE file_var('Home_POS ')
    WRITE file_var(lpos ,CR)
    DELAY 500

    Whit these write commands received data include a little portion of previous as well next data segment.


    I have the following two questions regarding the robot Socket server:

    1- how many clients can a robot server handle?

    2- how to check client dis-connections correctly? Can MSG_DISC() will work for it?, i have no success with handling client disconnections.

    i want when client disconnects then server stops sending data and wait for a reconnects.

  • Here is the received data from the robot Socket server.

    I have not set any file attribute.

    writing data to file like :

    Waiting for response.

    Thanks a lot.

  • Even with a trial version of roboguide running out of date you can compile Karel and TPE. For Karel compilation you don't need a virtual robot created. This is only for TPE.
    The robot.ini (Project folder) has to be set correctly and the win- system paths have to be OK.

    The first message was something about missing 'ev'. I'm not familiar with vision, but you should check if the file is present in your WinOlpc / Versions / support folder.


    Here is a robot.ini of mine. Fit it to your needs (Robot, Suppport and Output only for TPE)...


    [WinOLPC_Util]

    Robot=\D\VirtualRobots\V930\Robot_1

    Version=V9.30-1

    Path=C:\Program Files (x86)\FANUC\WinOLPC\Versions\V930-1\bin

    Support=D:\VirtualRobots\V930\Robot_1\support

    Output=D:\VirtualRobots\V930\Robot_1\output

  • Thank you 1Cllif

  • The first suggestion I have to is run WireShark on the computer running the python app, and examine the raw packets.

    Hi SkyFire,


    I modified my python script like this:


    JSON_DATA[data[0]] =dict([("XYZ",[float(i) for i in data[1:4]]),
                                                    ("WPR",[float(i) for i in data[4:7]]),
                                                    ("CONFIG","NUT000")])

    now my JSON data is ok but in the console, there is still data overlap. I have checked data packets in WireShark and packet bytes are random ranging between 70-90 bytes.


    in KAREL i am accessing Frames data like:

    GET_VAR(entry, '*SYSTEM*', '$MNUFRAME[1,9]', camframe, STATUS)

      WRITE file_var('camera_frame') --12 bytes (not sure)

    WRITE file_var(camframe ,CR) --56bytes

    --- writing other frames data follows same process 


    As camfram is a POSITION data so only 56bytes +12bytes only be written and the remaining bytes of write buffer must be handled by Carriage return but for me somehow it is not working.

Advertising from our partners