TCP Karel Client not connecting to server

  • My FANUC is configured to be a static IP on

    I wrote a simple python server to listen for connections and echo messages. It is running on on port 8000.

    I went through the client tag set up from the KAREL manual. Tag C1 looks like:


    System Variable $HOST_CFG[1] looks like:

    $PORT '8001'
    $SERVER_PORT '8000'

    My test client code looks like:

    I am able to load the program, and run it, but it throws an error:
    INTP-320 (KC,29) Undefined built in

    and that line points to MSG_CONNECT('C1:',status).

    On the user screen I see

    VAR status = 16006

    What am I doing wrong in the communication setup?

  • Thanks. I didn't have that. I had it installed. Now I can confirm that I see R648 'User Socket Msg' in the STATUS section.

    I am still not able to make a connection with the python server. My test client code looks like this:

    On the Python side, the server looks like this:

    I see on the pendant:

    Connect Status = 67206
    Disconnect Status = 67216

    What am I doing wrong?
    Under Setup->Host Comm->Client, I see my C1 tag defined.
    C1: SM [DEFINED]
    Under Setup->Host Comm->Server, I see a S1 tag defined (that I did not)
    S1: SM *** [STARTED]

    $HOST_CFG[1].$SERVER_PORT is defined to be 8000

    I disabled firewall on Windows.

    I wrote another Karel program that uses MSG_PING command with '' and the status was 0. So the Fanuc can ping the Python server's PC.

  • New issue: I am able to send a message, but not read.

    The python side has sent the 'RunJob' string back, but on the KAREL side, I see it stuck at

    'Waiting to read from server...'

  • It seems like you are stuck on

    READ file_var(tmp_str)

    because he's waiting (blocking) for more bytes, fanuc standard formatting for string should be: first byte containing an integer n indicating the length of the string, and then n characters (the string).
    You can specify your custom binary formatting with specifiers

Advertising from our partners