Client socket in karel

  • Hi all,


    I have created a client socket that communicates with a program on my PC. It works fine. However, I want to close the socket after communication with


    MSG_DISCO('C1:',Status)


    I always get 67215 as status. A non zero value means that an error ocurred.
    Any idea what goes wrong here ?


    Thanks


    Luc


    ps my code to open socket is following routine :


    ROUTINE C_Connect(Result : INTEGER)
    VAR
    entry:INTEGER


    BEGIN
    MSG_DISCO('C1:',ClientStatus)--CLOSE PORT BEFORE START
    SET_FILE_ATR(ComFile_C,ATR_IA)
    SET_VAR(entry,'*SYSTEM*','$HOSTC_CFG[1].$SERVER_PORT',10000,ClientStatus)--SETTING FILE AND PORT ATTRIBUTES--
    MSG_CONNECT('C1:',ClientStatus)
    DELAY(10)
    IF Result = 0 THEN
    OPEN FILE ComFile_C('RW','C1:')
    ENDIF
    Result = IO_STATUS(ComFile_C)
    END C_Connect

  • According to the fault, the socket is in use. Not sure how useful that is.


    Quote from http://www.linuxsand.info/fanuc/code/HOST-215


    HOST-215 SM: Connection is in use


    Cause: The requested tag is in use.


    Remedy: Stop using the remote tag. If necessary close any open file to the tag and disconnect the tag by using MSG_DISCO.

    Check out the Fanuc position converter I wrote here! Now open source!

    Check out my example Fanuc Ethernet/IP Explicit Messaging program here!

Advertising from our partners