Problem in using SysLibSocket for ABB PLC

2011-08-23
2023-08-17
  • hiten.upadhyay - 2011-08-23

    Hi,
    I am using ABB PM581 PLC and want to develope an application for TCP/IP server client communication. I have configurde the Ethernet port for MODBUS TCP/IP and I expect it should allow me to access the Ethernet port for TCP/IP use. But the SysSockBind() and SysSockConnect functions are not working and they always return FALSE.
    I am attatching here a piece of my code.

    SocketCreateHandle := SysSockCreate(SOCKET_AF_INET, SOCKET_STREAM, 0);
    SocketAddress.sin_family := SOCKET_AF_INET ;
    InetAddr := '201.65.32.177';
    SocketAddress.sin_addr := SysSockInetAddr(InetAddr);
    SocketAddress.sin_port := SysSockHtons(3000);
    bResult := SysSockBind(SocketCreateHandle, ADR(SocketAddress), SIZEOF(SocketAddress));
    IF bResult THEN
    // here it always returns false
    END_IF

     
  • KiranK - 2012-03-28

    hiten.upadhyay hat geschrieben:
    Hi,
    I am using ABB PM581 PLC and want to develope an application for TCP/IP server client communication. I have configurde the Ethernet port for MODBUS TCP/IP and I expect it should allow me to access the Ethernet port for TCP/IP use. But the SysSockBind() and SysSockConnect functions are not working and they always return FALSE.
    I am attatching here a piece of my code.

    Hi,
    Refer this attached example

    Regaurds,
    Kiran

    TcpUdp.zip [11.01 KiB]

     

Log in to post a comment.