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
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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,
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
Hi,
Refer this attached example
Regaurds,
Kiran
TcpUdp.zip [11.01 KiB]