EthernetKrl EKI Server Port

  • Dear All,
    I am using Ethernet krl for some perpose. I need my robot to be server. Ip address of KLI is 192.168.1.9 and I am able to connect with work visual and have installed corresponding KOP, no problem till here. Now I am trying to make a program to open a port 54600 on the same ip address but not successfull till now.


    Configuration file-


    Robot Program-

    Code
    DEF ram( )
    RET=EKI_Init("RPSCmd")
    RET=EKI_Open("RPSCmd")
    WAIT FOR  ( $FLAG[1] ) 
    WAIT FOR  ( $FLAG[1]==FALSE ) 
    RET=EKI_Clear("RPSCmd")
    END


    In the log viewer when program is running there is no error but when I deselect the program I get these below errors-
    BASIC dEthernetK 12:45:17.167 : MemObject: Successfully initialized memory pool of size 1048576 bytes.
    BASIC dEthernetK 12:45:17.216 : CEKIApp: EthernetKRL application created.
    ERROR RPSCmd 12:54:27.917 : CTcpSock: Failed to accept socket '455' (Code: 9)
    ERROR RPSCmd 12:54:27.917 : CIoDevice: Failed to accept TCP connection on port 54600 with timeout -1. (Code=-1)
    WARN RPSCmd 12:54:27.917 : CSystemCall: $Flag[1] is already '0'! Possible lost of interrupt edge at tick:635526
    ERROR RPSCmd 12:54:27.917 : CConnection: Listening for IoDevice
    WARN tFctCall 12:54:27.917 : CSystemCall: $Flag[1] is already '0'! Possible lost of interrupt edge at tick:635526
    ERROR dEthernetK 12:54:34.882 : COperator: connection list is empty. (Cleared channel of type '0'.)


    I am not able to open the port by looking command netstat -an in the command prompt, how ever if I swith to server.exe which is supplied by Ethernet krl software, I am able to open the port. So in summary I am not able to open the port from with program. Please help what is wrong with me.


    Update-One more thing, Some how the Ip address of server in xml file is not working. If I change the ip to x.x.x.x even than the situation and error remains the same.


    Update- I canged my configuration to be robot as client and the utility krl_server.exe as server. Even with the client xml , robot is not able to open the ports.

    Edited once, last by SkyeFire ().

  • What is the IP address of your robot set to?


    Your XML file is set as "Client" even though you're trying to have the robot act as a server.


    What are Flag 1 and Flag 4 doing when you run this test program?


    Have you used WireShark to examine the port traffic activities?


    At each step of the test program, what are the results of RET.MSG_NO?


    Quote

    Update- I canged my configuration to be robot as client and the utility krl_server.exe as server. Even with the client xml , robot is not able to open the ports.

    What does this mean, exactly?

    Edited once, last by SkyeFire ().

  • What is the IP address of your robot set to?
    KLI address is 192.168.1.9


    Your XML file is set as "Client" even though you're trying to have the robot act as a server.
    The external system is defined as a Client and Robot is working as server as the given syntax from manual.


    What are Flag 1 and Flag 4 doing when you run this test program?
    Flag 4 will be used for future use once I able to get connected. As far as I know Flag 1 will get true if a client is connected to the server. I
    can remove Flag 4 section but I think it doesnt creating any problem. My program waits for Flag 1 true all the time and my client application c# is always trying to connect to server.


    Have you used WireShark to examine the port traffic activities?
    No but I have tracked with command prompt (netstat -an) to monitor open ports for listening at robot side with the ip address of KLI on the robot computer when my robot waits for Flag 1 because Robot is working as server, but no additional ports( in the range of 54600 to 54615 ) are opened at that time.


    At each step of the test program, what are the results of RET.MSG_NO?
    RET=EKI_Init("RPSCmd") RET.MSG_NO =0,RET.Connected=False
    RET=EKI_Open("RPSCmd") RET.MSG_NO =0,RET.Connected=True
    WAIT FOR ( $FLAG[1] ) RET.MSG_NO =0,RET.Connected=True (program waits here infinitely)
    WAIT FOR ( $FLAG[1]==FALSE ) RET.MSG_NO =0,RET.Connected=True (after the block selection)
    RET=EKI_Clear("RPSCmd") RET.MSG_NO =0,RET.Connected=False


    My mean to change the configuration to client is I made External system as Server and my robot is working as Client for the trial and to test that if there is some problem for opening a listening port. I done the changes in the xml file to make my Robot as Client.For the external server, I used the utility supplied with the software itself Krl_Server.exe but not able to connect too.

  • Right, forgot the "client" setting was in External, not internal. :wallbash:


    No error codes from the EKI commands, so nothing obviously wrong there.


    What's your KLI netmask set to? IF you're using 192.168.1.*, then the netmask needs to be 255.255.255.0 in order to avoid the forbidden IP range.


    Do those error messages pop even after you run the EKI_Clear?


    Do you have ProfiNet or EIP running through the KLI? What are your virtual interfaces configured as?

  • 1. what is the IP address and subnet mask on KLI
    2. what is the IP address and subnet mask on Client
    3. how exactly they are connected physically? (if you are able to send/receive WoV project through KLI using WorkVisual, KLI and client NIC are most likely configured correctly)
    4. in what interpreter is your KRL program running? Should be run as Robot program, not submit.
    5. how exactly you try to establish connection? Using what software? (i use putty and works like a charm).
    6. is server started first? Server MUST run before Client tries to connect.
    7. your SRC and CONFIG are carbon copy of what is in the manual, port is configuration is valid. is that port client tries to use?

    1) read pinned topic: READ FIRST...

    2) if you have an issue with robot, post question in the correct forum section... do NOT contact me directly

    3) read 1 and 2

  • 1. what is the IP address and subnet mask on KLI
    192.168.1.9 255.255.255.0
    2. what is the IP address and subnet mask on Client
    192.168.1.21 255.255.255.0
    3. how exactly they are connected physically? (if you are able to send/receive WoV project through KLI using WorkVisual, KLI and client NIC are most likely configured correctly)
    We are connected through a LAN cable and from the client computer I am able to deploy,copy,edit the work visual project for the Robot.
    4. in what interpreter is your KRL program running? Should be run as Robot program, not submit.
    Yes, I am trying to run in robot program not in submit.
    5. how exactly you try to establish connection? Using what software? (i use putty and works like a charm).
    I have written C# application who tries to connect on tcp ip socket with the server but it never connects. so I left the c# program and want to look what is wrong at robot side. I am running only the robot krl program with out any client and at the state of waiting Flag 1 I am checking whether the robot has opened the given port for listening or not with the command netstat -an in command prompt. The robot opens the port for listening 139 and 1801 always not the given port in xml. You can try at your end too with given command and check whether the port is opened or not with out client(My request).
    6. is server started first? Server MUST run before Client tries to connect.
    Yes, server is always started first
    7. your SRC and CONFIG are carbon copy of what is in the manual, port is configuration is valid. is that port client tries to use?
    yes, I am using the same port at my client as xml. Even if I am not using the same port at my client side but the robot should always open the given xml port for listening but I have never seen robot to open the port that is why I am doubting on robot side. Even if my network configuration is wrong at client side, but the robot should always open the port for listening. If it opens the port for listening, I would say my problem is resolved.
    I think, there is some very basic mistake at robot side I making that is why I am not able to open the ports.

  • Have you tried to increase the Timeout?
    <TIMEOUT Connect="65534"/>
    and set the ALIVE tag like this?
    <ALIVE Set_Flag="1" Ping="200"/>

  • [size=2]So you did not tell us the whole story...[/size]
    [size=small]Your program is not running on external machine and it is not connected to KRC4 through KLI...?[/size]

    1) read pinned topic: READ FIRST...

    2) if you have an issue with robot, post question in the correct forum section... do NOT contact me directly

    3) read 1 and 2

  • I told you the whole story. I was running my program on the real controller when I first posted my problem on the forum. You can see I wrote clearly KLI port on the very first post.But as I was asking you people for the solution I had to travel for another site and so I created same condition in my notebook with my Office lite so that I can check easily the things suggested by you people for the faster response and believe me Office lite was behaving the same way as the real controller. I have not yet checked on the real controller yet because I am travelling. At least now I can connect with Officelite. After reaching my office I will again check with real controller and would ask you again if same problem persists. Again thank you all for your support but I am not yet out of the problem completely. :sadsmiley:

  • [size=1em]i just re-read the entire thread again and still see no mention of it.[/size]


    [size=1em]of course there will be "my program on real controller", that is your KRL program (SRC). external program (EXE or whatever) is supposed to run on an external system. if that is not the case, if the external program is also run on the KRC4, KLI is needed at all and KLI settings have no influence.[/size]


    so we were looking at wrong network settings....

    1) read pinned topic: READ FIRST...

    2) if you have an issue with robot, post question in the correct forum section... do NOT contact me directly

    3) read 1 and 2

    Edited once, last by panic mode ().

Advertising from our partners